knitr::opts_chunk$set(
  collapse = TRUE,
  warning = FALSE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  eval = TRUE
)

library(opendap.catalog)
library(terra)

Dependencies License: MIT Website deployment LifeCycle R CMD Check


OpenDap Catalog

« Explore the Docs »

Data Catalog · R Interface · Request Feature


One of the biggest challenges with Earth System and spatial research is extracting data. These challenges include not only finding the source data but then downloading, managing, and extracting the partitions critical for a given task.

Services exist to make data more readily available over the web but introduce new challenges of identifying subsets, working across a wide array of standards (e.g. non-standards), all without alleviating the challenge of finding resources.

In light of this, opendap.catolog provides three primary services.


1. Generalized space (XY) and Time (T) subsets for remote and local NetCDF data with dap()

remote

dap <- dap(URL = "https://cida.usgs.gov/thredds/dodsC/bcsd_obs", 
           AOI = AOI::aoi_get(state = "FL"), 
           startDate = "1995-01-01")

str(dap, max.level = 1)
plot(rast(dap))

local

file <- '/Users/mjohnson/Downloads/NEXGDM_srad_2020_v100.nc'
utils:::format.object_size(file.size(file), "auto")

dap = dap(URL = file, 
          AOI = AOI::aoi_get(state = "FL"), 
          startDate = "2020-01-01", endDate = "2020-01-05")
plot(rast(dap))

2. A catalog of r formatC(nrow(opendap.catalog::params),big.mark = ",",digits = 0,format = "f") web resources (as of r format(Sys.Date(), format = "%m/%Y"))

dplyr::glimpse(opendap.catalog::params)

For use in other applications (e.g. stars proxy, geoknife, climateR or python/go/Rust applciations) this catalog is available as a JSON artifact here.

read_json('https://mikejohnson51.github.io/opendap.catalog/cat_params.json', 
          simplifyVector = TRUE)

With r formatC(nrow(opendap.catalog::params),big.mark = ",",digits = 0,format = "f") web resources documented, there are simply too many resources to search through by hand unless you know exactly what you want. This voids the possibility of serendipitous discovery. So, we have added a generally fuzzy search tool to help discover datasets.

Say you want to find what resoruces there are for monhtly snow water equivilent? search and search_summary can help:

search("monthly swe")[,c("id", "model", "varname", "interval" )]
search("daily precipitation maca") |> 
  search_summary()

Search

Say we want to find what snow water equivalent data (SWE) is available for a research problem. We can search the catalog on that key word:

(swe = search("swe"))

(3) The ability to pass catalog elements to the generalized toolsets:

# Find MODIS PET in Florida for January 2010
dap = dap(
    catolog = dplyr::filter(params, 
                            id == 'MOD16A2.006', 
                            varname == 'PET_500m'),
    AOI = AOI::aoi_get(state = "FL"),
    startDate = "2010-01-01",
    endDate   = "2010-01-31"
  )
plot(dap)


mikejohnson51/opendap.catalog documentation built on Jan. 27, 2023, 1:25 a.m.