Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dateline Unwrapping #81

Closed
wants to merge 3 commits into from
Closed

Dateline Unwrapping #81

wants to merge 3 commits into from

Conversation

cmarshak
Copy link
Collaborator

@cmarshak cmarshak commented Dec 6, 2022

Solves #78

@cmarshak cmarshak added the patch Bump the patch version number of this project label Dec 6, 2022
Comment on lines +1 to +14
from shapely.geometry import box

from isce2_topsapp.dateline import unwrap_geometry


def test_wrapping():
bbox_unwrapped = box(-181, 51, -179, 53)
bbox_wrapped = box(-179, 51, 179, 53)

out_bbox_unwrapped = unwrap_geometry(bbox_wrapped)

# Set equality is demonstrated by double containment
bbox_unwrapped.contains(out_bbox_unwrapped)
out_bbox_unwrapped.contains(bbox_unwrapped)
Copy link
Collaborator Author

@cmarshak cmarshak Dec 6, 2022

Choose a reason for hiding this comment

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

This summarizes what we are doing by unwrapping - maybe not a good idea to say "unwrapping" but the similarities were sort of similar to the phase scenario...

Let me know if there is a better term.

@cmarshak
Copy link
Collaborator Author

cmarshak commented Dec 6, 2022

This will not pass until ACCESS-Cloud-Based-InSAR/dem-stitcher#50 is merged.

@cmarshak
Copy link
Collaborator Author

cmarshak commented Dec 6, 2022

isce2_topsapp --reference-scenes S1B_IW_SLC__1SDV_20211222T054456_20211222T054526_030134_039920_9391 \
              --secondary-scenes S1B_IW_SLC__1SDV_20201215T054451_20201215T054521_024709_02F04A_6033 \
              > topsapp_img.out 2> topsapp_img.err

@cmarshak
Copy link
Collaborator Author

cmarshak commented Dec 7, 2022

It appears there is an issue with isce2 as well using the command above. When I ran with the appropriate version of dem-stitcher for staging the unwrapped DEM. ISCE2 is fitting the extents of the merged data within +/- 180 longitude as seen below.

with rasterio.open('full_res.dem.wgs84') as ds:
    bounds_dem = ds.bounds
    
bounds_dem
# BoundingBox(left=-182.00020833333335, bottom=51.00013888888889, right=-176.99993055555558, top=53.00013888888889)

And

with rasterio.open('merged/filt_topophase.unw.conncomp.geo') as ds:
    profile_cc = ds.profile
    w, h = ds.width, ds.height
    bounds = ds.bounds
    
profile_cc, bounds, w, h
# ({'driver': 'ISCE', 'dtype': 'uint8', 'nodata': None, 'width': 431847, 'height': 2628, 'count': 1, 'crs': CRS.from_epsg(4326), 'transform': Affine(0.000833333, 0.0, -179.959167483,
        0.0, -0.000833333, 52.587600165000005), 'tiled': False},
 BoundingBox(left=-179.959167483, bottom=50.397601041, right=179.913188568, top=52.587600165000005),
 431847,
 2628)

The xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<topsApp>
  <component name="topsinsar">
    <component name="reference">
      <property name="orbit directory">orbits</property>
      <property name="auxiliary data directory">aux_cal</property>
      <property name="output directory">reference</property>
      <property name="safe">['S1B_IW_SLC__1SDV_20211222T054456_20211222T054526_030134_039920_9391.zip']</property>
    </component>
    <component name="secondary">
      <property name="orbit directory">orbits</property>
      <property name="auxiliary data directory">aux_cal</property>
      <property name="output directory">secondary</property>
      <property name="safe">['S1B_IW_SLC__1SDV_20201215T054451_20201215T054521_024709_02F04A_6033.zip']</property>
    </component>
    <property name="swaths">[1, 2, 3]</property>
    <property name="range looks">19</property>
    <property name="azimuth looks">7</property>
    <property name="filter strength">0.5</property>
    <property name="region of interest">[50.399727, 52.575905, -181.35786111767942, -177.2720415305902]</property>
    <property name="demFilename">full_res.dem.wgs84</property>
    <property name="geocodeDemFilename">low_res.dem.wgs84</property>
    <property name="do unwrap">True</property>
    <property name="unwrapper name">snaphu_mcf</property>
    <property name="do ESD">False</property>
    <property name="ESD coherence threshold">-1</property>
    <property name="use virtual files">True</property>
    <property name="geocode list">['merged/phsig.cor', 'merged/filt_topophase.unw', 'merged/los.rdr', 'merged/topophase.flat', 'merged/filt_topophase.flat', 'merged/filt_topophase_2stage.unw', 'merged/topophase.cor', 'merged/filt_topophase.unw.conncomp']</property>
  </component>
</topsApp>

@cmarshak cmarshak changed the title Dateline Wrapping Dateline Unwrapping Dec 7, 2022
@cmarshak
Copy link
Collaborator Author

I am going to close this for the time being. This is an ISCE2 issue and should be resolved there.

@cmarshak cmarshak closed this Jan 24, 2023
@cmarshak cmarshak mentioned this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Bump the patch version number of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant