print("Usage: ", argv[0], "<backDay>") print("where back_day is an integer representing which day to process,") print("e.g. 0 for today, 1 for yesterday, etc.") if len(argv) != 2: printUsage() exit(1) try: backDay = int(argv[1]) except ValueError: print("Wrong parameter: ", argv[1]) printUsage() exit(1) backDate = getBackDate(backDay) _year = str(backDate.year) _month = str(backDate.month).zfill(2) _day = str(backDate.day).zfill(2) _backdate = _year + _month + _day print("Processing products of ", _backdate, "...") # exit(1) l1aCmd = 'python ' + l1aScript + ' ' + _backdate # L1A_LAC => L1A_sub, GEO_sub l1bCmd = 'python ' + l1bScript + ' ' + _backdate # L1A_sub, GEO_sub => L1B_sub qlGenCmd = 'python ' + quicklookScript + ' ' + _backdate # L1B_sub => L1B_RGB l2Cmd = 'python ' + l2Script + ' ' + _backdate # L1B_sub => L2_sub gptTSMCmd = 'python ' + gptTSMScript + ' ' + _backdate # L2_sub => L2_TSM l3binningCmd = 'python ' + l3binningScript + ' ' + _backdate # L2_TSM => L3_TSM reprojectUTMCmd = 'python ' + reprojectUTMScript + ' ' + _backdate # L3_TSM => L3_UTM, L3_UTM_ql reprojectECOCmd = 'python ' + reprojectECOHAMScript + ' ' + _backdate # L3_TSM => L3_ECOHAM
__author__ = 'uwe' from os import system from utils.utilities import getBackDate backdays = range(2,-1,-1) # [2, 1, 0] while True: for _backday in backdays: _backdatetime = getBackDate(_backday) _backdate = str(_backdatetime.year) + str(_backdatetime.month).zfill(2) + str(_backdatetime.day).zfill(2) geochildgen_l1a_cmd = 'python /home/uwe/cronjobs/nasa/modis/seadas_processing/GEO/create_MODIS_GEO_L1A_extract.py ' + _backdate geochildgen_l1b_cmd = 'python /home/uwe/cronjobs/nasa/modis/seadas_processing/l1b/create_MODIS_L1B_sub.py ' + _backdate quicklook_gen_cmd = 'python /home/uwe/cronjobs/nasa/modis/seadas_processing/browse/create_MODIS_L1B_sub_browse.py ' + _backdate system(geochildgen_l1a_cmd) system(geochildgen_l1b_cmd) system(quicklook_gen_cmd) #for date in `cat datesl1b.txt`; do # python /home/uwe/cronjobs/nasa/modis/seadas_processing/GEO/create_MODIS_GEO_L1A_extract.py $date; # python /home/uwe/cronjobs/nasa/modis/seadas_processing/l1b/create_MODIS_L1B_sub.py $date; # python /home/uwe/cronjobs/nasa/modis/seadas_processing/browse/create_MODIS_L1B_sub_browse.py $date; # done
print("where back_day is an integer representing which day to process,") print("e.g. 0 for today, 1 for yesterday, etc.") if len(argv) != 2: printUsage() exit(1) try: backDay = int(argv[1]) except ValueError: print("Wrong parameter: ", argv[1]) printUsage() exit(1) backDate = getBackDate(backDay) _year = str(backDate.year) _month = str(backDate.month).zfill(2) _day = str(backDate.day).zfill(2) _backdate = _year + _month + _day print("Processing products of ", _backdate, "...") # exit(1) l1aCmd = 'python ' + l1aScript + ' ' + _backdate # L1A_LAC => L1A_sub, GEO_sub l1bCmd = 'python ' + l1bScript + ' ' + _backdate # L1A_sub, GEO_sub => L1B_sub qlGenCmd = 'python ' + quicklookScript + ' ' + _backdate # L1B_sub => L1B_RGB l2Cmd = 'python ' + l2Script + ' ' + _backdate # L1B_sub => L2_sub gptTSMCmd = 'python ' + gptTSMScript + ' ' + _backdate # L2_sub => L2_TSM l3binningCmd = 'python ' + l3binningScript + ' ' + _backdate # L2_TSM => L3_TSM reprojectUTMCmd = 'python ' + reprojectUTMScript + ' ' + _backdate # L3_TSM => L3_UTM, L3_UTM_ql reprojectECOCmd = 'python ' + reprojectECOHAMScript + ' ' + _backdate # L3_TSM => L3_ECOHAM
prodExtension = "A_NPP.tar.bz2" from nasa.viirs.seadas_processing.conf.paths import viirsL1A_BasePath as inputPath else: prodExtension = "_NPP_OC.bz2" from nasa.viirs.seadas_processing.conf.paths import viirsL2_BasePath as inputPath try: backDay = int(argv[2]) except TypeError: print("backDay parameter must be of integer type.") printUsage() exit(1) _now = datetime.now() # start time of computing _back_date = getBackDate(backDay) _year = str(_back_date.year) _month = str(_back_date.month) _day = str(_back_date.day) DOY = str(getBackDOY(backDay=backDay, _year=int(_year))) inputPath += ensureTrailingSlash(str(_year)) + ensureTrailingSlash(str(_month).zfill(2)) + ensureTrailingSlash(str(_day).zfill(2)) if not exists(inputPath): makedirs(inputPath) chdir(inputPath) min_acq_time = 8 # we start download for 8 o'clock data max_acq_time = 15 # stop time of acq in our ROI time_interval = [str(t).zfill(2) for t in range(min_acq_time, max_acq_time)]
if parameters=='wac': from bc.eodata.beam_processing.conf.paths import wac_graph_file as graph_file elif parameters=='sst': from bc.eodata.beam_processing.conf.paths import sst_graph_file as graph_file beamBinDir = beamHomeDir + 'bin/' gptProcessor = beamBinDir + 'gpt.sh' num_days_in_l3 = 7 _year = int(back_date[:4]) _month = int(back_date[4:6]) _day = int(back_date[6:]) proc_datetime = date(_year, _month, _day) delta_days = (date.today() - proc_datetime).days day_list = [getBackDate(day) for day in range(delta_days, delta_days + num_days_in_l3)] srcList = [] for item in day_list: modisL2_TSMPath = ensureTrailingSlash(ensureTrailingSlash(ensureTrailingSlash(modisL2_TSMBasePath + str(item.year)) + str(item.month).zfill(2)) + str(item.day).zfill(2)) srcList += glob(modisL2_TSMPath+'A' + str(item.year) + '*.L2_TSM.dim') exit_on_empty_list(srcList) srcList.sort() srcList = ",".join(srcList) modisWeeklyPath = ensureTrailingSlash(ensureTrailingSlash(modisWeeklyBasePath + str(_year)) + str(_month).zfill(2)) dateRangeString = str(day_list[6].year) + str(day_list[6].month).zfill(2) + str(day_list[6].day).zfill(2) + '_' + \ str(day_list[0].year) + str(day_list[0].month).zfill(2) + str(day_list[0].day).zfill(2)
prodExtension = "A_NPP.tar.bz2" from nasa.viirs.seadas_processing.conf.paths import viirsL1A_BasePath as inputPath else: prodExtension = "_NPP_OC.bz2" from nasa.viirs.seadas_processing.conf.paths import viirsL2_BasePath as inputPath try: backDay = int(argv[2]) except TypeError: print("backDay parameter must be of integer type.") printUsage() exit(1) _now = datetime.now() # start time of computing _back_date = getBackDate(backDay) _year = str(_back_date.year) _month = str(_back_date.month) _day = str(_back_date.day) DOY = str(getBackDOY(backDay=backDay, _year=int(_year))) inputPath += ensureTrailingSlash(str(_year)) + ensureTrailingSlash( str(_month).zfill(2)) + ensureTrailingSlash(str(_day).zfill(2)) if not exists(inputPath): makedirs(inputPath) chdir(inputPath) min_acq_time = 8 # we start download for 8 o'clock data max_acq_time = 15 # stop time of acq in our ROI