2 Utility functions for the next_name_finder program and associated modules.
4 These functions were placed in a separate module to prevent "circular imports".
5 Take care making modifications.
8 __author__ =
'melliott'
10 __version__ =
'1.0.3-2015-08-10'
17 Converts optparse options into a dictionary
20 if options.resolution:
21 ret_dict[
'resolution'] = options.resolution
23 ret_dict[
'suite'] = options.suite
25 ret_dict[
'oformat'] = options.oformat
30 Instantiates an instance of finder_class and returns it.
33 if 'resolution' in clopts:
34 resolution = clopts[
'resolution']
38 suite = clopts[
'suite']
41 if 'oformat' in clopts:
42 oformat = clopts[
'oformat']
45 level_finder = finder_class(data_file_list, target_program, suite,
51 Returns an appropriate level finder object for the data file passed in.
53 if not isinstance(clopts, dict):
57 if data_file_list[0].sensor.find(
'MODIS') != -1:
60 data_file_list, target_program)
61 elif data_file_list[0].sensor.find(
'HAWKEYE') != -1:
64 data_file_list, target_program)
65 elif data_file_list[0].sensor.find(
'SeaWiFS') != -1:
68 data_file_list, target_program)
69 elif data_file_list[0].sensor.find(
'Aquarius') != -1:
72 data_file_list, target_program)
73 elif data_file_list[0].sensor.find(
'MERIS') != -1:
76 data_file_list, target_program)
77 elif data_file_list[0].sensor.find(
'VIIRS') != -1:
80 data_file_list, target_program)
84 data_file_list, target_program)