cwaves 2026.12.4__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.
- cwaves-2026.12.4/.gitignore +44 -0
- cwaves-2026.12.4/LICENSE +21 -0
- cwaves-2026.12.4/PKG-INFO +151 -0
- cwaves-2026.12.4/README.md +102 -0
- cwaves-2026.12.4/assets/l1b-s1b-iw2-xsp-fixture.nc +0 -0
- cwaves-2026.12.4/assets/s1a-iw1-osw-vv-fixture.nc +0 -0
- cwaves-2026.12.4/assets/s1a-wv1-ocn-vv-20250501t060101-058996-075117-001.nc +0 -0
- cwaves-2026.12.4/assets/s1a_wv1_xsp_20250501t060101_058996_075117_dd24_a24.nc +0 -0
- cwaves-2026.12.4/assets/s1d-wv1-ocn-vv-20260802t194456-20260802t194459-003951-00729e-013.nc +0 -0
- cwaves-2026.12.4/cwaves/__init__.py +62 -0
- cwaves-2026.12.4/cwaves/_version.py +24 -0
- cwaves-2026.12.4/cwaves/client.py +387 -0
- cwaves-2026.12.4/cwaves/compute_cwaves.py +483 -0
- cwaves-2026.12.4/cwaves/config.py +45 -0
- cwaves-2026.12.4/cwaves/default_config.yml +38 -0
- cwaves-2026.12.4/cwaves/grid.py +443 -0
- cwaves-2026.12.4/cwaves/reconstruct.py +240 -0
- cwaves-2026.12.4/cwaves/scripts/__init__.py +1 -0
- cwaves-2026.12.4/cwaves/scripts/cwave_certification_report.py +2919 -0
- cwaves-2026.12.4/cwaves/scripts/cwave_listing_compare.py +395 -0
- cwaves-2026.12.4/cwaves/scripts/iw_cwaves_map.py +495 -0
- cwaves-2026.12.4/cwaves/scripts/plot_kernels.py +479 -0
- cwaves-2026.12.4/cwaves/symmetrize_xspectra.py +53 -0
- cwaves-2026.12.4/lean/README.md +13 -0
- cwaves-2026.12.4/pyproject.toml +187 -0
- cwaves-2026.12.4/tests/conftest.py +112 -0
- cwaves-2026.12.4/tests/test_client.py +170 -0
- cwaves-2026.12.4/tests/test_complex.py +115 -0
- cwaves-2026.12.4/tests/test_cwave_certification_report.py +1543 -0
- cwaves-2026.12.4/tests/test_cwave_listing_compare.py +174 -0
- cwaves-2026.12.4/tests/test_cwaves.py +430 -0
- cwaves-2026.12.4/tests/test_grid.py +283 -0
- cwaves-2026.12.4/tests/test_iw_cwaves_map.py +236 -0
- cwaves-2026.12.4/tests/test_plot_kernels.py +248 -0
- cwaves-2026.12.4/tests/test_reconstruct.py +114 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Byte-compiled / optimized
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
|
|
12
|
+
# Testing / coverage
|
|
13
|
+
.pytest_cache/
|
|
14
|
+
.coverage
|
|
15
|
+
.coverage.*
|
|
16
|
+
coverage.xml
|
|
17
|
+
htmlcov/
|
|
18
|
+
.tox/
|
|
19
|
+
|
|
20
|
+
# Type checkers
|
|
21
|
+
.mypy_cache/
|
|
22
|
+
.dmypy.json
|
|
23
|
+
dmypy.json
|
|
24
|
+
|
|
25
|
+
# Jupyter
|
|
26
|
+
.ipynb_checkpoints/
|
|
27
|
+
|
|
28
|
+
# Sphinx
|
|
29
|
+
docs/_build/
|
|
30
|
+
|
|
31
|
+
# Environments
|
|
32
|
+
.env
|
|
33
|
+
.venv/
|
|
34
|
+
env/
|
|
35
|
+
venv/
|
|
36
|
+
|
|
37
|
+
# Version file generated by hatch-vcs at build time
|
|
38
|
+
cwaves/_version.py
|
|
39
|
+
|
|
40
|
+
# OS
|
|
41
|
+
.DS_Store
|
|
42
|
+
|
|
43
|
+
# Apptainer images
|
|
44
|
+
*.sif
|
cwaves-2026.12.4/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antoine Grouazel / IFREMER
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cwaves
|
|
3
|
+
Version: 2026.12.4
|
|
4
|
+
Summary: lib python to compute CWAVE parameters from SAR ocean cross-spectra (Schulz-Stellenfleth et al. 2007)
|
|
5
|
+
Project-URL: repository, https://github.com/s1tools/CWAVES
|
|
6
|
+
Project-URL: homepage, https://github.com/s1tools/CWAVES
|
|
7
|
+
Project-URL: documentation, https://cwaves.readthedocs.io
|
|
8
|
+
Author-email: Antoine Grouazel <antoine.grouazel@ifremer.fr>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: CWAVE,SAR,cross-spectrum,ocean,sentinel1,wavenumber,waves
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: dask
|
|
23
|
+
Requires-Dist: h5netcdf
|
|
24
|
+
Requires-Dist: h5py
|
|
25
|
+
Requires-Dist: matplotlib
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: pyyaml
|
|
28
|
+
Requires-Dist: scipy
|
|
29
|
+
Requires-Dist: xarray
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: bandit; extra == 'dev'
|
|
32
|
+
Requires-Dist: cartopy; extra == 'dev'
|
|
33
|
+
Requires-Dist: codespell; extra == 'dev'
|
|
34
|
+
Requires-Dist: coverage; extra == 'dev'
|
|
35
|
+
Requires-Dist: coverage-badge; extra == 'dev'
|
|
36
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy-extensions; extra == 'dev'
|
|
38
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
42
|
+
Provides-Extra: docs
|
|
43
|
+
Requires-Dist: matplotlib; extra == 'docs'
|
|
44
|
+
Requires-Dist: sphinx; extra == 'docs'
|
|
45
|
+
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
|
|
46
|
+
Provides-Extra: scripts
|
|
47
|
+
Requires-Dist: cartopy; extra == 'scripts'
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
# CWAVES
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/cwaves/)
|
|
53
|
+
[](https://github.com/s1tools/CWAVES/actions/workflows/build.yml)
|
|
54
|
+
[](https://codecov.io/gh/s1tools/CWAVES)
|
|
55
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
56
|
+
[](https://www.python.org/)
|
|
57
|
+
[](https://opensource.org/licenses/MIT)
|
|
58
|
+
|
|
59
|
+
`cwaves` is a Python library to compute **CWAVE parameters** from ocean wave
|
|
60
|
+
and SAR spectra (cartesian or polar grids, half or full plane, real or
|
|
61
|
+
complex). It implements the orthonormal kernel decomposition described in :
|
|
62
|
+
|
|
63
|
+
> J. Schulz-Stellenfleth, T. Konig, and S. Lehner, "An empirical approach for the
|
|
64
|
+
> retrieval of integral ocean wave parameters from synthetic aperture radar data",
|
|
65
|
+
> **J. Geophys. Res., 112, C03019, 2007.**
|
|
66
|
+
> [doi:10.1029/2006JC003970](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2006JC003970)
|
|
67
|
+
|
|
68
|
+
The CWAVE method retrieves integral ocean wave parameters from SAR data without the
|
|
69
|
+
intermediate step of retrieving the 2D ocean wave spectrum : the spectrum is
|
|
70
|
+
projected onto a set of orthonormal kernels built as tensor products of
|
|
71
|
+
Gegenbauer polynomials (wavenumber direction, the orthonormalisation of
|
|
72
|
+
Gradshteyn & Ryzhik 7.313) and harmonic functions (angle direction), weighted by
|
|
73
|
+
the Jacobian of the wavenumber mapping. Read the
|
|
74
|
+
[limits and implementation choices](docs/limits.rst) before use.
|
|
75
|
+
|
|
76
|
+
This implementation is jointly performed by CLS (A. Benchaabane) and IFREMER
|
|
77
|
+
(A. Grouazel) as part of the Sentinel-1 Mission Performance Cluster (SAR-MPC)
|
|
78
|
+
project funded by ESA. It merges the preliminary implementations performed
|
|
79
|
+
separately by CLS and IFREMER. The CWAVE features are used as input of the ML
|
|
80
|
+
models made available by SAR-MPC in the AUX_ML2 auxiliary files published on
|
|
81
|
+
[sar-mpc.eu](https://sar-mpc.eu).
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install cwaves
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
From source :
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install -e ".[dev]"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Quick start
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
import cwaves
|
|
99
|
+
|
|
100
|
+
# spectrum: xarray.DataArray with coordinates k_rg / k_az (rad/m, cartesian,
|
|
101
|
+
# uniform or not) or k (rad/m) / phi (radians, polar); half or full plane
|
|
102
|
+
params = cwaves.compute_cwaves(spectrum, cwave_Nk=4, cwave_Nphi=5)
|
|
103
|
+
params_c = cwaves.compute_cwaves(spectrum, part="complex") # Re -> even, Im -> odd harmonics
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Command line (schema detected from the file's variables):
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cwaves --input-nc s1a_wv1_xsp.nc --output-nc cwave.nc
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Public API
|
|
113
|
+
|
|
114
|
+
| function | description |
|
|
115
|
+
|----------|-------------|
|
|
116
|
+
| `cwaves.compute_cwaves(spectrum, cwave_wlmax=600, cwave_wlmin=25, cwave_Nk=4, cwave_Nphi=5, part="modulus")` | **single entry point**: CWAVE parameters of a spectrum on any supported grid |
|
|
117
|
+
| `cwaves.compute_cwave_parameters(xs, cwave_wlmax=600, cwave_wlmin=25, cwave_Nk=4, cwave_Nphi=5, **kwargs)` | `xsar_slc`-compatible signature, delegates to `compute_cwaves` |
|
|
118
|
+
| `cwaves.compute_cwaves_from_file(path, lag=2, pol=0, **cwave)` | CWAVE of the spectrum stored in a NetCDF file (CLI `cwaves`) |
|
|
119
|
+
| `cwaves.reconstruct_spectrum(cwave_params, grid, method="mem", sigma=None)` | reconstruct a spectrum from its CWAVE parameters (maximum entropy, exact constraints; or linear) |
|
|
120
|
+
| `cwaves.compute_kernel(krg, kaz, kmin, kmax, cwave_Nk=4, cwave_Nphi=5, save_cwave_kernel=False, parity="even")` | compute the orthonormal CWAVE kernels |
|
|
121
|
+
| `cwaves.symmetrize_xspectrum(xs, dim_range='freq_sample', dim_azimuth='freq_line')` | symmetrize a one-sided cross-spectrum |
|
|
122
|
+
| `cwaves.gegenbauer_polynoms(x, nk, lbda=1.5)` | Gegenbauer polynomials `C_n^(3/2)` |
|
|
123
|
+
| `cwaves.harmonic_functions(x, nphi, parity="even")` | pi-periodic (even) or pi-antiperiodic (odd) harmonic functions |
|
|
124
|
+
|
|
125
|
+
## Axis convention
|
|
126
|
+
|
|
127
|
+
`kx = range` (`k_rg`, dimension `freq_sample`), `ky = azimuth` (`k_az`, dimension
|
|
128
|
+
`freq_line`). The major axis of the kernel ellipses is in the **range** direction.
|
|
129
|
+
|
|
130
|
+
## Corrected kernel implementation
|
|
131
|
+
|
|
132
|
+
With respect to the historical `xsar_slc` reference, this library implements the
|
|
133
|
+
**corrected** orthonormal kernels : the Gegenbauer coefficient carries the missing
|
|
134
|
+
`sqrt()` and `eta` is the exact Jacobian of the wavenumber mapping with the natural
|
|
135
|
+
logarithm. See [`repository_specifications.md`](repository_specifications.md)
|
|
136
|
+
(section 5) for the full investigation.
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pip install -e ".[dev]"
|
|
142
|
+
pre-commit install
|
|
143
|
+
pre-commit run --all-files
|
|
144
|
+
pytest -c pyproject.toml --cov=cwaves --cov-report=term-missing tests/
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
See [AGENTS.md](AGENTS.md) for the full development guide.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# CWAVES
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/cwaves/)
|
|
4
|
+
[](https://github.com/s1tools/CWAVES/actions/workflows/build.yml)
|
|
5
|
+
[](https://codecov.io/gh/s1tools/CWAVES)
|
|
6
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
7
|
+
[](https://www.python.org/)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
`cwaves` is a Python library to compute **CWAVE parameters** from ocean wave
|
|
11
|
+
and SAR spectra (cartesian or polar grids, half or full plane, real or
|
|
12
|
+
complex). It implements the orthonormal kernel decomposition described in :
|
|
13
|
+
|
|
14
|
+
> J. Schulz-Stellenfleth, T. Konig, and S. Lehner, "An empirical approach for the
|
|
15
|
+
> retrieval of integral ocean wave parameters from synthetic aperture radar data",
|
|
16
|
+
> **J. Geophys. Res., 112, C03019, 2007.**
|
|
17
|
+
> [doi:10.1029/2006JC003970](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2006JC003970)
|
|
18
|
+
|
|
19
|
+
The CWAVE method retrieves integral ocean wave parameters from SAR data without the
|
|
20
|
+
intermediate step of retrieving the 2D ocean wave spectrum : the spectrum is
|
|
21
|
+
projected onto a set of orthonormal kernels built as tensor products of
|
|
22
|
+
Gegenbauer polynomials (wavenumber direction, the orthonormalisation of
|
|
23
|
+
Gradshteyn & Ryzhik 7.313) and harmonic functions (angle direction), weighted by
|
|
24
|
+
the Jacobian of the wavenumber mapping. Read the
|
|
25
|
+
[limits and implementation choices](docs/limits.rst) before use.
|
|
26
|
+
|
|
27
|
+
This implementation is jointly performed by CLS (A. Benchaabane) and IFREMER
|
|
28
|
+
(A. Grouazel) as part of the Sentinel-1 Mission Performance Cluster (SAR-MPC)
|
|
29
|
+
project funded by ESA. It merges the preliminary implementations performed
|
|
30
|
+
separately by CLS and IFREMER. The CWAVE features are used as input of the ML
|
|
31
|
+
models made available by SAR-MPC in the AUX_ML2 auxiliary files published on
|
|
32
|
+
[sar-mpc.eu](https://sar-mpc.eu).
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install cwaves
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
From source :
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install -e ".[dev]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick start
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
import cwaves
|
|
50
|
+
|
|
51
|
+
# spectrum: xarray.DataArray with coordinates k_rg / k_az (rad/m, cartesian,
|
|
52
|
+
# uniform or not) or k (rad/m) / phi (radians, polar); half or full plane
|
|
53
|
+
params = cwaves.compute_cwaves(spectrum, cwave_Nk=4, cwave_Nphi=5)
|
|
54
|
+
params_c = cwaves.compute_cwaves(spectrum, part="complex") # Re -> even, Im -> odd harmonics
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Command line (schema detected from the file's variables):
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cwaves --input-nc s1a_wv1_xsp.nc --output-nc cwave.nc
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Public API
|
|
64
|
+
|
|
65
|
+
| function | description |
|
|
66
|
+
|----------|-------------|
|
|
67
|
+
| `cwaves.compute_cwaves(spectrum, cwave_wlmax=600, cwave_wlmin=25, cwave_Nk=4, cwave_Nphi=5, part="modulus")` | **single entry point**: CWAVE parameters of a spectrum on any supported grid |
|
|
68
|
+
| `cwaves.compute_cwave_parameters(xs, cwave_wlmax=600, cwave_wlmin=25, cwave_Nk=4, cwave_Nphi=5, **kwargs)` | `xsar_slc`-compatible signature, delegates to `compute_cwaves` |
|
|
69
|
+
| `cwaves.compute_cwaves_from_file(path, lag=2, pol=0, **cwave)` | CWAVE of the spectrum stored in a NetCDF file (CLI `cwaves`) |
|
|
70
|
+
| `cwaves.reconstruct_spectrum(cwave_params, grid, method="mem", sigma=None)` | reconstruct a spectrum from its CWAVE parameters (maximum entropy, exact constraints; or linear) |
|
|
71
|
+
| `cwaves.compute_kernel(krg, kaz, kmin, kmax, cwave_Nk=4, cwave_Nphi=5, save_cwave_kernel=False, parity="even")` | compute the orthonormal CWAVE kernels |
|
|
72
|
+
| `cwaves.symmetrize_xspectrum(xs, dim_range='freq_sample', dim_azimuth='freq_line')` | symmetrize a one-sided cross-spectrum |
|
|
73
|
+
| `cwaves.gegenbauer_polynoms(x, nk, lbda=1.5)` | Gegenbauer polynomials `C_n^(3/2)` |
|
|
74
|
+
| `cwaves.harmonic_functions(x, nphi, parity="even")` | pi-periodic (even) or pi-antiperiodic (odd) harmonic functions |
|
|
75
|
+
|
|
76
|
+
## Axis convention
|
|
77
|
+
|
|
78
|
+
`kx = range` (`k_rg`, dimension `freq_sample`), `ky = azimuth` (`k_az`, dimension
|
|
79
|
+
`freq_line`). The major axis of the kernel ellipses is in the **range** direction.
|
|
80
|
+
|
|
81
|
+
## Corrected kernel implementation
|
|
82
|
+
|
|
83
|
+
With respect to the historical `xsar_slc` reference, this library implements the
|
|
84
|
+
**corrected** orthonormal kernels : the Gegenbauer coefficient carries the missing
|
|
85
|
+
`sqrt()` and `eta` is the exact Jacobian of the wavenumber mapping with the natural
|
|
86
|
+
logarithm. See [`repository_specifications.md`](repository_specifications.md)
|
|
87
|
+
(section 5) for the full investigation.
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install -e ".[dev]"
|
|
93
|
+
pre-commit install
|
|
94
|
+
pre-commit run --all-files
|
|
95
|
+
pytest -c pyproject.toml --cov=cwaves --cov-report=term-missing tests/
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
See [AGENTS.md](AGENTS.md) for the full development guide.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT — see [LICENSE](LICENSE).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""CWAVES : computation of CWAVE parameters from ocean wave / SAR spectra.
|
|
2
|
+
|
|
3
|
+
Public API
|
|
4
|
+
----------
|
|
5
|
+
- :func:`cwaves.compute_cwaves` : **the single entry point**. Computes the CWAVE
|
|
6
|
+
parameters of a spectrum given as an ``xarray.DataArray`` on its native
|
|
7
|
+
wavenumber grid -- cartesian (``k_rg``/``k_az``, uniform or not, e.g. FFT or
|
|
8
|
+
sinh grids) or polar (``k``/``phi``), half plane (``k_rg >= 0``) or full
|
|
9
|
+
plane. The grid is detected from the coordinates (see :mod:`cwaves.grid`);
|
|
10
|
+
no resampling is performed.
|
|
11
|
+
- :func:`cwaves.compute_cwave_parameters` : historical ``xsar_slc`` signature,
|
|
12
|
+
kept for API conservativeness; delegates to :func:`cwaves.compute_cwaves`.
|
|
13
|
+
- :func:`cwaves.reconstruct_spectrum` : reconstruction of a spectrum from its
|
|
14
|
+
CWAVE parameters (maximum entropy, exact constraints, or linear).
|
|
15
|
+
- :func:`cwaves.compute_kernel` : the orthonormal CWAVE kernels.
|
|
16
|
+
- :func:`cwaves.gegenbauer_polynoms` / :func:`cwaves.harmonic_functions` :
|
|
17
|
+
the radial and angular factors of the kernels.
|
|
18
|
+
- :func:`cwaves.symmetrize_xspectrum` : standalone utility rebuilding the full
|
|
19
|
+
plane of a one-sided Hermitian cross-spectrum.
|
|
20
|
+
- :func:`cwaves.get_default_config` / :func:`cwaves.load_config` : the
|
|
21
|
+
``cwave_*`` configuration (the ``cwave`` block can be passed as kwargs).
|
|
22
|
+
- :func:`cwaves.compute_cwaves_from_file` : CLI-level helper (``cwaves
|
|
23
|
+
--input-nc``) that detects the schema of a NetCDF file and calls
|
|
24
|
+
:func:`cwaves.compute_cwaves` on its spectrum.
|
|
25
|
+
|
|
26
|
+
Reference
|
|
27
|
+
---------
|
|
28
|
+
J. Schulz-Stellenfleth, T. Konig, and S. Lehner, "An empirical approach for the
|
|
29
|
+
retrieval of integral ocean wave parameters from synthetic aperture radar data",
|
|
30
|
+
J. Geophys. Res., 112, C03019, 2007. doi:10.1029/2006JC003970
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
try: # version is generated by hatch-vcs at build time
|
|
34
|
+
from cwaves._version import __version__
|
|
35
|
+
except ImportError: # pragma: no cover - fallback for source checkout
|
|
36
|
+
__version__ = "0.0.0+unknown"
|
|
37
|
+
|
|
38
|
+
from cwaves.client import compute_cwaves_from_file
|
|
39
|
+
from cwaves.compute_cwaves import (
|
|
40
|
+
compute_cwave_parameters,
|
|
41
|
+
compute_cwaves,
|
|
42
|
+
compute_kernel,
|
|
43
|
+
gegenbauer_polynoms,
|
|
44
|
+
harmonic_functions,
|
|
45
|
+
)
|
|
46
|
+
from cwaves.config import get_default_config, load_config
|
|
47
|
+
from cwaves.reconstruct import reconstruct_spectrum
|
|
48
|
+
from cwaves.symmetrize_xspectra import symmetrize_xspectrum
|
|
49
|
+
|
|
50
|
+
__all__ = [
|
|
51
|
+
"compute_cwaves",
|
|
52
|
+
"compute_cwave_parameters",
|
|
53
|
+
"compute_kernel",
|
|
54
|
+
"compute_cwaves_from_file",
|
|
55
|
+
"reconstruct_spectrum",
|
|
56
|
+
"gegenbauer_polynoms",
|
|
57
|
+
"harmonic_functions",
|
|
58
|
+
"symmetrize_xspectrum",
|
|
59
|
+
"get_default_config",
|
|
60
|
+
"load_config",
|
|
61
|
+
"__version__",
|
|
62
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2026.12.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (2026, 12, 4)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|