WCRP-CORDEX / data-request-table

Machine readable data request tables
MIT License
0 stars 0 forks source link

check time cell method of monthly "max" variables #9

Closed larsbuntemeyer closed 5 months ago

larsbuntemeyer commented 5 months ago

need to check:

import pandas as pd

df = pd.read_csv("CORDEX-CMIP6/data-request.csv")
df[(df.out_name.str.contains("max")) & (df.frequency == "mon")].out_name.unique()
array(['tasmax', 'prhmax', 'sfcWindmax', 'wsgsmax', 'capemax', 'limax',
       'cinmax'], dtype=object)
larsbuntemeyer commented 5 months ago

Need to check these cell_methods:

out_name long_name frequency cell_methods
tasmax Daily Maximum Near-Surface Air Temperature mon area: mean time: maximum within days time: mean over days
prhmax Daily Maximum Hourly Precipitation Rate mon area: mean time: mean within hours time: maximum over hours
sfcWindmax Daily Maximum Near-Surface Wind Speed mon area: mean time: maximum within days time: mean over days
wsgsmax Daily Maximum Near-Surface Wind Speed of Gust mon area: mean time: maximum
capemax Daily Maximum Convective Available Potential Energy mon area: mean time: maximum
limax Daily Maximum Lifted Index mon area: mean time: maximum
cinmax Daily Maximum Convective Inhibition mon area: mean time: maximum
larsbuntemeyer commented 5 months ago
These were not provided in CMIP6, so i would set cell_methods for these like tasmax: out_name long_name frequency cell_methods
wsgsmax Daily Maximum Near-Surface Wind Speed of Gust mon area: mean time: maximum within days time: mean over days
capemax Daily Maximum Convective Available Potential Energy mon area: mean time: maximum within days time: mean over days
limax Daily Maximum Lifted Index mon area: mean time: maximum within days time: mean over days
cinmax Daily Maximum Convective Inhibition mon area: mean time: maximum within days time: mean over days
larsbuntemeyer commented 5 months ago

This is my final fix:

import pandas as pd

df = pd.read_csv("CORDEX-CMIP6/data-request.csv")

out_names = ["wsgsmax", "cinmax", "limax", "capemax"]
monmax = df[(df.out_name.isin(out_names)) & (df.frequency == "mon")]
df.loc[monmax.index, 'cell_methods'] = "area: mean time: maximum within days time: mean over days"

df.to_csv("CORDEX-CMIP6/data-request.csv", index=False)