# HG changeset patch # User Victor Nicolae # Date 1510302003 -7200 # Node ID fc270953f14b6f3ae04e6584927c8cda64b73f6e # Parent f3f0b9e4a4275071000aacca3f58c910457cac2d Add command line option for dark measurements. diff -r f3f0b9e4a427 -r fc270953f14b atmospheric_lidar/scripts/licel2scc.py --- a/atmospheric_lidar/scripts/licel2scc.py Fri Nov 10 09:39:12 2017 +0200 +++ b/atmospheric_lidar/scripts/licel2scc.py Fri Nov 10 10:20:03 2017 +0200 @@ -96,6 +96,9 @@ parser.add_argument('-s', '--silent', help="Show only warning and error messages.", action="store_const", dest="loglevel", const=logging.WARNING ) + parser.add_argument('-D', '--dark_measurements', help="Location of files containing dark measurements. Use relative path and filename wildcars, see 'files' parameter for example.", + default="", dest="dark_files" + ) parser.add_argument('--version', help="Show current version.", action='store_true') args = parser.parse_args() @@ -119,6 +122,17 @@ 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: diff -r f3f0b9e4a427 -r fc270953f14b readme.rst --- a/readme.rst Fri Nov 10 09:39:12 2017 +0200 +++ b/readme.rst Fri Nov 10 10:20:03 2017 +0200 @@ -51,6 +51,10 @@ -p PRESSURE, --pressure PRESSURE The pressure (in hPa) at lidar level, required if using US Standard atmosphere + -D DARK_FILES, --dark_files DARK_FILES + Location of files containing dark measurements. + Use relative path and filename wildcars, see 'files' + parameter for example. -d, --debug Print dubuging information. -s, --silent Show only warning and error messages. --version Show current version.