Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sar_pipeline/aws/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,16 @@ def make_rtc_opera_stac_and_upload_bursts(
)

logger.info(
f"Renaming all files so 'v' is not in the product version number, and version is '-' separated "
f"Renaming all files so 'v' is not in the product version number, version is '-' separated, and the platform name is lowercase (e.g s1a)."
)
for product_file in burst_folder.iterdir():
if product_file.is_file():
# step 1: remove 'v' before version numbers
name = re.sub(r"v(?=\d)", "", product_file.name)
# step 2: replace version pattern digits.digits.digits → digits-digits-digits
name = re.sub(r"(\d+)\.(\d+)\.(\d+)", r"\1-\2-\3", name)
# step 3: lowercase the platform (S1 + single letter, anywhere)
name = re.sub(r"S1[A-Z]", lambda m: m.group(0).lower(), name)
new_path = product_file.with_name(name)
if new_path != product_file:
logger.info(f"Renaming: {product_file.name} -> {new_path.name}")
Expand Down
14 changes: 13 additions & 1 deletion sar_pipeline/aws/metadata/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,15 @@ def add_assets_from_folder(
)

def add_linked_static_layers_as_assets_to_stac(
self, stac_suffix_string: str = "stac-item.json"
self,
stac_suffix_string: str = "stac-item.json",
assets_to_link: str = [
"number_of_looks",
"gamma0_to_beta0_ratio",
"gamma0_to_sigma0_ratio",
"local_incidence_angle",
"incidence_angle",
],
):
"""add the static layer assets to the STAC metadata file. This is
achieved by reading in the STAC metadata file associated with the
Expand Down Expand Up @@ -880,6 +888,10 @@ def add_linked_static_layers_as_assets_to_stac(
# iterate through the static layer assets and add them to the file
for asset_title in burst_static_layer_stac["assets"].keys():

# only link the requested assets. e.g. ignore the thumbnail
if asset_title not in assets_to_link:
continue

# data for each asset
asset_data = burst_static_layer_stac["assets"][asset_title]

Expand Down
38 changes: 35 additions & 3 deletions sar_pipeline/aws/metadata/templates/s1nrb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<IncAngleFarRange units="deg">
</IncAngleFarRange>
</SourceDataImageAttributes>
<PerformanceIndicators pol="HH">
<PerformanceIndicators pol="VV,VH,HH,HV">
<NoiseEquivalentIntensity type="Sigma0" units="dB">
<Estimates type="max">
</Estimates>
Expand Down Expand Up @@ -109,8 +109,6 @@
<ProductRowSpacing units="m">
</ProductRowSpacing>
</ProductSampleSpacing>
<ProductENL>
</ProductENL>
<ProductResolution>
<ProductResolutionColumn unit="m"></ProductResolutionColumn>
<ProductResolutionRow unit="m"></ProductResolutionRow>
Expand Down Expand Up @@ -222,6 +220,34 @@
<ByteOrder>
</ByteOrder>
</GammaToSigmaRatio>
<GammaToBetaRatio>
<FileName type="URL">
</FileName>
<SampleType units="Ratio">
</SampleType>
<DataFormat>
</DataFormat>
<DataType>
</DataType>
<BitsPerSample>
</BitsPerSample>
<ByteOrder>
</ByteOrder>
</GammaToBetaRatio>
<NumberOfLooks>
<FileName type="URL">
</FileName>
<SampleType units="Count">
</SampleType>
<DataFormat>
</DataFormat>
<DataType>
</DataType>
<BitsPerSample>
</BitsPerSample>
<ByteOrder>
</ByteOrder>
</NumberOfLooks>
</PerPixelMetadata>
<BackscatterMeasurementData>
<BackscatterMeasurement>
Expand Down Expand Up @@ -257,6 +283,12 @@
<GeoCorrAlgorithm type="DOI">
</GeoCorrAlgorithm>
<GriddingConvention>
<BurstGeogridSnapX units="m">
</BurstGeogridSnapX>
<BurstGeogridSnapY units="m">
</BurstGeogridSnapY>
<GriddingConventionReference type="URL">
</GriddingConventionReference>
</GriddingConvention>
<DigitalElevationModel dem="Surface">
<DEMReference type="URL">
Expand Down
Loading