Description Usage Arguments Details NetCDF output structure
View source: R/qchange_calcs_func.R
get.quantile.changes
calculates the change in the mean quantile by day
of year between a future period (mean across future.years
) and a base
period (mean across base.years
) by day of year for quantile estimates
generated by estimate.quantiles
and merged by
combine.params
). In words, for every estimated quantile and every
day of year, this code gives the difference between the average day of year
(i.e. Jan 1st) of that quantile in the future.years
period vs. the
same in the base.years
period.
1 2 3 | get.quantile.changes(defaults, export.nc = T, output.type = "grid",
lon_vec = numeric(), lat_vec = numeric(), comments = character(),
base.years, future.years, load.fn = character())
|
defaults |
the output of |
export.nc |
whether to directly save the output in a NetCDF file |
output.type |
if saving output in a NetCDF file, sets whether the variable is "linear" ([loc x quantile x day of year]) or "grid" (by default; [lon x lat x quantile x day of year]; pixels without data will be NAs) |
lon_vec, lat_vec |
if saving output in a NetCDF file as a "grid", these will manually set the [lon] and [lat] vectors to use as a basis. Especially useful if there are lat or lon gaps in the original data. |
comments |
if saving output in a NetCDF file, this inputs an extra global attribute, 'comments_2', with the contents of the variable. |
base.years |
the base years to average over (i.e. |
future.years |
the future years to average over (i.e. |
load.fn |
the file containing the quantile fit coefficients. If left empty,
it will look for the output file of |
Duplicate locations are removed from the final output.
If export.nc=TRUE
, the quantile changes are saved to a NetCDF file.
The main variable, "d[defaults$filevar]
", is a [loc x quantile
x day of year]
array if output.type=="linear"
and a
[lon x lat x quantile x day of year]
array if output.type=="grid"
,
with missing pixels filled with NAs. lat
, lon
, and
q
/quantile are also saved. The day of year is just an index 1:365
.
A few extra global attributes are included, and an additional "comment" attribute c
an be added to the NetCDF file using the comment
parameter.
The NetCDF file is saved in defaults$mod.data.dir
with the name:
d[filevar]_day_[mod.name]_qchange_[base.year[1]-base.year[end]]_[future.year[1]-future.year[end]].nc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.