Skip to content

Reprojecting polar stereographic watermask to radargrid#271

Merged
seongsujeong merged 7 commits into
isce-framework:developfrom
seongsujeong:polarstereo_watermask
May 28, 2026
Merged

Reprojecting polar stereographic watermask to radargrid#271
seongsujeong merged 7 commits into
isce-framework:developfrom
seongsujeong:polarstereo_watermask

Conversation

@seongsujeong
Copy link
Copy Markdown
Contributor

This PR is built upon #253 by @oberonia78 that addresses several issues in watermask reprojection. One of the issues was the necessity to reproject the watermask in polar stereographic (or any projection except for WGS84) to the radargrid.

This PR addresses the issue by transforming the longitude / latitude loaded from x.rdr and y.rdr in scratch directory to polar stereographic.

Below is the input watermask in EPSG 3413 (top), and reprojected to radargrid (bottom). of the test data.

Screenshot 2026-05-21 at 03 36 04 Screenshot 2026-05-21 at 03 33 49

For the record, below is the granule names of reference and secondary
NISAR_L1_PR_RSLC_012_015_A_037_7700_SHNA_A_20260203T054101_20260203T054138_X05012_N_P_J_001
NISAR_L1_PR_RSLC_013_015_A_037_7700_SHNA_A_20260215T054102_20260215T054139_X05012_N_P_J_001

@hfattahi hfattahi added this to the R05.02.0 milestone May 21, 2026
@seongsujeong seongsujeong requested a review from xhuang-jpl May 21, 2026 16:53
Copy link
Copy Markdown
Contributor

@hfattahi hfattahi left a comment

Choose a reason for hiding this comment

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

We went half way reviewing. Few comments so far.

Comment thread python/packages/isce3/unwrap/preprocess.py Outdated
Comment thread python/packages/isce3/unwrap/preprocess.py Outdated
Comment thread python/packages/isce3/unwrap/preprocess.py
Comment thread python/packages/isce3/unwrap/preprocess.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py
Copy link
Copy Markdown
Contributor

@hfattahi hfattahi left a comment

Choose a reason for hiding this comment

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

Few more minor comments and clarifications.

Comment thread python/packages/isce3/unwrap/preprocess.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
@seongsujeong
Copy link
Copy Markdown
Contributor Author

@hfattahi @oberonia78 Would you mind another round of look?

Copy link
Copy Markdown
Contributor

@hfattahi hfattahi left a comment

Choose a reason for hiding this comment

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

Thanks @seongsujeong for addressing my comments. LGTM!

Comment thread python/packages/nisar/workflows/ionosphere.py Outdated
Comment on lines +889 to +892
phase_second = out_paths['RIFG']
phase_second = out_paths['RUNW']
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.

revert changes.

Comment on lines +892 to +896
diff_phase_output = pathlib.Path(diff_dir, 'RIFG.h5')
unwrap_needed = False
diff_phase_output = pathlib.Path(diff_dir, 'RUNW.h5')
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.

revert changes

Comment on lines +932 to +943
if rerun_insar_pairs > 0:
dest_freq_path = f"{swath_path}/frequencyB"
dest_pol_path = f"{dest_freq_path}/interferogram/{pol_b}"
rifg_path_freq = f"{dest_pol_path}/wrappedInterferogram"

dest_freq_path = f"{swath_path}/frequencyB"
dest_pol_path = f"{dest_freq_path}/interferogram/{pol_b}"
rifg_path_freq = f"{dest_pol_path}/wrappedInterferogram"
second_data_path.append(rifg_path_freq)
else:
dest_freq_path = f"{runw_swath_path}/frequencyB"
dest_pol_path = f"{dest_freq_path}/interferogram/{pol_b}"
runw_path_b_freq = f"{dest_pol_path}/unwrappedPhase"

second_data_path.append(rifg_path_freq)
second_data_path.append(runw_path_b_freq)
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.

revert changes

Comment on lines +954 to +965
unwrap.run(iono_insar_cfg, out_paths['RIFG'], out_paths['RUNW'])

if unwrap_needed:
unwrap.run(iono_insar_cfg, out_paths['RIFG'], out_paths['RUNW'])
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.

revert changes

Copy link
Copy Markdown
Contributor

@oberonia78 oberonia78 left a comment

Choose a reason for hiding this comment

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

LGTM

@seongsujeong seongsujeong merged commit a000a4f into isce-framework:develop May 28, 2026
8 checks passed
Tyler-g-hudson pushed a commit that referenced this pull request May 28, 2026
* fix a bug in projecing water to cryosphere region

* fix issue in unitttest

* extend the input raster's EPSG beyond 4326

* Apply suggestion from code review

* Apply suggestion from PR review

* apply suggestion from PR review

---------

Co-authored-by: Jungkyo Jung <56169931+oberonia78@users.noreply.github.com>
Co-authored-by: Jungkyo Jung <jungkyoj@nisar-adt-dev-5.jpl.nasa.gov>
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.

3 participants