Merge from 89:c7ed2540212a

Wed, 06 Dec 2017 11:50:41 +0200

author
Iannis <ulalume3@yahoo.com>
date
Wed, 06 Dec 2017 11:50:41 +0200
changeset 91
f9d9d3ea8edb
parent 90
e2088d39ee9b (diff)
parent 89
361c9897030f (current diff)
child 92
6d26002aaeed

Merge from 89:c7ed2540212a

atmospheric_lidar/systems/adam2016/adam2016_depol.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2016/adam2016_depolarization_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2017/adam2017.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2017/adam2017_depol.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2017/adam2017_depolarization_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2017/adam2017_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/adam2017/adam2017_netcdf_parameters_2.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/aias/aias_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/ciao.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/eole/eole.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/eole/eole_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/ipral/ipral.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/ipral/ipral_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/lamp_lidar/at_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/lamp_lidar/cf_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/lamp_lidar/cf_raymetrics.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/lilas/lilas.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/lilas/lilas_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/musa/musa.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/musa/musa_2009_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/musa/musa_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/pearl/pearl.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/pearl/pearl_netcdf_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/rali/rali.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/rali/rali_depol.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/rali/rali_depolarization_parameters.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/rali/rali_netcdf_parameters.py file | annotate | diff | comparison | revisions
--- a/atmospheric_lidar/scripts/licel2scc.py	Mon Nov 20 16:24:19 2017 +0200
+++ b/atmospheric_lidar/scripts/licel2scc.py	Wed Dec 06 11:50:41 2017 +0200
@@ -109,6 +109,7 @@
 
     #coloredlogs.install(fmt='%(levelname)s: %(message)s', level=args.loglevel)
 
+    # Check for version
     if args.version:
         print("Version: %s" % __version__)
         sys.exit(0)
@@ -116,33 +117,36 @@
     # Get a list of files to convert
     files = glob.glob(args.files)
 
-    if files:
-        # Read the files
-        logger.info("Reading {0} files from {1}".format(len(files), os.path.abspath(os.path.dirname(args.files))))
-        CustomLidarMeasurement = create_custom_class(args.parameter_file, args.id_as_name, args.temperature,
-                                                     args.pressure)
-        measurement = CustomLidarMeasurement(files)
-        
-        # Get a list of files containing dark measurements
-        if args.dark_files != "":
-            dark_files = glob.glob (args.dark_files)
-            
-            if dark_files:
-                logger.debug("Using %s as dark measurements files!" % ', '.join(dark_files))
-                measurement.dark_measurement = CustomLidarMeasurement(dark_files)
-            else:
-                logger.warning('No dark measurement files found when searching for %s. Will not use any dark measurements.' % args.dark_files)
-        
-        try:
-            measurement = measurement.subset_by_scc_channels()
-        except ValueError as err:
-            logging.error(err)
-            sys.exit(1)
-        # Save the netcdf
-        logger.info("Saving netcdf")
-        measurement.set_measurement_id(args.measurement_id, args.measurement_number)
-        measurement.save_as_netcdf()
-        logger.info("Created file %s" % measurement.scc_filename)
-    else:
-        logger.error("No files found when searching for %s." % search_str)
-        sys.exit(1)
\ No newline at end of file
+    # If not files found, exit
+    if len(files) == 0:
+        logger.error("No files found when searching for %s." % args.files)
+        sys.exit(1)
+
+    # If everything OK, proceed
+    logger.info("Found {0} files matching {1}".format(len(files), os.path.abspath(args.files)))
+    CustomLidarMeasurement = create_custom_class(args.parameter_file, args.id_as_name, args.temperature,
+                                                 args.pressure)
+    measurement = CustomLidarMeasurement(files)
+
+    # Get a list of files containing dark measurements
+    if args.dark_files != "":
+        dark_files = glob.glob(args.dark_files)
+
+        if dark_files:
+            logger.debug("Using %s as dark measurements files!" % ', '.join(dark_files))
+            measurement.dark_measurement = CustomLidarMeasurement(dark_files)
+        else:
+            logger.warning('No dark measurement files found when searching for %s. Will not use any dark measurements.' % args.dark_files)
+
+    try:
+        measurement = measurement.subset_by_scc_channels()
+    except ValueError as err:
+        logging.error(err)
+        sys.exit(1)
+
+    # Save the netcdf
+    logger.info("Saving netcdf")
+    measurement.set_measurement_id(args.measurement_id, args.measurement_number)
+    measurement.save_as_netcdf()
+    logger.info("Created file %s" % measurement.scc_filename)
+

mercurial