grdwindinversion 0.2.3.post8__tar.gz → 0.2.3.post10__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.
- {grdwindinversion-0.2.3.post8/grdwindinversion.egg-info → grdwindinversion-0.2.3.post10}/PKG-INFO +1 -1
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/__init__.py +2 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/inversion.py +47 -24
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10/grdwindinversion.egg-info}/PKG-INFO +1 -1
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.editorconfig +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.github/dependabot.yml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.github/workflows/publish.yml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.gitignore +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.pre-commit-config.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/AUTHORS.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/CONTRIBUTING.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/HISTORY.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/LICENSE +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/MANIFEST.in +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/Makefile +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/README.md +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/ci/requirements/docs.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/ci/requirements/environment.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/Makefile +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/_static/css/grdwindinversion.css +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/algorithm.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/authors.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/conf.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/contributing.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/examples/wind-inversion-from-grd.ipynb +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/history.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/index.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/installation.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/make.bat +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/modules.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/readme.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/usage.rst +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/.github/ISSUE_TEMPLATE.md +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/.gitignore +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/.travis.yml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/config_prod.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/config_prod_recal.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/data_config.yaml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/load_config.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/main.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/utils.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/SOURCES.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/dependency_links.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/entry_points.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/requires.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/top_level.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/pyproject.toml +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/requirements_dev.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/requirements_doc.txt +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/setup.cfg +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/tests/__init__.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/tests/test_grdwindinversion.py +0 -0
- {grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/tox.ini +0 -0
|
@@ -6,6 +6,8 @@ __all__ = ['inversion']
|
|
|
6
6
|
# __version__ = metadata.version('grdwindinversion')
|
|
7
7
|
from grdwindinversion import *
|
|
8
8
|
from importlib.metadata import version
|
|
9
|
+
from grdwindinversion.inversion import inverse
|
|
10
|
+
|
|
9
11
|
try:
|
|
10
12
|
__version__ = version("grdwindinversion")
|
|
11
13
|
except Exception:
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/inversion.py
RENAMED
|
@@ -118,8 +118,8 @@ def getOutputName2(input_file, out_folder, sensor, meta):
|
|
|
118
118
|
|
|
119
119
|
def getAncillary(meta, ancillary_name='ecmwf'):
|
|
120
120
|
"""
|
|
121
|
-
Map ancillary wind from ECMWF.
|
|
122
|
-
This function is used to check if the
|
|
121
|
+
Map ancillary wind from ECMWF or ERA5.
|
|
122
|
+
This function is used to check if the model files are available and to map the model to the SAR data.
|
|
123
123
|
|
|
124
124
|
Parameters
|
|
125
125
|
----------
|
|
@@ -184,8 +184,31 @@ def getAncillary(meta, ancillary_name='ecmwf'):
|
|
|
184
184
|
|
|
185
185
|
return map_model
|
|
186
186
|
|
|
187
|
+
elif ancillary_name == 'era5':
|
|
188
|
+
era5_name = "era5_0250_1h"
|
|
189
|
+
logging.debug('conf: %s', getConf())
|
|
190
|
+
era0250 = getConf()[era5_name]
|
|
191
|
+
logging.debug('%s : %s', (era5_name, era0250))
|
|
192
|
+
meta.set_raster(era5_name, era0250)
|
|
193
|
+
|
|
194
|
+
era5_infos = meta.rasters.loc[era5_name]
|
|
195
|
+
try:
|
|
196
|
+
era5_file = era5_infos['get_function'](era5_infos['resource'],
|
|
197
|
+
date=datetime.datetime.strptime(meta.start_date,
|
|
198
|
+
'%Y-%m-%d %H:%M:%S.%f'))[1]
|
|
199
|
+
except Exception as e:
|
|
200
|
+
era5_file = era5_infos['get_function'](era5_infos['resource'],
|
|
201
|
+
date=datetime.datetime.strptime(meta.start_date,
|
|
202
|
+
'%Y-%m-%d %H:%M:%S'))[1]
|
|
203
|
+
if not os.path.isfile(era5_file):
|
|
204
|
+
raise ValueError(f"era5 file {era5_file} not found")
|
|
205
|
+
|
|
206
|
+
map_model = {'%s_%s' % (era5_name, uv): 'model_%s' %
|
|
207
|
+
uv for uv in ['U10', 'V10']}
|
|
208
|
+
return map_model
|
|
209
|
+
|
|
187
210
|
else:
|
|
188
|
-
raise ValueError("ancillary_name must be ecmwf, got %s" %
|
|
211
|
+
raise ValueError("ancillary_name must be ecmwf/era5, got %s" %
|
|
189
212
|
ancillary_name)
|
|
190
213
|
|
|
191
214
|
|
|
@@ -301,13 +324,9 @@ def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, copol_gmf, crosspol_gmf,
|
|
|
301
324
|
'offboresight': 'owiOffBoresightAngle',
|
|
302
325
|
'mask': 'owiMask',
|
|
303
326
|
'windspeed_co': 'owiWindSpeed_co',
|
|
304
|
-
'windspeed_cross': 'owiWindSpeed_cross',
|
|
305
|
-
'windspeed_dual': 'owiWindSpeed',
|
|
306
327
|
'winddir_co': 'owiWindDirection_co',
|
|
307
|
-
'
|
|
308
|
-
'
|
|
309
|
-
'ancillary_wind_speed': 'owiEcmwfWindSpeed',
|
|
310
|
-
'ancillary_wind_direction': 'owiEcmwfWindDirection',
|
|
328
|
+
'ancillary_wind_speed': 'owiAncillaryWindSpeed',
|
|
329
|
+
'ancillary_wind_direction': 'owiAncillaryWindDirection',
|
|
311
330
|
})
|
|
312
331
|
xr_dataset['owiNrcs'] = xr_dataset['sigma0_ocean'].sel(pol=copol)
|
|
313
332
|
xr_dataset.owiNrcs.attrs = xr_dataset.sigma0_ocean.attrs
|
|
@@ -351,7 +370,11 @@ def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, copol_gmf, crosspol_gmf,
|
|
|
351
370
|
|
|
352
371
|
xr_dataset = xr_dataset.rename({
|
|
353
372
|
'dsig_cross': 'owiDsig_cross',
|
|
354
|
-
'nesz_cross_final': 'owiNesz_cross_final'
|
|
373
|
+
'nesz_cross_final': 'owiNesz_cross_final',
|
|
374
|
+
'winddir_cross': 'owiWindDirection_cross',
|
|
375
|
+
'winddir_dual': 'owiWindDirection',
|
|
376
|
+
'windspeed_cross': 'owiWindSpeed_cross',
|
|
377
|
+
'windspeed_dual': 'owiWindSpeed',
|
|
355
378
|
})
|
|
356
379
|
|
|
357
380
|
xr_dataset['owiNrcs_cross'] = xr_dataset['sigma0_ocean'].sel(
|
|
@@ -557,10 +580,11 @@ def makeL2(filename, out_folder, config_path, overwrite=False, generateCSV=True,
|
|
|
557
580
|
logging.info("out_file %s exists ; returning empty Dataset" % out_file)
|
|
558
581
|
return out_file, xr.Dataset()
|
|
559
582
|
|
|
560
|
-
|
|
583
|
+
ancillary_name = config["ancillary"]
|
|
584
|
+
map_model = getAncillary(meta, ancillary_name)
|
|
561
585
|
if map_model is None:
|
|
562
586
|
raise Exception(
|
|
563
|
-
'the weather model is not set `map_model` is None -> you probably don"t have access to
|
|
587
|
+
f'the weather model is not set `map_model` is None -> you probably don"t have access to f{ancillary_name} archive')
|
|
564
588
|
|
|
565
589
|
try:
|
|
566
590
|
if ((recalibration) & ("SENTINEL" in sensor_longname)):
|
|
@@ -669,7 +693,7 @@ def makeL2(filename, out_folder, config_path, overwrite=False, generateCSV=True,
|
|
|
669
693
|
xr_dataset['ancillary_wind_direction'].attrs = {}
|
|
670
694
|
xr_dataset['ancillary_wind_direction'].attrs['units'] = 'degrees_north'
|
|
671
695
|
xr_dataset['ancillary_wind_direction'].attrs[
|
|
672
|
-
'long_name'] = '
|
|
696
|
+
'long_name'] = f'{ancillary_name} Wind direction (meteorological convention)'
|
|
673
697
|
xr_dataset['ancillary_wind_direction'].attrs['standart_name'] = 'wind_direction'
|
|
674
698
|
|
|
675
699
|
xr_dataset['ancillary_wind_speed'] = np.sqrt(
|
|
@@ -680,7 +704,7 @@ def makeL2(filename, out_folder, config_path, overwrite=False, generateCSV=True,
|
|
|
680
704
|
xr_dataset['ancillary_wind_speed'].attrs = {}
|
|
681
705
|
xr_dataset['ancillary_wind_speed'].attrs['units'] = 'm s^-1'
|
|
682
706
|
xr_dataset['ancillary_wind_speed'].attrs[
|
|
683
|
-
'long_name'] = '
|
|
707
|
+
'long_name'] = f'{ancillary_name} Wind speed'
|
|
684
708
|
xr_dataset['ancillary_wind_speed'].attrs['standart_name'] = 'wind_speed'
|
|
685
709
|
|
|
686
710
|
xr_dataset['ancillary_wind'] = xr.where(xr_dataset['mask'], np.nan,
|
|
@@ -742,21 +766,20 @@ def makeL2(filename, out_folder, config_path, overwrite=False, generateCSV=True,
|
|
|
742
766
|
|
|
743
767
|
# get windspeeds
|
|
744
768
|
xr_dataset['windspeed_co'] = np.abs(wind_co)
|
|
745
|
-
xr_dataset['windspeed_dual'] = np.abs(wind_dual)
|
|
746
|
-
|
|
747
|
-
if dual_pol:
|
|
748
|
-
xr_dataset = xr_dataset.assign(
|
|
749
|
-
windspeed_cross=(['line', 'sample'], windspeed_cr))
|
|
750
|
-
else:
|
|
751
|
-
xr_dataset['windspeed_cross'] = windspeed_cr
|
|
752
769
|
|
|
753
770
|
# get winddirections
|
|
754
771
|
xr_dataset['winddir_co'] = (
|
|
755
772
|
90 - (np.angle(-np.conj(wind_co), deg=True)) + xr_dataset.ground_heading) % 360
|
|
756
773
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
774
|
+
if dual_pol:
|
|
775
|
+
xr_dataset['windspeed_dual'] = np.abs(wind_dual)
|
|
776
|
+
|
|
777
|
+
xr_dataset = xr_dataset.assign(
|
|
778
|
+
windspeed_cross=(['line', 'sample'], windspeed_cr))
|
|
779
|
+
|
|
780
|
+
xr_dataset['winddir_dual'] = (
|
|
781
|
+
90 - (np.angle(-np.conj(wind_dual), deg=True)) + xr_dataset.ground_heading) % 360
|
|
782
|
+
xr_dataset['winddir_cross'] = xr_dataset['winddir_dual'].copy()
|
|
760
783
|
|
|
761
784
|
xr_dataset, encoding = makeL2asOwi(
|
|
762
785
|
xr_dataset, dual_pol, copol, crosspol, copol_gmf, crosspol_gmf, config)
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/.github/workflows/publish.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/ci/requirements/environment.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/docs/_static/css/grdwindinversion.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/config_prod.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/data_config.yaml
RENAMED
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion/load_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/grdwindinversion.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.3.post8 → grdwindinversion-0.2.3.post10}/tests/test_grdwindinversion.py
RENAMED
|
File without changes
|
|
File without changes
|