atmospheric_lidar/scripts/licel2scc_depol.py

changeset 106
6511136e6937
parent 92
6d26002aaeed
child 107
2f3f75e5b99e
equal deleted inserted replaced
100:b20b59b350d5 106:6511136e6937
94 dest="loglevel", const=logging.DEBUG, default=logging.INFO, 94 dest="loglevel", const=logging.DEBUG, default=logging.INFO,
95 ) 95 )
96 parser.add_argument('-s', '--silent', help="Show only warning and error messages.", action="store_const", 96 parser.add_argument('-s', '--silent', help="Show only warning and error messages.", action="store_const",
97 dest="loglevel", const=logging.WARNING 97 dest="loglevel", const=logging.WARNING
98 ) 98 )
99 parser.add_argument('-D', '--dark_measurements', help="Location of files containing dark measurements. Use relative path and filename wildcars, see 'files' parameter for example.",
100 default="", dest="dark_files"
101 )
99 parser.add_argument('--version', help="Show current version.", action='store_true') 102 parser.add_argument('--version', help="Show current version.", action='store_true')
100 103
101 args = parser.parse_args() 104 args = parser.parse_args()
102 105
103 # Get the logger with the appropriate level 106 # Get the logger with the appropriate level
124 127
125 CustomLidarMeasurement = create_custom_class(args.parameter_file, args.id_as_name, args.temperature, 128 CustomLidarMeasurement = create_custom_class(args.parameter_file, args.id_as_name, args.temperature,
126 args.pressure) 129 args.pressure)
127 130
128 measurement = CustomLidarMeasurement(plus45_files, minus45_files) 131 measurement = CustomLidarMeasurement(plus45_files, minus45_files)
132
133 # Get a list of files containing dark measurements
134 if args.dark_files != "":
135 dark_files = glob.glob(args.dark_files)
136
137 if dark_files:
138 logger.debug("Using %s as dark measurements files!" % ', '.join(dark_files))
139 measurement.dark_measurement = CustomLidarMeasurement(dark_files, dark_files)
140 else:
141 logger.warning('No dark measurement files found when searching for %s. Will not use any dark measurements.' % args.dark_files)
129 142
130 try: 143 try:
131 measurement = measurement.subset_by_scc_channels() 144 measurement = measurement.subset_by_scc_channels()
132 except ValueError as err: 145 except ValueError as err:
133 logging.error(err) 146 logging.error(err)

mercurial