jgcri / an2month Goto Github PK
View Code? Open in Web Editor NEWUse CMIP 5 data to approximate monthly data from annual data.
Use CMIP 5 data to approximate monthly data from annual data.
Set up raw-data processing code to calculate the average monthly fraction of precipitation that falls within a year. Output from the raw-data processing should be stored as internal package data as some sort of documented Rdata object like an array or something.
I just wanted to keep track of the cdo functions used in the monthly fraction processing code.
cdo documentation from https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-4610002.8.23.
Package data names will be changing to alpha_<model>
instead of frac_<model>
. Update relevant code to reflect this.
Check if the data files on PIC used to estimate fractions:
https://github.com/JGCRI/an2month/blob/master/data-raw/L0.find_and_preprocess_isimip.R#L22
ISIMIP_DIR <- "/pic/projects/GCAM/leng569/data/Input_GCM_bced" # The location of the isimip files on pic
agree with the files ultimatly used elsewhere in the experiment.
Check if the fractions are only from RCP4.5 as the code
https://github.com/JGCRI/an2month/blob/master/data-raw/L0.find_and_preprocess_isimip.R#L38 and
https://github.com/JGCRI/an2month/blob/master/data-raw/L0.find_and_preprocess_isimip.R#L61-L90 and
https://github.com/JGCRI/an2month/blob/master/data-raw/run_L0_isimip.sh
suggest - the .sh
file appears to just be running the .R
scripts once, with the default argument, suggesting only the RCP45 data is the only data being used to estimate fractions. Possible that what got run on pic differs from what's here in the code; at any rate we'll need to check through and document better at least for the paper
FYI to @crvernon @FeralFlows
Do we want to incorporate the Xanthos unit conversions into downscaling_component_api
or should it be done in a separate step?
Documentation says the input alpha
to the function monthly_downscaling
should be
#' @param alpha Matrix[ngrid, 12] of the alpha parameters for the Dirichlet
#' distribution. These values are included as package data. For more details
#' on how they are calculated see data-raw.
But the code is actually expecting alpha
to be a list, one entry of which is that matrix (under the appropriate variable name).
Will probably address this under the PR for #16, and will just add any other additional documentation corrections that come up here.
Forgot to open issue on Jul 06, 2020, when work started:
currently, from the code, it appears that the monthly fractions are sampled from a distribution once for each realization of annual data. So every year in realization 1 is the same kind of year, every year in realization 2 is the same kind of year (but different from the kind of year in realization 1).
@claudiatebaldi @kdorheim In trying to work through the code in more depth for doing this enhancement #16,
I've done more careful, line by line combing through the nested functions in data_raw/L3_fit_dirichlet_params.R
and data_raw/jobrun.zsh
. I think that the code is estimating the parameters of a multivariable beta distribution for the temperature data, and a separate set of parameters for the precipitation data. At least I think.
I didn't catch it in my initial trying to learn the an2month
package, I think because of how the functions are nested. And because I think that approach of treating T and P separately is different from the very early notes I had contributing to figuring out what the sampling should look like (around Dec 2018) and then I wasn't involved in the actual work. And then so many issues came up with how fldgen was being called in the pipeline, I didn't return to this until last week/this week.
So do we want to keep T and P separate the way they're implemented, or do we want to estimate 24 parameters together (like I initially thought was happening)? Also thoughts on continuing to use a multivariate beta distribution?
Need to add documentation to functions and package data!
Monthly precipitation values are average rates, not total accumulation. The monthly downscaling function assumes the latter, and so needs to be changed.
validating that what we see are reasonable.
brainstorm for metrics to look at?
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.