Skip to content

Commit

Permalink
Update gedifinder to find level3 and level4 products
Browse files Browse the repository at this point in the history
  • Loading branch information
caiohamamura committed Sep 13, 2023
1 parent 0d06ebb commit 6036c3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Suggests:
lidR,
plot3D,
rasterVis,
sf,
viridis
SystemRequirements:
GNU Scientific Library (>= 2.1),
Expand Down
14 changes: 8 additions & 6 deletions R/gedifinder.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
concept_ids <- list(
GEDI01_B.001 = "C1656765475-LPDAAC_ECS",
GEDI02_A.001 = "C1656766463-LPDAAC_ECS",
GEDI02_B.001 = "C1656767133-LPDAAC_ECS",
GEDI01_B.002 = "C1908344278-LPDAAC_ECS",
GEDI02_A.002 = "C1908348134-LPDAAC_ECS",
GEDI02_B.002 = "C1908350066-LPDAAC_ECS"
GEDI02_B.002 = "C1908350066-LPDAAC_ECS",
GEDI03.002 = "C2153683336-ORNL_CLOUD",
GEDI04_A.001 = "C2734289572-ORNL_CLOUD",
GEDI04_A.002 = "C2237824918-ORNL_CLOUD",
GEDI04_B.002 = "C2244602422-ORNL_CLOUD"
)

#' GEDI finder
#'
#' @description This function finds the exact granule(s) that contain GEDI data
#' for a given region of interest and date range
#'
#' @param product GEDI data level; Options: "GEDI01_B", "GEDI02_A" or "GEDI02_B"
#' @param product GEDI data level; Options: "GEDI01_B", "GEDI02_A",
#' "GEDI02_B", "GEDI03", "GEDI04_A", "GEDI04_A", "GEDI04_B"
#' @param ul_lat Numeric. Upper left (ul) corner coordinates, in lat
#' (decimal degrees) for the bounding box of the area of interest.
#' @param ul_lon Numeric. Upper left (ul) corner coordinates, in lon
Expand Down Expand Up @@ -78,7 +80,7 @@ gedifinder <- function(product,
# Granules search url pattern
url_format <- paste0(
"https://cmr.earthdata.nasa.gov/search/granules.json?",
"pretty=true&provider=LPDAAC_ECS&page_size=2000&concept_id=%s",
"pretty=true&project=GEDI&page_size=2000&concept_id=%s",
"&bounding_box=%s"
)
request_url <- sprintf(
Expand Down

0 comments on commit 6036c3f

Please sign in to comment.