Repository navigation
fix(nisar): verify CMR UMM-JSON results against atom-JSON - #230
Merged
Merged
Conversation
CMR's granules.umm_json leaves out NISAR records and serves another granule's record under some concept ids (2026-10). fetch_cmr_pages(verify=True) cross-checks names against granules.json, re-fetches the bad records by concept id, keeps one record per name and can report CMR's errors; CMR requests now retry timeouts and 429/5xx. Both NISAR searches use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Since October 2026, CMR's
granules.umm_jsonresults are unreliable for the NISAR GSLC and GUNW collections:CMR-Hitsare left out of the results.G4246696294-ASFisNISAR_L2_PR_GUNW_023_055_D_066_...in atom-JSON and fromsearch/concepts/, but UMM-JSON serves the record of..._023_059_A_038_...under it.On 2026-10-21, UMM-JSON served the wrong record for 13,769 of 155,910 provisional GSLCs and 12,607 of 89,932 GUNWs, and left out a further 198 and 6,024. The atom-JSON
granules.jsonlisting of the same query has every granule under its own name. The concepts endpoint returns the right record;echo10does not.This PR:
fetch_cmr_pages(..., verify=True). It walks the same query in atom-JSON and drops UMM-JSON records whoseGranuleURdisagrees with the atom title. It then re-fetches the missing and mislabelled ones: first from UMM-JSON byconcept_id[], keeping only matching names, then fromsearch/concepts/<id>. The result holds one record per granule name.CmrSearchReport, optional, which records the left-out, mislabelled, duplicate-name and unrecovered concept ids, for reporting them to CMR.nisar.searchandnisar.search_gunw. The DISP-S1 search is unchanged, because a sample of the newest 20,000OPERA_L3_DISP-S1_V1granules came back clean in both formats.The same fix runs in opera-adt/nisar_db (#63, #65), which publishes the NISAR frame viewer.
Cost
Verification adds one atom-JSON page walk, plus one concepts-endpoint request per bad record. A California GUNW search (1,128 granules, 458 bad) took 138 s.
Verification
search_gunwover California (-125, 32, -114, 42) returns all 1,128 granules. Without verification, UMM-JSON returned 1,096, and 426 of them carried another granule's record.tests/test_cmr.pyuses a fake CMR that leaves out, mislabels and duplicates records. It covers recovery, the report, keeping one record per name, retries, and non-retried 400s. The existing NISAR search tests switch the atom-JSON listing off with one fixture, since they check parsing and filtering.pytest tests/test_cmr.py tests/test_nisar_search.py tests/test_disp_search.py: 42 passed; pre-commit clean. In my local pixi test environment, 13 unrelated tests fail identically onmainwithout this change. They cover the projection library, stitching, the version check and aiohttp.🤖 Generated with Claude Code