# HG changeset patch # User Iannis # Date 1512553841 -7200 # Node ID f9d9d3ea8edb1f9f5fca92de591767cedec831dc # Parent e2088d39ee9b4ce0d80b2031a882868d2845323c# Parent 361c9897030f75d06800b4d6a728cb33c01996ce Merge from 89:c7ed2540212a diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/scripts/licel2scc.py --- 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) + diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2016/adam2016_depol.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2016/adam2016_depolarization_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2017/adam2017.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2017/adam2017_depol.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2017/adam2017_depolarization_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2017/adam2017_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/adam2017/adam2017_netcdf_parameters_2.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/aias/aias_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/ciao.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/eole/eole.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/eole/eole_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/ipral/ipral.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/ipral/ipral_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/lamp_lidar/at_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/lamp_lidar/cf_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/lamp_lidar/cf_raymetrics.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/lilas/lilas.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/lilas/lilas_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/musa/musa.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/musa/musa_2009_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/musa/musa_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/pearl/pearl.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/pearl/pearl_netcdf_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/rali/rali.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/rali/rali_depol.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/rali/rali_depolarization_parameters.py diff -r 361c9897030f -r f9d9d3ea8edb atmospheric_lidar/systems/rali/rali_netcdf_parameters.py