@@ -660,12 +660,16 @@ def make_rtc_opera_stac_and_upload_bursts(
660660 f"Making STAC metadata for burst { i + 1 } of { len (burst_folders )} : { burst_folder } "
661661 )
662662
663- logger .info (f"Renaming all files so 'v' is not in the product version number " )
663+ logger .info (
664+ f"Renaming all files so 'v' is not in the product version number, and version is '-' separated "
665+ )
664666 for product_file in burst_folder .iterdir ():
665667 if product_file .is_file ():
666- new_path = product_file .with_name (
667- re .sub (r"v(?=\d)" , "" , product_file .name )
668- )
668+ # step 1: remove 'v' before version numbers
669+ name = re .sub (r"v(?=\d)" , "" , product_file .name )
670+ # step 2: replace version pattern digits.digits.digits → digits-digits-digits
671+ name = re .sub (r"(\d+)\.(\d+)\.(\d+)" , r"\1-\2-\3" , name )
672+ new_path = product_file .with_name (name )
669673 if new_path != product_file :
670674 logger .info (f"Renaming: { product_file .name } -> { new_path .name } " )
671675 product_file .rename (new_path )
@@ -761,9 +765,18 @@ def make_rtc_opera_stac_and_upload_bursts(
761765 # create the XML file from the existing metadata files
762766 if xml_filepath :
763767 logger .info ("Creating the XML file from the stac and .h5 metadata files" )
764- XML = XMLMapper (stac_path = stac_filepath , h5_path = burst_h5_filepath )
768+ XML = XMLMapper (
769+ stac_path = stac_filepath ,
770+ h5_path = burst_h5_filepath ,
771+ polarisations = burst_stac_manager .polarisations ,
772+ backscatter_convention = backscatter_convention ,
773+ )
765774 logger .info ("Populating the XML template using the mapping file" )
766775 XML .populate_xml ()
776+ logger .info (
777+ f"Adding special mappings to XML template. e.g. multiple backscatter pols"
778+ )
779+ XML .populate_special_xml_mappings ()
767780 logger .info (f"Saving XML file to : { xml_filepath } " )
768781 XML .save_xml (xml_filepath )
769782
@@ -773,7 +786,7 @@ def make_rtc_opera_stac_and_upload_bursts(
773786 else :
774787 # re-check that the files don't already exist in S3. This will help protect against
775788 # simultaneous runs of the same product. E.g. the product did not exist at the
776- # start of the run and was created by another process during this run
789+ # start of the run and was created by another process during this runtime
777790 logger .info (
778791 f"Checking if product already exist before uploading for burst : { burst_stac_manager .burst_id } "
779792 )
0 commit comments