Skip to content

Commit

Permalink
ViirsSDR: Fix not to crash on single file input.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Nov 17, 2014
1 parent 89b3108 commit fb780f2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mpop/satin/viirs_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,10 @@ def load(self, satscene, calibrate=1, time_interval=None, area=None, filename=No
#"satellite": satscene.fullname
}

file_list = []
if filename is not None:
file_list = []
if not isinstance(filename, (list, set, tuple)):
filename = [filename]
geofile_list = []
for fname in filename:
if os.path.basename(fname).startswith("SV"):
Expand All @@ -572,10 +574,12 @@ def load(self, satscene, calibrate=1, time_interval=None, area=None, filename=No
geofile_list.append(fname)
else:
logger.info("Unrecognized SDR file: %s", fname)
directory = os.path.dirname(file_list[0])
geodirectory = os.path.dirname(geofile_list[0])
else:
if file_list:
directory = os.path.dirname(file_list[0])
if geofile_list:
geodirectory = os.path.dirname(geofile_list[0])

if not file_list:
filename_tmpl = strftime(
satscene.time_slot, options["filename"]) % values

Expand Down

0 comments on commit fb780f2

Please sign in to comment.