Skip to content

Commit 7d15ed2

Browse files
interferogalVirginia Brancato
andauthored
Update NISAR InSAR product metadata to latest product specifications (isce-framework#60)
* Change the description of processingType * lower case Reference Terrain Height description * lower case Reference Terrain Height description for GUNW * make quotes and backticks consistent * Modify description of LOS and along-track unit vectors * Add 'else' catch-all statement for 'OD' case and log in cases when proc type differs from OD * Sync logging with GCOV workflow * Remove unused info channel --------- Co-authored-by: Virginia Brancato <virginia.brancato@jpl.nasa.com>
1 parent a0420c7 commit 7d15ed2

File tree

5 files changed

+30
-14
lines changed

5 files changed

+30
-14
lines changed

python/packages/nisar/products/insar/GOFF_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def add_parameters_to_procinfo_group(self):
6969
for rslc_name in ['reference', 'secondary']:
7070
rslc = self[self.group_paths.ParametersPath][rslc_name]
7171
rslc['referenceTerrainHeight'].attrs['description'] = \
72-
np.bytes_("Reference Terrain Height as a function of"
72+
np.bytes_("Reference terrain height as a function of"
7373
f" map coordinates for {rslc_name} RSLC")
7474
rslc['referenceTerrainHeight'].attrs['units'] = \
7575
Units.meter
@@ -124,7 +124,7 @@ def add_grids_to_hdf5(self):
124124
" where 1 is water and 0 is non-water;"
125125
" the second digit represents the subswath number of that pixel in the reference RSLC;"
126126
" the least-significant digit represents the subswath number of that pixel in the secondary RSLC."
127-
" A value of '0' in either subswath digit indicates an invalid sample in the corresponding RSLC"),
127+
" A value of 0 in either subswath digit indicates an invalid sample in the corresponding RSLC"),
128128
grid_mapping=grids_val,
129129
xds=xds,
130130
yds=yds,

python/packages/nisar/products/insar/GUNW_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def add_parameters_to_procinfo_group(self):
186186
for rslc_name in ['reference', 'secondary']:
187187
rslc = self[self.group_paths.ParametersPath][rslc_name]
188188
rslc['referenceTerrainHeight'].attrs['description'] = \
189-
np.bytes_("Reference Terrain Height as a function of"
189+
np.bytes_("Reference terrain height as a function of"
190190
f" map coordinates for {rslc_name} RSLC")
191191
rslc['referenceTerrainHeight'].attrs['units'] = \
192192
Units.meter
@@ -273,7 +273,7 @@ def add_grids_to_hdf5(self):
273273
" where 1 is water and 0 is non-water;"
274274
" the second digit represents the subswath number of that pixel in the reference RSLC;"
275275
" the least-significant digit represents the subswath number of that pixel in the secondary RSLC."
276-
" A value of '0' in either subswath digit indicates an invalid sample in the corresponding RSLC"),
276+
" A value of 0 in either subswath digit indicates an invalid sample in the corresponding RSLC"),
277277
grid_mapping=grids_val,
278278
xds=xds,
279279
yds=yds,

python/packages/nisar/products/insar/InSAR_L1_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def add_pixel_offsets_to_swaths_group(self):
502502
" subswath number of that pixel in the secondary RSLC,"
503503
" and the most significant digit represents"
504504
" the subswath number of that pixel in the reference RSLC."
505-
" A value of '0' in either digit indicates an invalid sample"
505+
" A value of 0 in either digit indicates an invalid sample"
506506
" in the corresponding RSLC"),
507507
fill_value=255)
508508
offset_group['mask'].attrs['long_name'] = np.bytes_("Valid samples subswath mask")

python/packages/nisar/products/insar/InSAR_base_writer.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import Any, Optional, Union
55

66
import h5py
7+
import journal
78
import numpy as np
89
from isce3.core import crop_external_orbit
910
from isce3.core.types import complex32, to_complex32
@@ -384,7 +385,7 @@ def add_RSLC_to_procinfo_params_group(self, rslc_name: str):
384385

385386
reference_terrain_height = "referenceTerrainHeight"
386387
reference_terrain_height_description = \
387-
f"Reference Terrain Height as a function of time for {rslc_name} RSLC"
388+
f"Reference terrain height as a function of time for {rslc_name} RSLC"
388389
if reference_terrain_height in src_param_group:
389390
src_param_group.copy(reference_terrain_height, dst_param_group)
390391
dst_param_group[reference_terrain_height].attrs['description'] = \
@@ -914,6 +915,7 @@ def add_identification_to_hdf5(self):
914915
"""
915916
Add the identification group to the product
916917
"""
918+
warning_channel = journal.warning('InSAR_base_writer.add_identification_to_hdf5')
917919
radar_band_name = self._get_band_name()
918920
primary_exec_cfg = self.cfg["primary_executable"]
919921

@@ -930,10 +932,13 @@ def add_identification_to_hdf5(self):
930932
processing_type = np.bytes_('Nominal')
931933
elif processing_type == 'UR':
932934
processing_type = np.bytes_('Urgent')
933-
elif processing_type == 'OD':
934-
processing_type = np.bytes_('Custom')
935935
else:
936-
processing_type = np.bytes_('Undefined')
936+
processing_type = np.bytes_('Custom')
937+
if processing_type != 'OD':
938+
warning_channel.log(
939+
'The processing type in the runconfig is set to'
940+
f' "{processing_type}", which is not a valid value'
941+
' for the output product metadata. Defaulting to "Custom"')
937942

938943
# Adopt same logic as RSLC, GSLC, GCOV
939944
# If no condition is met, assign string from runconfig
@@ -1162,7 +1167,10 @@ def add_identification_to_hdf5(self):
11621167
DatasetParams(
11631168
"processingType",
11641169
processing_type,
1165-
"Nominal (or) Urgent (or) Custom (or) Undefined",
1170+
'Processing pipeline used to generate this granule. ' \
1171+
'"Nominal": standard production system; "Urgent": time-sensitive ' \
1172+
'processing in response to urgent response events; ' \
1173+
'"Custom": user-initiated processing outside the nominal production system',
11661174
),
11671175
DatasetParams(
11681176
"radarBand", radar_band_name,

python/packages/nisar/workflows/h5_prep.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,25 +842,33 @@ def add_radar_grid_cubes_to_hdf5(hdf5_obj, cube_group_name, geogrid,
842842
cube_group, 'losUnitVectorX', np.float32, cube_shape,
843843
zds=zds, yds=yds, xds=xds,
844844
long_name='LOS unit vector X',
845-
descr='East component of unit vector of LOS from target to sensor',
845+
descr='East component of the line-of-sight (LOS) unit vector, defined from ' \
846+
'the target to the sensor, expressed in the east-north-up (ENU) coordinate ' \
847+
'system with its origin at the target location',
846848
units='1', valid_min=-1.0, valid_max=1.0, **create_dataset_kwargs)
847849
los_unit_vector_y_raster = _get_raster_from_hdf5_ds(
848850
cube_group, 'losUnitVectorY', np.float32, cube_shape,
849851
zds=zds, yds=yds, xds=xds,
850852
long_name='LOS unit vector Y',
851-
descr='North component of unit vector of LOS from target to sensor',
853+
descr='North component of the line-of-sight (LOS) unit vector, defined from ' \
854+
'the target to the sensor, expressed in the east-north-up (ENU) coordinate ' \
855+
'system with its origin at the target location',
852856
units='1', valid_min=-1.0, valid_max=1.0, **create_dataset_kwargs)
853857
along_track_unit_vector_x_raster = _get_raster_from_hdf5_ds(
854858
cube_group, 'alongTrackUnitVectorX', np.float32, cube_shape,
855859
zds=zds, yds=yds, xds=xds,
856860
long_name='Along-track unit vector X',
857-
descr='East component of unit vector along ground track',
861+
descr='East component of the along-track unit vector at the target location, ' \
862+
'expressed in the east-north-up (ENU) coordinate system and projected ' \
863+
'onto the horizontal plane (i.e., excluding the up component)',
858864
units='1', valid_min=-1.0, valid_max=1.0, **create_dataset_kwargs)
859865
along_track_unit_vector_y_raster = _get_raster_from_hdf5_ds(
860866
cube_group, 'alongTrackUnitVectorY', np.float32, cube_shape,
861867
zds=zds, yds=yds, xds=xds,
862868
long_name='Along-track unit vector Y',
863-
descr='North component of unit vector along ground track',
869+
descr='North component of the along-track unit vector at the target location, ' \
870+
'expressed in the east-north-up (ENU) coordinate system and projected ' \
871+
'onto the horizontal plane (i.e., excluding the up component)',
864872
units='1', valid_min=-1.0, valid_max=1.0, **create_dataset_kwargs)
865873
elevation_angle_raster = _get_raster_from_hdf5_ds(
866874
cube_group, 'elevationAngle', np.float32, cube_shape,

0 commit comments

Comments
 (0)