From e8bf5b646ecf2a32db90c2eefab4b661947dc300 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Tue, 25 Nov 2014 10:22:23 +0100 Subject: [PATCH] change options names to cloud_product_* and add lookup in os.environ. Signed-off-by: Martin Raspaud --- mpop/satin/nc_pps_l2.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mpop/satin/nc_pps_l2.py b/mpop/satin/nc_pps_l2.py index 951547ef..72ec78b7 100644 --- a/mpop/satin/nc_pps_l2.py +++ b/mpop/satin/nc_pps_l2.py @@ -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 @@ -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, @@ -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))