crssi: CRSS Input Class (crssi)

View source: R/crssi.R

crssiR Documentation

CRSS Input Class (crssi)

Description

crssi() constructs a crssi object that holds all of the necessary trace-based input data for CRSS. Namely, this includes the intervening, monthly natural flow for all 29 sites, the Sacremento Year Type index, and a scenario number.

Usage

crssi(flow, sac_year_type, scen_number, scen_name = NULL, drop_flow = TRUE)

is_crssi(x)

Arguments

flow

A crss_nf object.

sac_year_type

An annual xts object with all time steps having a September or December-some year time step. The number of columns in this object must match the number of traces in flow. Additionally, there must be some overlapping years of data. See details.

scen_number

The scenario number. See Scenario Numbering Convention section.

scen_name

Optional. This is only used when printing in R to help the user quickly know what is stored in the crssi object.

drop_flow

Boolean. If TRUE, and if flow contains flows other than monthly, intervening, these flows will be dropped. This is suggested as the memory needed to store the object and the time needed to apply ISM to the object will be drastically reduced. If FALSE, the other flows are kept in the object.

x

An object.

Details

crssi() inherits from crss_nf, maintaining the same required structure for the intervening natural flows. The object also contains the Sacramento Year Type index, and a scenario number. Given this, all functions that work on crss_nf and nfd objects work on crssi objects.

Sacramento Year Type index: Beginning in CRSS v2.6, input data for the Sacramento year type index are necessary. For historical values see sac_year_type_get().

Overlapping years: crssi() checks to make sure that there at least some overlappying yeras of data between flow and sac_year_type. It then trims the data to be January, year1 - December, year2 for the overlapping period between flow and sac_year_type. For example, if flow contains data for March 2020 - December 2024 while sac_year_type contains data for December 2020 - December 2025, the returned object will contain monthly intervening flow for January 2021 - December 2024, and Sacremento year type index values for December 2021 - December 2024.

Value

crssi() returns an object of class crssi.

is_crssi() returns TRUE if class inherits from crssi.

Scenario Numbering Convention

Scenario numbering can change faster than this package. For the latest numbering convention, check the package wiki.

The numbering convention uses the following for the ones place of the scenario number.

  • 1 = Observed Resampled, i.e., ISM applied to the historical record.

  • 2 = Direct Paleo Resampled

  • 3 = Paleo-conditioned

  • 4 = CMIP3 Downscaled GCM Projected-

  • 5 = CMIP5 Downscaled GCM Projected, BCSD downscaling, quantile mapping secondary bias correction

Then, for scenarios that use the observed resampled data, the decimal portion should be set to reflect the years that ISM is applied to. For example, if you are using the 1988-2012 record, the decimal portion should be set to 19882012, where the first 4 numbers represent the start year and the second four numbers represent the end year. Thus scen_number should be 1.19882012 in this example. This tells the user of CRSS that the supply scenario is the observed historical natural flows with the ISM method applied to the 1988-2012 data.

See Also

crss_nf, nfd, write_crssi(), sac_year_type_get()

Examples


# get natural flow and Sacremento Year Type data for 2000-2002
nf <- crss_nf(
  CoRiverNF::monthlyInt["2000/2002"],
  flow_space = "intervening",
  time_step = "monthly"
)
sac <- sac_year_type_get(internal = TRUE)["2000/2002"]
in_data <- crssi(nf, sac, scen_number = 1.20002002)


BoulderCodeHub/CRSSIO documentation built on July 2, 2023, 5:15 p.m.