qFSP reduction for ionosphere - #333
Conversation
| def check_qfsp_flag(slc_path): | ||
| qFSP_path = '/science/LSAR/identification/hasInputDataException/' |
There was a problem hiding this comment.
Seems like this should go in the nisar namespace somewhere. The isce3 namespace shouldn't care about NISAR product internals.
hfattahi
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
| # 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 |
There was a problem hiding this comment.
Do we really need this? Perhaps not needed.
| outer_feather=10, | ||
| fill_value=np.nan, | ||
| ): | ||
| """ |
There was a problem hiding this comment.
Please complete the doc string
There was a problem hiding this comment.
docstring was updated.
| return bool(np.asarray(value).item()) | ||
|
|
||
|
|
||
| def _fit_2d_polynomial_surface(data, valid_mask, order=2): |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Should this be template_estimation_mask?
| weight = np.clip(weight, 0.0, 1.0) | ||
|
|
||
| # Smoothstep transition. | ||
| weight = weight * weight * (3.0 - 2.0 * weight) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I added the background theory of the equation.
| 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 |
There was a problem hiding this comment.
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.
|
Hey @oberonia78 - if you rebase this PR to develop, that should get rid of the outside test failures. |
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
inputDataExceptionMaskfields. 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.