Incorporate the qFSP mask into InSAR mask#247
Incorporate the qFSP mask into InSAR mask#247xhuang-jpl wants to merge 39 commits intoisce-framework:developfrom
Conversation
|
We reviewed this PR in a PR review session. Overall it looks good pending testing and very minor comments provided offline. |
| sec_i = int(int(i) + azimuth_off[0,int(j)] + 0.5) | ||
| sec_j = int(int(j) + range_off[0,int(j)] + 0.5) |
There was a problem hiding this comment.
Use round() function here
| # The azimuth index is not in the radar grid meaning no subswath mask | ||
| else: | ||
| subswath_mask += [0] * len(rg_idx_arr) | ||
| mask += [0] * len(rg_idx_arr) |
There was a problem hiding this comment.
may use the fillvalue (255) here
hfattahi
left a comment
There was a problem hiding this comment.
LGTM! Thank you @xhuang-jpl for this addition. The PR looks good and I have extensively tested with real data. I do understand that we are making a change to an existing dataset in the InSAR products. We had two choices to make either add couple of extra mask datasets or modify the current mask. After detailed evaluation we decided to modify the existing mask in a largely backward compatible manner to ensure user convenience. We understand that users may need to slightly modify their InSAR readers to read mask but with this modification one can use one unified parser to parse mask dataset from both new and old products.
Here is an example code snippet for parsing RUNW mask from both old and new mask dataset.
def parse_mask(mask_value):
"""
Decodes a RUNW/RIFG mask (8 bits or 32 bits).
"""
# regardless if the mask_value is 8 or 32 bits, we convert to 32 bits
mask_value = mask_value & 0xFFFFFFFF
# Bits 0–7: Subswath encoding
subswath_byte = mask_value & 0xFF
ref_subswath = (subswath_byte // 10) % 10
sec_subswath = subswath_byte % 10
# Bits 8–15: Secondary RSLC anomaly flags
sec_anomaly = (mask_value >> 8) & 0xFF
# Bits 16–23: Reference RSLC anomaly flags
ref_anomaly = (mask_value >> 16) & 0xFF
# Bits 24–31: Reserved for future use
reserved = (mask_value >> 24) & 0xFF
return {
"ref_subswath": ref_subswath,
"sec_subswath": sec_subswath,
"sec_anomaly_raw": sec_anomaly, # Binary string for bitwise flags
"ref_anomaly_raw": ref_anomaly, # Binary string for bitwise flags
"is_valid_subswath": (ref_subswath > 0) & (sec_subswath > 0),
"anomaly_mask": (ref_anomaly == 0) & (sec_anomaly == 0)
}
The code snippet requires small modification for GUNW which has extra water mask.
In a future PR we will add an ionospheric phase mask to 1 bit of the reserved bits.
|
|
||
| """ | ||
| Generate the InSAR subswath 2d array mask | ||
| Generate the InSAR 2d array mask |
There was a problem hiding this comment.
| Generate the InSAR 2d array mask | |
| Generate the InSAR 2d array mask |
just a nit pick
This PR is to incorporate the qFSP mask into the InSAR mask, where many places are updated including:
geocode_insar.pyinterpret_subswath_maskfunction