dist-s1-enumerator 1.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. dist_s1_enumerator-1.0.8/.github/dependabot.yml +8 -0
  2. dist_s1_enumerator-1.0.8/.github/workflows/bump-tag-for-release.yml +15 -0
  3. dist_s1_enumerator-1.0.8/.github/workflows/changelog-updated.yml +18 -0
  4. dist_s1_enumerator-1.0.8/.github/workflows/github-release.yml +16 -0
  5. dist_s1_enumerator-1.0.8/.github/workflows/labeled-pr.yml +15 -0
  6. dist_s1_enumerator-1.0.8/.github/workflows/nb_tests.yml +46 -0
  7. dist_s1_enumerator-1.0.8/.github/workflows/pypi-release.yml +37 -0
  8. dist_s1_enumerator-1.0.8/.github/workflows/static_analysis.yml +11 -0
  9. dist_s1_enumerator-1.0.8/.github/workflows/tests.yml +43 -0
  10. dist_s1_enumerator-1.0.8/.gitignore +101 -0
  11. dist_s1_enumerator-1.0.8/CHANGELOG.md +175 -0
  12. dist_s1_enumerator-1.0.8/LICENSE +202 -0
  13. dist_s1_enumerator-1.0.8/PKG-INFO +295 -0
  14. dist_s1_enumerator-1.0.8/README.md +272 -0
  15. dist_s1_enumerator-1.0.8/environment.yml +28 -0
  16. dist_s1_enumerator-1.0.8/notebooks/A__Staging_Inputs_for_One_MGRS_Tile.ipynb +1261 -0
  17. dist_s1_enumerator-1.0.8/notebooks/B__Enumerate_MGRS_tile.ipynb +1139 -0
  18. dist_s1_enumerator-1.0.8/pyproject.toml +109 -0
  19. dist_s1_enumerator-1.0.8/setup.cfg +4 -0
  20. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/__init__.py +57 -0
  21. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/asf.py +328 -0
  22. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/constants.py +50 -0
  23. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/data/jpl_burst_geo.parquet +0 -0
  24. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/data/mgrs.parquet +0 -0
  25. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/data/mgrs_burst_lookup_table.parquet +0 -0
  26. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/dist_enum.py +425 -0
  27. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/dist_enum_inputs.py +138 -0
  28. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/exceptions.py +2 -0
  29. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/mgrs_burst_data.py +170 -0
  30. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/param_models.py +100 -0
  31. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/py.typed +0 -0
  32. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/rtc_s1_io.py +142 -0
  33. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator/tabular_models.py +91 -0
  34. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/PKG-INFO +295 -0
  35. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/SOURCES.txt +54 -0
  36. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/dependency_links.txt +1 -0
  37. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/not-zip-safe +1 -0
  38. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/requires.txt +1 -0
  39. dist_s1_enumerator-1.0.8/src/dist_s1_enumerator.egg-info/top_level.txt +1 -0
  40. dist_s1_enumerator-1.0.8/tests/conftest.py +30 -0
  41. dist_s1_enumerator-1.0.8/tests/data/dist_hls_tiles.txt +19043 -0
  42. dist_s1_enumerator-1.0.8/tests/data/mock_ts_data_for_enum.ipynb +1047 -0
  43. dist_s1_enumerator-1.0.8/tests/data/rtc_s1_ts_metadata/chile_19HBD.parquet +0 -0
  44. dist_s1_enumerator-1.0.8/tests/data/rtc_s1_ts_metadata/mgrs01UBT.parquet +0 -0
  45. dist_s1_enumerator-1.0.8/tests/data/rtc_s1_ts_metadata/mgrs11SLT_11SLU_11SMT.parquet +0 -0
  46. dist_s1_enumerator-1.0.8/tests/data/rtc_s1_ts_metadata/mgrs15RXN__track63.parquet +0 -0
  47. dist_s1_enumerator-1.0.8/tests/data/rtc_s1_ts_metadata/mgrs22WFD.parquet +0 -0
  48. dist_s1_enumerator-1.0.8/tests/data/ts_data_for_workflow_inputs.ipynb +68 -0
  49. dist_s1_enumerator-1.0.8/tests/test_asf.py +58 -0
  50. dist_s1_enumerator-1.0.8/tests/test_dist_enum.py +366 -0
  51. dist_s1_enumerator-1.0.8/tests/test_dist_enum_inputs.py +62 -0
  52. dist_s1_enumerator-1.0.8/tests/test_mgrs_burst_data.py +184 -0
  53. dist_s1_enumerator-1.0.8/tests/test_notebooks.py +49 -0
  54. dist_s1_enumerator-1.0.8/tests/test_package.py +9 -0
  55. dist_s1_enumerator-1.0.8/tests/test_param_model.py +194 -0
  56. dist_s1_enumerator-1.0.8/tests/test_rtc_s1_io.py +60 -0
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ labels:
8
+ - "bumpless"
@@ -0,0 +1,15 @@
1
+ name: Bump and Tag Release Version on Main
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ call-bump-version-workflow:
10
+ uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.21.0
11
+ with:
12
+ user: opera-pst-dev
13
+ email: opera-pst-dev@jpl.nasa.gov
14
+ secrets:
15
+ USER_TOKEN: ${{ secrets.OPERA_PST_DIST_TOKEN }}
@@ -0,0 +1,18 @@
1
+ name: Check Changelog Updated
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - labeled
8
+ - unlabeled
9
+ - synchronize
10
+ branches:
11
+ - main
12
+ - dev
13
+
14
+ jobs:
15
+ call-changelog-check-workflow:
16
+ uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.21.0
17
+ secrets:
18
+ USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,16 @@
1
+ name: Create Release on Github
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ call-release-workflow:
10
+ uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.21.0
11
+ with:
12
+ release_prefix: dist-s1-enumerator
13
+ develop_branch: dev
14
+ sync_pr_label: team-bot
15
+ secrets:
16
+ USER_TOKEN: ${{ secrets.OPERA_PST_DIST_TOKEN }}
@@ -0,0 +1,15 @@
1
+ name: Check PR Labeled
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - labeled
8
+ - unlabeled
9
+ - synchronize
10
+ branches:
11
+ - main
12
+
13
+ jobs:
14
+ call-labeled-pr-check-workflow:
15
+ uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.21.0
@@ -0,0 +1,46 @@
1
+ name: Notebook Tests
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ - dev
9
+ pull_request:
10
+ branches:
11
+ - main
12
+ - dev
13
+
14
+ jobs:
15
+ pytest:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python-version: ['3.12']
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+
25
+ - uses: extractions/netrc@v2
26
+ with:
27
+ machine: urs.earthdata.nasa.gov
28
+ username: ${{ secrets.EARTHDATA_USERNAME }}
29
+ password: ${{ secrets.EARTHDATA_PASSWORD }}
30
+
31
+ - uses: mamba-org/setup-micromamba@v2
32
+ with:
33
+ environment-name: dist-s1-enumerator
34
+ environment-file: environment.yml
35
+ extra-specs: |
36
+ python=${{ matrix.python-version }}
37
+ create-args: |
38
+ papermill
39
+
40
+ - name: Pytest Notebook tests in conda environment
41
+ shell: bash -l {0}
42
+ run: |
43
+ mamba install papermill --yes
44
+ python -m pip install --no-deps .
45
+ python -m ipykernel install --user --name dist-s1-enumerator
46
+ pytest . -m 'notebooks'
@@ -0,0 +1,37 @@
1
+ name: Distribute to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ jobs:
9
+ distribute:
10
+ runs-on: ubuntu-latest
11
+ outputs:
12
+ SDIST_VERSION: ${{ steps.build.outputs.version }}
13
+ steps:
14
+ - uses: actions/checkout@v6
15
+
16
+ - uses: actions/setup-python@v6
17
+ with:
18
+ python-version: 3.11
19
+
20
+ - name: Install dependencies
21
+ run: |
22
+ python -m pip install --upgrade pip
23
+ python -m pip install --upgrade setuptools build "setuptools-scm[toml]"
24
+
25
+ - name: Build distribuion
26
+ id: build
27
+ run: |
28
+ git fetch origin +refs/tags/*:refs/tags/*
29
+ export SDIST_VERSION=$(python -m setuptools_scm)
30
+ echo "::set-output name=version::${SDIST_VERSION}"
31
+ python -m build
32
+
33
+ - name: upload to PyPI.org
34
+ uses: pypa/gh-action-pypi-publish@release/v1
35
+ with:
36
+ user: __token__
37
+ password: ${{ secrets.OPERA_PST_PYPI_TOKEN }}
@@ -0,0 +1,11 @@
1
+ name: Static Analysis (Ruff)
2
+
3
+ on: push
4
+
5
+ jobs:
6
+
7
+ call-secrets-analysis-workflow:
8
+ uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.21.0
9
+
10
+ call-ruff-workflow:
11
+ uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.21.0
@@ -0,0 +1,43 @@
1
+ name: Unit and Small Integration Tests
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ - dev
9
+ pull_request:
10
+ branches:
11
+ - main
12
+ - dev
13
+
14
+ jobs:
15
+ pytest:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ python-version: ["3.12", "3.13"]
20
+ fail-fast: false
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+
25
+ - uses: extractions/netrc@v2
26
+ with:
27
+ machine: urs.earthdata.nasa.gov
28
+ username: ${{ secrets.EARTHDATA_USERNAME }}
29
+ password: ${{ secrets.EARTHDATA_PASSWORD }}
30
+
31
+ - uses: mamba-org/setup-micromamba@v2
32
+ with:
33
+ environment-name: dist-s1-enumerator
34
+ environment-file: environment.yml
35
+ create-args: >-
36
+ python=${{ matrix.python-version }}
37
+
38
+
39
+ - name: Pytest in conda environment
40
+ shell: bash -l {0}
41
+ run: |
42
+ python -m pip install --no-deps .
43
+ pytest . -m 'not notebooks'
@@ -0,0 +1,101 @@
1
+ # OS Files
2
+ **/.DS_Store
3
+ **/.DS_Store?
4
+
5
+ # vscode
6
+ .vscode
7
+
8
+ # env file
9
+ .env
10
+
11
+ # Vim files
12
+ *.sw[mnop]
13
+
14
+ # Notebooks used for presentations
15
+ notebooks_plots/
16
+
17
+ # Test output
18
+ tests/out/
19
+
20
+ # .pyenv files
21
+ .python-version
22
+
23
+ # pytest files
24
+ .pytest_cache/
25
+
26
+ # Jupyter files
27
+ *.ipynb_checkpoints
28
+
29
+ # Python build files
30
+ build/
31
+
32
+ # Rope Files
33
+ .ropeproject/
34
+
35
+ # Byte-compiled / optimized / DLL files
36
+ __pycache__/
37
+ *.py[cod]
38
+ *$py.class
39
+
40
+ # Setuptools distribution folder.
41
+ /dist/
42
+
43
+ # Python egg metadata, regenerated from source files by setuptools.
44
+ **/*.egg-info
45
+
46
+ # Environments
47
+ .env
48
+ .envrc
49
+
50
+ # Gdal and other image formats
51
+ *.tif
52
+ *.xml
53
+ *.shp
54
+ *.sbx
55
+ *.sbn
56
+ *.shx
57
+ *.prj
58
+ *.qpj
59
+ *.dbf
60
+ *.cpg
61
+ *.msk
62
+ *.kmz
63
+ *.jpg
64
+ *.wld
65
+ *.geojson
66
+ *.tif
67
+
68
+ # VRT
69
+ *.vrt
70
+ *.wgs84
71
+
72
+ # Log files
73
+ *.log
74
+
75
+ # Pickle Data
76
+ *.pkl
77
+
78
+ # Ignore pdf Files
79
+ *.pdf
80
+
81
+ # Ignore json
82
+ *.json
83
+
84
+ # Coverage
85
+ *.coverage
86
+
87
+ # pre-commit
88
+ .pre-commit-config.yaml
89
+
90
+ # Ruff
91
+ .ruff_cache/
92
+
93
+ # Data directory
94
+ **/out/
95
+
96
+ # Notebooks
97
+ notebooks/*.parquet
98
+
99
+ # out tests
100
+ tests/tmp/
101
+ tests/out/
@@ -0,0 +1,175 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
7
+ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [1.0.8] - 2025-11-10
10
+
11
+ ### Changed
12
+ * Updated all tables to use
13
+ - Water mask generated by UMD water mask utilized by DIST-S1
14
+ - Burst to use the correct geometries see v1.0.6
15
+ - 100 km^2 minimum overlap of burst data and MGRS tile.
16
+
17
+
18
+ ## [1.0.7] - 2025-10-24
19
+
20
+ ### Added
21
+ * Updated print statements for multi-window to show the max number of pre-images per year.
22
+
23
+
24
+ ## [1.0.6] - 2025-10-09
25
+
26
+ ### Added
27
+ * Tests for MGRS tiles and burst geometries ensuring they overlap the antimeridian if and only if they are multipolygons.
28
+ * Updated readme with information about these mgrs/burst geometries and the dateline.
29
+ * Updated burst geometries using geopackage geometry from opera_adt/burst_db. See this issue: https://github.com/opera-adt/burst_db/issues/120 - some dateline geometries were cut off. The new geometries are larger and the table went from 24 MB to 37 MB. See this notebook: https://github.com/OPERA-Cal-Val/dist-s1-research/blob/dev/marshak/Zb_update_burst_table/Update%20Burst%20Geometries%20Using%20Geopackage.ipynb
30
+
31
+ ## [1.0.5] - 2025-09-29
32
+
33
+ ### Fixed
34
+ * CMR metadata does not have correctly migrated urls from ASF datapool to ASF cumulus - see https://github.com/opera-adt/dist-s1/issues/158.
35
+
36
+
37
+ ## [1.0.4] - 2025-09-29
38
+
39
+ ### Added
40
+ * Update time-series enumeration for multiple polarizations within an MGRS tile.
41
+ - We now ensure that for each MGRS tile, a single fixed spatial burst creates a baseline (set of pre-images) for a given RTC-S1 burst product. That is, if the recent data was VV+VH in a burst, then the baseline for that burst VV+VH. Multiple dual polarization (i.e. both VV+VH and HH+HV) data can be used within a single MGRS tile.
42
+ * We now ensure that single polarization data is excluded from baselines and not used in the creation of the post-image set.
43
+
44
+ ### Fixed
45
+ * Bug in enumerating 1 product - we did not ensure spatial bursts were consistent between pre-/post-image sets.
46
+
47
+
48
+ ## [1.0.3] - 2025-09-09
49
+
50
+ ### Fixed
51
+ * Defaults for `lookback_delta_days` from 0 to 365 in enumeration of multiple products. Leading to submission of jobs that had no baseline (see Issue: https://github.com/opera-adt/dist-s1-enumerator/issues/44)
52
+ * Renamed variables for easier tracking in `enumerat_dist_s1_products`.
53
+
54
+ ## [1.0.2] - 2025-09-09
55
+
56
+ ### Changed
57
+ * `backoff` library is removed and we now use `tenacity`
58
+
59
+ ### Added
60
+ * Uses sessions and adapters to handle mutiple concurrent requests more reliably.
61
+
62
+ ## [1.0.1] - 2025-08-07
63
+
64
+ ### Added
65
+ * Improved tqdm outputs for enumeration of 1 dist-s1 product with multiwindow
66
+ * Added back more print statements
67
+
68
+ ## [1.0.0] - 2025-08-05
69
+
70
+ ### Changed
71
+ - `multi_window` is now the default parameter
72
+ - Consolidated `*_mw` and other parameters for single API.
73
+ - Assumes 3 anniversary dates for multi_window strategy
74
+
75
+ ### Fixed
76
+ - New pandera import works only on 0.24.0
77
+ - Allow for acquisition metadata to be obtained around anniversary date
78
+ - Typing of functions.
79
+
80
+ ### Removed
81
+ - print statements
82
+
83
+ ### Added
84
+ - `reorder_columns` can accept empty dataframes and creates empty table with schema (important for longer number of pre-image anniversaries), where there may be no acquisitions available.
85
+ - More docstring information on the enumeration functions
86
+ - pydantic models for updating/validating with `immediate_lookback` and `multi_window` strategy
87
+ - Function to get inputs for triggering `dist-s1` workflow (not necessarily all the RTC input data).
88
+ - Tests for multi-window lookback strategy
89
+ - Tests for workflow inputs
90
+
91
+
92
+ ## [0.0.9] - 2025-06-06
93
+
94
+ ### Fixed
95
+ - Pandera imports are changing and currently raising lots of warnings. We resolve these warnings.
96
+
97
+ ## [0.0.8] - 2025-05-27
98
+
99
+ ### Added
100
+ * Implemented `lookback_strategy` in `dist_enum`
101
+ * Use option `immediate_lookback` to search for the pre dates immediatelly before the `post_date`
102
+ * Use option `multi_window` to search for pre dates as windows defined by `max_pre_imgs_per_burst_mw` and `delta_lookback_days_mw`
103
+
104
+
105
+ ## [0.0.7] - 2025-01-16
106
+
107
+ ### Fixed
108
+ * Fixed bug where RTC-S1 data was not being sorted by `jpl_burst_id` and `acq_dt` - this was causing us to establish baseline imagery from incorrect position
109
+
110
+
111
+ ## [0.0.6] - 2025-01-16
112
+
113
+ ## Changed
114
+ * Renamed `disable_tqdm` to `tqdm_enabled` in `localize_rtc_s1_ts`
115
+
116
+ ## Added
117
+ * Description to `tqdm` progress bar in `localize_rtc_s1_ts`.
118
+ * Use `tqdm.auto` to automatically determine how `tqdm` should be displayed (either via CLI or in a notebook).
119
+
120
+ ## [0.0.5] - 2025-01-16
121
+
122
+ * Dummy release due to expired github token.
123
+
124
+ ## [0.0.4] - 2024-12-30
125
+
126
+ ### Removed
127
+ * Removed `papermill` from environment.yml as it is not supported by 3.13
128
+
129
+ ### Added
130
+ * Added `localize_rtc_s1_ts` to top-level imports
131
+ * Allowed `post_date` to be a string in the form of 'YYYY-MM-DD' for one product enumeration
132
+ * Schema for localized inputs to ensure columns for local paths: `loc_path_copol` and `loc_path_crosspol`
133
+
134
+ ### Changed
135
+ * Added print date in notebook for clarity.
136
+ * Remove schema check from `append_pass_data` and enforce only certain columns to be present.
137
+
138
+
139
+ ## [0.0.3] - 2024-12-12
140
+
141
+ ### Added
142
+ * Support for Python 3.13
143
+ * Explicit error messages when no data is retrieved from various tables (e.g. burst data, MGRS/burst LUT data, etc.)
144
+ * Suite of tests for enumeration
145
+ * Unit tests - tests that can be run in a quick fashion and will be run on each PR to main/dev
146
+ * Integration tests - in our case, hitting the DAAC API and downloading data when necessary; these also include running the Notebooks.
147
+ * The latter is marked with `@pytest.mark.integration` and will be run on PRs to main (i.e. release PRs)
148
+ * Schema with Pandera to explicitly define and validate columns and their types
149
+ * Flexibility to retrieve either HH+HV or VV+VH or target one particular dual polarization type (currently does not support mixtures of dual polarized data).
150
+ * Expose the primary functions via the `__init__.py` file
151
+ * Updated environment.yml for Papermill tests
152
+
153
+ ## Fixed
154
+ * `epsg` (now `utm_epsg`) was a string (with extra spacing) and now it's an integer
155
+
156
+ ## Changed
157
+ * For the MGRS table, we renamed `epsg` to `utm_epsg` (to be in line with `utm_wkt`) and cast it as an int
158
+
159
+ ## [0.0.2]
160
+
161
+ ### Added
162
+ 1. Minimum working example of enumeration of DIST-S1 products from MGRS tiles and (optionally) a track number in said MGRS tiles.
163
+
164
+ ### Changed
165
+ API is *very* much in flux to support enumeration of large spatial areas and to support the localization of RTC-S1 data. Will likely continue to change to promote changing.
166
+
167
+ ## [0.0.1]
168
+
169
+ The initial release of this library. This library provides:
170
+
171
+ 1. Enumeration of DIST-S1-ALERT products. A DIST-S1-ALERT product can be uniquely identified (assuming a pre-image selection process is fixed)by:
172
+ + MGRS tile
173
+ + Acquisition time of the post-image
174
+ + Track of the post-image
175
+ 2. Ability to localize OPERA RTC-S1 data for the creation of the DIST-S1 product.