Open ngachung opened 1 week ago
I think this is wrong because it's using collection and trying to load catalog.
Collection.from_stac("/Users/nchung/PycharmProjects/unity-data-services/cwl/stage-in-unity/granules/catalog.json")
When using Catalog
, it can load but validation fails with this error: pystac.errors.STACError: Relative path catalog.json encountered without owner "self" link set.
upload_result = Catalog.from_dict(sample)
upload_result.validate()
But the cause is still the same.
{
'type': 'Catalog', 'id': 'NA', 'stac_version': '1.0.0', 'description': 'NA',
'links': [{'rel': 'root', 'href': 'catalog.json', 'type': 'application/json'}, {'rel': 'item', 'href': 'SNDR.SNPP.ATMS.L1A.nominal2.08.stac.json', 'type': 'application/json'}, {'rel': 'item', 'href': 'SNDR.SNPP.ATMS.L1A.nominal2.01.stac.json', 'type': 'application/json'}, {'rel': 'item', 'href': 'SNDR.SNPP.ATMS.L1A.nominal2.06.stac.json', 'type': 'application/json'}, {'rel': 'item', 'href': 'SNDR.SNPP.ATMS.L1A.nominal2.18.stac.json', 'type': 'application/json'}, {'rel': 'item', 'href': 'SNDR.SNPP.ATMS.L1A.nominal2.04.stac.json', 'type': 'application/json'}]}
This works, but the above example doesn't work.
This is the solution. But it requires the reader to decode it.
import urllib.parse
urllib.parse.quote("urn:nasa:unity:unity:dev:SBG-L2A_RSRFL___1:SISTER_EMIT_L2A_RSRFL_20240103T131936_001.stac.json", safe="")
Or when we write the catalog.json and *.stac.json can we remove the urn prefix and just use, for example, SISTER_EMIT_L2A_RSRFL_20240103T131936_001_UNC.stac.json and SISTER_EMIT_L2A_RSRFL_20240103T131936_001.stac.json
I see. Since this is just a filename, it can be anything. That also works.
When using UDS v9.0.0 image, stage-in produces catalog.json that cannot be read by pystac when trying to stage data cataloged by DS.
Tried to read that following catalog.json with unitypy
Results in the following stacktrace