Example of Wind inversion¶
define a product GRD Sentinel-1¶
[1]:
import xsar
[2]:
# test on an dummy GRD IW product
input_file = xsar.get_test_file('S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_Z010.SAFE')
perform wind inversion¶
[3]:
from grdwindinversion.inversion import makeL2
define config file¶
[4]:
import grdwindinversion
import os
config_file_s1 = os.path.join(os.path.dirname(grdwindinversion.__file__),'config_S1.yaml')
grdwindinversion.__file__
print(os.path.exists(config_file_s1))
True
[5]:
out_folder = '/tmp/test_windinversion'
[6]:
makeL2?
[7]:
out_file,outds = makeL2(input_file,out_folder, config_path=config_file_s1,overwrite=True)
outds
WARNING:xsar.base_dataset:Raster variable are experimental
INFO:xsarsea.windspeed:timing invert_from_model : 3.81s. mem: +123.5Mb
/opt/conda-envs/dev/lib/python3.10/site-packages/xsarsea/windspeed/windspeed.py:76: UserWarning: Unable to check sigma0 pol. Assuming VH
warnings.warn('Unable to check sigma0 pol. Assuming %s' % model_pol)
INFO:xsarsea.windspeed:timing invert_from_model : 0.74s. mem: +4.0Mb
/home1/datahome/agrouaze/sources/git/grdwindinversion/grdwindinversion/inversion.py:417: UserWarning: rename 'line' to 'owiAzSize' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
dataset_1000m = dataset_1000m.rename(
/home1/datahome/agrouaze/sources/git/grdwindinversion/grdwindinversion/inversion.py:417: UserWarning: rename 'sample' to 'owiRaSize' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
dataset_1000m = dataset_1000m.rename(
/opt/conda-envs/dev/lib/python3.10/site-packages/pandas/core/internals/blocks.py:2540: RuntimeWarning: invalid value encountered in cast
values = values.astype(str)
[7]:
<xarray.Dataset> Dimensions: (owiAzSize: 167, owiRaSize: 251) Dimensions without coordinates: owiAzSize, owiRaSize Data variables: (12/22) owiLon (owiAzSize, owiRaSize) float64 -67.85 ... owiLandFlag (owiAzSize, owiRaSize) bool False ... ... owiElevationAngle (owiAzSize, owiRaSize) float64 27.53 .... owiIncidenceAngle (owiAzSize, owiRaSize) float64 30.85 .... owiHeading (owiAzSize, owiRaSize) float32 -169.3 ... owiLat (owiAzSize, owiRaSize) float64 20.72 .... ... ... owiWindSpeed (owiAzSize, owiRaSize) float64 22.4 ..... owiWindSpeed_cross (owiAzSize, owiRaSize) float64 25.4 ..... owiEcmwfWindSpeed (owiAzSize, owiRaSize) float64 24.22 .... owiEcmwfWindDirection (owiAzSize, owiRaSize) float64 -0.1119... owiWindQuality (owiAzSize, owiRaSize) float64 0.0 ...... owiWindFilter (owiAzSize, owiRaSize) float64 0.0 ...... Attributes: (12/43) short_name: SENTINEL1_DS:S1A_IW_GRDH_1SDV_20170907T103020_2017... product: GRDH safe: S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_0... swath: IW multidataset: False ipf: 2.84 ... ... inversionTabGMF: cmod5n, gmf_s1_v2 wnf_3km_average: / owiWindSpeedSrc: owiWindSpeed owiWindDirectionSrc: / xsar_version: 1.1.7.dev1+g7186725.d20230829 xsarsea_version: 0.8