grdwindinversion 0.3.8__tar.gz → 1.0.0__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 (80) hide show
  1. grdwindinversion-1.0.0/.gitattributes +4 -0
  2. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.github/workflows/ci.yml +5 -11
  3. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/AUTHORS.rst +1 -5
  4. {grdwindinversion-0.3.8/grdwindinversion.egg-info → grdwindinversion-1.0.0}/PKG-INFO +1 -1
  5. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/ci/requirements/environment.yaml +8 -6
  6. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/algorithm.rst +1 -1
  7. grdwindinversion-1.0.0/docs/configuration.rst +215 -0
  8. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/examples/streaks-display.ipynb +4 -4
  9. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/examples/wind-inversion-from-grd.ipynb +5 -5
  10. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/index.rst +17 -14
  11. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/installation.rst +4 -4
  12. grdwindinversion-1.0.0/docs/modules.rst +51 -0
  13. grdwindinversion-1.0.0/docs/usage.rst +96 -0
  14. grdwindinversion-1.0.0/grdwindinversion/__init__.py +17 -0
  15. grdwindinversion-1.0.0/grdwindinversion/config_prod_recal.yaml +113 -0
  16. grdwindinversion-1.0.0/grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml +113 -0
  17. grdwindinversion-1.0.0/grdwindinversion/config_prod_streaks.yaml +113 -0
  18. grdwindinversion-1.0.0/grdwindinversion/config_prod_streaks_nrcsmod.yaml +113 -0
  19. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/config_prod_v3.yaml +43 -0
  20. grdwindinversion-1.0.0/grdwindinversion/data_config.yaml +25 -0
  21. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/inversion.py +484 -204
  22. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/main.py +3 -1
  23. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/utils.py +8 -6
  24. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0/grdwindinversion.egg-info}/PKG-INFO +1 -1
  25. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion.egg-info/SOURCES.txt +6 -1
  26. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/recipe/meta.yaml +2 -1
  27. grdwindinversion-1.0.0/tests/config_test.yaml +117 -0
  28. grdwindinversion-1.0.0/tests/data_config_ci.yaml +22 -0
  29. grdwindinversion-1.0.0/tests/test_ancillary.py +202 -0
  30. grdwindinversion-1.0.0/tests/test_config.py +111 -0
  31. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tests/test_grdwindinversion_ci.py +8 -2
  32. grdwindinversion-1.0.0/tests/test_mask_functions.py +139 -0
  33. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tests/test_simple_functions.py +7 -7
  34. grdwindinversion-0.3.8/docs/modules.rst +0 -27
  35. grdwindinversion-0.3.8/docs/usage.rst +0 -17
  36. grdwindinversion-0.3.8/grdwindinversion/__init__.py +0 -14
  37. grdwindinversion-0.3.8/grdwindinversion/config_prod.yaml +0 -52
  38. grdwindinversion-0.3.8/grdwindinversion/config_prod_recal.yaml +0 -49
  39. grdwindinversion-0.3.8/grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml +0 -48
  40. grdwindinversion-0.3.8/grdwindinversion/config_prod_streaks.yaml +0 -52
  41. grdwindinversion-0.3.8/grdwindinversion/config_prod_streaks_nrcsmod.yaml +0 -52
  42. grdwindinversion-0.3.8/grdwindinversion/data_config.yaml +0 -8
  43. grdwindinversion-0.3.8/tests/config_test.yaml +0 -56
  44. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.editorconfig +0 -0
  45. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.github/dependabot.yml +0 -0
  46. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.github/workflows/build.yml +0 -0
  47. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.github/workflows/publish.yml +0 -0
  48. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.gitignore +0 -0
  49. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/.pre-commit-config.yaml +0 -0
  50. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/CONTRIBUTING.rst +0 -0
  51. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/HISTORY.rst +0 -0
  52. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/LICENSE +0 -0
  53. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/MANIFEST.in +0 -0
  54. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/Makefile +0 -0
  55. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/README.md +0 -0
  56. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/ci/requirements/docs.yaml +0 -0
  57. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/Makefile +0 -0
  58. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/_static/css/grdwindinversion.css +0 -0
  59. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/authors.rst +0 -0
  60. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/conf.py +0 -0
  61. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/contributing.rst +0 -0
  62. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/history.rst +0 -0
  63. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/docs/make.bat +0 -0
  64. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/.github/ISSUE_TEMPLATE.md +0 -0
  65. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/.gitignore +0 -0
  66. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/gradientFeatures.py +0 -0
  67. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/load_config.py +0 -0
  68. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion/utils_memory.py +0 -0
  69. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion.egg-info/dependency_links.txt +0 -0
  70. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion.egg-info/entry_points.txt +0 -0
  71. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion.egg-info/requires.txt +0 -0
  72. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/grdwindinversion.egg-info/top_level.txt +0 -0
  73. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/pyproject.toml +0 -0
  74. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/requirements_dev.txt +0 -0
  75. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/requirements_doc.txt +0 -0
  76. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/setup.cfg +0 -0
  77. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tests/__init__.py +0 -0
  78. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tests/listing_rcm_safe.txt +0 -0
  79. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tests/test_getOutputName.py +0 -0
  80. {grdwindinversion-0.3.8 → grdwindinversion-1.0.0}/tox.ini +0 -0
@@ -0,0 +1,4 @@
1
+ * text=auto
2
+ *.py text eol=lf
3
+ *.js text eol=lf
4
+ *.md text eol=lf
@@ -53,8 +53,8 @@ jobs:
53
53
  id: cache
54
54
  with:
55
55
  path: ./test_data
56
- key: test-data-v4
57
- restore-keys: test-data-v4
56
+ key: test-data-v6
57
+ restore-keys: test-data-v6
58
58
 
59
59
  # Download test data if not already cached
60
60
  - name: Download test data
@@ -67,6 +67,8 @@ jobs:
67
67
  unzip /tmp/l1.zip -d ./test_data/
68
68
  wget https://cloud.ifremer.fr/index.php/s/RgloaQ8gi8svYOe/download -O /tmp/auxiliary.zip
69
69
  unzip /tmp/auxiliary.zip -d ./test_data/
70
+ wget https://cloud.ifremer.fr/index.php/s/oEUYYFqpYXELr7U/download -O /tmp/masks.zip
71
+ unzip /tmp/masks.zip -d ./test_data/
70
72
  timeout-minutes: 200 # Adjust depending on the size of your data
71
73
 
72
74
  # Set up xsar configuration
@@ -81,15 +83,7 @@ jobs:
81
83
  - name: Setup grdwindinversion configuration
82
84
  run: |
83
85
  mkdir -p ~/.grdwindinversion
84
- echo "'ecmwf_0100_1h': ./test_data/ECMWF/forecast/hourly/0100deg/netcdf_light/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc" > ~/.grdwindinversion/data_config.yaml
85
- echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
86
- echo "unit_test_s1_product: './test_data/L1/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE'" >> ~/.grdwindinversion/data_config.yaml
87
- echo "unit_test_rcm_product: './test_data/L1/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD'" >> ~/.grdwindinversion/data_config.yaml
88
- echo "unit_test_rs2_product: './test_data/L1/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF'" >> ~/.grdwindinversion/data_config.yaml
89
-
90
- #echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
91
- #echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
92
- #echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
86
+ cp tests/data_config_ci.yaml ~/.grdwindinversion/data_config.yaml
93
87
 
94
88
  # Run the tests
95
89
  - name: Run tests
@@ -5,10 +5,6 @@ Authors
5
5
  Development Lead
6
6
  ----------------
7
7
 
8
- * Vincent Lheureux <vincent.lheureux@ifremer.fr>
8
+ * Vincent Lheureux <vinc.lheureux@gmail.com>
9
9
  * Antoine Grouazel <antoine.grouazel@ifremer.fr>
10
10
 
11
- Contributors
12
- ------------
13
-
14
- None yet. Why not be the first?
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grdwindinversion
3
- Version: 0.3.8
3
+ Version: 1.0.0
4
4
  Summary: Package to perform Wind inversion from GRD Level-1 SAR images
5
5
  Author-email: Antoine Grouazel <antoine.grouazel@ifremer.fr>
6
6
  License: MIT
@@ -1,8 +1,10 @@
1
1
  name: grdwindinversion-tests
2
2
  channels:
3
3
  - conda-forge
4
+
4
5
  dependencies:
5
6
  - python=3.10
7
+
6
8
  # development
7
9
  - ipython
8
10
  - pre-commit
@@ -11,23 +13,23 @@ dependencies:
11
13
  - isort
12
14
  - black
13
15
  - dask-labextension
16
+
14
17
  # testing
15
18
  - pytest
16
19
  - pytest-reportlog
17
20
  - hypothesis
18
21
  - coverage
22
+
19
23
  # I/O
20
24
  - rioxarray
21
25
  - h5netcdf
22
26
  - zarr
23
- - scipy
27
+
24
28
  # data
25
- - xarray
29
+ - dask <2025
30
+
26
31
  - xarray-datatree
27
- - dask
28
- - numpy
29
- - pandas
30
- - shapely
32
+
31
33
  # processing
32
34
  - more-itertools
33
35
  - tqdm
@@ -1,4 +1,4 @@
1
1
  Algorithm description
2
2
  =====================
3
3
 
4
- TODO
4
+ TODO
@@ -0,0 +1,215 @@
1
+ =============
2
+ Configuration
3
+ =============
4
+
5
+ Configuration Files Implementation Guide
6
+ =========================================
7
+
8
+ Overview
9
+ --------
10
+
11
+ The ``grdwindinversion`` configuration system uses two types of YAML files:
12
+
13
+ 1. **data_config.yaml**: Paths to data sources (ancillary, , LUTs, masks)
14
+ 2. **config_*.yaml**: Processing parameters specific to each satellite
15
+
16
+ Configuration System Architecture
17
+ ----------------------------------
18
+
19
+ Loading Hierarchy
20
+ ~~~~~~~~~~~~~~~~~
21
+
22
+ The ``data_config.yaml`` file is loaded with the following priority:
23
+
24
+ .. code-block:: text
25
+
26
+ 1. ~/.grdwindinversion/data_config.yaml (user local configuration)
27
+ 2. ./local_data_config.yaml (project local configuration)
28
+ 3. <package>/data_config.yaml (package default configuration)
29
+
30
+ Accessing Configuration
31
+ ~~~~~~~~~~~~~~~~~~~~~~~~
32
+
33
+ .. code-block:: python
34
+
35
+ from grdwindinversion.load_config import getConf
36
+
37
+ # Get the global configuration dictionary
38
+ config = getConf()
39
+
40
+ # Access data paths
41
+ ecmwf_path = config["ecmwf_0100_1h"]
42
+ nc_luts_path = config["nc_luts_path"]
43
+
44
+ data_config.yaml Structure
45
+ ---------------------------
46
+
47
+ 1. Meteorological Data Paths (ancillary)
48
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
+
50
+ .. code-block:: yaml
51
+
52
+ ancillary_sources:
53
+ ecmwf:
54
+ - name: 'ecmwf_0100_1h'
55
+ path: '/path/to/ecmwf/0.100deg/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
56
+ - name: 'ecmwf_0125_1h'
57
+ path: '/path/to/ecmwf/0.125deg/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
58
+ era5:
59
+ - name: 'era5_0250_1h'
60
+ path: '/path/to/era5/%Y/%m/era_5-copernicus__%Y%m%d.nc'
61
+
62
+ **Priority System**:
63
+
64
+ When multiple models are configured for the same source (e.g., both ``ecmwf_0100_1h`` and ``ecmwf_0125_1h``),
65
+ the function tries each model in the order listed and uses the first one for which a file exists.
66
+ For example, with the configuration above, ``ecmwf_0100_1h`` will be tried first, and ``ecmwf_0125_1h``
67
+ will be used as a fallback if the first file is not available.
68
+
69
+ **Metadata Preservation**:
70
+
71
+ The selected ancillary source name and full path are automatically stored in the output dataset attributes:
72
+ - ``ancillary_source``: Name of the selected model (e.g., ``ecmwf_0100_1h``)
73
+ - ``ancillary_source_path``: Full path to the selected file
74
+
75
+ **Template Format**: Uses Python datetime format codes
76
+
77
+ - ``%Y``: Year (4 digits)
78
+ - ``%j``: Day of year (001-366)
79
+ - ``%m``: Month (01-12)
80
+ - ``%d``: Day of month (01-31)
81
+ - ``%H``: Hour (00-23)
82
+ - ``%M``: Minute (00-59)
83
+
84
+ 2. LUT Paths (Look-Up Tables)
85
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86
+
87
+ .. code-block:: yaml
88
+
89
+ nc_luts_path: '/path/to/luts/'
90
+ lut_cmod7_path: '/path/to/cmod7_lut.nc'
91
+
92
+ 3. Masks Configuration
93
+ ~~~~~~~~~~~~~~~~~~~~~~
94
+
95
+ .. code-block:: yaml
96
+
97
+ masks:
98
+ land:
99
+ - name: 'gshhsH'
100
+ path: '/path/to/gshhs/GSHHS_h_L1.shp'
101
+ - name: 'custom_land'
102
+ path: '/path/to/custom_land.shp'
103
+ ice:
104
+ - name: 'iceSource'
105
+ path: '/path/to/ice_mask.shp'
106
+
107
+ **Mask Notes**:
108
+
109
+ - The ``_mask`` suffix is automatically appended to variable names
110
+ - Multiple masks per category are supported
111
+
112
+ config_*.yaml Structure
113
+ -----------------------
114
+
115
+ Global Parameters (root level)
116
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
+
118
+ .. code-block:: yaml
119
+
120
+ no_subdir: True # Don't create subdirectories in output
121
+ winddir_convention: "meteorological" # Wind direction convention
122
+ add_gradientsfeatures: False # Add gradient/streak features
123
+ add_nrcs_model: False # Add NRCS from model (forced to False)
124
+ overwrite: False # Overwrite existing files
125
+
126
+ Recommended Configuration
127
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
128
+
129
+ **Use ``config_prod_v3.yaml`` as the default configuration file.**
130
+
131
+ This configuration includes:
132
+
133
+ - Support for all Sentinel-1 satellites (S1A, S1B, S1C, S1D)
134
+ - Support for RS2 and RCM satellites
135
+ - Automatic handling of S1 EW calibration changes (July 2019) with latest GMFs
136
+
137
+ Satellite-Specific Parameters
138
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139
+
140
+ Each satellite section includes:
141
+
142
+ .. code-block:: yaml
143
+
144
+ S1A:
145
+ # Geophysical Model Functions
146
+ GMF_HH_NAME: "nc_lut_gmf_cmod5n_Rhigh_hh_mouche1"
147
+ GMF_VV_NAME: "gmf_cmod5n"
148
+ GMF_VH_NAME: "gmf_s1_v2"
149
+ dsig_VH_NAME: "gmf_s1_v2"
150
+ dsig_cr_step: "nrcs" # Polarization mixing step
151
+
152
+ # Automatic handling of S1 EW recalibration (after 2019-07-31)
153
+ S1_EW_calG>20190731:
154
+ GMF_VH_NAME: "gmf_s1_v3_ew_rec"
155
+ dsig_VH_NAME: "dsig_wspd_s1_ew_rec_v3"
156
+ dsig_cr_step: "wspd"
157
+
158
+ # Processing parameters
159
+ apply_flattening: True # NESZ correction
160
+ recalibration: False # Kersten recalibration
161
+ ancillary: "ecmwf" # Meteorological data
162
+ inc_step: 0.1 # Incidence angle step (°)
163
+ wspd_step: 0.1 # Wind speed step (m/s)
164
+ phi_step: 1.0 # Azimuth step (°)
165
+ resolution: "high"
166
+
167
+ Configuration Examples
168
+ ----------------------
169
+
170
+ Configuration with Recalibration
171
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172
+
173
+ File: ``config_prod_recal.yaml``
174
+
175
+ .. code-block:: yaml
176
+
177
+ no_subdir: True
178
+ winddir_convention: "meteorological"
179
+ add_gradientsfeatures: False
180
+ add_nrcs_model: False
181
+
182
+ S1A:
183
+ GMF_VV_NAME: "gmf_cmod5n"
184
+ GMF_VH_NAME: "gmf_s1_v2"
185
+ recalibration: True # Enable Kersten recalibration formula
186
+ # ... other parameters ...
187
+
188
+ **Usage**: Applies recalibration correction to NRCS data before inversion.
189
+
190
+
191
+ Multi-GMFS Version Configuration (S1 v3)
192
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
193
+
194
+ File: ``config_prod_v3.yaml``
195
+
196
+ .. code-block:: yaml
197
+
198
+ no_subdir: True
199
+ winddir_convention: "meteorological"
200
+ add_gradientsfeatures: False
201
+ add_nrcs_model: False
202
+
203
+ S1A:
204
+ GMF_VV_NAME: "gmf_cmod5n"
205
+ GMF_VH_NAME: "gmf_s1_v2"
206
+ # Standard configuration
207
+ # ...
208
+
209
+ # Configuration for EW products with calG after 2019-07-31
210
+ S1_EW_calG>20190731:
211
+ GMF_VV_NAME: "gmf_cmod5n_v3"
212
+ GMF_VH_NAME: "gmf_s1_v3"
213
+ # ... adapted parameters ...
214
+
215
+ **Usage**: Automatically handles different S1 calibration versions.
@@ -213,14 +213,14 @@
213
213
  " fig = plt.figure(figsize=(10, 9))\n",
214
214
  " ax = plt.axes(projection=ccrs.PlateCarree())\n",
215
215
  "\n",
216
- " # Calculer les composantes u et v à partir des angles streaks_dir\n",
216
+ " # Calculer les composantes u et v \u00e0 partir des angles streaks_dir\n",
217
217
  " u, v, u_norm, v_norm = get_uv_from_dir(streaks_dir)\n",
218
218
  "\n",
219
219
  " # Display streaks direction\n",
220
220
  " #ax.quiver(longitude, latitude, u_norm, v_norm, edgecolors='k', norm=norm, pivot= 'mid', scale_units='xy', scale=4., zorder=10, width=0.1/25,transform = ccrs.PlateCarree(), color = 'red', label = 'owiWindStreaks')\n",
221
221
  " ax.quiver(longitude, latitude, u_norm, v_norm, edgecolors='k', norm=norm, pivot= 'mid', scale_units='xy', scale=8., zorder=10, width=0.1/25,transform = ccrs.PlateCarree(), color = 'red', label = 'owiWindStreaks')\n",
222
222
  "\n",
223
- " # Display ancillary wind direction\n",
223
+ " #\u00a0Display ancillary wind direction\n",
224
224
  " #ax.quiver(lons, lats, u_norm_ancillary, v_norm_ancillary, edgecolors='k', norm=norm, pivot= 'mid', scale_units='xy', scale=4., zorder=10, width=0.1/25,transform = ccrs.PlateCarree(), color='blue', label = \"owiAncillaryWindDirection\")\n",
225
225
  " ax.quiver(lons, lats, u_norm_ancillary, v_norm_ancillary, edgecolors='k', norm=norm, pivot= 'mid', scale_units='xy', scale=8., zorder=10, width=0.1/25,transform = ccrs.PlateCarree(), color='blue', label = \"owiAncillaryWindDirection\")\n",
226
226
  "\n",
@@ -316,9 +316,9 @@
316
316
  "name": "python",
317
317
  "nbconvert_exporter": "python",
318
318
  "pygments_lexer": "ipython3",
319
- "version": "3.11.0"
319
+ "version": "3.10.15"
320
320
  }
321
321
  },
322
322
  "nbformat": 4,
323
323
  "nbformat_minor": 4
324
- }
324
+ }
@@ -72,7 +72,7 @@
72
72
  "source": [
73
73
  "import grdwindinversion\n",
74
74
  "import os\n",
75
- "config_file_s1 = os.path.join(os.path.dirname(grdwindinversion.__file__),'config_prod.yaml')\n",
75
+ "config_file_s1 = os.path.join(os.path.dirname(grdwindinversion.__file__),'config_prod_v3.yaml')\n",
76
76
  "grdwindinversion.__file__\n",
77
77
  "print(os.path.exists(config_file_s1))"
78
78
  ]
@@ -94,8 +94,8 @@
94
94
  "metadata": {},
95
95
  "outputs": [],
96
96
  "source": [
97
- "outfile,outds = makeL2(input_file,out_folder, config_path=config_file_s1,overwrite=True)\n",
98
- "outds"
97
+ "out_file, outputds, return_status = makeL2(input_file,out_folder, config_path=config_file_s1,overwrite=True)\n",
98
+ "outputds"
99
99
  ]
100
100
  },
101
101
  {
@@ -105,13 +105,13 @@
105
105
  "metadata": {},
106
106
  "outputs": [],
107
107
  "source": [
108
- "outds.owiWindSpeed.plot() "
108
+ "outputds.owiWindSpeed.plot() "
109
109
  ]
110
110
  }
111
111
  ],
112
112
  "metadata": {
113
113
  "kernelspec": {
114
- "display_name": "Python 3 (ipykernel)",
114
+ "display_name": "env_xsar",
115
115
  "language": "python",
116
116
  "name": "python3"
117
117
  },
@@ -1,49 +1,52 @@
1
1
  Welcome to grdwindinversion's documentation!
2
2
  ============================================
3
3
 
4
+ ``grdwindinversion`` is a Python package for wind inversion from SAR imagery.
4
5
 
6
+ Quick Links
7
+ -----------
8
+
9
+ * :doc:`installation` - Installation instructions
10
+ * :doc:`usage` - Usage guide
11
+ * :doc:`configuration` - Configuration reference
5
12
 
6
13
  Examples
7
- ........
14
+ --------
8
15
 
9
16
  .. note::
10
17
  With `recommended installation`_ you will be able to download and execute those examples in `jupyter notebook`_.
11
18
 
19
+ * :doc:`examples/wind-inversion-from-grd` - Wind inversion from GRD data
20
+ * :doc:`examples/streaks-display` - Display wind streaks features
12
21
 
13
- * :doc:`examples/wind-inversion-from-grd`
14
-
15
- Functions description
16
- .....................
17
-
18
- * :doc:`modules`
19
-
22
+ API Reference
23
+ -------------
20
24
 
25
+ * :doc:`modules` - Complete API documentation
21
26
 
22
27
  .. toctree::
23
28
  :maxdepth: 2
24
29
  :caption: Contents:
30
+ :hidden:
25
31
 
26
32
  ../README
27
33
  installation
28
34
  usage
35
+ configuration
29
36
  examples/wind-inversion-from-grd
30
37
  examples/streaks-display
31
-
32
38
  algorithm
33
39
  modules
34
40
  contributing
35
41
  authors
36
42
  history
37
43
 
38
-
39
-
40
-
41
44
  Indices and tables
42
45
  ==================
46
+
43
47
  * :ref:`genindex`
44
48
  * :ref:`modindex`
45
49
  * :ref:`search`
46
50
 
47
-
48
51
  .. _jupyter notebook: https://jupyter.org/
49
- .. _recommended installation: installation.html
52
+ .. _recommended installation: installation.html
@@ -32,13 +32,13 @@ You can either clone the public repository:
32
32
 
33
33
  .. code-block:: console
34
34
 
35
- $ git clone git://github.com/agrouaze/grdwindinversion
35
+ $ git clone git://github.com/umr-lops/grdwindinversion
36
36
 
37
37
  Or download the `tarball`_:
38
38
 
39
39
  .. code-block:: console
40
40
 
41
- $ curl -OJL https://github.com/agrouaze/grdwindinversion/tarball/master
41
+ $ curl -OJL https://github.com/umr-lops/grdwindinversion/tarball/master
42
42
 
43
43
  Once you have a copy of the source, you can install it with:
44
44
 
@@ -47,5 +47,5 @@ Once you have a copy of the source, you can install it with:
47
47
  $ python setup.py install
48
48
 
49
49
 
50
- .. _Github repo: https://github.com/agrouaze/grdwindinversion
51
- .. _tarball: https://github.com/agrouaze/grdwindinversion/tarball/master
50
+ .. _Github repo: https://github.com/umr-lops/grdwindinversion
51
+ .. _tarball: https://github.com/umr-lops/grdwindinversion/tarball/master
@@ -0,0 +1,51 @@
1
+ #######################################
2
+ Application Programming Interface (API)
3
+ #######################################
4
+
5
+ ..
6
+ to document functions, add them to __all__ in ../grdwindinversion/__init__.py
7
+
8
+ Core Processing
9
+ ===============
10
+
11
+ Wind Inversion
12
+ --------------
13
+
14
+ .. automodule:: grdwindinversion.inversion
15
+ :members: inverse, makeL2, makeL2asOwi, getSensorMetaDataset, getOutputName, inverse_dsig_wspd, addMasks_toMeta, mergeLandMasks, processLandMask, getAncillary, preprocess, process_gradients, transform_winddir
16
+ :show-inheritance:
17
+
18
+ Configuration Management
19
+ ------------------------
20
+
21
+ .. automodule:: grdwindinversion.load_config
22
+ :members:
23
+ :undoc-members:
24
+ :show-inheritance:
25
+
26
+ Gradient Features
27
+ -----------------
28
+
29
+ .. automodule:: grdwindinversion.gradientFeatures
30
+ :members:
31
+ :undoc-members:
32
+ :show-inheritance:
33
+
34
+ Utilities
35
+ =========
36
+
37
+ General Utilities
38
+ -----------------
39
+
40
+ .. automodule:: grdwindinversion.utils
41
+ :members:
42
+ :undoc-members:
43
+ :show-inheritance:
44
+
45
+ Memory Management
46
+ -----------------
47
+
48
+ .. automodule:: grdwindinversion.utils_memory
49
+ :members:
50
+ :undoc-members:
51
+ :show-inheritance:
@@ -0,0 +1,96 @@
1
+ =====
2
+ Usage
3
+ =====
4
+
5
+ Python API
6
+ ----------
7
+
8
+ To use grdwindinversion in a project::
9
+
10
+ import grdwindinversion
11
+
12
+
13
+ Configuration Setup
14
+ -------------------
15
+
16
+ To define the path where the ECMWF files used for wind inversion (or any supported ancillary wind)::
17
+
18
+ cp ./grdwindinversion/data_config.yaml ./grdwindinversion/local_data_config.yaml
19
+ # Then edit the file
20
+ vi ./grdwindinversion/local_data_config.yaml
21
+
22
+ See :doc:`configuration` for detailed configuration options.
23
+
24
+
25
+ Command-Line Interface
26
+ ----------------------
27
+
28
+ Basic Usage
29
+ ~~~~~~~~~~~
30
+
31
+ Process a SAR image with wind inversion:
32
+
33
+ .. code-block:: bash
34
+
35
+ SAR_L1-to-L2_wind_processor \
36
+ --input_file /path/to/S1A_*.SAFE \
37
+ --config_file /path/to/config_prod_v3.yaml \
38
+ --outputdir /path/to/output/ \
39
+ --resolution 1000m \
40
+ --overwrite \
41
+ --verbose
42
+
43
+ Command-Line Options
44
+ ~~~~~~~~~~~~~~~~~~~~
45
+
46
+ ``--input_file``
47
+ Path to SAR L1 product (SAFE format for Sentinel-1)
48
+
49
+ ``--config_file``
50
+ Configuration file to use (recommended: ``config_prod_v3.yaml``)
51
+
52
+ ``--outputdir``
53
+ Output directory for L2 wind products
54
+
55
+ ``--resolution``
56
+ Output resolution (e.g., ``1000m``, ``500m``)
57
+
58
+ ``--overwrite``
59
+ Overwrite existing output files
60
+
61
+ ``--verbose``
62
+ Enable verbose output
63
+
64
+
65
+ Examples
66
+ --------
67
+
68
+ With default configuration:
69
+
70
+ .. code-block:: bash
71
+
72
+ SAR_L1-to-L2_wind_processor \
73
+ --input_file S1A_EW_GRDM_1SDH_*.SAFE \
74
+ --config_file config_prod_v3.yaml \
75
+ --outputdir ./output/ \
76
+ --resolution 1000m
77
+
78
+ With recalibration:
79
+
80
+ .. code-block:: bash
81
+
82
+ SAR_L1-to-L2_wind_processor \
83
+ --input_file S1A_EW_GRDM_1SDH_*.SAFE \
84
+ --config_file config_prod_recal.yaml \
85
+ --outputdir ./output/ \
86
+ --resolution 1000m
87
+
88
+ With wind streaks features:
89
+
90
+ .. code-block:: bash
91
+
92
+ SAR_L1-to-L2_wind_processor \
93
+ --input_file S1A_EW_GRDM_1SDH_*.SAFE \
94
+ --config_file config_prod_streaks.yaml \
95
+ --outputdir ./output/ \
96
+ --resolution 1000m
@@ -0,0 +1,17 @@
1
+ from importlib.metadata import version
2
+ from grdwindinversion.inversion import inverse, makeL2, makeL2asOwi, getSensorMetaDataset
3
+ from grdwindinversion.load_config import getConf
4
+
5
+ __all__ = [
6
+ "inverse",
7
+ "makeL2",
8
+ "makeL2asOwi",
9
+ "getSensorMetaDataset",
10
+ "getConf",
11
+ "inversion",
12
+ ]
13
+
14
+ try:
15
+ __version__ = version("grdwindinversion")
16
+ except Exception:
17
+ __version__ = "999"