Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mean clim obs info dict update #880

Merged
merged 7 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions doc/obs_info_dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"period": "200301-201812",
"shape": "(12, 60, 350)",
"template": "hfls/TropFlux-1-0/v20210804/hfls_mon_TropFlux-1-0_PCMDI_gn.200301-201812.AC.v20210804.nc"
}
},
"default": "TropFlux-1-0",
"alternate1": "ERA-INT"
},
"hfns": {
"TropFlux-1-0": {
Expand All @@ -28,7 +30,8 @@
"period": "200301-201812",
"shape": "(12, 60, 350)",
"template": "hfns/TropFlux-1-0/v20210804/hfns_mon_TropFlux-1-0_PCMDI_gn.200301-201812.AC.v20210804.nc"
}
},
"default": "TropFlux-1-0"
},
"hfss": {
"ERA-INT": {
Expand All @@ -48,7 +51,9 @@
"period": "200301-201812",
"shape": "(12, 60, 350)",
"template": "hfss/TropFlux-1-0/v20210804/hfss_mon_TropFlux-1-0_PCMDI_gn.200301-201812.AC.v20210804.nc"
}
},
"default": "TropFlux-1-0",
"alternate1": "ERA-INT"
},
"hur": {
"ERA-INT": {
Expand All @@ -59,7 +64,8 @@
"period": "200301-201812",
"shape": "(12, 19, 121, 240)",
"template": "hur/ERA-INT/v20210804/hur_mon_ERA-INT_PCMDI_gn.200301-201812.AC.v20210804.nc"
}
},
"default": "ERA-INT"
},
"hus": {
"ERA-INT": {
Expand Down Expand Up @@ -496,7 +502,9 @@
"period": "200301-201812",
"shape": "(12, 180, 360)",
"template": "rt/CERES-EBAF-4-1/v20210804/rt_mon_CERES-EBAF-4-1_PCMDI_gn.200301-201812.AC.v20210804.nc"
}
},
"default": "CERES-EBAF-4-1",
"alternate1": "CERES-EBAF-4-0"
},
"sfcWind": {
"ERA-INT": {
Expand Down
4 changes: 0 additions & 4 deletions pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ def compute_metrics(Var, dm, do):
metrics_defs["rmsc_xy"] = pcmdi_metrics.pcmdi.rmsc_xy.compute(None, None)
metrics_defs["bias_xy"] = pcmdi_metrics.pcmdi.bias_xy.compute(None, None)
metrics_defs["mae_xy"] = pcmdi_metrics.pcmdi.meanabs_xy.compute(None, None)
# metrics_defs["cor_xyt"] = pcmdi_metrics.pcmdi.cor_xyt.compute(
# None,
# None)
metrics_defs["cor_xy"] = pcmdi_metrics.pcmdi.cor_xy.compute(None, None)
metrics_defs["mean_xy"] = pcmdi_metrics.pcmdi.mean_xy.compute(None)
metrics_defs["std_xy"] = pcmdi_metrics.pcmdi.std_xy.compute(None)
Expand Down Expand Up @@ -50,7 +47,6 @@ def compute_metrics(Var, dm, do):

# CALCULATE ANNUAL CYCLE SPACE-TIME RMS, CORRELATIONS and STD
rms_xyt = pcmdi_metrics.pcmdi.rms_xyt.compute(dm, do)
# cor_xyt = pcmdi_metrics.pcmdi.cor_xyt.compute(dm, do)
stdObs_xyt = pcmdi_metrics.pcmdi.std_xyt.compute(do)
std_xyt = pcmdi_metrics.pcmdi.std_xyt.compute(dm)

Expand Down
16 changes: 15 additions & 1 deletion pcmdi_metrics/pcmdi/mean_climate_metrics_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def run_diags(self):
continue

for region in self.regions_dict[self.var]:
logging.getLogger("pcmdi_metrics").info("REGION: {}".format(region))
logging.getLogger("pcmdi_metrics").info(
"VAR: {}, REGION: {}".format(self.var, region)
)
self.region = self.create_region(region)
self.run_reference_and_test_comparison()

Expand Down Expand Up @@ -158,6 +160,12 @@ def run_reference_and_test_comparison(self):
reference_data_set_is_obs = self.is_data_set_obs(reference_data_set)
test_data_set_is_obs = self.is_data_set_obs(test_data_set)

logging.getLogger("pcmdi_metrics").info(
"reference_data_set (given): {}, reference_data_set_is_obs: {}, test_data_set_is_obs: {}".format(
reference_data_set, reference_data_set_is_obs, test_data_set_is_obs
)
)

# If either the reference or test are obs, the data sets
# themselves need to be modified.
if reference_data_set_is_obs:
Expand All @@ -169,6 +177,12 @@ def run_reference_and_test_comparison(self):
test_data_set, self.obs_dict, self.var
)

logging.getLogger("pcmdi_metrics").info(
"reference_data_set (adjusted): {}, test_data_set: {}".format(
reference_data_set, test_data_set
)
)

if len(reference_data_set) == 0: # We did not find any ref!!!
raise RuntimeError("No reference dataset found!")

Expand Down
Loading