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

Add cmec flag to Monsoon (Wang) #708

Merged
merged 2 commits into from
Mar 15, 2021
Merged
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: 17 additions & 1 deletion pcmdi_metrics/monsoon_wang/monsoon_wang_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ def create_monsoon_wang_parser():
default=2.5 / 86400.,
type=float,
help="Threshold for a hit when computing skill score")

P.add_argument("--cmec",
dest="cmec",
default=False,
action="store_true",
help="Use to save CMEC format metrics JSON")
P.add_argument("--no_cmec",
dest="cmec",
default=False,
action="store_false",
help="Do not save CMEC format metrics JSON")
P.set_defaults(cmec=False)
return P


Expand All @@ -71,6 +81,9 @@ def monsoon_wang_runner(args):
thr = args.threshold
sig_digits = '.3f'

# Get flag for CMEC output
cmec = args.cmec

#########################################
# PMP monthly default PR obs
cdms2.axis.longitude_aliases.append("longitude_prclim_mpd")
Expand Down Expand Up @@ -226,3 +239,6 @@ def monsoon_wang_runner(args):
separators=(
',',
': '))
if cmec:
print("Writing cmec file")
OUT.write_cmec(indent=4, separators=(',', ': '))