Skip to content

Commit

Permalink
For Scott: 'Not found' in rendered template
Browse files Browse the repository at this point in the history
  • Loading branch information
JHofman728 committed Sep 22, 2023
1 parent f8b1c76 commit 47057d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/opera/pge/disp_s1/disp_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,27 @@ def _collect_disp_s1_product_metadata(self):
# Extract all metadata assigned by the SAS at product creation time
output_product_metadata = get_disp_s1_product_metadata(representative_product)

# Add temporary fields
output_product_metadata['identification']['reference_datetime'] = '2021-09-05T14:31:56.9300799Z'
output_product_metadata['identification']['secondary_datetime'] = '2021-09-05T14:31:56.9300799Z'

output_product_metadata['geospatial_lon_min'] = 10.0
output_product_metadata['geospatial_lon_max'] = 20.0
output_product_metadata['geospatial_lat_min'] = 10.0
output_product_metadata['geospatial_lat_max'] = 30.0

output_product_metadata['polarization'] = 'test_string'

# Add some fields on the dimensions of the data.
output_product_metadata['xCoordinates'] = {
'size': 3660, # pixels
'spacing': 30 # meters/pixel
}
output_product_metadata['yCoordinates'] = {
'size': 3660, # pixels
'spacing': 30 # meters/pixel
}

return output_product_metadata

def _create_custom_metadata(self):
Expand Down
11 changes: 11 additions & 0 deletions src/opera/test/pge/disp_s1/test_disp_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ def test_disp_s1_pge_execution(self):
expected_sas_config_file = join(pge.runconfig.scratch_path, 'test_disp_s1_config_sas.yaml')
self.assertTrue(os.path.exists(expected_sas_config_file))

# Check that the ISO metadata file was created and all placeholders were
# filled in
expected_iso_metadata_file = join(
pge.runconfig.output_product_path, pge._iso_metadata_filename())
self.assertTrue(os.path.exists(expected_iso_metadata_file))

with open(expected_iso_metadata_file, 'r', encoding='utf-8') as infile:
iso_contents = infile.read()

self.assertNotIn('!Not found!', iso_contents)

# Check that the log file was created and moved into the output directory
expected_log_file = pge.logger.get_file_name()
self.assertTrue(os.path.exists(expected_log_file))
Expand Down

0 comments on commit 47057d0

Please sign in to comment.