appeears 1.0 CRAN release

A new R package for the NASA EarthData AppEEARS API

We’re happy to announce the release of our appeears R package. This programmatic interface to the NASA AppEEARS API services provides conventient access to analysis ready datasets or subsets from a variety of NASA archives and enables users to subset geospatial datasets using spatial, temporal, and band/layer parameters. The package can be easily installed from CRAN.

install.packages("appeears")
library("appeears")

User credentials

Data queries do require API credentials, which can be set using the following routine.

# set a key to the keychain
rs_set_key(
  user = "earth_data_user",
  password = "XXXXXXXXXXXXXXXXXXXXXX"
  )

# you can retrieve the password using
rs_get_key(user = "earth_data_user")

# the output should be the key you provided
# "XXXXXXXXXXXXXXXXXXXXXX"

Data downloads

Once credentials are validate you can use the following routine, and the main rs_request() function to download datasets. Spatial constraints on datasets can be provided by either sf or terra based bounding boxes or outlines.

For an in depth discussion on the use of the package functionality we refer to the documentation vignette.

# list all products
rs_products()

# list layers of the MOD11A2.061 product
rs_layers("MOD11A2.061")

df <- data.frame(
  task = "time_series",
  subtask = "US-Ha1",
  latitude = 42.5378,
  longitude = -72.1715,
  start = "2010-01-01",
  end = "2010-12-31",
  product = "MCD43A4.061",
  layer = c("Nadir_Reflectance_Band3","Nadir_Reflectance_Band4")
)

# build the area based request/task
# rename the task name so data will
# be saved in the "point" folder
# as defined by the task name
df$task <- "point"
task <- rs_build_task(df = df)

# request the task to be executed
rs_request(
  request = task,
  user = "earth_data_user",
  transfer = TRUE,
  path = "~/some_path",
  verbose = TRUE
)

If you need help, or encounter issues with the package please file an issue at https://github.com/bluegreen-labs/appeears/issues.

Acknowledgements

Image by Joseph M. Smith and NASA EarthData

Avatar
Koen Hufkens, PhD
Partner, Researcher

As an earth system scientist and ecologist I model ecosystem processes.

Related

Next
Previous