grdwindinversion 0.2.7__py3-none-any.whl → 0.3.2__py3-none-any.whl
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.
- grdwindinversion/config_prod.yaml +6 -0
- grdwindinversion/config_prod_recal.yaml +7 -3
- grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml +48 -0
- grdwindinversion/config_prod_streaks.yaml +52 -0
- grdwindinversion/config_prod_streaks_nrcsmod.yaml +52 -0
- grdwindinversion/data_config.yaml +7 -4
- grdwindinversion/gradientFeatures.py +448 -0
- grdwindinversion/inversion.py +259 -75
- grdwindinversion/load_config.py +7 -4
- grdwindinversion/utils.py +40 -0
- grdwindinversion-0.3.2.dist-info/METADATA +67 -0
- grdwindinversion-0.3.2.dist-info/RECORD +22 -0
- grdwindinversion/streaks.py +0 -79
- grdwindinversion-0.2.7.dist-info/METADATA +0 -83
- grdwindinversion-0.2.7.dist-info/RECORD +0 -19
- {grdwindinversion-0.2.7.dist-info → grdwindinversion-0.3.2.dist-info}/AUTHORS.rst +0 -0
- {grdwindinversion-0.2.7.dist-info → grdwindinversion-0.3.2.dist-info}/LICENSE +0 -0
- {grdwindinversion-0.2.7.dist-info → grdwindinversion-0.3.2.dist-info}/WHEEL +0 -0
- {grdwindinversion-0.2.7.dist-info → grdwindinversion-0.3.2.dist-info}/entry_points.txt +0 -0
- {grdwindinversion-0.2.7.dist-info → grdwindinversion-0.3.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: grdwindinversion
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Package to perform Wind inversion from GRD Level-1 SAR images
|
|
5
|
+
Author-email: Antoine Grouazel <antoine.grouazel@ifremer.fr>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: xarray,earth-observation,remote-sensing,satellite-imagery,Sentinel-1,RCM,RadarSat2,sar,synthetic-aperture-radar
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
License-File: AUTHORS.rst
|
|
21
|
+
Requires-Dist: xsar
|
|
22
|
+
Requires-Dist: xsarsea
|
|
23
|
+
Requires-Dist: xarray
|
|
24
|
+
Requires-Dist: xarray-datatree
|
|
25
|
+
Requires-Dist: pyyaml
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: scipy
|
|
28
|
+
Requires-Dist: fsspec
|
|
29
|
+
Requires-Dist: aiohttp
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
[](https://pypi.org/project/grdwindinversion/)
|
|
33
|
+
[](https://github.com/umr-lops/grdwindinversion/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
|
|
34
|
+
|
|
35
|
+
Package to perform Wind inversion from GRD Level-1 SAR images
|
|
36
|
+
|
|
37
|
+
- Free software: MIT license
|
|
38
|
+
- Documentation: https://grdwindinversion.readthedocs.io.
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
|
|
44
|
+
SAR_L1-to-L2_wind_processor -h
|
|
45
|
+
usage: SAR_L1-to-L2_wind_processor [-h] --input_file INPUT_FILE [--config_file CONFIG_FILE] --outputdir OUTPUTDIR [--verbose] [--overwrite]
|
|
46
|
+
|
|
47
|
+
Perform inversion from S1(L1-GRD) SAFE, L1-RCM, L1-RS2 ; using xsar/xsarsea tools
|
|
48
|
+
|
|
49
|
+
options:
|
|
50
|
+
-h, --help show this help message and exit
|
|
51
|
+
--input_file INPUT_FILE
|
|
52
|
+
input file path
|
|
53
|
+
--config_file CONFIG_FILE
|
|
54
|
+
config file path [if not provided will take config file based on input file]
|
|
55
|
+
--outputdir OUTPUTDIR
|
|
56
|
+
--verbose
|
|
57
|
+
--overwrite overwrite existing .nc files [default is False]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
This Python library (based on `xarray`) allows to perform wind inversion from level-1 GRD (projected magnitude image).
|
|
63
|
+
Mission supported:
|
|
64
|
+
|
|
65
|
+
- Sentinel-1
|
|
66
|
+
- RCM
|
|
67
|
+
- RadarSat-2
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
grdwindinversion/.gitignore,sha256=vmDRHGeESYckUdUztsPr7u6ZNfBYMCVR3GE3AJCBnsY,1204
|
|
2
|
+
grdwindinversion/__init__.py,sha256=VQc2V_j124NX2Gp06Go1oSZDSF4lBIVPYT-W9ZkNBXE,415
|
|
3
|
+
grdwindinversion/config_prod.yaml,sha256=VEAgtJt894v3u4AhYOlcCWjb379vPDMfwBb4PKeDmAw,1314
|
|
4
|
+
grdwindinversion/config_prod_recal.yaml,sha256=74n2J4tzSx1I5vaat3ydwig1jyfDgxGTGDxxw8ALC-U,1222
|
|
5
|
+
grdwindinversion/config_prod_recal_streaks_nrcsmod.yaml,sha256=ob0YmzHrwkI4GLxaR9HzidYtXBrTOAlEYwPYdCK7AqA,1092
|
|
6
|
+
grdwindinversion/config_prod_streaks.yaml,sha256=lJMl4qH6XYqO8ich7yW0WDQsQDrjmWThlLyx1xZy1DA,1313
|
|
7
|
+
grdwindinversion/config_prod_streaks_nrcsmod.yaml,sha256=4yC4KcsC7rUumYHwhpKxM8_LDMe_Je-RIu4-9e1ayp8,1312
|
|
8
|
+
grdwindinversion/data_config.yaml,sha256=FnglUHbAtGwHWg8w86hwZt3-vo-dY8uIjxqyI1jZpv8,567
|
|
9
|
+
grdwindinversion/gradientFeatures.py,sha256=pBmsk6L8V9OrfSaAlFnxWztowSMEq2uoNdK93-drCuQ,17234
|
|
10
|
+
grdwindinversion/inversion.py,sha256=Tup2TbjKzxHA4aF-0BOXFrUX_ILHbrKtMi2SVZ4JMgo,53972
|
|
11
|
+
grdwindinversion/load_config.py,sha256=o0zVRpw3cIk-0fAsgOAb5JYzbHd3wdKmFskT8B3FAok,875
|
|
12
|
+
grdwindinversion/main.py,sha256=0DLDW0i14CWhDKAGegzOKlWnCkag_cGn3vzMIAKcv4g,2658
|
|
13
|
+
grdwindinversion/utils.py,sha256=bowCr2wKqXE7j0Uo5xkFMjWkr7NhnmjCaPFTO4MYNV4,3803
|
|
14
|
+
grdwindinversion/utils_memory.py,sha256=1N3Kh4qVZPELPU6I4onbmkur1CZd7EHZqfbSAa6eaVc,1480
|
|
15
|
+
grdwindinversion/.github/ISSUE_TEMPLATE.md,sha256=qiM_a7CCUz3fSrz3Q20Se1nwPNFS8QCc8tkwK_0DSCo,327
|
|
16
|
+
grdwindinversion-0.3.2.dist-info/AUTHORS.rst,sha256=KmhW_5LBKGTIGwWEVkoTm1qx_bvdDR3yYL-1cwbDOFQ,218
|
|
17
|
+
grdwindinversion-0.3.2.dist-info/LICENSE,sha256=-B8mBiTeY3J7OLuayiV1myqmc7yeijBc7s34kc8RTmg,1075
|
|
18
|
+
grdwindinversion-0.3.2.dist-info/METADATA,sha256=qpJr7Mfj2Tk8PanobOIlMbUp5ag-Md1EcnHF-M42nwc,2441
|
|
19
|
+
grdwindinversion-0.3.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
20
|
+
grdwindinversion-0.3.2.dist-info/entry_points.txt,sha256=2rjvlVCy0iasRXjOz3kOIGuy2OCGQ-VTNuwuViQ6cMM,95
|
|
21
|
+
grdwindinversion-0.3.2.dist-info/top_level.txt,sha256=z6lPix3QPEYOo37qq8plA2hY7S3C8MQZY81agRlksMI,17
|
|
22
|
+
grdwindinversion-0.3.2.dist-info/RECORD,,
|
grdwindinversion/streaks.py
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import xarray as xr
|
|
2
|
-
import xsarsea.gradients
|
|
3
|
-
import xarray as xr
|
|
4
|
-
from scipy.ndimage import binary_dilation
|
|
5
|
-
import numpy as np
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def get_streaks(xr_dataset, xr_dataset_100):
|
|
9
|
-
"""
|
|
10
|
-
Get the streaks from the wind field.
|
|
11
|
-
|
|
12
|
-
Parameters
|
|
13
|
-
----------
|
|
14
|
-
xr_dataset : xarray.Dataset
|
|
15
|
-
dataset at user resolution.
|
|
16
|
-
xr_dataset_100 : xarray.Dataset
|
|
17
|
-
dataset at 100m resolution.
|
|
18
|
-
|
|
19
|
-
Returns
|
|
20
|
-
-------
|
|
21
|
-
xarray.Dataset
|
|
22
|
-
Extract wind direction from Koch Method using xsarsea tools.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
# return empy dataArray, waiting for solution
|
|
26
|
-
return xr.DataArray(data=np.nan * np.ones([len(xr_dataset.coords[dim]) for dim in ['line','sample']]),
|
|
27
|
-
dims=['line','sample'],
|
|
28
|
-
coords=[xr_dataset.coords[dim] for dim in ['line','sample']])
|
|
29
|
-
#
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
gradients = xsarsea.gradients.Gradients(xr_dataset_100['sigma0_detrend'], windows_sizes=[
|
|
33
|
-
1600, 3200], downscales_factors=[1, 2], window_step=1)
|
|
34
|
-
|
|
35
|
-
# get gradients histograms as an xarray dataset
|
|
36
|
-
hist = gradients.histogram
|
|
37
|
-
|
|
38
|
-
# get orthogonals gradients
|
|
39
|
-
hist['angles'] = hist['angles'] + np.pi/2
|
|
40
|
-
|
|
41
|
-
# mean
|
|
42
|
-
hist_mean = hist.mean(['downscale_factor', 'window_size', 'pol'])
|
|
43
|
-
|
|
44
|
-
# smooth
|
|
45
|
-
hist_mean_smooth = hist_mean.copy()
|
|
46
|
-
hist_mean_smooth['weight'] = xsarsea.gradients.circ_smooth(
|
|
47
|
-
hist_mean['weight'])
|
|
48
|
-
|
|
49
|
-
# smooth only
|
|
50
|
-
# hist_smooth = hist.copy()
|
|
51
|
-
# hist_smooth['weight'] = xsarsea.gradients.circ_smooth(hist_smooth['weight'])
|
|
52
|
-
|
|
53
|
-
# select histogram peak
|
|
54
|
-
iangle = hist_mean_smooth['weight'].fillna(0).argmax(dim='angles')
|
|
55
|
-
streaks_dir = hist_mean_smooth.angles.isel(angles=iangle)
|
|
56
|
-
streaks_weight = hist_mean_smooth['weight'].isel(angles=iangle)
|
|
57
|
-
streaks = xr.merge(
|
|
58
|
-
[dict(angle=streaks_dir, weight=streaks_weight)]).drop('angles')
|
|
59
|
-
|
|
60
|
-
# streaks are [0, pi]. Remove ambiguity with anciallary wind
|
|
61
|
-
ancillary_wind = xr_dataset_100['ancillary_wind'].sel(line=streaks.line,
|
|
62
|
-
sample=streaks.sample,
|
|
63
|
-
method='nearest').compute()
|
|
64
|
-
streaks_c = streaks['weight'] * np.exp(1j * streaks['angle'])
|
|
65
|
-
diff_angle = xr.apply_ufunc(np.angle, ancillary_wind / streaks_c)
|
|
66
|
-
streaks_c = xr.where(np.abs(diff_angle) > np.pi/2, -streaks_c, streaks_c)
|
|
67
|
-
streaks['weight'] = np.abs(streaks_c)
|
|
68
|
-
streaks['angle'] = xr.apply_ufunc(np.angle, streaks_c)
|
|
69
|
-
|
|
70
|
-
streaks_dir = xr.apply_ufunc(
|
|
71
|
-
np.angle, streaks_c.interp(line=xr_dataset.line, sample=xr_dataset.sample))
|
|
72
|
-
streaks_dir = xr.where(
|
|
73
|
-
xr_dataset['land_mask'], np.nan, streaks_dir)
|
|
74
|
-
streaks_dir.attrs['comment'] = 'angle in radians, anticlockwise, 0=line'
|
|
75
|
-
streaks_dir.attrs['description'] = 'wind direction estimated from local gradient, and direction ambiguity removed with ancillary wind'
|
|
76
|
-
|
|
77
|
-
return streaks_dir
|
|
78
|
-
|
|
79
|
-
"""
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: grdwindinversion
|
|
3
|
-
Version: 0.2.7
|
|
4
|
-
Summary: Package to perform Wind inversion from GRD Level-1 SAR images
|
|
5
|
-
License: MIT
|
|
6
|
-
Classifier: Development Status :: 2 - Pre-Alpha
|
|
7
|
-
Classifier: Intended Audience :: Developers
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Natural Language :: English
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Requires-Python: >=3.9
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
License-File: LICENSE
|
|
20
|
-
License-File: AUTHORS.rst
|
|
21
|
-
Requires-Dist: xsar
|
|
22
|
-
Requires-Dist: xsarsea
|
|
23
|
-
Requires-Dist: xarray
|
|
24
|
-
Requires-Dist: xarray-datatree
|
|
25
|
-
Requires-Dist: pyyaml
|
|
26
|
-
Requires-Dist: numpy
|
|
27
|
-
Requires-Dist: scipy
|
|
28
|
-
Requires-Dist: fsspec
|
|
29
|
-
Requires-Dist: aiohttp
|
|
30
|
-
Requires-Dist: xarray-safe-s1
|
|
31
|
-
Requires-Dist: xradarsat2
|
|
32
|
-
Requires-Dist: xarray-safe-rcm
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# grdwindinversion
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
[](https://pypi.org/project/grdwindinversion/)
|
|
40
|
-
[](https://github.com/umr-lops/grdwindinversion/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Package to perform Wind inversion from GRD Level-1 SAR images
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* Free software: MIT license
|
|
50
|
-
* Documentation: https://grdwindinversion.readthedocs.io.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## Usage
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```python
|
|
57
|
-
|
|
58
|
-
SAR_L1-to-L2_wind_processor -h
|
|
59
|
-
usage: SAR_L1-to-L2_wind_processor [-h] --input_file INPUT_FILE [--config_file CONFIG_FILE] --outputdir OUTPUTDIR [--verbose] [--overwrite]
|
|
60
|
-
|
|
61
|
-
Perform inversion from S1(L1-GRD) SAFE, L1-RCM, L1-RS2 ; using xsar/xsarsea tools
|
|
62
|
-
|
|
63
|
-
options:
|
|
64
|
-
-h, --help show this help message and exit
|
|
65
|
-
--input_file INPUT_FILE
|
|
66
|
-
input file path
|
|
67
|
-
--config_file CONFIG_FILE
|
|
68
|
-
config file path [if not provided will take config file based on input file]
|
|
69
|
-
--outputdir OUTPUTDIR
|
|
70
|
-
--verbose
|
|
71
|
-
--overwrite overwrite existing .nc files [default is False]
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## Features
|
|
76
|
-
|
|
77
|
-
This Python library (based on `xarray`) allows to perform wind inversion from level-1 GRD (projected magnitude image).
|
|
78
|
-
Mission supported:
|
|
79
|
-
* Sentinel-1
|
|
80
|
-
* RCM
|
|
81
|
-
* RadarSat-2
|
|
82
|
-
|
|
83
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
grdwindinversion/.gitignore,sha256=vmDRHGeESYckUdUztsPr7u6ZNfBYMCVR3GE3AJCBnsY,1204
|
|
2
|
-
grdwindinversion/__init__.py,sha256=VQc2V_j124NX2Gp06Go1oSZDSF4lBIVPYT-W9ZkNBXE,415
|
|
3
|
-
grdwindinversion/config_prod.yaml,sha256=sYF1TAYM5ifFqlGdVwz8ygydo3_6KnEqYb7eBWYeDiw,1047
|
|
4
|
-
grdwindinversion/config_prod_recal.yaml,sha256=WzucOsKVCK-lw5kRn-4llONwBxl8TogYrReeLycXC6k,1006
|
|
5
|
-
grdwindinversion/data_config.yaml,sha256=YbbgxqpgasR5RINO29Ep_1cELdZotoylLzn6Qh7f6LM,473
|
|
6
|
-
grdwindinversion/inversion.py,sha256=zJt2HNoeqiQhNG5jKGUVe33HWbGeub1BRM1gPGoCcQo,47239
|
|
7
|
-
grdwindinversion/load_config.py,sha256=bt7EXTmXfbuK0oNR-qwtijv_iZBQzi5BtY92RGKEo4Y,651
|
|
8
|
-
grdwindinversion/main.py,sha256=0DLDW0i14CWhDKAGegzOKlWnCkag_cGn3vzMIAKcv4g,2658
|
|
9
|
-
grdwindinversion/streaks.py,sha256=SucALdajwAr-tcqwJs6KOj8CQ7qQPp3JUKSh2dHAJTY,2950
|
|
10
|
-
grdwindinversion/utils.py,sha256=UK-ACGAFktiQaINzFFa1rtD-Vd1StXn4_n4-6t4yefc,2579
|
|
11
|
-
grdwindinversion/utils_memory.py,sha256=1N3Kh4qVZPELPU6I4onbmkur1CZd7EHZqfbSAa6eaVc,1480
|
|
12
|
-
grdwindinversion/.github/ISSUE_TEMPLATE.md,sha256=qiM_a7CCUz3fSrz3Q20Se1nwPNFS8QCc8tkwK_0DSCo,327
|
|
13
|
-
grdwindinversion-0.2.7.dist-info/AUTHORS.rst,sha256=KmhW_5LBKGTIGwWEVkoTm1qx_bvdDR3yYL-1cwbDOFQ,218
|
|
14
|
-
grdwindinversion-0.2.7.dist-info/LICENSE,sha256=-B8mBiTeY3J7OLuayiV1myqmc7yeijBc7s34kc8RTmg,1075
|
|
15
|
-
grdwindinversion-0.2.7.dist-info/METADATA,sha256=aBCWc9uXi9BHTtGdTldSQpjLGXdYnhYFljOYDNjhFn0,2479
|
|
16
|
-
grdwindinversion-0.2.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
17
|
-
grdwindinversion-0.2.7.dist-info/entry_points.txt,sha256=2rjvlVCy0iasRXjOz3kOIGuy2OCGQ-VTNuwuViQ6cMM,95
|
|
18
|
-
grdwindinversion-0.2.7.dist-info/top_level.txt,sha256=z6lPix3QPEYOo37qq8plA2hY7S3C8MQZY81agRlksMI,17
|
|
19
|
-
grdwindinversion-0.2.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|