View source: R/WATCHgroupWFDobs.R
WATCHgroupWFDobs | R Documentation |
Extracts all variables from WFD NetCDF files and builds obs files for all specified locations
WATCHgroupWFDobs( siteFile, ncLocation, outputLocation, startyear = 1901, endyear = 2001, solarMethod = "PotSolarInst", interpolationMethod = "linear", quiet = TRUE, logfile = "" )
siteFile |
Required. A .csv file containing all of the variables required to describe the site locations. These are:
|
ncLocation |
Required. Location of all of the WATCH WFD files. Must have a trailing '\' symbol. |
outputLocation |
Required. Location for all of the output files. Must have a trailing '\' symbol. |
startyear |
Optional. Year to begin extraction. Default is 1901. |
endyear |
Optional. Year to begin extraction. Default is 2001. |
solarMethod |
The method to be used for calculating the extra-terrestrial radiation. The default method is PotSolarInst, which requires the package EcoHydRology to be installed. The other supported method is simpleMaxSolar. Note that this method is only valid for latitudes between 49 and 55 N. |
interpolationMethod |
Optional. A vector containing the methods to be used for interpolation for each of the variables. Currently supported methods are linear and spline. The default is to use linear interpolation. If fewer methods than columns are specified, the methods are recycled. |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful, returns the value TRUE
and writes the specified .obs file. Each month's data is written as it is created. If unsuccessful, returns the value FALSE
.
Kevin Shook
R code for conversion of air pressure and absolute humidity was taken from project PEcAn The Predictive Ecosystem Analyzer http://pecanproject.github.io. The source code is available at https://github.com/PecanProject/pecan/blob/master/modules/data.atmosphere/R/metutils.R.
## Not run: points <- './Reanalysis/testdata/WATCH_selected_points.csv' outputLocation <- './Reanalysis/testdata/' ncloc <- '//water.usask.ca/Centre/Reanalysis_data/WATCH/WFD' WATCHgroupWFDobs(siteFile = points, ncLocation = ncloc, outputLocation=outputLocation, startyear = 1962, endyear = 1962)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.