NASA-IMPACT / csdap-cumulus

SmallSat Cumulus Deployment
Other
1 stars 1 forks source link

Add thumb.jpg entries to cmr.json files for granules in WV04_MSI_L1B collection #313

Closed chuckwondo closed 9 months ago

chuckwondo commented 9 months ago

The granules in WV04_MSI_L1B were missing their thumb.jpg files (see #312), so when they were ingested, the cmr.json files were updated to not include relevant entries for them. This means that even though the thumb.jpg files have been created in the csdap-cumulus-prod-protected bucket, when we migrate the granules to CBA Prod, the thumb.jpg files won't show up as thumbnails in Earthdata Search, because the metadata entries are missing.

We must update the cmr.json files to include entries for the thumb.jpg files so that migration to CBA Prod will have the desired results. Specifically, for each cmr.json file, we must duplicate the 2 BROWSE.jpg entries in RelatedUrls and within the 2 duplicate entries, replace BROWSE with thumb, so we end up with 2 BROWSE.jpg entires and 2 thumb.jpg entries.

Here is an example of the 2 BROWSE entries within a cmr.json file's RelatedUrls list:

    {
      "URL": "https://data.csda.earthdata.nasa.gov/csdap-cumulus-prod-protected/WV04_MSI_L1B___1/2017/124/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-BROWSE.jpg",
      "Description": "Download WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-BROWSE.jpg",
      "Type": "GET DATA"
    },
    {
      "URL": "s3://csdap-cumulus-prod-protected/WV04_MSI_L1B___1/2017/124/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-BROWSE.jpg",
      "Description": "This link provides direct download access via S3 to the granule",
      "Type": "GET DATA VIA DIRECT ACCESS"
    }

For those 2 entries, we want to copy them, and make the following changes to both copies:

Given the 2 entries above, we'll create 2 new entries that look like the following:

    {
      "URL": "https://data.csda.earthdata.nasa.gov/csdap-cumulus-prod-protected/WV04_MSI_L1B___1/2017/124/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-thumb.jpg",
      "Description": "Download WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-thumb.jpg",
      "Type": "GET RELATED VISUALIZATION"
    },
    {
      "URL": "s3://csdap-cumulus-prod-protected/WV04_MSI_L1B___1/2017/124/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001/WV04_20170504052256_f9ca790e-2502-46a6-9918-205faa15cd4c-inv_17MAY04052256-M1BS-059097041070_01_P001-thumb.jpg",
      "Description": "This link provides direct download access via S3 to the granule",
      "Type": "GET RELATED VISUALIZATION"
    }
chuckwondo commented 9 months ago

Manually updating the cmr.json files is unnecessary. As long as the thumbnails are in place (they are), and the collection definition includes an entry for them (it does), Cumulus will add the RelatedUrls when it transform the cmr.json during ingest.