Skip to content

Commit

Permalink
Bugfix: Do not crash on multiple non-nwc files.
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 cade921 commit cf6f3bf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions mpop/satin/nc_pps_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,6 @@ def load(self, satscene, *args, **kwargs):
LOG.warning("No option 'geodir' in level3 section")
geodir = None

if not prodfilename:
filename = conf.get(satscene.instrument_name + "-level3", "filename",
raw=True)
directory = conf.get(satscene.instrument_name + "-level3", "dir")
pathname_tmpl = os.path.join(directory, filename)
LOG.debug("Path = " + str(pathname_tmpl))

if not geofilename and geodir:
# Load geo file from config file:
try:
Expand Down Expand Up @@ -283,9 +276,17 @@ def load(self, satscene, *args, **kwargs):
kwargs['filename'] = fname
self.load(satscene, *args, **kwargs)
elif (prodfilename and
os.path.basename(prodfilename).split("_")[2] == NEW_PRODNAMES[product]):
os.path.basename(prodfilename).startswith('S_NWC') and
os.path.basename(prodfilename).split("_")[2] == NEW_PRODNAMES[product]):
filename = prodfilename
else:
filename = conf.get(satscene.instrument_name + "-level3", "filename",
raw=True)
directory = conf.get(
satscene.instrument_name + "-level3", "dir")
pathname_tmpl = os.path.join(directory, filename)
LOG.debug("Path = " + str(pathname_tmpl))

if not satscene.orbit:
orbit = ""
else:
Expand Down

0 comments on commit cf6f3bf

Please sign in to comment.