Skip to content

Commit c051d3c

Browse files
authored
Merge pull request #87 from ropensci/doc-updates
Updated docs + examples + vignette
2 parents 5f5466b + 3271b75 commit c051d3c

19 files changed

+366
-223
lines changed

‎DESCRIPTION‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Package: smapr
22
Type: Package
33
Title: Acquisition and Processing of NASA Soil Moisture Active-Passive (SMAP) Data
4-
Version: 0.2.1
4+
Version: 0.3.0
55
Authors@R: c(
6-
person("Maxwell", "Joseph", email = "[email protected]",
7-
role = c("aut", "cre")),
6+
person("Maxwell", "Joseph", email = "[email protected]",
7+
role = c("aut", "cre", "cph")),
88
person("Matthew", "Oakley", email = "[email protected]",
99
role = "aut"),
1010
person("Zachary", "Schira", email = "[email protected]",
@@ -18,13 +18,12 @@ Imports:
1818
methods,
1919
rappdirs (>= 0.3.1),
2020
terra
21-
Maintainer: Maxwell Joseph <[email protected]>
21+
Maintainer: Maxwell Joseph <[email protected]>
2222
Description:
2323
Facilitates programmatic access to NASA Soil Moisture Active
2424
Passive (SMAP) data with R. It includes functions to search for, acquire,
2525
and extract SMAP data.
2626
License: GPL-3
27-
LazyData: TRUE
2827
RoxygenNote: 7.3.3
2928
Suggests:
3029
knitr,
@@ -34,6 +33,6 @@ Suggests:
3433
utils,
3534
covr
3635
VignetteBuilder: knitr
37-
URL: https://docs.ropensci.org/smapr, https://github.com/ropensci/smapr
36+
URL: https://docs.ropensci.org/smapr/, https://github.com/ropensci/smapr
3837
BugReports: https://github.com/ropensci/smapr/issues
3938
Encoding: UTF-8

‎R/download_smap.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#' vector specifying the local directory containing the downloaded files.
2424
#' @examples
2525
#' \dontrun{
26-
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 4)
26+
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 8)
2727
#' # files[1, ] refers to the first available data file
2828
#' downloads <- download_smap(files[1, ])
2929
#' }

‎R/extract_smap.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#' @return Returns a SpatRaster object.
1414
#' @examples
1515
#' \dontrun{
16-
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 4)
16+
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 8)
1717
#' downloads <- download_smap(files[1, ])
1818
#' sm_raster <- extract_smap(downloads, name = '/Geophysical_Data/sm_surface')
1919
#' }

‎R/find_smap.R‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' There are many SMAP data products that can be accessed with this function.
77
#' Currently, smapr supports level 3 and level 4 data products, each of which
88
#' has an associated Data Set ID which is specified by the \code{id} argument,
9-
#' described at \url{https://nsidc.org/data/smap/smap-data.html} and summarized
9+
#' described at \url{https://nsidc.org/data/smap/data} and summarized
1010
#' below:
1111
#'
1212
#' \describe{
@@ -40,20 +40,20 @@
4040
#' such as produced by \code{seq.Date}.
4141
#' @param version Which data version would you like to search for? Version
4242
#' information for each data product can be found at
43-
#' \url{https://nsidc.org/data/smap/data_versions}
43+
#' \url{https://nsidc.org/data/smap/version-history}
4444
#' @return A data.frame with the names of the data files, the remote directory,
4545
#' and the date.
4646
#'
4747
#' @examples
4848
#' \dontrun{
4949
#' # looking for data on one day:
50-
#' find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 4)
50+
#' find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 8)
5151
#'
5252
#' # searching across a date range
5353
#' start_date <- as.Date("2015-03-31")
5454
#' end_date <- as.Date("2015-04-02")
5555
#' date_sequence <- seq(start_date, end_date, by = 1)
56-
#' find_smap(id = "SPL4SMGP", dates = date_sequence, version = 4)
56+
#' find_smap(id = "SPL4SMGP", dates = date_sequence, version = 8)
5757
#' }
5858
#'
5959
#' @importFrom httr GET

‎R/list_smap.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' of each data file in \code{files}.
1111
#' @examples
1212
#' \dontrun{
13-
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 4)
13+
#' files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 8)
1414
#' files <- download_smap(files[1, ])
1515
#' list_smap(files)
1616
#' list_smap(files, all = TRUE)

‎R/set_smap_credentials.R‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#' be overwritten unless \code{overwrite = TRUE}.
1919
#' @param overwrite Logical: whether to overwrite previous Earthdata credentials
2020
#' in your .Renviron file (only applies when \code{save = TRUE})
21-
#' @return A data.frame with the names of the data files, the remote directory,
22-
#' and the date.
21+
#' @return No return value, called for side effects (sets environment variables
22+
#' and optionally saves credentials to .Renviron).
2323
#'
2424
#' @examples
2525
#' \dontrun{

‎README.md‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
smapr
22
================
33

4-
[![codecov](https://codecov.io/gh/ropensci/smapr/branch/master/graph/badge.svg)](https://codecov.io/gh/ropensci/smapr)
5-
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/smapr)](https://cran.r-project.org/package=smapr)
6-
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
7-
[![](http://cranlogs.r-pkg.org/badges/grand-total/smapr)](http://cran.rstudio.com/web/packages/smapr/index.html)
8-
[![](https://badges.ropensci.org/231_status.svg)](https://github.com/ropensci/onboarding/issues/231)
4+
[![codecov](https://app.codecov.io/gh/ropensci/smapr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ropensci/smapr)
5+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/smapr)](https://cran.r-project.org/package=smapr)
6+
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
7+
[![](https://cranlogs.r-pkg.org/badges/grand-total/smapr)](https://cran.r-project.org/package=smapr)
8+
[![](https://badges.ropensci.org/231_status.svg)](https://github.com/ropensci/software-review/issues/231)
99
[![Project Status: Active – The project has reached a stable, usable
1010
state and is being actively
11-
developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
11+
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
1212

1313
An R package for acquisition and processing of [NASA (Soil Moisture
14-
Active-Passive) SMAP data](http://smap.jpl.nasa.gov/)
14+
Active-Passive) SMAP data](https://smap.jpl.nasa.gov/)
1515

1616
## Installation
1717

@@ -91,19 +91,19 @@ including surface soil moisture, root zone soil moisture, freeze/thaw
9191
status, surface temperature, vegetation water content, vegetation
9292
opacity, net ecosystem carbon exchange, soil temperature, and
9393
evapotranspiration. NSIDC provides documentation for all SMAP data
94-
products on their [website](https://nsidc.org/data/smap/smap-data.html),
94+
products on their [website](https://nsidc.org/data/smap/data),
9595
and we provide a summary of data products supported by smapr below.
9696

97-
| Dataset id | Description | Resolution |
98-
|------------|-----------------------------------------------------|------------|
99-
| SPL2SMAP_S | SMAP/Sentinel-1 Radiometer/Radar Soil Moisture | 3 km |
100-
| SPL3FTA | Radar Northern Hemisphere Daily Freeze/Thaw State | 3 km |
101-
| SPL3SMA | Radar Global Daily Soil Moisture | 3 km |
102-
| SPL3SMP | Radiometer Global Soil Moisture | 36 km |
103-
| SPL3SMAP | Radar/Radiometer Global Soil Moisture | 9 km |
104-
| SPL4SMAU | Surface/Rootzone Soil Moisture Analysis Update | 9 km |
105-
| SPL4SMGP | Surface/Rootzone Soil Moisture Geophysical Data | 9 km |
106-
| SPL4CMDL | Carbon Net Ecosystem Exchange | 9 km |
97+
| Dataset id | Description | Resolution |
98+
|------------|---------------------------------------------------|------------|
99+
| SPL2SMAP_S | SMAP/Sentinel-1 Radiometer/Radar Soil Moisture | 3 km |
100+
| SPL3FTA | Radar Northern Hemisphere Daily Freeze/Thaw State | 3 km |
101+
| SPL3SMA | Radar Global Daily Soil Moisture | 3 km |
102+
| SPL3SMP | Radiometer Global Soil Moisture | 36 km |
103+
| SPL3SMAP | Radar/Radiometer Global Soil Moisture | 9 km |
104+
| SPL4SMAU | Surface/Rootzone Soil Moisture Analysis Update | 9 km |
105+
| SPL4SMGP | Surface/Rootzone Soil Moisture Geophysical Data | 9 km |
106+
| SPL4CMDL | Carbon Net Ecosystem Exchange | 9 km |
107107

108108
## Typical workflow
109109

@@ -124,18 +124,18 @@ returns a data frame of available data. As data mature and pass checks,
124124
versions advance. At any specific time, not all versions of all datasets
125125
for all dates may exist. For the most up to date overview of dataset
126126
versions, see the NSIDC SMAP data version
127-
[webpage](https://nsidc.org/data/smap/smap-data.html).
127+
[webpage](https://nsidc.org/data/smap/version-history).
128128

129129
``` r
130130
library(smapr)
131131
library(terra)
132-
#> terra 1.7.18
132+
#> terra 1.8.86
133133
available_data <- find_smap(id = "SPL3SMAP", date = "2015-05-25", version = 3)
134134
str(available_data)
135135
#> 'data.frame': 1 obs. of 3 variables:
136136
#> $ name: chr "SMAP_L3_SM_AP_20150525_R13080_001"
137137
#> $ date: Date, format: "2015-05-25"
138-
#> $ dir : chr "SPL3SMAP.003/2015.05.25/"
138+
#> $ dir : chr "SPL3SMAP/003/2015/05/25/"
139139
```
140140

141141
### Downloading and inspecting SMAP data
@@ -146,14 +146,14 @@ an argument, the data are stored in the user’s cache.
146146

147147
``` r
148148
downloads <- download_smap(available_data)
149-
#> Downloading https://n5eil01u.ecs.nsidc.org/SMAP/SPL3SMAP.003/2015.05.25/SMAP_L3_SM_AP_20150525_R13080_001.h5
150-
#> Downloading https://n5eil01u.ecs.nsidc.org/SMAP/SPL3SMAP.003/2015.05.25/SMAP_L3_SM_AP_20150525_R13080_001.qa
151-
#> Downloading https://n5eil01u.ecs.nsidc.org/SMAP/SPL3SMAP.003/2015.05.25/SMAP_L3_SM_AP_20150525_R13080_001.h5.iso.xml
149+
#> Downloading https://data.nsidc.earthdatacloud.nasa.gov/nsidc-cumulus-prod-protected/SMAP/SPL3SMAP/003/2015/05/25/SMAP_L3_SM_AP_20150525_R13080_001.h5
150+
#> Downloading https://data.nsidc.earthdatacloud.nasa.gov/nsidc-cumulus-prod-protected/SMAP/SPL3SMAP/003/2015/05/25/SMAP_L3_SM_AP_20150525_R13080_001.qa
151+
#> Downloading https://data.nsidc.earthdatacloud.nasa.gov/nsidc-cumulus-prod-protected/SMAP/SPL3SMAP/003/2015/05/25/SMAP_L3_SM_AP_20150525_R13080_001.h5.iso.xml
152152
str(downloads)
153153
#> 'data.frame': 1 obs. of 4 variables:
154154
#> $ name : chr "SMAP_L3_SM_AP_20150525_R13080_001"
155155
#> $ date : Date, format: "2015-05-25"
156-
#> $ dir : chr "SPL3SMAP.003/2015.05.25/"
156+
#> $ dir : chr "SPL3SMAP/003/2015/05/25/"
157157
#> $ local_dir: chr "~/.cache/smap"
158158
```
159159

‎man/download_smap.Rd‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎man/extract_smap.Rd‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎man/figures/extract-data-1.png‎

1.05 KB
Loading

0 commit comments

Comments
 (0)