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

resample: fix discrepancy between num_box and dest_box_list #940

Merged
merged 2 commits into from
Dec 28, 2022

Conversation

yunjunz
Copy link
Member

@yunjunz yunjunz commented Dec 28, 2022

Description of proposed changes

  • objects.resample.prepare_geometry_definition_radar(): update the initially guessed num_box value, based on the later-on-calculated actually-used dest_box_list. These two could occasionally be different when the input file is large.

  • .github./dependabot.yml: fix typo introduced in docs/installation: switch link syntax from markdown to html #939

  • use use scipy.interpolate.RegularGridInterpolator without as RGI in the following scripts, as suggested by codacy.

    • objects.resample.py
    • tropo_gacos.py
    • utils.utils0.py

Reminders

  • Pass Pre-commit check (green)
  • 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.

@yunjunz yunjunz changed the title resample: fix occasional discrepancy between num_box and dest_box_list resample: fix discrepancy between num_box and dest_box_list Dec 28, 2022
@yunjunz yunjunz merged commit 04793a5 into insarlab:main Dec 28, 2022
@yunjunz yunjunz deleted the resample branch December 28, 2022 06:14
yunjunz added a commit to yunjunz/MintPy that referenced this pull request Jun 13, 2023
…st one

+ objects.cluster.split_box2sub_boxes(): if the last step is too small (<5% or <5 pixels), merge it to the 2nd last one. This change is necessary to avoid the reshaping error when the step size of the last sub-box is 1, turning a 3D matrix into 2D, thus, resulting in a reshape error, such as in diff.py.

+ update the num_box based on the returned box_list from split_box2sub_boxes(), as it maybe different from the initially input num_box. This is similar to insarlab#940, but search and update all the other instances.
yunjunz added a commit that referenced this pull request Jun 14, 2023
…` for tiny last step (#1024)

+ `save_gdal.py`: convert numpy array from boolean to uint8, as GDAL does not support boolean data type, such as used in all the mask files.

+ `objects.cluster.split_box2sub_boxes()`: avoid the tiny last step (<5% of the normal step, or <5 pixels), by merging it into the 2nd last one. This happens to very large datasets sometimes. For example, if the last step has a size of 1, a 3D matrix will be turned into 2D, resulting in a reshape error.

+ `objects.cluster.split_box2sub_boxes()`: return the final number of sub_boxes, in addition to the current list of sub_boxes, for easier usage (as it may be different from the initial num_box as identified in #940). Update the usage in all occurrences:
   - objects.resample
   - dem_error
   - diff
   - reference_date
   - timeseries2velocity
yunjunz added a commit to yunjunz/MintPy that referenced this pull request Jun 14, 2023
…st one

+ objects.cluster.split_box2sub_boxes(): if the last step is too small (<5% or <5 pixels), merge it to the 2nd last one. This change is necessary to avoid the reshaping error when the step size of the last sub-box is 1, turning a 3D matrix into 2D, thus, resulting in a reshape error, such as in diff.py.

+ update the num_box based on the returned box_list from split_box2sub_boxes(), as it maybe different from the initially input num_box. This is similar to insarlab#940, but search and update all the other instances.
yunjunz added a commit to yunjunz/MintPy that referenced this pull request Jun 14, 2023
…` for tiny last step (insarlab#1024)

+ `save_gdal.py`: convert numpy array from boolean to uint8, as GDAL does not support boolean data type, such as used in all the mask files.

+ `objects.cluster.split_box2sub_boxes()`: avoid the tiny last step (<5% of the normal step, or <5 pixels), by merging it into the 2nd last one. This happens to very large datasets sometimes. For example, if the last step has a size of 1, a 3D matrix will be turned into 2D, resulting in a reshape error.

+ `objects.cluster.split_box2sub_boxes()`: return the final number of sub_boxes, in addition to the current list of sub_boxes, for easier usage (as it may be different from the initial num_box as identified in insarlab#940). Update the usage in all occurrences:
   - objects.resample
   - dem_error
   - diff
   - reference_date
   - timeseries2velocity
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