diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index c81dbc4..b53663a 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -12,6 +12,6 @@ on: jobs: call-changelog-check-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.8.3 secrets: USER_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/create-jira-issue.yml b/.github/workflows/create-jira-issue.yml index 3615af1..3a138e9 100644 --- a/.github/workflows/create-jira-issue.yml +++ b/.github/workflows/create-jira-issue.yml @@ -6,7 +6,7 @@ on: jobs: call-create-jira-issue-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.8.3 secrets: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} diff --git a/.github/workflows/distribute.yml b/.github/workflows/distribute.yml index b2f933f..3962c33 100644 --- a/.github/workflows/distribute.yml +++ b/.github/workflows/distribute.yml @@ -7,7 +7,7 @@ on: jobs: call-version-info-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.8.3 distribute: runs-on: ubuntu-latest @@ -15,11 +15,13 @@ jobs: run: shell: bash -l {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: mamba-org/provision-with-micromamba@v15 + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml - name: Build distribution id: build @@ -27,7 +29,7 @@ jobs: python -m build - name: upload to PyPI.org - uses: pypa/gh-action-pypi-publish@v1.8.8 + uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.TOOLS_PYPI_PAK }} @@ -41,9 +43,11 @@ jobs: run: shell: bash -l {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: mamba-org/provision-with-micromamba@v15 + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml - name: Ensure hyp3_sdk v${{ needs.call-version-info-workflow.outputs.version }}} is pip installable run: | diff --git a/.github/workflows/labeled-pr.yml b/.github/workflows/labeled-pr.yml index ee8a5f5..103ae29 100644 --- a/.github/workflows/labeled-pr.yml +++ b/.github/workflows/labeled-pr.yml @@ -12,4 +12,4 @@ on: jobs: call-labeled-pr-check-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.8.3 diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml index 550dedc..c1f908e 100644 --- a/.github/workflows/notify-downstream.yml +++ b/.github/workflows/notify-downstream.yml @@ -17,13 +17,3 @@ jobs: repo: ASFHyP3/hyp3-docs ref: main inputs: '{"sdk_version": "${{ github.event.release.tag_name }}"}' - - - name: Tweet release notes - uses: benc-uk/workflow-dispatch@v1.2 - with: - workflow: propose-tweet.yml - token: ${{ secrets.TOOLS_BOT_PAK }} - repo: ASFHyP3/hyp3-docs - ref: develop - inputs: > - {"message": ${{ toJSON(format('{0}{1}', github.event.release.name, github.event.release.body)) }} } diff --git a/.github/workflows/release-template-comment.yml b/.github/workflows/release-template-comment.yml index 42994c1..5ecedad 100644 --- a/.github/workflows/release-template-comment.yml +++ b/.github/workflows/release-template-comment.yml @@ -7,7 +7,7 @@ on: jobs: call-release-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.8.3 permissions: pull-requests: write secrets: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be19bb4..ab16a9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: call-release-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.8.3 with: release_prefix: HyP3 SDK secrets: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 2d1d541..ae70063 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -4,9 +4,9 @@ on: push jobs: call-flake8-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.8.3 with: local_package_names: hyp3_sdk call-secrets-analysis-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.3 diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml index 5053fe6..5130be2 100644 --- a/.github/workflows/tag-version.yml +++ b/.github/workflows/tag-version.yml @@ -7,6 +7,6 @@ on: jobs: call-bump-version-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.8.3 secrets: USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7ed72d..348b8c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,6 @@ on: jobs: call-pytest-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.8.2 + uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.8.3 with: local_package_name: hyp3_sdk diff --git a/CHANGELOG.md b/CHANGELOG.md index 6251c83..63ffe51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.0] +### Added +* Added the `phase_filter_parameter` keyword argument for the `HyP3.submit_insar_job` and `HyP3.prepare_insar_job` methods. + ## [3.0.0] ### Removed * Removed the `Job.subscription_id` attribute in response to the Subscriptions feature being removed from HyP3. diff --git a/src/hyp3_sdk/hyp3.py b/src/hyp3_sdk/hyp3.py index 8cce8e9..1ccae8a 100644 --- a/src/hyp3_sdk/hyp3.py +++ b/src/hyp3_sdk/hyp3.py @@ -335,7 +335,8 @@ def submit_insar_job(self, include_dem: bool = False, include_wrapped_phase: bool = False, apply_water_mask: bool = False, - include_displacement_maps: bool = False) -> Batch: + include_displacement_maps: bool = False, + phase_filter_parameter: float = 0.6) -> Batch: """Submit an InSAR job Args: @@ -353,6 +354,10 @@ def submit_insar_job(self, apply_water_mask: Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping include_displacement_maps: Include displacement maps (line-of-sight and vertical) in the product package + phase_filter_parameter: Adaptive phase filter parameter. + Useful values fall in the range 0.2 to 1. + Larger values result in stronger filtering. + If zero, adaptive phase filter will be skipped. Returns: A Batch object containing the InSAR job @@ -374,7 +379,8 @@ def prepare_insar_job(cls, include_dem: bool = False, include_wrapped_phase: bool = False, apply_water_mask: bool = False, - include_displacement_maps: bool = False) -> dict: + include_displacement_maps: bool = False, + phase_filter_parameter: float = 0.6) -> dict: """Submit an InSAR job Args: @@ -392,6 +398,11 @@ def prepare_insar_job(cls, apply_water_mask: Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping include_displacement_maps: Include displacement maps (line-of-sight and vertical) in the product package + phase_filter_parameter: Adaptive phase filter parameter. + Useful values fall in the range 0.2 to 1. + Larger values result in stronger filtering. + If zero, adaptive phase filter will be skipped. + Returns: A dictionary containing the prepared InSAR job """ diff --git a/tests/test_hyp3.py b/tests/test_hyp3.py index 041f711..b2305b2 100644 --- a/tests/test_hyp3.py +++ b/tests/test_hyp3.py @@ -272,12 +272,13 @@ def test_prepare_insar_job(): 'include_wrapped_phase': False, 'apply_water_mask': False, 'include_displacement_maps': False, + 'phase_filter_parameter': 0.6, } } assert HyP3.prepare_insar_job(granule1='my_granule1', granule2='my_granule2', name='my_name', looks='10x2', include_los_displacement=True, include_look_vectors=True, include_inc_map=True, include_dem=True, include_wrapped_phase=True, apply_water_mask=True, - include_displacement_maps=True) == { + include_displacement_maps=True, phase_filter_parameter=0.4) == { 'job_type': 'INSAR_GAMMA', 'name': 'my_name', 'job_parameters': { @@ -290,6 +291,7 @@ def test_prepare_insar_job(): 'include_wrapped_phase': True, 'apply_water_mask': True, 'include_displacement_maps': True, + 'phase_filter_parameter': 0.4, }, }