|
| 1 | +# Using the PEcAn atmospheric data utilities |
| 2 | + |
| 3 | +Explain what these are |
| 4 | + |
| 5 | +github.com/pecanproject/pecan |
| 6 | + |
| 7 | +insert slide from talks ... |
| 8 | + |
| 9 | +## Dependencies |
| 10 | + |
| 11 | +```{r install-pecan-dependencies, message=FALSE, eval = FALSE} |
| 12 | +
|
| 13 | +devtools::install_github("pecanproject/pecan", |
| 14 | + subdir = 'base/utils', ref = 'develop', dependencies = FALSE) |
| 15 | +devtools::install_github("pecanproject/pecan", |
| 16 | + subdir = 'base/db') |
| 17 | +devtools::install_github("rforge/reddyproc", |
| 18 | + subdir = "pkg/REddyProc") |
| 19 | +devtools::install_github("pecanproject/pecan", |
| 20 | + subdir = 'modules/data.atmosphere', |
| 21 | + ref = 'develop') |
| 22 | +
|
| 23 | +source("https://raw.githubusercontent.com/PecanProject/pecan/develop/models/biocro/R/met2model.BIOCRO.R") |
| 24 | +``` |
| 25 | + |
| 26 | + |
| 27 | +## PEcAn Met Workflow |
| 28 | + |
| 29 | +```{r write-clowder, eval = FALSE} |
| 30 | +writeLines(" |
| 31 | +<pecan> |
| 32 | + <clowder> |
| 33 | + <hostname>terraref.ncsa.illinois.edu</hostname> |
| 34 | + <user>user@illinois.edu</user> |
| 35 | + <password>ask</password> |
| 36 | + </clowder> |
| 37 | +</pecan>", |
| 38 | +con = "~/.pecan.clowder.xml") |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +```{r pecan-met-workflow, message=FALSE, warning=FALSE, eval = FALSE} |
| 44 | +library("PEcAn.data.atmosphere") |
| 45 | +library("dplyr") |
| 46 | +
|
| 47 | +## download raw data |
| 48 | +ne <- download.Geostreams( |
| 49 | + outfolder="data", |
| 50 | + sitename="EnvironmentLogger sensor_weather_station", |
| 51 | + start_date="2016-02-28", |
| 52 | + end_date="2016-04-01", |
| 53 | + overwrite = TRUE) |
| 54 | +
|
| 55 | +## convert to standard |
| 56 | +ne_cf <- met2CF.Geostreams( |
| 57 | + in.path = "data/", |
| 58 | + in.prefix = ne$dbfile.name, |
| 59 | + outfolder = "data/cf", |
| 60 | + start_date = "2016-03-01", # note date shift to avoid TZ issues |
| 61 | + end_date = "2016-04-01", |
| 62 | + overwrite = TRUE) |
| 63 | +
|
| 64 | +## convert to model specific input |
| 65 | +met2model.BIOCRO( |
| 66 | + overwrite = TRUE, |
| 67 | + in.path = "data/cf", |
| 68 | + in.prefix = ne_cf$dbfile.name, |
| 69 | + outfolder = "data/biocromet", |
| 70 | + lat = 40, |
| 71 | + lon = -88, |
| 72 | + start_date = "2016-03-01", |
| 73 | + end_date = "2016-03-30") |
| 74 | +
|
| 75 | +met <- readr::read_csv('data/biocromet/Clowder.UIUC Energy Farm - NE.2016-02-28.2016-04-01.2016.csv') |
| 76 | +``` |
0 commit comments