-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
88 lines (73 loc) · 2.83 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
eval = FALSE,
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# nohrsc
<!-- badges: start -->
[](https://travis-ci.org/jpshanno/nohrsc)
[](https://ci.appveyor.com/project/jpshanno/nohrsc)
[](https://codecov.io/github/jpshanno/nohrsc?branch=master)
<!-- badges: end -->
nohrsc is designed to make it easy to access the NOHRSC data archive. It takes
common name arguments and dates to construct the proper URLs and access the
correctly formatted file names. Multiple days and products can be downloaded and
extracted in a single call. The extracted rasters will be converted to \*.bil
format and an appropriate \*.hdr and \*.prj will be created for each raster.
## Installation
If you are using Windows you should install nohrsc by downloading the binary
version (see below) of the package. Otherwise you can build `nohrsc` from these
source files.
**Windows Installation**
``` r
install.packages("https://pages.mtu.edu/~jpshanno/win_binaries/nohrsc.zip",
repos = NULL)
```
**`remotes` Linux Installation**
``` r
remotes::install_github("jpshanno/nohrsc")
```
or without `remotes` by
**Linux Installation without `remotes` package**
``` r
nohrsc_source <- file.path(tempdir(), "nohrsc-master.zip")
download.file("https://github.com/jpshanno/nohrsc/archive/master.zip",
nohrsc_source)
unzip(nohrsc_source,
exdir = dirname(nohrsc_source))
install.packages(sub(".zip$", "", nohrsc_source),
repos = NULL,
type = "source")
```
## Development Timeline
### Minimum Viable Product
- [x] Download data (use *apply to make >1 easy)
- [ ] Automatic data handling if path not specified (via rappdirs)
- [ ] Query/Load downloaded data
- [ ] Add citations to NOHRSC data & documentation
- [ ] Unit tests
- [ ] Use assertthat to check archive/raster filenames etc
### First Improvement
- [ ] Improve queries
- [ ] Delete data
### Second Improvement
- [ ] Allow clipping before storage to save disk space
- [ ] [Change NA values being recorded as large positive integers](https://www.nohrsc.noaa.gov/archived_data/instructions.html)
## Example
Download data over three days and extract SWE and melt data:
```{r}
library(nohrsc)
rasters <-
nsa_get_snodas(product = c("snow water equivalent", "snow melt"),
start.date = "2015-04-01",
end.date = "2015-04-03",
path = "snodas")
```