Skip to content

Commit

Permalink
Add processing facility, datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Dec 20, 2024
1 parent 9629834 commit af33d33
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions src/disp_s1/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,21 +540,29 @@ def _create_identification_group(
"""Create the identification group in the output file."""
with h5netcdf.File(output_name, "a") as f:
identification_group = f.create_group(IDENTIFICATION_GROUP_NAME)
_create_dataset(
group=identification_group,
name="processing_facility",
dimensions=(),
data="NASA Jet Propulsion Laboratory on AWS",
fillvalue=None,
description="Product processing facility",
)
_create_dataset(
group=identification_group,
name="frame_id",
dimensions=(),
data=pge_runconfig.input_file_group.frame_id,
fillvalue=None,
description="ID number of the processed frame.",
description="ID number of the processed frame",
)
_create_dataset(
group=identification_group,
name="product_version",
dimensions=(),
data=pge_runconfig.product_path_group.product_version,
fillvalue=None,
description="Version of the product.",
description="Version of the product",
)
_create_dataset(
group=identification_group,
Expand Down Expand Up @@ -705,6 +713,11 @@ def _create_identification_group(
input_dts = sorted(
[get_dates(f)[0] for f in pge_runconfig.input_file_group.cslc_file_list]
)
processing_dts = sorted(
get_dates(f)[1]
for f in pge_runconfig.input_file_group.cslc_file_list
if "compressed" not in str(f).lower()
)
parsed_files = [
parse_filename(f)
for f in pge_runconfig.input_file_group.cslc_file_list
Expand Down Expand Up @@ -742,6 +755,26 @@ def _create_identification_group(
description="Datetime of latest input granule used during processing",
attrs={"units": "unitless"},
)
early_processing_date_str = processing_dts[0].isoformat()
_create_dataset(
group=identification_group,
name="source_data_earliest_processing_datetime",
dimensions=(),
data=early_processing_date_str,
fillvalue=None,
description="Earliest processing datetime of input granules",
attrs={"units": "unitless"},
)
last_processing_date_str = processing_dts[-1].isoformat()
_create_dataset(
group=identification_group,
name="source_data_latest_processing_datetime",
dimensions=(),
data=last_processing_date_str,
fillvalue=None,
description="Latest processing datetime of input granules",
attrs={"units": "unitless"},
)
_create_dataset(
group=identification_group,
name="ceos_number_of_input_granules",
Expand Down

0 comments on commit af33d33

Please sign in to comment.