diff --git a/src/predict_ltg.py b/src/predict_ltg.py index 131d7e7fd1c8a20d39ce015fffec98ce8b67dbc6..20ca8bb2754bbf6753b4127e9eff5523c25a368c 100755 --- a/src/predict_ltg.py +++ b/src/predict_ltg.py @@ -1374,6 +1374,7 @@ def predict_ltg(filelist, try: if(make_remap_cache): remap_cache = get_remap_cache(glm_area_def, abi_area_def) #If new corner point, cache info for remapping glmgrid = ltg_stats_fcts.get_fed(dt,glmpatt,glmvar=glmvar,remap_cache=remap_cache) + glmgrid = glmgrid[0:(endY-startY),0:(endX-startX)] #force it to have the same dims as ABI data except (UnboundLocalError,ValueError): logging.critical("Couldn't find FED to make predictions for " + dt.strftime('%Y%m%d-%H%M%S')) sys.exit() @@ -1429,13 +1430,10 @@ def predict_ltg(filelist, try: if(make_remap_cache): remap_cache = get_remap_cache(glm_area_def, abi_area_def) #If new corner point, cache info for remapping fed_data = ltg_stats_fcts.get_fed(dt,glmpatt,glmvar=glmvar,remap_cache=remap_cache) + fed_data = fed_data[0:(endY-startY),0:(endX-startX)] #force it to have the same dims as ABI data except (UnboundLocalError,ValueError): #couldn't find fed data logging.warning("Couldn't find FED for " + dt.strftime('%Y%m%d-%H%M%S')) continue #move on to next line / datetime - else: - #remap FED data to ABI scene - fed_data = pr.kd_tree.resample_nearest(glm_area_def,fed_data,abi_area_def,radius_of_influence=4000,fill_value=-1) - fed_data = fed_data.filled(0) #if saving preds/labels, get accumulation target/truth data if(pickle_preds_labs): @@ -1444,6 +1442,7 @@ def predict_ltg(filelist, #Doing this so that we can use the glmpatt with "agg" for --ltg_stats glmpatt2 = glmpatt.replace('/agg/','/FED_accum_60min_2km/') if('accum' not in glmpatt) else glmpatt fed_accum_data = ltg_stats_fcts.get_fed(dt,glmpatt2,glmvar='FED_accum_60min_2km',remap_cache=remap_cache) + fed_accum_data = fed_accum_data[0:(endY-startY),0:(endX-startX)] #force it to have the same dims as ABI data except (UnboundLocalError,ValueError): logging.error(f"Couldn't find any fed_accum_data near {dt}. Moving on to next datetime.") continue @@ -1637,6 +1636,7 @@ def predict_ltg(filelist, try: if(make_remap_cache): remap_cache = get_remap_cache(glm_area_def, abi_area_def) #If new corner point, cache info for remapping imgdata = ltg_stats_fcts.get_fed(dt,glmpatt,glmvar=glmvar,remap_cache=remap_cache) + imgdata = imgdata[0:(endY-startY),0:(endX-startX)] #force it to have the same dims as ABI data except (UnboundLocalError,ValueError): #couldn't find fed data logging.warning("Couldn't find FED for " + dt.strftime('%Y%m%d-%H%M%S')) continue #move on to next line / datetime