nasa / nasa/Common-Metadata-Repository

Implement asset-role for STAC results

Open
#2,045 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
397
Forks
108
Avg merge
3d 14m
Merged PRs (30d)
13

Description

My use case is given a CMR granule in stac format, i want to download the data files locally for processing. Given a collection with multiple data files, we are returned STAC results like the following: https://cmr.earthdata.nasa.gov/search/concepts/G2813285105-LPCLOUD.stac

the keys to the assets are as follows:

"metadata": {
"href": "[https://cmr.earthdata.nasa.gov:443/search/concepts/G2813285105-LPCLOUD.xml](https://cmr.earthdata.nasa.gov/search/concepts/G2813285105-LPCLOUD.xml)",
"type": "application/xml"
},
"browse": {
"title": "Download EMIT_L1B_RAD_001_20231206T160939_2334011_006.png",
"href": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/EMITL1BRAD.001/EMIT_L1B_RAD_001_20231206T160939_2334011_006/EMIT_L1B_RAD_001_20231206T160939_2334011_006.png",
"type": "image/png"
},
"opendap": {
"title": "OPeNDAP request URL",
"href": "https://opendap.earthdata.nasa.gov/collections/C2408009906-LPCLOUD/granules/EMIT_L1B_RAD_001_20231206T160939_2334011_006"
},
"data": {
"title": "Download EMIT_L1B_RAD_001_20231206T160939_2334011_006.nc",
"href": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/EMITL1BRAD.001/EMIT_L1B_RAD_001_20231206T160939_2334011_006/EMIT_L1B_RAD_001_20231206T160939_2334011_006.nc"
},
"data1": {
"title": "Download EMIT_L1B_OBS_001_20231206T160939_2334011_006.nc",
"href": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/EMITL1BRAD.001/EMIT_L1B_RAD_001_20231206T160939_2334011_006/EMIT_L1B_OBS_001_20231206T160939_2334011_006.nc"
}

This requires us to look for the keys data and data1 (and possibly more). This is non-ideal when stac supports the asset-role which is made directly for this use case. The keys to the file can be whatever, but they would have the asset roles included that can then be interrogated for download. Also, things like "thumbnail" can be made as preview images is clients like the STAC-Browser. Most of this information is already available in the umm-g collections, though a more exhaustive mapping might be needed.

https://cmr.earthdata.nasa.gov/search/concepts/G2813285105-LPCLOUD.umm_json

umm-g --> Asset role:
"Type": "GET DATA" --> data
"Type": "GET RELATED VISUALIZATION" --> thumbnail
"Type": "EXTENDED METADATA" --> metadata
"Type": "VIEW RELATED INFORMATION" --> overview

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked STAC asset-roles specification and the supplied UMM-G example, then trace where CMR produces STAC results. Done means asset keys no longer need to be named data/data1: roles are mapped from UMM-G types, including data, thumbnail, metadata, and overview, with support for multiple data assets.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.