--- title: "CMR Snapshot: Provider Metadata Health, Today" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{CMR Snapshot: Provider Metadata Health, Today} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>") online <- tryCatch({ con <- url("https://cmr.earthdata.nasa.gov/search/collections.json?page_size=1", open = "rb") close(con) TRUE }, error = function(e) FALSE) knitr::opts_chunk$set(eval = online) ``` ```{r offline-note, echo = FALSE, eval = !online, results = "asis"} cat( "CMR (`cmr.earthdata.nasa.gov`) wasn't reachable when this vignette was ", "built, so the live checks below were skipped. Re-build with a network ", "connection to see current numbers, or see `vignette(\"cmr-landscape\")` ", "for a written-up example run.", sep = "" ) ``` Unlike `vignette("cmr-landscape")` -- a fixed narrative of one exploration session, kept as a written record -- this article re-queries CMR **live, every time it's built**, and shows whatever the catalog looks like right now. Re-render it occasionally to see how these numbers drift as collections are added, retired, or have their metadata cleaned up. ```{r libs, message = FALSE} library(cmrlifecycle) library(dplyr) ``` ```{r timestamp} Sys.time() ``` ## One collection, right now A quick liveness + declared-coverage check, the way a new user would use this package day to day: ```{r one-collection} cmr_collection_liveness("MUR-JPL-L4-GLOB-v4.1") cmr_find_collections(short_name = "MUR-JPL-L4-GLOB-v4.1") |> select(short_name, temporal_start, temporal_end, ends_at_present, granule_count) ``` For contrast, a collection this package found to have *no granules at all* (see `vignette("cmr-landscape")`) -- still true today? ```{r aadc-collection} cmr_find_collections(short_name = "AAS_4088_Adelie_occupancy_Mawson_Taylor") |> select(short_name, granule_count, temporal_start, temporal_end) ``` ## `ends_at_present`, provider by provider, today This re-runs the PO.DAAC-vs-LAADS comparison from `vignette("cmr-landscape")` fresh. Each provider costs just two requests (one for collection metadata, one for granule counts), so this is cheap enough to run on every build, even though the earlier deep-dive sampling (checking individual collections' *recent* granule activity to validate the flag) is not repeated here. ```{r provider-breakdown} providers <- c("POCLOUD", "LAADS") breakdown <- lapply(providers, function(p) { cols <- cmr_all_collections(provider = p, delay = 0) tibble( provider = p, n_collections = nrow(cols), pct_true = round(100 * mean(cols$ends_at_present), 1), pct_ambiguous = round(100 * mean(!cols$ends_at_present & is.na(cols$temporal_end) & cols$granule_count > 0), 1) ) }) |> bind_rows() breakdown ``` ```{r provider-plot, fig.alt = "Bar chart comparing the percentage of collections declaring ends_at_present = TRUE between POCLOUD and LAADS"} barplot(breakdown$pct_true, names.arg = breakdown$provider, ylim = c(0, 100), ylab = "% of collections with ends_at_present = TRUE", main = "ends_at_present reliability by provider (live)") ``` As of the `vignette("cmr-landscape")` write-up (2026-08-25), this stood at 4.5% for POCLOUD and 70.7% for LAADS -- if the bars above look different, that's the catalog changing, which is exactly the point of re-running this rather than trusting a single snapshot. ## A small live liveness sample A tiny, cheap version of the "sample some ambiguous collections and check if they're really still active" method from the landscape article -- a handful of PO.DAAC collections that declare `ends_at_present = FALSE` with no end date, checked directly: ```{r liveness-sample} sample_check <- cmr_all_collections(provider = "POCLOUD", delay = 0) |> filter(!ends_at_present, is.na(temporal_end), granule_count > 0) |> slice_sample(n = 5) |> cmr_collection_liveness(delay = 0) sample_check ``` ```{r liveness-summary} sprintf("%d of %d sampled collections were live in the last %d days", sum(sample_check$is_live), nrow(sample_check), sample_check$lookback_days[1]) ``` Small samples like this move around run to run -- see `vignette("cmr-landscape")` for a fuller (25-collection) version with more stable percentages.