RSRF 0.0.1__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 (81) hide show
  1. rsrf-0.0.1/MANIFEST.in +11 -0
  2. rsrf-0.0.1/PKG-INFO +207 -0
  3. rsrf-0.0.1/README.md +158 -0
  4. rsrf-0.0.1/docs/assets/javascripts/rsrf-visualizations-v2.js +946 -0
  5. rsrf-0.0.1/docs/assets/javascripts/rsrf-visualizations-v3.js +1047 -0
  6. rsrf-0.0.1/docs/assets/javascripts/rsrf-visualizations.js +875 -0
  7. rsrf-0.0.1/docs/assets/stylesheets/rsrf-visualizations-v2.css +412 -0
  8. rsrf-0.0.1/docs/assets/stylesheets/rsrf-visualizations-v3.css +449 -0
  9. rsrf-0.0.1/docs/assets/stylesheets/rsrf-visualizations.css +408 -0
  10. rsrf-0.0.1/docs/cli.md +42 -0
  11. rsrf-0.0.1/docs/data-model.md +68 -0
  12. rsrf-0.0.1/docs/decisions/README.md +12 -0
  13. rsrf-0.0.1/docs/decisions/adr-0001-canonical-split.md +34 -0
  14. rsrf-0.0.1/docs/decisions/index.md +7 -0
  15. rsrf-0.0.1/docs/development.md +46 -0
  16. rsrf-0.0.1/docs/getting-started.md +61 -0
  17. rsrf-0.0.1/docs/index.md +30 -0
  18. rsrf-0.0.1/docs/releasing.md +40 -0
  19. rsrf-0.0.1/docs/repository-layout.md +53 -0
  20. rsrf-0.0.1/docs/sensor-notes/README.md +12 -0
  21. rsrf-0.0.1/docs/sensor-notes/desis.md +23 -0
  22. rsrf-0.0.1/docs/sensor-notes/index.md +16 -0
  23. rsrf-0.0.1/docs/sensor-notes/p2_optical_bucket.md +42 -0
  24. rsrf-0.0.1/docs/sensor-notes/prisma.md +41 -0
  25. rsrf-0.0.1/docs/visualizations.md +137 -0
  26. rsrf-0.0.1/mkdocs.yml +50 -0
  27. rsrf-0.0.1/pyproject.toml +80 -0
  28. rsrf-0.0.1/scripts/build/README.md +11 -0
  29. rsrf-0.0.1/scripts/build/export_docs_visualization_assets.py +48 -0
  30. rsrf-0.0.1/scripts/build/register_p2_planned_sensors.py +53 -0
  31. rsrf-0.0.1/scripts/ingest/ingest_band_spec_table.py +102 -0
  32. rsrf-0.0.1/scripts/ingest/ingest_sampled_curve.py +98 -0
  33. rsrf-0.0.1/scripts/ingest/ingest_sentinel2_srf.py +79 -0
  34. rsrf-0.0.1/scripts/validate/README.md +15 -0
  35. rsrf-0.0.1/scripts/validate/generate_validation_report.py +60 -0
  36. rsrf-0.0.1/scripts/validate/refresh_validation_fixtures.py +61 -0
  37. rsrf-0.0.1/setup.cfg +4 -0
  38. rsrf-0.0.1/src/RSRF.egg-info/PKG-INFO +207 -0
  39. rsrf-0.0.1/src/RSRF.egg-info/SOURCES.txt +79 -0
  40. rsrf-0.0.1/src/RSRF.egg-info/dependency_links.txt +1 -0
  41. rsrf-0.0.1/src/RSRF.egg-info/entry_points.txt +2 -0
  42. rsrf-0.0.1/src/RSRF.egg-info/requires.txt +30 -0
  43. rsrf-0.0.1/src/RSRF.egg-info/top_level.txt +1 -0
  44. rsrf-0.0.1/src/rsrf/__init__.py +88 -0
  45. rsrf-0.0.1/src/rsrf/__main__.py +7 -0
  46. rsrf-0.0.1/src/rsrf/api.py +272 -0
  47. rsrf-0.0.1/src/rsrf/band_specs.py +47 -0
  48. rsrf-0.0.1/src/rsrf/cli.py +6 -0
  49. rsrf-0.0.1/src/rsrf/commands/__init__.py +6 -0
  50. rsrf-0.0.1/src/rsrf/commands/app.py +49 -0
  51. rsrf-0.0.1/src/rsrf/commands/handlers.py +213 -0
  52. rsrf-0.0.1/src/rsrf/commands/parser.py +144 -0
  53. rsrf-0.0.1/src/rsrf/commands/render.py +88 -0
  54. rsrf-0.0.1/src/rsrf/convolve.py +95 -0
  55. rsrf-0.0.1/src/rsrf/ingest.py +324 -0
  56. rsrf-0.0.1/src/rsrf/io.py +196 -0
  57. rsrf-0.0.1/src/rsrf/manifests.py +108 -0
  58. rsrf-0.0.1/src/rsrf/models.py +834 -0
  59. rsrf-0.0.1/src/rsrf/parsers/__init__.py +32 -0
  60. rsrf-0.0.1/src/rsrf/parsers/band_spec_table.py +169 -0
  61. rsrf-0.0.1/src/rsrf/parsers/common.py +188 -0
  62. rsrf-0.0.1/src/rsrf/parsers/emit.py +115 -0
  63. rsrf-0.0.1/src/rsrf/parsers/enmap.py +119 -0
  64. rsrf-0.0.1/src/rsrf/parsers/landsat_tirs.py +97 -0
  65. rsrf-0.0.1/src/rsrf/parsers/modis.py +114 -0
  66. rsrf-0.0.1/src/rsrf/parsers/multiband_curve_csv.py +117 -0
  67. rsrf-0.0.1/src/rsrf/parsers/obpg.py +222 -0
  68. rsrf-0.0.1/src/rsrf/parsers/olci.py +54 -0
  69. rsrf-0.0.1/src/rsrf/parsers/prisma.py +168 -0
  70. rsrf-0.0.1/src/rsrf/parsers/probav.py +75 -0
  71. rsrf-0.0.1/src/rsrf/parsers/sentinel2.py +265 -0
  72. rsrf-0.0.1/src/rsrf/parsers/usgs_json.py +171 -0
  73. rsrf-0.0.1/src/rsrf/parsers/viirs.py +128 -0
  74. rsrf-0.0.1/src/rsrf/planning.py +193 -0
  75. rsrf-0.0.1/src/rsrf/plotting.py +211 -0
  76. rsrf-0.0.1/src/rsrf/qa.py +697 -0
  77. rsrf-0.0.1/src/rsrf/realize.py +114 -0
  78. rsrf-0.0.1/src/rsrf/registry.py +462 -0
  79. rsrf-0.0.1/src/rsrf/resample.py +28 -0
  80. rsrf-0.0.1/src/rsrf/validate.py +52 -0
  81. rsrf-0.0.1/src/rsrf/visualization.py +334 -0
rsrf-0.0.1/MANIFEST.in ADDED
@@ -0,0 +1,11 @@
1
+ include README.md
2
+ include mkdocs.yml
3
+ graft src
4
+ graft docs
5
+ graft scripts
6
+ prune docs/assets/visualization
7
+ prune data
8
+ prune sources
9
+ prune tests
10
+ global-exclude __pycache__
11
+ global-exclude *.py[cod]
rsrf-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,207 @@
1
+ Metadata-Version: 2.4
2
+ Name: RSRF
3
+ Version: 0.0.1
4
+ Summary: Canonical spectral response definitions, ingest tooling, and QA workflows for optical satellite sensors.
5
+ License-Expression: LicenseRef-RepositorySpecific
6
+ Project-URL: Homepage, https://github.com/MarcYin/spectral_response
7
+ Project-URL: Documentation, https://marcyin.github.io/spectral_response/
8
+ Project-URL: Repository, https://github.com/MarcYin/spectral_response
9
+ Project-URL: Issues, https://github.com/MarcYin/spectral_response/issues
10
+ Keywords: spectral response,remote sensing,satellite,hyperspectral,multispectral
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Classifier: Topic :: Scientific/Engineering :: GIS
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: numpy>=1.21
25
+ Requires-Dist: openpyxl>=3.1
26
+ Requires-Dist: pandas>=1.5
27
+ Requires-Dist: pyarrow>=10
28
+ Provides-Extra: docs
29
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
30
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
31
+ Provides-Extra: ingest
32
+ Requires-Dist: h5py>=3.8; extra == "ingest"
33
+ Requires-Dist: netCDF4>=1.6; extra == "ingest"
34
+ Requires-Dist: xarray>=2023.0; extra == "ingest"
35
+ Provides-Extra: qa
36
+ Requires-Dist: matplotlib>=3.5; extra == "qa"
37
+ Provides-Extra: release
38
+ Requires-Dist: build>=1.2; extra == "release"
39
+ Requires-Dist: twine>=5.1; extra == "release"
40
+ Provides-Extra: dev
41
+ Requires-Dist: h5py>=3.8; extra == "dev"
42
+ Requires-Dist: matplotlib>=3.5; extra == "dev"
43
+ Requires-Dist: mkdocs>=1.6; extra == "dev"
44
+ Requires-Dist: mkdocs-material>=9.5; extra == "dev"
45
+ Requires-Dist: netCDF4>=1.6; extra == "dev"
46
+ Requires-Dist: build>=1.2; extra == "dev"
47
+ Requires-Dist: twine>=5.1; extra == "dev"
48
+ Requires-Dist: xarray>=2023.0; extra == "dev"
49
+
50
+ # RSRF
51
+
52
+ ![rsrfs](figs/rsrfs.png)
53
+
54
+ `RSRF` is a repository-backed Python toolkit for canonical optical sensor spectral response definitions.
55
+
56
+ It combines three things that usually drift apart:
57
+
58
+ - a clean Python API for reading sampled curves and metadata-only band specs
59
+ - reproducible ingest tooling for official upstream response artifacts
60
+ - QA and release workflows for maintaining a curated response repository
61
+
62
+ The PyPI distribution name is `RSRF`. The import package is `rsrf`.
63
+
64
+ > **Explore the RSRFs in your browser:** [https://marcyin.github.io/spectral_response/visualizations/](https://marcyin.github.io/spectral_response/visualizations/)
65
+ >
66
+ > Use the interactive visualization page to inspect sensor bandpasses, compare overlapping responses, and quickly check the published RSRFs without setting up the repository locally.
67
+
68
+ ## Installation
69
+
70
+ During development:
71
+
72
+ ```bash
73
+ python3 -m pip install -e ".[dev]"
74
+ ```
75
+
76
+ After release:
77
+
78
+ ```bash
79
+ python3 -m pip install RSRF
80
+ ```
81
+
82
+ ## Quick start
83
+
84
+ From a repository checkout:
85
+
86
+ ```bash
87
+ export RSRF_ROOT="$PWD"
88
+ rsrf list-sensors
89
+ rsrf list-bands sentinel-2c_msi --variant band_average
90
+ rsrf show-response prisma_hsi B001 --variant metadata_band_spec
91
+ rsrf validate-sensor sentinel-2c_msi --variant band_average
92
+ ```
93
+
94
+ From Python:
95
+
96
+ ```python
97
+ from rsrf import list_sensors, load_response_definition
98
+
99
+ sensors = list_sensors()
100
+ response = load_response_definition("sentinel-2c_msi", "B01", "band_average")
101
+ ```
102
+
103
+ ## Working with repository data
104
+
105
+ The installed package does not bundle the full canonical repository, raw sources, or parquet registries. Point the code at a repository checkout or generated data root with one of these patterns:
106
+
107
+ - run commands from the repository root
108
+ - pass `--root /path/to/repo`
109
+ - set `RSRF_ROOT=/path/to/repo`
110
+
111
+ Manifest-driven commands also resolve checked-in manifest filenames directly from the manifest library, so this works from the repository root:
112
+
113
+ ```bash
114
+ rsrf validate-manifest rsrf_source_manifest_sentinel2c_v2.json
115
+ rsrf register-manifest rsrf_source_manifest_prisma_hsi_v2.json
116
+ ```
117
+
118
+ ## Repository structure
119
+
120
+ ```text
121
+ .
122
+ |-- data/
123
+ | |-- canonical/
124
+ | |-- common_grid/
125
+ | |-- realized/
126
+ | `-- registry/
127
+ |-- docs/
128
+ |-- plans/
129
+ |-- scripts/
130
+ | |-- build/
131
+ | |-- ingest/
132
+ | `-- validate/
133
+ |-- sources/
134
+ | |-- extracted/
135
+ | |-- manifests/
136
+ | | |-- official/
137
+ | | |-- planning/
138
+ | | `-- templates/
139
+ | `-- raw/
140
+ |-- src/rsrf/
141
+ | |-- commands/
142
+ | `-- parsers/
143
+ `-- tests/
144
+ ```
145
+
146
+ The package is organized so users can navigate by concern:
147
+
148
+ - `src/rsrf/api.py`: read-side access to canonical sensor definitions
149
+ - `src/rsrf/commands/`: CLI parser, dispatch, and output helpers
150
+ - `src/rsrf/ingest.py`: canonical artifact writing and registry updates
151
+ - `src/rsrf/manifests.py`: manifest library lookup and path resolution
152
+ - `src/rsrf/parsers/`: sensor-family-specific source parsers
153
+ - `src/rsrf/planning.py`: registry-first planning catalog support
154
+ - `src/rsrf/qa.py`: validation reports and plot export
155
+ - `src/rsrf/registry.py`: repository layout and parquet registry helpers
156
+
157
+ Trusted sampled-curve overlays live at:
158
+
159
+ ```text
160
+ sources/extracted/<sensor_unit_id>/<representation_variant>/overlay_reference.csv
161
+ ```
162
+
163
+ ## Current coverage
164
+
165
+ The repository currently includes:
166
+
167
+ - sampled-curve families across Sentinel-2, Landsat MSS/TM/ETM+/OLI/TIRS, MODIS, VIIRS, OLCI, ASTER, Planet, PROBA-V, and legacy NASA OBPG ocean-colour missions
168
+ - band-spec families across PACE OCI, EnMAP, EMIT, PRISMA, Satellogic NewSat, Pleiades, Pleiades-Neo, SPOT-6/7, FORMOSAT-5, Amazonia-1, and CBERS-4A
169
+ - optional realized Gaussian approximations when official full sampled curves are not published
170
+
171
+ The remaining notable gap from the original roadmap is `DESIS`.
172
+
173
+ ## Documentation
174
+
175
+ Project documentation is built with MkDocs:
176
+
177
+ - [https://marcyin.github.io/spectral_response/](https://marcyin.github.io/spectral_response/)
178
+
179
+ Key entry points:
180
+
181
+ - getting started: [`docs/getting-started.md`](docs/getting-started.md)
182
+ - interactive visualizations: [https://marcyin.github.io/spectral_response/visualizations/](https://marcyin.github.io/spectral_response/visualizations/) ([`docs/visualizations.md`](docs/visualizations.md))
183
+ - repository layout: [`docs/repository-layout.md`](docs/repository-layout.md)
184
+ - CLI reference: [`docs/cli.md`](docs/cli.md)
185
+ - data model: [`docs/data-model.md`](docs/data-model.md)
186
+ - development guide: [`docs/development.md`](docs/development.md)
187
+ - release guide: [`docs/releasing.md`](docs/releasing.md)
188
+
189
+ ## Development
190
+
191
+ Run the local verification stack with:
192
+
193
+ ```bash
194
+ python3 -m unittest discover -s tests/unit
195
+ python3 -m unittest discover -s tests/regression
196
+ python3 scripts/build/export_docs_visualization_assets.py --root .
197
+ python3 -m build
198
+ python3 -m twine check dist/*
199
+ mkdocs build --strict
200
+ ```
201
+
202
+ ## Project status
203
+
204
+ The active design and implementation history now live under `plans/`:
205
+
206
+ - [`plans/rsrf_repo_plan_v3_hyperspectral_support.md`](plans/rsrf_repo_plan_v3_hyperspectral_support.md)
207
+ - [`plans/rsrf_implementation_plan.md`](plans/rsrf_implementation_plan.md)
rsrf-0.0.1/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # RSRF
2
+
3
+ ![rsrfs](figs/rsrfs.png)
4
+
5
+ `RSRF` is a repository-backed Python toolkit for canonical optical sensor spectral response definitions.
6
+
7
+ It combines three things that usually drift apart:
8
+
9
+ - a clean Python API for reading sampled curves and metadata-only band specs
10
+ - reproducible ingest tooling for official upstream response artifacts
11
+ - QA and release workflows for maintaining a curated response repository
12
+
13
+ The PyPI distribution name is `RSRF`. The import package is `rsrf`.
14
+
15
+ > **Explore the RSRFs in your browser:** [https://marcyin.github.io/spectral_response/visualizations/](https://marcyin.github.io/spectral_response/visualizations/)
16
+ >
17
+ > Use the interactive visualization page to inspect sensor bandpasses, compare overlapping responses, and quickly check the published RSRFs without setting up the repository locally.
18
+
19
+ ## Installation
20
+
21
+ During development:
22
+
23
+ ```bash
24
+ python3 -m pip install -e ".[dev]"
25
+ ```
26
+
27
+ After release:
28
+
29
+ ```bash
30
+ python3 -m pip install RSRF
31
+ ```
32
+
33
+ ## Quick start
34
+
35
+ From a repository checkout:
36
+
37
+ ```bash
38
+ export RSRF_ROOT="$PWD"
39
+ rsrf list-sensors
40
+ rsrf list-bands sentinel-2c_msi --variant band_average
41
+ rsrf show-response prisma_hsi B001 --variant metadata_band_spec
42
+ rsrf validate-sensor sentinel-2c_msi --variant band_average
43
+ ```
44
+
45
+ From Python:
46
+
47
+ ```python
48
+ from rsrf import list_sensors, load_response_definition
49
+
50
+ sensors = list_sensors()
51
+ response = load_response_definition("sentinel-2c_msi", "B01", "band_average")
52
+ ```
53
+
54
+ ## Working with repository data
55
+
56
+ The installed package does not bundle the full canonical repository, raw sources, or parquet registries. Point the code at a repository checkout or generated data root with one of these patterns:
57
+
58
+ - run commands from the repository root
59
+ - pass `--root /path/to/repo`
60
+ - set `RSRF_ROOT=/path/to/repo`
61
+
62
+ Manifest-driven commands also resolve checked-in manifest filenames directly from the manifest library, so this works from the repository root:
63
+
64
+ ```bash
65
+ rsrf validate-manifest rsrf_source_manifest_sentinel2c_v2.json
66
+ rsrf register-manifest rsrf_source_manifest_prisma_hsi_v2.json
67
+ ```
68
+
69
+ ## Repository structure
70
+
71
+ ```text
72
+ .
73
+ |-- data/
74
+ | |-- canonical/
75
+ | |-- common_grid/
76
+ | |-- realized/
77
+ | `-- registry/
78
+ |-- docs/
79
+ |-- plans/
80
+ |-- scripts/
81
+ | |-- build/
82
+ | |-- ingest/
83
+ | `-- validate/
84
+ |-- sources/
85
+ | |-- extracted/
86
+ | |-- manifests/
87
+ | | |-- official/
88
+ | | |-- planning/
89
+ | | `-- templates/
90
+ | `-- raw/
91
+ |-- src/rsrf/
92
+ | |-- commands/
93
+ | `-- parsers/
94
+ `-- tests/
95
+ ```
96
+
97
+ The package is organized so users can navigate by concern:
98
+
99
+ - `src/rsrf/api.py`: read-side access to canonical sensor definitions
100
+ - `src/rsrf/commands/`: CLI parser, dispatch, and output helpers
101
+ - `src/rsrf/ingest.py`: canonical artifact writing and registry updates
102
+ - `src/rsrf/manifests.py`: manifest library lookup and path resolution
103
+ - `src/rsrf/parsers/`: sensor-family-specific source parsers
104
+ - `src/rsrf/planning.py`: registry-first planning catalog support
105
+ - `src/rsrf/qa.py`: validation reports and plot export
106
+ - `src/rsrf/registry.py`: repository layout and parquet registry helpers
107
+
108
+ Trusted sampled-curve overlays live at:
109
+
110
+ ```text
111
+ sources/extracted/<sensor_unit_id>/<representation_variant>/overlay_reference.csv
112
+ ```
113
+
114
+ ## Current coverage
115
+
116
+ The repository currently includes:
117
+
118
+ - sampled-curve families across Sentinel-2, Landsat MSS/TM/ETM+/OLI/TIRS, MODIS, VIIRS, OLCI, ASTER, Planet, PROBA-V, and legacy NASA OBPG ocean-colour missions
119
+ - band-spec families across PACE OCI, EnMAP, EMIT, PRISMA, Satellogic NewSat, Pleiades, Pleiades-Neo, SPOT-6/7, FORMOSAT-5, Amazonia-1, and CBERS-4A
120
+ - optional realized Gaussian approximations when official full sampled curves are not published
121
+
122
+ The remaining notable gap from the original roadmap is `DESIS`.
123
+
124
+ ## Documentation
125
+
126
+ Project documentation is built with MkDocs:
127
+
128
+ - [https://marcyin.github.io/spectral_response/](https://marcyin.github.io/spectral_response/)
129
+
130
+ Key entry points:
131
+
132
+ - getting started: [`docs/getting-started.md`](docs/getting-started.md)
133
+ - interactive visualizations: [https://marcyin.github.io/spectral_response/visualizations/](https://marcyin.github.io/spectral_response/visualizations/) ([`docs/visualizations.md`](docs/visualizations.md))
134
+ - repository layout: [`docs/repository-layout.md`](docs/repository-layout.md)
135
+ - CLI reference: [`docs/cli.md`](docs/cli.md)
136
+ - data model: [`docs/data-model.md`](docs/data-model.md)
137
+ - development guide: [`docs/development.md`](docs/development.md)
138
+ - release guide: [`docs/releasing.md`](docs/releasing.md)
139
+
140
+ ## Development
141
+
142
+ Run the local verification stack with:
143
+
144
+ ```bash
145
+ python3 -m unittest discover -s tests/unit
146
+ python3 -m unittest discover -s tests/regression
147
+ python3 scripts/build/export_docs_visualization_assets.py --root .
148
+ python3 -m build
149
+ python3 -m twine check dist/*
150
+ mkdocs build --strict
151
+ ```
152
+
153
+ ## Project status
154
+
155
+ The active design and implementation history now live under `plans/`:
156
+
157
+ - [`plans/rsrf_repo_plan_v3_hyperspectral_support.md`](plans/rsrf_repo_plan_v3_hyperspectral_support.md)
158
+ - [`plans/rsrf_implementation_plan.md`](plans/rsrf_implementation_plan.md)