Coder Social home page Coder Social logo

cmip6hack-precip's People

Contributors

apendergrass avatar bolliger32 avatar chiaral avatar ks905383 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cmip6hack-precip's Issues

detrending should happen on each season rather than the whole timeseries

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

Separate out tropics and extratropics

Calculate precip mean and std change, and huss change, for three regions (all land):

  • tropics (< |30° lat|)
  • NH XT (>30° lat)
  • SH XT (<-30° lat)
    And for two seasons:
  • DJF
  • JJA

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

Stretch goal: Make the plot look nice

Make the plot look nice.

  • Make markers for pr std change bigger than the original
  • Consider using markers for mean pr change and huss change.
  • Consider making more use of color (no need to continue single-color scheme from paper for this context)

Substitute areacella for weights=np.cos(lat)

Models have constant field of "areacella" to correctly area average quantities.

  • check that we have them for all models in use for cloud
  • check that we have them for all models in use for glade
  • modify weights from np.cos(latr) to areacella
  • leave some if checks for those models without areacella and leave np.cos(latr) as alternative

fix data conversion

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.

Stretch goal: Add error bars

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)

Read in data with intake-esm

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.

get DJF correctly

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

Incorporate huss

Read in huss, take its mean over the regions/seasons, and incorporate into plots (analogous to mean pr)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.