From bf41b7abb36ed90bbc5c86cd8ca55cf90542403c Mon Sep 17 00:00:00 2001 From: floeschau Date: Fri, 10 Jan 2025 18:38:02 +0100 Subject: [PATCH] STAC asset name ('cloud_mask') for NewSat --- ...tractorsTests_20241102_105919_SN48_L1D_SR_MS_251827.json | 2 +- .../Model/Metadata/NewSat/NewSatMetadataExtractor.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Stars.Data.Tests/Resources/SATELLOGIC/NEWSAT/MetadataExtractorsTests_20241102_105919_SN48_L1D_SR_MS_251827.json b/src/Stars.Data.Tests/Resources/SATELLOGIC/NEWSAT/MetadataExtractorsTests_20241102_105919_SN48_L1D_SR_MS_251827.json index 8ed53c46..b18bd3eb 100644 --- a/src/Stars.Data.Tests/Resources/SATELLOGIC/NEWSAT/MetadataExtractorsTests_20241102_105919_SN48_L1D_SR_MS_251827.json +++ b/src/Stars.Data.Tests/Resources/SATELLOGIC/NEWSAT/MetadataExtractorsTests_20241102_105919_SN48_L1D_SR_MS_251827.json @@ -289,7 +289,7 @@ ], "filename": "20241102_105919_SN48_L1D_SR_MS_TOA_0.tif" }, - "cloud": { + "cloud_mask": { "type": "application/xml", "roles": [ "cloud" diff --git a/src/Stars.Data/Model/Metadata/NewSat/NewSatMetadataExtractor.cs b/src/Stars.Data/Model/Metadata/NewSat/NewSatMetadataExtractor.cs index 88ad24b3..cd8639aa 100644 --- a/src/Stars.Data/Model/Metadata/NewSat/NewSatMetadataExtractor.cs +++ b/src/Stars.Data/Model/Metadata/NewSat/NewSatMetadataExtractor.cs @@ -84,6 +84,12 @@ protected override async Task ExtractMetadata(IItem item, string suffi // add L3 visual tif asset bool x = AddL3Assets(item, stacItem) || AddL1Assets(item, stacItem); + if (!stacItem.Assets.ContainsKey("cloud_mask") && stacItem.Assets.ContainsKey("cloud")) + { + stacItem.Assets["cloud_mask"] = stacItem.Assets["cloud"]; + stacItem.Assets.Remove("cloud"); + } + return StacNode.Create(stacItem, item.Uri); }