Originally reported by @gmgunter on March 17, 2025: https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2170
Summary
attitudeType metadata is always set to "Custom".
Products Impacted: All L1, All L2, and STATIC
Causes (2.5 causes)
Cause 1 -- Incorrect Input Pointing Files
Here is the relevant description from the SIS for the pointing files:
@bhawkins grabbed a random NRP, and saw:
<fileClass>Custom</fileClass>
<fileType>NRP</fileType>
@jplzhan grabbed a PRP, and it claimed to be a FRP:
<fileClass>Custom</fileClass>
<fileType>FRP</fileType>
Per @bhawkins D&C will need to fix the pointing XML products.
Cause 2 - Hardcoded values in both focus.py and static.py
RSLC: Hardcoded in focus.py
Copy-paste from https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2170 , with updated links:
A thing I noticed while shamelessly stealing @bhawkins's code to use in static layers--
The SLC writer class's set_attitude() method takes an attitude type string as an optional input, defaulting to "Custom". This is used to populate the metadata/attitude/attitudeType dataset in the RSLC product.
|
def set_attitude(self, attitude: Attitude, orbit: Orbit, |
|
ellipsoid=Ellipsoid(), type="Custom"): |
|
log.info("Writing attitude to SLC") |
|
g = self.root.require_group("metadata/attitude") |
|
d = g.require_dataset("attitudeType", (), "S10", data=np.bytes_(type)) |
|
d.attrs["description"] = np.bytes_( |
|
'Attitude type, either "FRP", "NRP", "PRP, or "Custom", where' |
|
' "FRP" stands for Forecast Radar Pointing, "NRP" is Near' |
|
' Real-time Pointing, and "PRP" is Precise Radar Pointing') |
When writing output RSLC products in focus.py, we don't override the default attitude type, so it's always set to "Custom".
|
slc.set_attitude(attitude, orbit) |
STATIC: Hardcoded in static.py
|
# FIXME: There's not currently a good mechanism to get the attitude type. The RSLC |
|
# workflow hardcodes it to 'Custom' so let's do the same here. See |
|
# https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2170. |
|
attitude_type = "Custom" |
|
dataset_spec = product_spec.get_dataset_spec("/".join([group.name, "attitudeType"])) |
|
create_dataset(group.file, dataset_spec, attitude_type) |
GSLC, GCOV, InSAR: Inherited from input RSLC HDF5
These workflows copy the attitudeType from the input RSLC. Once focus.py is updated, then the downstream products will automatically populate their products with the correct value.
Action Items
cc: @hfattahi @bhawkins @gshiroma @jplzhan @Tyler-g-hudson
Originally reported by @gmgunter on March 17, 2025: https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2170
Summary
attitudeTypemetadata is always set to "Custom".Products Impacted: All L1, All L2, and STATIC
Causes (2.5 causes)
Cause 1 -- Incorrect Input Pointing Files
Here is the relevant description from the SIS for the pointing files:
@bhawkins grabbed a random NRP, and saw:
@jplzhan grabbed a PRP, and it claimed to be a FRP:
Per @bhawkins D&C will need to fix the pointing XML products.
Cause 2 - Hardcoded values in both
focus.pyandstatic.pyRSLC: Hardcoded in
focus.pyCopy-paste from https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2170 , with updated links:
A thing I noticed while shamelessly stealing @bhawkins's code to use in static layers--
The SLC writer class's
set_attitude()method takes an attitude type string as an optional input, defaulting to "Custom". This is used to populate themetadata/attitude/attitudeTypedataset in the RSLC product.isce3/python/packages/nisar/products/writers/SLC.py
Lines 667 to 675 in bdf1f6f
When writing output RSLC products in
focus.py, we don't override the default attitude type, so it's always set to "Custom".isce3/python/packages/nisar/workflows/focus.py
Line 1878 in bdf1f6f
STATIC: Hardcoded in
static.pyisce3/python/packages/nisar/static/product.py
Lines 518 to 523 in bdf1f6f
GSLC, GCOV, InSAR: Inherited from input RSLC HDF5
These workflows copy the
attitudeTypefrom the input RSLC. Oncefocus.pyis updated, then the downstream products will automatically populate their products with the correct value.Action Items
focus.pystatic.pycc: @hfattahi @bhawkins @gshiroma @jplzhan @Tyler-g-hudson