Add command line option for dark measurements.

Fri, 10 Nov 2017 10:20:03 +0200

author
Victor Nicolae <victor.nicolae@inoe.ro>
date
Fri, 10 Nov 2017 10:20:03 +0200
changeset 85
fc270953f14b
parent 84
f3f0b9e4a427
child 86
cefef866804c

Add command line option for dark measurements.

atmospheric_lidar/scripts/licel2scc.py file | annotate | diff | comparison | revisions
readme.rst file | annotate | diff | comparison | revisions
--- 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:
--- 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.

mercurial