apendergrass / cmip6hack-precip Goto Github PK
View Code? Open in Web Editor NEWPrecipitation and extreme precipitation in CMIP6
License: MIT License
Precipitation and extreme precipitation in CMIP6
License: MIT License
sd_hist = (xr.apply_ufunc(signal.detrend, data_tmp['hist'].fillna(0),
kwargs={'axis': 0}).where(~data_tmp['hist'].isnull())
.sel(time=data_tmp['hist'].time.dt.season.isin(seas))
.std("time"))
sd_futr = (xr.apply_ufunc(signal.detrend, data_tmp['futr'].fillna(0),
kwargs={'axis': 0}).where(~data_tmp['futr'].isnull())
.sel(time=data_tmp['futr'].time.dt.season.isin(seas))
.std("time"))
i think detrending is applied to the whole timeseries for each month, but the seasonal mean should be calculated first, then the timeseries of seasonsal means should be detrended, then the std should come last
Calculate precip mean and std change, and huss change, for three regions (all land):
For the plots, average the NH XT, DJF with SH XT, JJA and vice versa to get XT land in winter and XT land in summer
the current CSVs lack the first two time periods, which are commented out in the list
Make the plot look nice.
Models have constant field of "areacella" to correctly area average quantities.
np.cos(latr)
to areacella
if
checks for those models without areacella
and leave np.cos(latr)
as alternativeAdd comments throughout
Isolate to land, hopefully using each model's land mask (sftlf variable)
https://github.com/hdrake/cmip6hack-multigen/blob/master/notebooks/0_calc_tas_skill.ipynb
seems to have done the first step of our project nicely.
Currently the code has:
dsdG_djf=results.copy()
dsdG_jja=results.copy()
dmuG_djf=results.copy()
dmuG_jja=results.copy()
for model in results:
for timeperiod in results[model]:
dsdG_djf[model][timeperiod]=results[model][timeperiod]['DJF'].dsdG.values.item(0)
dsdG_jja[model][timeperiod]=results[model][timeperiod]['JJA'].dsdG.values.item(0)
dmuG_djf[model][timeperiod]=results[model][timeperiod]['DJF'].dmuG.values.item(0)
dmuG_jja[model][timeperiod]=results[model][timeperiod]['JJA'].dmuG.values.item(0)
But what actually made the one csv that worked was
dsdG_djf=results
for model in results:
for timeperiod in results[model]:
dsdG_djf[model][timeperiod]=results[model][timeperiod]['DJF'].dsdG.values.item(0)
The problem is that it alters "results" and overwrites the other data. The challenge is to figure out how to get the data out without overwriting.
Fix duplicative calls etc
Enforce that any model with a NaN in any variable has a NaN in all variables before plotting. Right now one model has a lot of NaNs
save data from the loading/calculate notebook into a csv
load and plot it in another notebook
Proposal: envelope of 95% confidence interval of average pr std change based on t-test for spread across models in pr std change at each time.
Could also add envelopes for mean precip and huss (might require more graphic design, but they should be smaller envelopes)
Merge subset_models_with_intake.ipynb, which implements intake-esm but doesn't actually load data, into mean_var_calcs.ipynb, which opens data and calculates and plots things, but only works on the cloud.
Ssps start in 2006 but the first period to evaluate change over starts in 1991
Calculate the change in tas, pr mean, pr std, and huss mean for each ensemble member / variant of a model, and average them together
to get 30 years of DJF seasons where each season is a contiguous 30 years, there needs to be 31 years of data to start, and the partial seasons should be thrown out
for xarray.dataset (eg temp_dapr) - temp_dapr.to_netcdf()
Read in huss, take its mean over the regions/seasons, and incorporate into plots (analogous to mean pr)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.