Skip to content

qFSP reduction for ionosphere - #333

Open
oberonia78 wants to merge 8 commits into
isce-framework:developfrom
oberonia78:insar_qfsp
Open

qFSP reduction for ionosphere#333
oberonia78 wants to merge 8 commits into
isce-framework:developfrom
oberonia78:insar_qfsp

Conversation

@oberonia78

Copy link
Copy Markdown
Contributor

This PR introduces qFSP phase-slip artifact correction into the ionosphere phase correction workflow. The main goal is to prevent qFSP-related phase artifacts in the differential interferogram from propagating into the estimated dispersive ionosphere phase screen.

The correction is applied before dispersive and non-dispersive phase estimation. This ensures that compute_disp_nondisp() uses the qFSP-corrected differential phase rather than the original differential phase containing phase-slip artifacts.

The qFSP artifact region is identified using the InSAR mask anomaly bits derived from the reference and secondary inputDataExceptionMask fields. Non-anomaly pixels are used to estimate a smooth background phase, and the qFSP artifact template is estimated and removed from the affected region.

The qFSP artifact region is identified from the InSAR mask anomaly bits derived from the reference and secondary inputDataExceptionMask fields. Reliable non-anomaly pixels are used to fit a smooth background phase using a low-order polynomial surface. The qFSP artifact is then estimated from the residual between the original differential phase and the fitted background inside the anomaly region.

The estimated artifact is smoothed, optionally feathered near the artifact boundary, and subtracted from the original differential phase. This removes localized qFSP phase-slip artifacts while preserving the large-scale phase structure needed for ionosphere estimation.

image image

@hfattahi hfattahi added this to the R05.03.0 milestone Aug 11, 2026
Comment on lines +6 to +7
def check_qfsp_flag(slc_path):
qFSP_path = '/science/LSAR/identification/hasInputDataException/'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should go in the nisar namespace somewhere. The isce3 namespace shouldn't care about NISAR product internals.

@hfattahi hfattahi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @oberonia78 . Here are the first round of comments for this PR where we went over with you, @xhuang-jpl and @seongsujeong

bridge_ramp_maximum_pixel: num(min=0, required=False)

qfsp_correction_options:
# Boolean flag to enable/disable qFSP phase-slip artifact correction

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Boolean flag to enable/disable qFSP phase-slip artifact correction
# Boolean flag to enable/disable residual qFSP phase-slip artifact correction

min_fraction_rows: num(min=0.0, max=1.0, required=False)
# Minimum width, in pixels, of a qFSP artifact group
min_group_width: int(min=1, required=False)
# Smoothing window size used for qFSP template estimation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? Perhaps not needed.

outer_feather=10,
fill_value=np.nan,
):
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please complete the doc string

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring was updated.

return bool(np.asarray(value).item())


def _fit_2d_polynomial_surface(data, valid_mask, order=2):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why won't we use the existing polynomial fit in isce3.math.offsets_polyfit (based on @xhuang-jpl comments)

residual = phase - background

groups = _find_column_groups(
artifact_mask,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be template_estimation_mask?

weight = np.clip(weight, 0.0, 1.0)

# Smoothstep transition.
weight = weight * weight * (3.0 - 2.0 * weight)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We went through the algorithm here and overall this function makes sense. But I and the team were not sure about this last magic part. Can we be sure why this line works?
I understand we need some smoothness at the edge but why this equation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the background theory of the equation.

Comment on lines +1200 to +1205
if not ref_qfsp_flag and not sec_qfsp_flag:
info_channel.log(
"qFSP correction is enabled but none of input "
"does not qFSP slip"
)
iono_qfsp_correction_flag = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When both acquisitions have qFSP sample slip, the impact should cancel out. Let's make sure we will not apply extra correction if both have qFSP sample slip.

@Tyler-g-hudson

Copy link
Copy Markdown
Contributor

Hey @oberonia78 - if you rebase this PR to develop, that should get rid of the outside test failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants