CRHMr-package: Contains functions to perform pre- and post- processing on...

CRHMr-packageR Documentation

Contains functions to perform pre- and post- processing on data used with the Cold Regions Hydrological Modelling (CRHM) platform

Description

All data in CRHMr, whether model input or output must be stored in the standard type of data frame. The file input functions (readObsFile readExportFile readOutputFile) will automatically create standard CRHMr data frames. If you are reading data from another type of file using standard R functions, then you will have to force it to be in the standard format.
The first column of the data frame is labeled datetime, and as is the date and time stored as a POSIXct value, with the correctly-specified time zone. The only exception is for daily CRHM data or for aggregated values which use a daily or longer time step. In these cases the first column will have the appropriate name.

Because CRHM allows there to be many values of a variable, each variable will have a trailing number such as .1. This is added automatically when importing CRHM data. Most of the functions allow you to select a variable by its column number. In all cases, the column number does NOT include the datetime column.
To make your research more reproducible, each function writes information about what it did, including the date and time it was run, to a log file ( CRHMr.log) in the default directory. It is suggested that you also run the function user when you first start to use CRHMr as it writes information about your computer to the log file. This may be helpful when trying to figure out bugs. Please send the output of your log file (including the user output) when reporting bugs.

The package contains functions to do the following:

  1. Read in CRHM data into a CRHMr data frame. This includes data from .obs files (observation data used by CRHM), and model run outputs, either output automatically, or manually exported.

  2. Manipulate obs data. Includes functions to plot the values, to find missing values, or datetimes, and to infill gaps by interpolation (linea or spline) and by imputation from other datasets.

  3. Convert Ea values to RH and vice-versa. Interpolation and imputation require Ea values, as RH values depend on the air temperature. For safety, CRHMr functions do not permit both Ea and RH values in a data frame, as it would be impossible to know which was correct.

  4. Write a data frame data to a CRHM obs file.

  5. Execute CRHM. This allows CRHM to be run automatically, which is very useful for doing sensitivity analyses. There are functions to prepare a CRHM model to be executed, including setting the run start and end dates, and to run CRHM from inside R.

  6. Examine output from CRHM runs. Includes functions to read in model output and to aggregate, summarize and plot the values.

Author(s)

Maintainer: Kevin Shook kevin.shook@usask.ca

Authors:

  • Alex Cebulski

References

To cite CRHMr in publications, use the command citation('CRHMr') to get the current version of the citation.
The CRHM program is described in:
Pomeroy, John W, D M Gray, T Brown, N Hedstrom, W L Quinton, R J Granger, and S K Carey. 2007. “The Cold Regions Hydrological Model : A Platform for Basing Process Representation and Model Structure on Physical Evidence”. Hydrological Processes 21 (19): 2650-2567.
The CRHM model may be downloaded from http://www.usask.ca/hydrology/CRHM.php.

See Also

Useful links:


CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.