Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yunjunz
Copy link
Member

@yunjunz yunjunz commented Jun 17, 2022

Description of proposed changes

This PR supports loading multiple stack files in one command line, to simplify its usage, e.g.:

  • ifgramStack.h5 for regular interferograms
  • ionStack.h5 for ionosphere estimate
  • offsetStack.h5 for range/azimuth offsets

It also resizes the low-resolution ionosphere, such as provided by isce2/topsStack, to the same spatial extent as the regular interferograms during the loading process, to simplify the operations afterward.

Changes / simplications in the following scripts are made to support the above capability:

  • objects/stackDict.py
  • prep_isce.py
  • load_data.py

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

yunjunz added 4 commits June 17, 2022 13:37
+ utils.isce_utils.extract_geometry_metadata():
   - extract LENGTH & WIDTH, as reference for the A/RLOOKS
   - update attribute if box is not None
   - simplify its usage in prep_fringe.py

+ prep_isce.prepare_stack(): update the following metadata if the input obs file has different size than the stack.rsc file, to better reflect the truth, e.g. for low resolution iono file.
   - A/RLOOKS
   - AZIMUTH/RANGE_PIXEL_SIZE
   - NCORRLOOKS
   - note that LENGTH/WIDTH/Y/X_FIRST/STEP is already extracted from the obs file, thus, no need for checking or updating to reflect the truth.
+ replace the combination of -f/-d with the single -f option for a simpler and more robust logic to grab all data files in a given path pattern.

+ Together with the A/RLOOKS update from previous commit, this allows preparing metadata for both regular and iono interferograms in different resolutions.
+ objects.stackDict.py:
   - ifgramStackDict.get_size(): add geom_obj arg to be able to use the size from the reference geometry file, for the low-resolution ion file, needed for run_or_skip() checking in load_data.py
   - ifgramStackDict.write2hdf5(): add geom_obj arg, to auto detect the low-reso ion file, for resizing on the fly
   - ifgramDict.read(): add resize2shape arg to resize on the fly using skimage.transform.resize(), and make it compatible with the exiting subset and resampling options.

+ load_data.py: support multiple stack files loading in one command line, which is more flexible and simpler
   - remove the obsolete --ion option, as it's not needed anymore
   - remove the rarely used --output options, and use the hardwired values in the code, for simplification
   - code refactoring
   - update to the latest usage of prep_isce.py, to support loading regular and ion interferograms at the same command line call
   - use a for loop to load the following multiple stack HDF5 files:
       - ifgramStack.h5
       - ionStack.h5
       - offsetStack.h5

+ diff.py: light refactoring
@yunjunz yunjunz merged commit f0a8038 into insarlab:main Jun 17, 2022
@yunjunz yunjunz deleted the load branch June 17, 2022 21:24
yunjunz added a commit to yunjunz/MintPy that referenced this pull request Jun 17, 2022
+ utils.isce_utils.extract_geometry_metadata():
   - extract LENGTH & WIDTH, as reference for the A/RLOOKS
   - update attribute if box is not None
   - simplify its usage in prep_fringe.py

+ prep_isce.py: simplify and support multiple obs files w/ different resolutions
   - prepare_stack(): update A/R/NCORRLOOKS & AZ/RG_PIXEL_SIZE if the input obs file has a different size than the stack.rsc file, to better reflect the truth, e.g. for low-resolution iono file. 
   - Note that LENGTH/WIDTH/Y/X_FIRST/STEP is already extracted from the obs file, thus, no need for checking or updating to reflect the truth.
   - replace the combination of `-f/-d` with the single `-f` option for a simpler and more robust logic to grab all data files in a given path pattern.

+ objects.stackDict.py:
   - ifgramStackDict.get_size(): add geom_obj arg to be able to use the size from the reference geometry file, for the low-resolution ion file, needed for run_or_skip() checking in load_data.py
   - ifgramStackDict.write2hdf5(): add geom_obj arg, to auto detect the low-reso ion file, for resizing on the fly
   - ifgramDict.read(): add resize2shape arg to resize on the fly using skimage.transform.resize(), and make it compatible with the exiting subset and resampling options.

+ load_data.py: support multiple stack files loading in one command line, which is more flexible and simpler
   - remove the obsolete --ion option, as it's not needed anymore
   - remove the rarely used --output options, and use the hardwired values in the code, for simplification
   - code refactoring
   - update to the latest usage of prep_isce.py, to support loading regular and ion interferograms at the same command line call
   - use a for loop to load the following multiple stack HDF5 files:
       - ifgramStack.h5
       - ionStack.h5
       - offsetStack.h5

+ diff.py: light refactoring
yuankailiu added a commit to yuankailiu/MintPy that referenced this pull request Jun 17, 2022
Allow different options of multilook interpolation while loading data by parsing a method variable
+ 'nearest' method (default)
+ 'mean'    method
+ 'median'  method

Propagate the method variable from the template file named as mintpy.load.stepMethod

Merge and resolve conflicts with insarlab#796
yunjunz pushed a commit to yuankailiu/MintPy that referenced this pull request Jun 21, 2022
Allow different options of multilook interpolation while loading data by parsing a method variable
+ 'nearest' method (default)
+ 'mean'    method
+ 'median'  method

Propagate the method variable from the template file named as mintpy.load.stepMethod

Merge and resolve conflicts with insarlab#796
yunjunz pushed a commit to yuankailiu/MintPy that referenced this pull request Jun 22, 2022
Allow different options of multilook interpolation while loading data by parsing a method variable
+ 'nearest' method (default)
+ 'mean'    method
+ 'median'  method

Propagate the method variable from the template file named as mintpy.load.stepMethod

Merge and resolve conflicts with insarlab#796
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.

1 participant