Skip to content

Commit

Permalink
drop not needed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhuzhang committed Jul 12, 2024
1 parent 4d8a1e3 commit f0a80c9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#[#]
#sets = ["annual_cycle_zonal_mean"]
#case_id = "OMI-MLS"
#variables = ["SCO"]
#ref_name = "OMI-MLS"
#reference_name = "OMI-MLS"
#test_colormap = "WhiteBlueGreenYellowRed.rgb"
#reference_colormap = "WhiteBlueGreenYellowRed.rgb"
#diff_colormap = "diverging_bwr.rgb"
#contour_levels = [180,200,220,240,260,280,300,320,340,360,380]
#diff_levels = [ -40, -30, -20, -15, -10, -5,-2,2, 5, 10, 15, 20, 30,40]
#
#[#]
#sets = ["annual_cycle_zonal_mean"]
#case_id = "OMI-MLS"
#variables = ["TCO"]
#ref_name = "OMI-MLS"
#reference_name = "OMI-MLS"
#test_colormap = "WhiteBlueGreenYellowRed.rgb"
#reference_colormap = "WhiteBlueGreenYellowRed.rgb"
#diff_colormap = "diverging_bwr.rgb"
#contour_levels = [12,16,20,24,28,32,36,40,44]
#diff_levels = [-20,-15,-10,-5,-2,2,5,10,15,20]
[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "OMI-MLS"
variables = ["SCO"]
ref_name = "OMI-MLS"
reference_name = "OMI-MLS"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "diverging_bwr.rgb"
contour_levels = [180,200,220,240,260,280,300,320,340,360,380]
diff_levels = [ -40, -30, -20, -15, -10, -5,-2,2, 5, 10, 15, 20, 30,40]

[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "OMI-MLS"
variables = ["TCO"]
ref_name = "OMI-MLS"
reference_name = "OMI-MLS"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "diverging_bwr.rgb"
contour_levels = [12,16,20,24,28,32,36,40,44]
diff_levels = [-20,-15,-10,-5,-2,2,5,10,15,20]

[#]
sets = ["annual_cycle_zonal_mean"]
Expand All @@ -32,14 +32,14 @@ contour_levels = [-1, 0, 1, 3, 6, 9, 12, 15, 18, 20, 22, 24, 26, 28, 29]
diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.2, 0.2, 0.5, 1, 2, 3, 4, 5]


#[#]
#sets = ["annual_cycle_zonal_mean"]
#case_id = "GPCP_v3.2"
#variables = ["PRECT"]
#ref_name = "GPCP_v3.2"
#reference_name = "GPCP_v3.2"
#test_colormap = "WhiteBlueGreenYellowRed.rgb"
#reference_colormap = "WhiteBlueGreenYellowRed.rgb"
#diff_colormap = "BrBG"
#contour_levels = [0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16]
#diff_levels = [-5, -4, -3, -2, -1, -0.5, 0.5, 1, 2, 3, 4, 5]
[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "GPCP_v3.2"
variables = ["PRECT"]
ref_name = "GPCP_v3.2"
reference_name = "GPCP_v3.2"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "BrBG"
contour_levels = [0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16]
diff_levels = [-5, -4, -3, -2, -1, -0.5, 0.5, 1, 2, 3, 4, 5]
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#CFG_PATH = "/global/homes/c/chengzhu/e3sm_diags/auxiliary_tools/cdat_regression_testing/669-annual_cycle_zonal_mean/annual_cycle_zonal_mean_model_vs_obs.cfg"
# TODO: <OPTIONAL> Update MULTIPROCESSING based on whether to run in parallel or
# serial. For debugging purposes, set to False to run serially.
#MULTIPROCESSING = True
MULTIPROCESSING = False
MULTIPROCESSING = True
#MULTIPROCESSING = False

run_set(SET_NAME, SET_DIR, CFG_PATH, MULTIPROCESSING)
3 changes: 3 additions & 0 deletions e3sm_diags/driver/annual_cycle_zonal_mean_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def run_diag(parameter: CoreParameter) -> CoreParameter:
ds_test = test_ds.get_climo_dataset(var_key, "ANNUALCYCLE")
ds_ref = ref_ds.get_ref_climo_dataset(var_key, "ANNUALCYCLE", ds_test)

# ds_test = ds_test[[var_key]]
# ds_ref = ds_ref[[var_key]]

dv_test = ds_test[var_key]
dv_ref = ds_ref[var_key]

Expand Down
5 changes: 5 additions & 0 deletions e3sm_diags/driver/utils/dataset_xr.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ def _get_climo_dataset(self, season: str) -> xr.Dataset:
if "slat" in ds.dims:
ds = ds.drop_dims(["slat", "slon"])

all_vars = list(ds.data_vars.keys())
keep_bnds = [var for var in all_vars if "bnd" in var]
# ds = ds[[self.var, 'lat_bnds', 'lon_bnds']]
ds = ds[[self.var] + keep_bnds]

return ds

def _open_climo_dataset(self, filepath: str) -> xr.Dataset:
Expand Down

0 comments on commit f0a80c9

Please sign in to comment.