-
Notifications
You must be signed in to change notification settings - Fork 74
(InSAR) min/max/mean/std metrics do not account for the mask #228
Copy link
Copy link
Open
Description
Currently, the min/max/mean/std metrics provided in InSAR products do not account for the subswath mask. Should we instead be masking out pixels from invalid regions between subswaths (constant PRF), and masking out pixels with coverage from only one input RSLC, when computing these metrics?
@xhuang-jpl can probably comment on how widespread through the InSAR products this concern is; I have only spot-checked.
Here is an example from one of the sample products (dithered dataset):
# Open NISAR Sample GUNW product
>>> f = h5py.File("../NISAR_L2_PR_GUNW_003_064_D_130_004_7700_SH_20251021T160803_20251021T160836_20251102T160804_20251102T160837_X05007_N_P_J_001.h5", "r")
# Recompute mean; Compare to stored attribute value
>>> ds = f["/science/LSAR/GUNW/grids/frequencyA/unwrappedInterferogram/HH/unwrappedPhase"]
>>> np.nanmean(ds[()])
np.float32(50.597443)
>>> ds.attrs["mean_value"][()]
np.float64(50.36126708984375)
# Recompute mean with the mask applied
>>> mask = f["/science/LSAR/GUNW/grids/frequencyA/unwrappedInterferogram/mask"][()]
>>> third_digit = mask % 10
>>> second_digit = (mask // 10) % 10
>>> result = np.where((second_digit > 0) & (third_digit > 0), ds, np.nan)
>>> np.nanmean(result)
np.float32(51.03899)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels