Go to the documentation of this file.
3 Class for handling the processing of MODIS data files.
12 __author__ =
'melliott'
16 A class for doing MODIS Processing
18 def __init__(self, l0_name, l1a=None, geo=None):
32 Determine what the default basename for the L1A file (and GEO file) should be.
35 create_constructor_cmd = [
'l0cnst_write_modis ', self.
l0_file]
36 print(
'Running: ', create_constructor_cmd)
38 l0cnst_write_output = subprocess.run(create_constructor_cmd, capture_output=
True, text=
True, shell=
False)
39 if l0cnst_write_output.returncode:
40 print(
'Error! Could not run l0const')
43 print(
'l0cnst_write_modis run complete')
44 for line
in l0cnst_write_output.stdout.splitlines():
46 key, val = line.split(
'=')
49 if 'starttime' in key:
52 except OSError
as ose:
53 print(ose.errno, ose.strerror)
56 print(
'Error! Could not determine start time.')
59 return ''.join([
'A', granule_time])
63 Do the MODIS Geonavigation processing.
65 geo_cmd = [os.path.join(self.
ocssw_root,
'bin',
'modis_GEO'), self.
l1a]
67 geo_cmd.append([
'-o',out_file])
68 ret_val = subprocess.run(geo_cmd, shell=
False).returncode
73 Do the MODIS L1A processing.
77 l1a_cmd.append([
'-o',out_file])
78 ret_val = subprocess.run(l1a_cmd, shell=
False).returncode
83 Do the MODIS L1B processing.
85 l1b_cmd = [os.path.join(self.
ocssw_root,
'bin',
'modis_L1B'), self.
l1a]
86 ret_val = subprocess.run(l1b_cmd, shell=
False).returncode
def run_modis_l1a(self, out_file=None)
def run_modis_geo(self, out_file=None)
def __init__(self, l0_name, l1a=None, geo=None)
def derive_l1a_basename(self)
def date_convert(datetime_i, in_datetype=None, out_datetype=None)