grdwindinversion 0.3.9__tar.gz → 1.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 (82) hide show
  1. grdwindinversion-1.0.1/.gitattributes +4 -0
  2. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.github/workflows/ci.yml +4 -16
  3. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/AUTHORS.rst +1 -5
  4. {grdwindinversion-0.3.9/grdwindinversion.egg-info → grdwindinversion-1.0.1}/PKG-INFO +1 -1
  5. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/ci/requirements/environment.yaml +8 -6
  6. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/algorithm.rst +1 -1
  7. grdwindinversion-1.0.1/docs/configuration.rst +184 -0
  8. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/examples/streaks-display.ipynb +4 -6
  9. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/examples/wind-inversion-from-grd.ipynb +6 -6
  10. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/index.rst +17 -14
  11. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/installation.rst +4 -4
  12. grdwindinversion-1.0.1/docs/modules.rst +43 -0
  13. grdwindinversion-1.0.1/docs/usage.rst +96 -0
  14. grdwindinversion-1.0.1/grdwindinversion/__init__.py +15 -0
  15. grdwindinversion-1.0.1/grdwindinversion/config_prod_recal.yaml +139 -0
  16. grdwindinversion-1.0.1/grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml +139 -0
  17. grdwindinversion-1.0.1/grdwindinversion/config_prod_streaks.yaml +139 -0
  18. grdwindinversion-1.0.1/grdwindinversion/config_prod_streaks_nrcsmod.yaml +139 -0
  19. grdwindinversion-1.0.1/grdwindinversion/config_prod_v3.yaml +139 -0
  20. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/inversion.py +499 -219
  21. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/main.py +3 -4
  22. grdwindinversion-1.0.1/grdwindinversion/utils.py +259 -0
  23. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1/grdwindinversion.egg-info}/PKG-INFO +1 -1
  24. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion.egg-info/SOURCES.txt +13 -8
  25. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/recipe/meta.yaml +2 -1
  26. grdwindinversion-1.0.1/tests/ci/__init__.py +1 -0
  27. grdwindinversion-0.3.9/grdwindinversion/config_prod_v3.yaml → grdwindinversion-1.0.1/tests/ci/config_test.yaml +23 -0
  28. grdwindinversion-1.0.1/tests/ci/data_config_ci.yaml +22 -0
  29. {grdwindinversion-0.3.9/tests → grdwindinversion-1.0.1/tests/ci}/test_grdwindinversion_ci.py +27 -12
  30. grdwindinversion-1.0.1/tests/unit/__init__.py +1 -0
  31. grdwindinversion-1.0.1/tests/unit/test_ancillary.py +198 -0
  32. grdwindinversion-1.0.1/tests/unit/test_config.py +115 -0
  33. grdwindinversion-1.0.1/tests/unit/test_mask_functions.py +138 -0
  34. grdwindinversion-0.3.9/docs/modules.rst +0 -27
  35. grdwindinversion-0.3.9/docs/usage.rst +0 -17
  36. grdwindinversion-0.3.9/grdwindinversion/__init__.py +0 -14
  37. grdwindinversion-0.3.9/grdwindinversion/config_prod.yaml +0 -52
  38. grdwindinversion-0.3.9/grdwindinversion/config_prod_recal.yaml +0 -49
  39. grdwindinversion-0.3.9/grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml +0 -48
  40. grdwindinversion-0.3.9/grdwindinversion/config_prod_streaks.yaml +0 -52
  41. grdwindinversion-0.3.9/grdwindinversion/config_prod_streaks_nrcsmod.yaml +0 -52
  42. grdwindinversion-0.3.9/grdwindinversion/data_config.yaml +0 -8
  43. grdwindinversion-0.3.9/grdwindinversion/load_config.py +0 -30
  44. grdwindinversion-0.3.9/grdwindinversion/utils.py +0 -154
  45. grdwindinversion-0.3.9/tests/config_test.yaml +0 -56
  46. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.editorconfig +0 -0
  47. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.github/dependabot.yml +0 -0
  48. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.github/workflows/build.yml +0 -0
  49. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.github/workflows/publish.yml +0 -0
  50. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.gitignore +0 -0
  51. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/.pre-commit-config.yaml +0 -0
  52. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/CONTRIBUTING.rst +0 -0
  53. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/HISTORY.rst +0 -0
  54. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/LICENSE +0 -0
  55. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/MANIFEST.in +0 -0
  56. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/Makefile +0 -0
  57. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/README.md +0 -0
  58. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/ci/requirements/docs.yaml +0 -0
  59. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/Makefile +0 -0
  60. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/_static/css/grdwindinversion.css +0 -0
  61. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/authors.rst +0 -0
  62. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/conf.py +0 -0
  63. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/contributing.rst +0 -0
  64. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/history.rst +0 -0
  65. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/docs/make.bat +0 -0
  66. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/.github/ISSUE_TEMPLATE.md +0 -0
  67. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/.gitignore +0 -0
  68. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/gradientFeatures.py +0 -0
  69. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion/utils_memory.py +0 -0
  70. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion.egg-info/dependency_links.txt +0 -0
  71. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion.egg-info/entry_points.txt +0 -0
  72. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion.egg-info/requires.txt +0 -0
  73. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/grdwindinversion.egg-info/top_level.txt +0 -0
  74. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/pyproject.toml +0 -0
  75. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/requirements_dev.txt +0 -0
  76. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/requirements_doc.txt +0 -0
  77. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/setup.cfg +0 -0
  78. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/tests/__init__.py +0 -0
  79. {grdwindinversion-0.3.9/tests → grdwindinversion-1.0.1/tests/unit}/listing_rcm_safe.txt +0 -0
  80. {grdwindinversion-0.3.9/tests → grdwindinversion-1.0.1/tests/unit}/test_getOutputName.py +0 -0
  81. {grdwindinversion-0.3.9/tests → grdwindinversion-1.0.1/tests/unit}/test_simple_functions.py +0 -0
  82. {grdwindinversion-0.3.9 → grdwindinversion-1.0.1}/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
@@ -77,20 +79,6 @@ jobs:
77
79
  echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yml
78
80
  echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yml
79
81
 
80
- # Set up grdwindinversion configuration
81
- - name: Setup grdwindinversion configuration
82
- run: |
83
- 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
93
-
94
82
  # Run the tests
95
83
  - name: Run tests
96
84
  run: |
@@ -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.9
3
+ Version: 1.0.1
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,184 @@
1
+ =============
2
+ Configuration
3
+ =============
4
+
5
+ Configuration Files Implementation Guide
6
+ =========================================
7
+
8
+ Overview
9
+ --------
10
+
11
+ The ``grdwindinversion`` configuration system uses a **single YAML configuration file** that contains both data source paths and processing parameters.
12
+
13
+ Configuration File Structure
14
+ -----------------------------
15
+
16
+ 1. Meteorological Data Paths (ancillary)
17
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+
19
+ .. code-block:: yaml
20
+
21
+ ancillary_sources:
22
+ ecmwf:
23
+ - name: 'ecmwf_0100_1h'
24
+ path: '/path/to/ecmwf/0.100deg/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
25
+ - name: 'ecmwf_0125_1h'
26
+ path: '/path/to/ecmwf/0.125deg/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
27
+ era5:
28
+ - name: 'era5_0250_1h'
29
+ path: '/path/to/era5/%Y/%m/era_5-copernicus__%Y%m%d.nc'
30
+
31
+ **Priority System**:
32
+
33
+ When multiple models are configured for the same source (e.g., both ``ecmwf_0100_1h`` and ``ecmwf_0125_1h``),
34
+ the function tries each model in the order listed and uses the first one for which a file exists.
35
+ For example, with the configuration above, ``ecmwf_0100_1h`` will be tried first, and ``ecmwf_0125_1h``
36
+ will be used as a fallback if the first file is not available.
37
+
38
+ **Metadata Preservation**:
39
+
40
+ The selected ancillary source name and full path are automatically stored in the output dataset attributes:
41
+ - ``ancillary_source``: Name of the selected model (e.g., ``ecmwf_0100_1h``)
42
+ - ``ancillary_source_path``: Full path to the selected file
43
+
44
+ **Template Format**: Uses Python datetime format codes
45
+
46
+ - ``%Y``: Year (4 digits)
47
+ - ``%j``: Day of year (001-366)
48
+ - ``%m``: Month (01-12)
49
+ - ``%d``: Day of month (01-31)
50
+ - ``%H``: Hour (00-23)
51
+ - ``%M``: Minute (00-59)
52
+
53
+ 2. LUT Paths (Look-Up Tables)
54
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
+
56
+ .. code-block:: yaml
57
+
58
+ nc_luts_path: '/path/to/luts/'
59
+ lut_cmod7_path: '/path/to/cmod7_lut.nc'
60
+
61
+ 3. Masks Configuration
62
+ ~~~~~~~~~~~~~~~~~~~~~~
63
+
64
+ .. code-block:: yaml
65
+
66
+ masks:
67
+ land:
68
+ - name: 'gshhsH'
69
+ path: '/path/to/gshhs/GSHHS_h_L1.shp'
70
+ - name: 'custom_land'
71
+ path: '/path/to/custom_land.shp'
72
+ ice:
73
+ - name: 'iceSource'
74
+ path: '/path/to/ice_mask.shp'
75
+
76
+ **Mask Notes**:
77
+
78
+ - The ``_mask`` suffix is automatically appended to variable names
79
+ - Multiple masks per category are supported
80
+
81
+ config_*.yaml Structure
82
+ -----------------------
83
+
84
+ Global Parameters (root level)
85
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86
+
87
+ .. code-block:: yaml
88
+
89
+ no_subdir: True # Don't create subdirectories in output
90
+ winddir_convention: "meteorological" # Wind direction convention
91
+ add_gradientsfeatures: False # Add gradient/streak features
92
+ add_nrcs_model: False # Add NRCS from model (forced to False)
93
+ overwrite: False # Overwrite existing files
94
+
95
+ Recommended Configuration
96
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
97
+
98
+ **Use ``config_prod_v3.yaml`` as the default configuration file.**
99
+
100
+ This configuration includes:
101
+
102
+ - Support for all Sentinel-1 satellites (S1A, S1B, S1C, S1D)
103
+ - Support for RS2 and RCM satellites
104
+ - Automatic handling of S1 EW calibration changes (July 2019) with latest GMFs
105
+
106
+ Satellite-Specific Parameters
107
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
+
109
+ Each satellite section includes:
110
+
111
+ .. code-block:: yaml
112
+
113
+ S1A:
114
+ # Geophysical Model Functions
115
+ GMF_HH_NAME: "nc_lut_gmf_cmod5n_Rhigh_hh_mouche1"
116
+ GMF_VV_NAME: "gmf_cmod5n"
117
+ GMF_VH_NAME: "gmf_s1_v2"
118
+ dsig_VH_NAME: "gmf_s1_v2"
119
+ dsig_cr_step: "nrcs" # Polarization mixing step
120
+
121
+ # Automatic handling of S1 EW recalibration (after 2019-07-31)
122
+ S1_EW_calG>20190731:
123
+ GMF_VH_NAME: "gmf_s1_v3_ew_rec"
124
+ dsig_VH_NAME: "dsig_wspd_s1_ew_rec_v3"
125
+ dsig_cr_step: "wspd"
126
+
127
+ # Processing parameters
128
+ apply_flattening: True # NESZ correction
129
+ recalibration: False # Kersten recalibration
130
+ ancillary: "ecmwf" # Meteorological data
131
+ inc_step: 0.1 # Incidence angle step (°)
132
+ wspd_step: 0.1 # Wind speed step (m/s)
133
+ phi_step: 1.0 # Azimuth step (°)
134
+ resolution: "high"
135
+
136
+ Configuration Examples
137
+ ----------------------
138
+
139
+ Configuration with Recalibration
140
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141
+
142
+ File: ``config_prod_recal.yaml``
143
+
144
+ .. code-block:: yaml
145
+
146
+ no_subdir: True
147
+ winddir_convention: "meteorological"
148
+ add_gradientsfeatures: False
149
+ add_nrcs_model: False
150
+
151
+ S1A:
152
+ GMF_VV_NAME: "gmf_cmod5n"
153
+ GMF_VH_NAME: "gmf_s1_v2"
154
+ recalibration: True # Enable Kersten recalibration formula
155
+ # ... other parameters ...
156
+
157
+ **Usage**: Applies recalibration correction to NRCS data before inversion.
158
+
159
+
160
+ Multi-GMFS Version Configuration (S1 v3)
161
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162
+
163
+ File: ``config_prod_v3.yaml``
164
+
165
+ .. code-block:: yaml
166
+
167
+ no_subdir: True
168
+ winddir_convention: "meteorological"
169
+ add_gradientsfeatures: False
170
+ add_nrcs_model: False
171
+
172
+ S1A:
173
+ GMF_VV_NAME: "gmf_cmod5n"
174
+ GMF_VH_NAME: "gmf_s1_v2"
175
+ # Standard configuration
176
+ # ...
177
+
178
+ # Configuration for EW products with calG after 2019-07-31
179
+ S1_EW_calG>20190731:
180
+ GMF_VV_NAME: "gmf_cmod5n_v3"
181
+ GMF_VH_NAME: "gmf_s1_v3"
182
+ # ... adapted parameters ...
183
+
184
+ **Usage**: Automatically handles different S1 calibration versions.
@@ -213,7 +213,7 @@
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
+ " # Compute u,v from streaks \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",
@@ -234,8 +234,6 @@
234
234
  " lat_min, lat_max = np.nanmin(lats) - .2, np.nanmax(lats) + .7\n",
235
235
  " ax.set_extent([lon_min, lon_max, lat_min, lat_max], crs=ccrs.PlateCarree())\n",
236
236
  "\n",
237
- "\n",
238
- " # Configurer les axes\n",
239
237
  " ax.set_xlabel('Longitude')\n",
240
238
  " ax.set_ylabel('Latitude')\n",
241
239
  " ax.set_aspect('equal', adjustable='box')\n",
@@ -300,9 +298,9 @@
300
298
  "source": []
301
299
  }
302
300
  ],
303
- "metadata": {
301
+ "metadata": {
304
302
  "kernelspec": {
305
- "display_name": "Python 3 (ipykernel)",
303
+ "display_name": "Python 3",
306
304
  "language": "python",
307
305
  "name": "python3"
308
306
  },
@@ -316,7 +314,7 @@
316
314
  "name": "python",
317
315
  "nbconvert_exporter": "python",
318
316
  "pygments_lexer": "ipython3",
319
- "version": "3.11.0"
317
+ "version": "3.10.15"
320
318
  }
321
319
  },
322
320
  "nbformat": 4,
@@ -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
- "metadata": {
112
+ "metadata": {
113
113
  "kernelspec": {
114
- "display_name": "Python 3 (ipykernel)",
114
+ "display_name": "Python 3",
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,43 @@
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
+ Gradient Features
19
+ -----------------
20
+
21
+ .. automodule:: grdwindinversion.gradientFeatures
22
+ :members:
23
+ :undoc-members:
24
+ :show-inheritance:
25
+
26
+ Utilities
27
+ =========
28
+
29
+ General Utilities
30
+ -----------------
31
+
32
+ .. automodule:: grdwindinversion.utils
33
+ :members:
34
+ :undoc-members:
35
+ :show-inheritance:
36
+
37
+ Memory Management
38
+ -----------------
39
+
40
+ .. automodule:: grdwindinversion.utils_memory
41
+ :members:
42
+ :undoc-members:
43
+ :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 paths for ECMWF files and other data sources, create or copy a configuration file::
17
+
18
+ cp ./grdwindinversion/config_prod_v3.yaml ./my_config.yaml
19
+ # Then edit the file to match your local paths
20
+ vi ./my_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,15 @@
1
+ from importlib.metadata import version
2
+ from grdwindinversion.inversion import inverse, makeL2, makeL2asOwi, getSensorMetaDataset
3
+
4
+ __all__ = [
5
+ "inverse",
6
+ "makeL2",
7
+ "makeL2asOwi",
8
+ "getSensorMetaDataset",
9
+ "inversion",
10
+ ]
11
+
12
+ try:
13
+ __version__ = version("grdwindinversion")
14
+ except Exception:
15
+ __version__ = "999"