Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog metadata checkums/DSWx ISO metadata creation #76

Merged
merged 9 commits into from
Mar 30, 2022

Conversation

collinss-jpl
Copy link
Collaborator

This PR wraps up work for two tickets, one to add MD5 checksums for output products to the catalog metadata, and another to add ISO metadata creation support to the DSWx-HLS PGE.

The necessary metadata for the ISO template is collected by the _create_iso_metadata() implementation within DSWxPostProcessorMixin. The rendered version of the template is returned by this method, from which the base implementation of _stage_output_files() in base_pge.py handles the output of the file to disk.

Closes #72
Closes #73

@collinss-jpl collinss-jpl requested a review from JimHofman March 28, 2022 19:18
@collinss-jpl collinss-jpl self-assigned this Mar 28, 2022
@collinss-jpl collinss-jpl mentioned this pull request Mar 28, 2022
rendered_template = render_jinja2(iso_template_path, iso_metadata, self.logger)

return rendered_template

Copy link
Collaborator

@JimHofman JimHofman Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clear.

output_product_path = abspath(self.output_product_path)
output_products = [join(output_product_path, filename)
for filename in os.listdir(output_product_path)
if isfile(join(output_product_path, filename))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I better get used to this pattern.

catalog_metadata = {
'PGE_Name': "BASE_PGE_TEST",
'PGE_Version': "1.0.test",
'SAS_Version': "2.0.test",
'Input_Files': ["input/input_file01.h5", "input/input_file02.h5"],
'Ancillary_Files': ["input/input_dem.vrt"],
'Production_DateTime': "2022-01-20T12:07:10.9143060000Z"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Scott Collins added 9 commits March 30, 2022 10:14
…l object, added caching of metadata obtained from a tif file, and modified get_hls_filename_fields() to match file name format expected within geotiff metadata
…tive to expected template location within repository
…e_pge.PostProcessorMixin

While base_pge.py now contains the hooks for ISO metadata generation, the base PgeExecutor class itself does not generate ISO metadata.
The DSWx-HLS ISO metadata is collected from the runconfig, output product(s) and catalog metdata, and then used to render the ISO jinja2 template.
dswx_pge.py then relies on inherited functionality from base_pge.py for writing the actual metadata XML file to disk.
@collinss-jpl collinss-jpl force-pushed the 72_iso_metadata_collection branch from 4f81a1e to dc9491c Compare March 30, 2022 17:14
@JimHofman
Copy link
Collaborator

I checked the changes and it all looks good.

@collinss-jpl collinss-jpl merged commit c45111b into main Mar 30, 2022
@collinss-jpl collinss-jpl deleted the 72_iso_metadata_collection branch April 1, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checksum generation for catalog metadata DSWx metadata collection for ISO template
2 participants