Skip to content

Commit

Permalink
change options names to cloud_product_* and add lookup in os.environ.
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 25, 2014
1 parent 11fd374 commit e8bf5b6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions mpop/satin/nc_pps_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ def load(self, satscene, *args, **kwargs):
conf.read(os.path.join(CONFIG_PATH, satscene.fullname + ".cfg"))

try:
geodir = conf.get(satscene.instrument_name + "-level3", "geodir")
geodir = conf.get(satscene.instrument_name + "-level3",
"cloud_product_geodir",
vars=os.environ)
except NoOptionError:
LOG.warning("No option 'geodir' in level3 section")
geodir = None
Expand All @@ -236,7 +238,9 @@ def load(self, satscene, *args, **kwargs):
else:
orbit = satscene.orbit
geoname_tmpl = conf.get(satscene.instrument_name + "-level3",
"geofilename", raw=True)
"cloud_product_geofilename",
raw=True,
vars=os.environ)
filename_tmpl = (satscene.time_slot.strftime(geoname_tmpl)
% {"orbit": orbit.zfill(5) or "*",
"area": area_name,
Expand Down Expand Up @@ -286,10 +290,13 @@ def load(self, satscene, *args, **kwargs):
else:
continue
else:
filename = conf.get(satscene.instrument_name + "-level3", "filename",
raw=True)
directory = conf.get(
satscene.instrument_name + "-level3", "dir")
filename = conf.get(satscene.instrument_name + "-level3",
"cloud_product_filename",
raw=True,
vars=os.environ)
directory = conf.get(satscene.instrument_name + "-level3",
"cloud_product_dir",
vars=os.environ)
pathname_tmpl = os.path.join(directory, filename)
LOG.debug("Path = " + str(pathname_tmpl))

Expand Down

0 comments on commit e8bf5b6

Please sign in to comment.