From af33d336ee2c7a174be081984beb50d5064effb2 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Fri, 20 Dec 2024 18:34:23 -0500 Subject: [PATCH] Add processing facility, datetimes --- src/disp_s1/product.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/disp_s1/product.py b/src/disp_s1/product.py index bfbc0e8..41349d6 100644 --- a/src/disp_s1/product.py +++ b/src/disp_s1/product.py @@ -540,13 +540,21 @@ 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, @@ -554,7 +562,7 @@ def _create_identification_group( 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, @@ -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 @@ -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",