Description Usage Arguments Details Value Output On project.climate parameters
View source: R/wrapper_project_climate.R
build.projection
is a wrapper for project.climate
that
allows for file management, batch processing, bootstrapping, and saving of
output, if all the directory and filename/structure defaults are followed,
for the projection of climate time series by changes in the distribution
shape estimated across a different dataset/model, with potentially multiple
runs of data over the same time frame, calculated using
wrapper_get_quantiles.R
.
1 2 | build.projection(defaults, log = T, max.runtime = 4 * 60 * 60,
assumed.avg.processing.time = 5, process.inputs = list())
|
defaults |
the output from |
log |
whether to log the output using |
max.runtime |
if batch processing on a server with a maximum allocated
runtime, you can set it here, and the run will stop when the next block of
time might take longer to run than the remaining allocated time. This
prevents empty, un-processed temporary output files from preventing the
complete processing of all data 'blocks'. Explicitly, the next block isn't
processed and the function run is interrupted if the current system time if
|
assumed.avg.processing.time |
by default 5 (seconds), the estimated processing time per pixel. Used in interrupting batch run if time is running out. |
process.inputs |
add custom process.inputs list. By default, the code
attempts to load [defaults$mod.data.dir]/process_inputs.RData. If this is
not desired (i.e. you want to just process a subset of process chunks),
put a subsetted output of |
build.projection
runs project.climate
on a
pixel-by-pixel basis. These pixels are loaded and processed on a
latitude-by-region/subset basis - in other words, a 'block' of pixels is
every pixel in one subset/region (determined by a separate .nc file in the
mod.data.dir
set by the set.defaults
function) with the
same latitude. This 'block' of pixels is loaded and sent through
get.quantiles
one at a time; the resultant coefficients are
saved in files 'block' by 'block' (and can be recombined later using
combine.locs
). The 'blocks' are identified through the saved
output of get.process.chunks
.
CURRENTLY, the code requires that the 'base data' (the data to be projected)
is saved in the SAME chunk-by-chunk format as the model data being used to
calculated the quantile changes. In other words, each model .nc file in
mod.data.dir
must have an equivalent file with the same suffix and
covering the same pixels in base.data.dir
. Since memory usage is
a much bigger issue in the model quantile fits, a future version of this
will allow for the use of more 'standard' base data (not saved in chunks).
Nothing. Output is saved instead.
the output="full"
output in
project.climate
option is used, returning (within
the function) a list for each latitude-by-region/subset chunk
giving the projected time series as an xts
object
(proj.data
), the coefficients of the quantiles used for
normalizing the base climate time series (base.norm.coef
),
the lat
and lon
of the pixel, the output.years
,
and the linear indices (in the base period) used a the reference
year/days in the projected period (base.idxs
). This list
object is saved for each processing chunk in the
"[defaults$base.data.dir]/output/
" directory, under the
filename: "[filevar]_day_[base.name]_[mod.name]proj_[proj.method]_[proj.year.range]_locs[global_loc(1)-global_loc(end)]([fn.suffix]).RData
",
where proj.method
is a quick shorthand for the projection
method (set by index.type
and resampling.timescale
in defaults
), and fn.suffix
is set by
set.defaults
.
project.climate
parametersInputs to project.climate
are governed through the
defaults
object, generated by the
set.defaults
function. These include which
data to use as 'base' data for the projection (index.type
and resampling.timescale
) and bootstrap/uncertainty
quantification parameters (bootstrapping
, nboots
,
and block.size
). See project.climate
and set.defaults
for details.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.