Skip to contents

Searches NASA's Common Metadata Repository (CMR) for satellite lidar granules that overlap a bounding box and optional date range. The sensor (GEDI or ICESat-2) is determined automatically from product, since the valid product strings do not overlap.

Usage

sl_search(
  bbox,
  product = c("L2A", "L2B", "L4A", "L4C", "L1B", "ATL03", "ATL06", "ATL07", "ATL08",
    "ATL10", "ATL13", "ATL24"),
  date_start = NULL,
  date_end = NULL,
  version = NULL
)

Arguments

bbox

An sl_bbox object created by sl_bbox(), or a numeric vector c(xmin, ymin, xmax, ymax).

product

Character. One of:

  • GEDI: "L1B", "L2A", "L2B", "L4A", "L4C"

  • ICESat-2: "ATL03", "ATL06", "ATL07", "ATL08", "ATL10", "ATL13", "ATL24"

date_start, date_end

Either a Date object or a character string in strict "YYYY-MM-DD" format (e.g. "2020-06-01"). Other character forms (e.g. "01/06/2020", "June 1 2020", "2020-06") are rejected with an informative error to avoid ambiguity. POSIXct inputs are not accepted — format them explicitly with format(x, "%Y-%m-%d").

Bounds are treated as UTC and inclusive of the end date: a range of "2020-06-01" to "2020-06-30" covers every granule whose start time falls on any of those 30 days.

date_start defaults to the mission start (2019-03-25 for GEDI, 2018-10-14 for ICESat-2). date_end defaults to today.

version

Character or NULL. Product version, for the products that can be searched in more than one. The first listed is the default:

  • GEDI L1B, L2A, L2B and L4C: "3" or "2".

  • GEDI L4A: "3" or "2.1".

  • ICESat-2 ATL24: "1", "2" or "3".

Must be NULL for every other product. See Product versions.

Value

A classed data frame (sl_gedi_search or sl_icesat2_search) with columns:

id

CMR granule identifier.

time_start

POSIXct start time of the granule.

time_end

POSIXct end time of the granule.

url

HTTPS data URL.

geometry

wk_wkt polygon of the granule swath footprint.

The returned object carries bbox and product as attributes so sl_read() can dispatch without re-specifying them.

Details

Product versions

A search queries one version (one CMR collection) of a product. NASA closes a version when its successor is published: GEDI L1B, L2A and L2B version 2 and L4A version 2.1 hold nothing after 2025-07-10, L4C version 2 nothing after 2025-07-09, and ATL24 version 1 nothing after 2024-11-07. A search whose dates run past the end of a closed version warns, because the empty tail of the result means "not in this version", not "no overpasses".

GEDI version 3 (published June to September 2026) reprocesses the whole mission and is the default. It is not a drop-in replacement for version 2: geolocation is improved, L2B canopy cover and the vertical profiles are computed differently, and L2A, L2B, L4A and L4C rename or drop variables. The quality flags are the change most code will meet: quality_flag (L2A), l2b_quality_flag and wsci_quality_flag become l2a_quality_flag_rel3, l2b_quality_flag_rel3 and l4c_quality_flag_rel3. sl_columns(product, version = ) lists each version's variables. Pass version = "2" to keep reading version 2, and do not pool values from the two versions without checking that they are comparable for your purpose.

Authentication

No authentication is needed for the search itself; Earthdata credentials are only required when reading data via sl_read().

The CMR search filters by bounding box on the server side. For finer spatial filtering (e.g. against an irregular polygon), filter the returned geometry column with your favourite spatial package.

See also

sl_read() to read data from the returned granules.

Examples

if (FALSE) { # interactive()
# GEDI L2A over a small Pacific Northwest forest bbox, summer 2020.
granules <- sl_search(
  sl_bbox(-124.04, 41.39, -124.01, 41.42),
  product    = "L2A",
  date_start = "2020-06-01",
  date_end   = "2020-09-01"
)
granules

# ICESat-2 ATL08 (land + canopy segments) over the same bbox, 2020.
sl_search(
  sl_bbox(-124.10, 41.36, -124.00, 41.45),
  product    = "ATL08",
  date_start = "2020-01-01",
  date_end   = "2021-01-01"
)
}