diff --git a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/All_functions.py b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/All_functions.py index 1b4d3db1e..cfde65129 100755 --- a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/All_functions.py +++ b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/All_functions.py @@ -17,10 +17,7 @@ def Sel_var (SEL_CIM_DATA, VAR_NAME, MODEL): else: VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.sum(dim='SoilMoist_profiles') ## Summing soil moisture from all layers if VAR_NAME == 'Surface-SM': - if (MODEL=='CLSM'): - VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(SoilMoist_profiles=0) # for clsm the total soil moisture is in the third layer - else: - VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(SoilMoist_profiles=0) ## Summing soil moisture from all layers + VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(SoilMoist_profiles=0) elif VAR_NAME == 'Total-Runoff': VAR_SEL_CLIM_DATA = SEL_CIM_DATA.Qs_tavg+SEL_CIM_DATA.Qsb_tavg ## Adding total surface runoff with sub-surface runoff diff --git a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_function.py b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_function.py index 8d0284cd4..18fa91434 100755 --- a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_function.py +++ b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_function.py @@ -54,7 +54,7 @@ def CALC_BCSD(OBS_CLIM_ALL, FCST_CLIM_ALL, LEAD_FINAL, TARGET_FCST_VAL_ARR, TARG #BIAS_CORRECTED_VALUE = lookup(TARGET_FCST_QUANT, OBS_QUANT_TS.values, OBS_CLIM_TS.values, len(OBS_CLIM_TS.values), BC_VAR, 'DATA', obs_mean, obs_sd, obs_skew, TINY); if (BC_VAR=='PRCP') and (BIAS_CORRECTED_VALUE<0): ## This is just a hack to check we are not getting negative value of precipitation - print (TARGET_FCST_VAL, TARGET_FCST_QUANT, fcst_yr, LEAD_NUM, ens_num, lat_num, lon_num) + print (TARGET_FCST_VAL, TARGET_FCST_QUANT, fcst_yr, LEAD_NUM, ens_num) ## Now storing the bias corrected anomaly CORRECT_FCST_COARSE[fcst_yr, LEAD_NUM, ens_num] = BIAS_CORRECTED_VALUE diff --git a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_stats_functions.py b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_stats_functions.py index f66db3beb..37a35d35b 100755 --- a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_stats_functions.py +++ b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/BCSD_stats_functions.py @@ -217,7 +217,7 @@ def get_F_from_data_EVI(mean, sd, x, TINY): if(F>=1.0) or (F<=0.0): print ("Error in get_F_from_data_EVI") - print ("Bad quantile: data={:0.2f} mean={0.2f} sd={0.2f} quant={0.2f}".format(x,mean,sd,F)); + print ("Bad quantile: data={:0.2f} mean={:0.2f} sd={:0.2f} quant={:0.2f}".format(x,mean,sd,F)); sys.exit(1); else: return F; @@ -226,7 +226,7 @@ def get_data_from_F_EVI(mean, sd, F, TINY): #Gumbel (EV Type I distribution) for maxima if(F>=1.0) or (F<=0.0): print ("Error in get_data_from_F_EVI") - print ("Bad quantile: mean={0.2f} sd={0.2f} quant={0.2f}".format(mean,sd,F)) + print ("Bad quantile: mean={:0.2f} sd={:0.2f} quant={:0.2f}".format(mean,sd,F)) sys.exit(0); b = 3.14159/(sd*sqrt(6)) a = mean-0.5772/b diff --git a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/Shrad_modules.py b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/Shrad_modules.py index 399a9297c..9efc17e69 100755 --- a/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/Shrad_modules.py +++ b/ldt/utils/usaf/bcsd_preproc/lib_bcsd_metrics/Shrad_modules.py @@ -79,7 +79,6 @@ def plotmap(var, lats, lons, lat_min, lat_max, lat_int, lon_min, lon_max, lon_in if plottype == 'mesh': cs=m.pcolormesh(xi, yi, var, vmax=cbmax, vmin=cbmin, cmap=cmap) elif plottype == 'contour': - cmap = cmap cmap.set_under(col_under) cmap.set_over(col_higher) norm = mpl.pyplot.cm.colors.Normalize(vmax=cbmax, vmin=cbmin, clip=False) diff --git a/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/All_functions.py b/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/All_functions.py index 48cb2806c..1689fd90a 100755 --- a/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/All_functions.py +++ b/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/All_functions.py @@ -19,10 +19,7 @@ def Sel_var (SEL_CIM_DATA, VAR_NAME, MODEL): VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=0)*0.05+SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=1)*0.15+SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=2)*0.3+SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=3)*0.5 if VAR_NAME == 'Surface-SM': - if (MODEL=='CLSM'): - VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=0) # for clsm the total soil moisture is in the third layer - else: - VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=0) ## Summing soil moisture from all layers + VAR_SEL_CLIM_DATA = SEL_CIM_DATA.SoilMoist_tavg.isel(soil_layer=0) elif VAR_NAME == 'Total-Runoff': VAR_SEL_CLIM_DATA = SEL_CIM_DATA.Qs_tavg+SEL_CIM_DATA.Qsb_tavg ## Adding total surface runoff with sub-surface runoff @@ -43,15 +40,12 @@ def GET_BOUNDARY(REGION_NAME): BOUNDARY_EA = (22, 55, -12, 23); BOUNDARY_WA = (-19, 26, -5, 25) ##BOUNDARY_SA = (8, 52, -37, 0); BOUNDARY_FAME = (-20, 60, -40, 40) BOUNDARY_SA = (8, 52, -37, 6); BOUNDARY_FAME = (-20, 55, -40, 40) - #BOUNDARY_SA1 = (24, 33, -31, -24) if (REGION_NAME == 'EA'): Boundary = BOUNDARY_EA elif (REGION_NAME == 'WA'): Boundary = BOUNDARY_WA elif (REGION_NAME == 'SA'): Boundary = BOUNDARY_SA - elif (REGION_NAME == 'SA1'): - Boundary = BOUNDARY_SA1 else: Boundary = BOUNDARY_FAME return Boundary diff --git a/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/Shrad_modules.py b/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/Shrad_modules.py index 03f58a4b1..8a3655065 100755 --- a/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/Shrad_modules.py +++ b/lvt/utils/usaf/s2smetric/lib_bcsd_metrics/Shrad_modules.py @@ -78,7 +78,6 @@ def plotmap(var, lats, lons, lat_min, lat_max, lat_int, lon_min, lon_max, lon_in if plottype == 'mesh': cs=m.pcolormesh(xi, yi, var, vmax=cbmax, vmin=cbmin, cmap=cmap) elif plottype == 'contour': - cmap = cmap cmap.set_under(col_under) cmap.set_over(col_higher) norm = mpl.pyplot.cm.colors.Normalize(vmax=cbmax, vmin=cbmin, clip=False)