XSAR simple example¶
[1]:
import xsar
[2]:
import rasterio
rasterio.__version__
[2]:
'1.2.1'
[3]:
import gdal
gdal.VersionInfo()
[3]:
'3010400'
[4]:
import holoviews as hv
hv.extension('bokeh')
from holoviews.operation.datashader import datashade,rasterize
import datashader as dh
[5]:
# archive SAFE L1
# for example is the SAFE archive of Irma cyclone
filename = '/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_992F.SAFE'
[6]:
# define the resolution in pixel
# the default value is None you read the data with high resolution
resolution = {'atrack': 30, 'xtrack': 30}
[7]:
# open_dataset funcion return the list of dataset in your SAFE
sar_ds = xsar.open_dataset(filename, resolution=resolution)
sar_ds
[7]:
<xarray.Dataset> Dimensions: (atrack: 600, pol: 2, xtrack: 840) Coordinates: * pol (pol) object 'VV' 'VH' * atrack (atrack) float64 15.0 45.0 75.0 ... 1.796e+04 1.798e+04 * xtrack (xtrack) float64 15.0 45.0 75.0 ... 2.516e+04 2.518e+04 Data variables: digital_number (pol, atrack, xtrack) float32 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> time (atrack) datetime64[ns] 2017-09-07T10:30:20.936409088 ...... longitude (atrack, xtrack) float32 dask.array<chunksize=(600, 840), meta=np.ndarray> latitude (atrack, xtrack) float32 dask.array<chunksize=(600, 840), meta=np.ndarray> elevation (atrack, xtrack) float32 dask.array<chunksize=(600, 840), meta=np.ndarray> incidence (atrack, xtrack) float32 dask.array<chunksize=(600, 840), meta=np.ndarray> sigma0_raw (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> nesz (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> gamma0_raw (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> negz (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> sigma0 (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> gamma0 (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 840), meta=np.ndarray> Attributes: (12/13) ipf: 2.84 platform: SENTINEL-1A swath: IW product: GRD pols: VV VH name: SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170... ... ... stop_date: 2017-09-07 10:30:45.935264 footprint: POLYGON ((-67.84221143971432 20.72564283093837, -70.2216... coverage: 251km * 170km (xtrack * atrack ) pixel_atrack_m: 10.2 pixel_xtrack_m: 10.0 Conventions: CF-1.7
xarray.Dataset
- atrack: 600
- pol: 2
- xtrack: 840
- pol(pol)object'VV' 'VH'
array(['VV', 'VH'], dtype=object)
- atrack(atrack)float6415.0 45.0 ... 1.796e+04 1.798e+04
- units :
- 1
array([1.5000e+01, 4.5000e+01, 7.5000e+01, ..., 1.7925e+04, 1.7955e+04, 1.7985e+04])
- xtrack(xtrack)float6415.0 45.0 ... 2.516e+04 2.518e+04
- units :
- 1
array([1.5000e+01, 4.5000e+01, 7.5000e+01, ..., 2.5125e+04, 2.5155e+04, 2.5185e+04])
- digital_number(pol, atrack, xtrack)float32dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
Array Chunk Bytes 4.03 MB 2.02 MB Shape (2, 600, 840) (1, 600, 840) Count 31 Tasks 2 Chunks Type float32 numpy.ndarray - time(atrack)datetime64[ns]2017-09-07T10:30:20.936409088 .....
array(['2017-09-07T10:30:20.936409088', '2017-09-07T10:30:20.978143488', '2017-09-07T10:30:21.019877632', ..., '2017-09-07T10:30:45.851795456', '2017-09-07T10:30:45.893529600', '2017-09-07T10:30:45.935264000'], dtype='datetime64[ns]')
- longitude(atrack, xtrack)float32dask.array<chunksize=(600, 840), meta=np.ndarray>
- standard_name :
- longitude
- units :
- degrees_east
Array Chunk Bytes 2.02 MB 2.02 MB Shape (600, 840) (600, 840) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - latitude(atrack, xtrack)float32dask.array<chunksize=(600, 840), meta=np.ndarray>
- standard_name :
- latitude
- units :
- degrees_north
Array Chunk Bytes 2.02 MB 2.02 MB Shape (600, 840) (600, 840) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - elevation(atrack, xtrack)float32dask.array<chunksize=(600, 840), meta=np.ndarray>
Array Chunk Bytes 2.02 MB 2.02 MB Shape (600, 840) (600, 840) Count 5 Tasks 1 Chunks Type float32 numpy.ndarray - incidence(atrack, xtrack)float32dask.array<chunksize=(600, 840), meta=np.ndarray>
Array Chunk Bytes 2.02 MB 2.02 MB Shape (600, 840) (600, 840) Count 5 Tasks 1 Chunks Type float32 numpy.ndarray - sigma0_raw(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 55 Tasks 2 Chunks Type float64 numpy.ndarray - nesz(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 39 Tasks 2 Chunks Type float64 numpy.ndarray - gamma0_raw(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 55 Tasks 2 Chunks Type float64 numpy.ndarray - negz(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 39 Tasks 2 Chunks Type float64 numpy.ndarray - sigma0(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 84 Tasks 2 Chunks Type float64 numpy.ndarray - gamma0(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 840), meta=np.ndarray>
Array Chunk Bytes 8.06 MB 4.03 MB Shape (2, 600, 840) (1, 600, 840) Count 84 Tasks 2 Chunks Type float64 numpy.ndarray
- ipf :
- 2.84
- platform :
- SENTINEL-1A
- swath :
- IW
- product :
- GRD
- pols :
- VV VH
- name :
- SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_992F.SAFE:IW
- start_date :
- 2017-09-07 10:30:20.936409
- stop_date :
- 2017-09-07 10:30:45.935264
- footprint :
- POLYGON ((-67.84221143971432 20.72564283093837, -70.22162571215458 21.14758369556577, -70.51434171237564 19.64044158236074, -68.15836401927538 19.21519321274318, -67.84221143971432 20.72564283093837))
- coverage :
- 251km * 170km (xtrack * atrack )
- pixel_atrack_m :
- 10.2
- pixel_xtrack_m :
- 10.0
- Conventions :
- CF-1.7
[8]:
rasterize(hv.Image(sar_ds.sigma0.sel(pol='VV')).opts(clim=(0,0.4), cmap='gray',colorbar=True,tools=['hover'],title="xsar"))
[8]:
[9]:
# you can select a specific polarization or zone in your SAFE with function xarray.sel
sar_ds = sar_ds.sel(pol='VV')
sar_ds = sar_ds.sel(xtrack=slice(5000, 9999, 1), atrack=slice(7000, 11999, 1)) # irma eye
sar_ds
[9]:
<xarray.Dataset> Dimensions: (atrack: 167, xtrack: 166) Coordinates: pol <U2 'VV' * atrack (atrack) float64 7.005e+03 7.035e+03 ... 1.196e+04 1.198e+04 * xtrack (xtrack) float64 5.025e+03 5.055e+03 ... 9.945e+03 9.975e+03 Data variables: digital_number (atrack, xtrack) float32 dask.array<chunksize=(167, 166), meta=np.ndarray> time (atrack) datetime64[ns] 2017-09-07T10:30:30.660504576 ...... longitude (atrack, xtrack) float32 dask.array<chunksize=(167, 166), meta=np.ndarray> latitude (atrack, xtrack) float32 dask.array<chunksize=(167, 166), meta=np.ndarray> elevation (atrack, xtrack) float32 dask.array<chunksize=(167, 166), meta=np.ndarray> incidence (atrack, xtrack) float32 dask.array<chunksize=(167, 166), meta=np.ndarray> sigma0_raw (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> nesz (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> gamma0_raw (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> negz (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> sigma0 (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> gamma0 (atrack, xtrack) float64 dask.array<chunksize=(167, 166), meta=np.ndarray> Attributes: (12/13) ipf: 2.84 platform: SENTINEL-1A swath: IW product: GRD pols: VV VH name: SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170... ... ... stop_date: 2017-09-07 10:30:45.935264 footprint: POLYGON ((-67.84221143971432 20.72564283093837, -70.2216... coverage: 251km * 170km (xtrack * atrack ) pixel_atrack_m: 10.2 pixel_xtrack_m: 10.0 Conventions: CF-1.7
xarray.Dataset
- atrack: 167
- xtrack: 166
- pol()<U2'VV'
array('VV', dtype='<U2')
- atrack(atrack)float647.005e+03 7.035e+03 ... 1.198e+04
- units :
- 1
array([ 7005., 7035., 7065., 7095., 7125., 7155., 7185., 7215., 7245., 7275., 7305., 7335., 7365., 7395., 7425., 7455., 7485., 7515., 7545., 7575., 7605., 7635., 7665., 7695., 7725., 7755., 7785., 7815., 7845., 7875., 7905., 7935., 7965., 7995., 8025., 8055., 8085., 8115., 8145., 8175., 8205., 8235., 8265., 8295., 8325., 8355., 8385., 8415., 8445., 8475., 8505., 8535., 8565., 8595., 8625., 8655., 8685., 8715., 8745., 8775., 8805., 8835., 8865., 8895., 8925., 8955., 8985., 9015., 9045., 9075., 9105., 9135., 9165., 9195., 9225., 9255., 9285., 9315., 9345., 9375., 9405., 9435., 9465., 9495., 9525., 9555., 9585., 9615., 9645., 9675., 9705., 9735., 9765., 9795., 9825., 9855., 9885., 9915., 9945., 9975., 10005., 10035., 10065., 10095., 10125., 10155., 10185., 10215., 10245., 10275., 10305., 10335., 10365., 10395., 10425., 10455., 10485., 10515., 10545., 10575., 10605., 10635., 10665., 10695., 10725., 10755., 10785., 10815., 10845., 10875., 10905., 10935., 10965., 10995., 11025., 11055., 11085., 11115., 11145., 11175., 11205., 11235., 11265., 11295., 11325., 11355., 11385., 11415., 11445., 11475., 11505., 11535., 11565., 11595., 11625., 11655., 11685., 11715., 11745., 11775., 11805., 11835., 11865., 11895., 11925., 11955., 11985.])
- xtrack(xtrack)float645.025e+03 5.055e+03 ... 9.975e+03
- units :
- 1
array([5025., 5055., 5085., 5115., 5145., 5175., 5205., 5235., 5265., 5295., 5325., 5355., 5385., 5415., 5445., 5475., 5505., 5535., 5565., 5595., 5625., 5655., 5685., 5715., 5745., 5775., 5805., 5835., 5865., 5895., 5925., 5955., 5985., 6015., 6045., 6075., 6105., 6135., 6165., 6195., 6225., 6255., 6285., 6315., 6345., 6375., 6405., 6435., 6465., 6495., 6525., 6555., 6585., 6615., 6645., 6675., 6705., 6735., 6765., 6795., 6825., 6855., 6885., 6915., 6945., 6975., 7005., 7035., 7065., 7095., 7125., 7155., 7185., 7215., 7245., 7275., 7305., 7335., 7365., 7395., 7425., 7455., 7485., 7515., 7545., 7575., 7605., 7635., 7665., 7695., 7725., 7755., 7785., 7815., 7845., 7875., 7905., 7935., 7965., 7995., 8025., 8055., 8085., 8115., 8145., 8175., 8205., 8235., 8265., 8295., 8325., 8355., 8385., 8415., 8445., 8475., 8505., 8535., 8565., 8595., 8625., 8655., 8685., 8715., 8745., 8775., 8805., 8835., 8865., 8895., 8925., 8955., 8985., 9015., 9045., 9075., 9105., 9135., 9165., 9195., 9225., 9255., 9285., 9315., 9345., 9375., 9405., 9435., 9465., 9495., 9525., 9555., 9585., 9615., 9645., 9675., 9705., 9735., 9765., 9795., 9825., 9855., 9885., 9915., 9945., 9975.])
- digital_number(atrack, xtrack)float32dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 110.89 kB 110.89 kB Shape (167, 166) (167, 166) Count 33 Tasks 1 Chunks Type float32 numpy.ndarray - time(atrack)datetime64[ns]2017-09-07T10:30:30.660504576 .....
array(['2017-09-07T10:30:30.660504576', '2017-09-07T10:30:30.702238976', '2017-09-07T10:30:30.743973120', '2017-09-07T10:30:30.785707520', '2017-09-07T10:30:30.827441920', '2017-09-07T10:30:30.869176064', '2017-09-07T10:30:30.910910464', '2017-09-07T10:30:30.952644864', '2017-09-07T10:30:30.994379008', '2017-09-07T10:30:31.036113408', '2017-09-07T10:30:31.077847808', '2017-09-07T10:30:31.119581952', '2017-09-07T10:30:31.161316352', '2017-09-07T10:30:31.203050752', '2017-09-07T10:30:31.244784896', '2017-09-07T10:30:31.286519296', '2017-09-07T10:30:31.328253696', '2017-09-07T10:30:31.369987840', '2017-09-07T10:30:31.411722240', '2017-09-07T10:30:31.453456640', '2017-09-07T10:30:31.495190784', '2017-09-07T10:30:31.536925184', '2017-09-07T10:30:31.578659584', '2017-09-07T10:30:31.620393728', '2017-09-07T10:30:31.662128128', '2017-09-07T10:30:31.703862528', '2017-09-07T10:30:31.745596672', '2017-09-07T10:30:31.787331072', '2017-09-07T10:30:31.829065472', '2017-09-07T10:30:31.870799616', '2017-09-07T10:30:31.912534016', '2017-09-07T10:30:31.954268416', '2017-09-07T10:30:31.996002560', '2017-09-07T10:30:32.037736960', '2017-09-07T10:30:32.079471360', '2017-09-07T10:30:32.121205504', '2017-09-07T10:30:32.162939904', '2017-09-07T10:30:32.204674304', '2017-09-07T10:30:32.246408448', '2017-09-07T10:30:32.288142848', '2017-09-07T10:30:32.329877248', '2017-09-07T10:30:32.371611392', '2017-09-07T10:30:32.413345792', '2017-09-07T10:30:32.455080192', '2017-09-07T10:30:32.496814336', '2017-09-07T10:30:32.538548736', '2017-09-07T10:30:32.580283136', '2017-09-07T10:30:32.622017280', '2017-09-07T10:30:32.663751680', '2017-09-07T10:30:32.705486080', '2017-09-07T10:30:32.747220224', '2017-09-07T10:30:32.788954624', '2017-09-07T10:30:32.830689024', '2017-09-07T10:30:32.872423168', '2017-09-07T10:30:32.914157568', '2017-09-07T10:30:32.955891968', '2017-09-07T10:30:32.997626112', '2017-09-07T10:30:33.039360512', '2017-09-07T10:30:33.081094912', '2017-09-07T10:30:33.122829056', '2017-09-07T10:30:33.164563456', '2017-09-07T10:30:33.206297856', '2017-09-07T10:30:33.248032000', '2017-09-07T10:30:33.289766400', '2017-09-07T10:30:33.331500800', '2017-09-07T10:30:33.373234944', '2017-09-07T10:30:33.414969344', '2017-09-07T10:30:33.456703744', '2017-09-07T10:30:33.498438144', '2017-09-07T10:30:33.540172288', '2017-09-07T10:30:33.581906688', '2017-09-07T10:30:33.623641088', '2017-09-07T10:30:33.665375232', '2017-09-07T10:30:33.707109632', '2017-09-07T10:30:33.748844032', '2017-09-07T10:30:33.790578176', '2017-09-07T10:30:33.832312576', '2017-09-07T10:30:33.874046976', '2017-09-07T10:30:33.915781120', '2017-09-07T10:30:33.957515520', '2017-09-07T10:30:33.999249920', '2017-09-07T10:30:34.040984064', '2017-09-07T10:30:34.082718464', '2017-09-07T10:30:34.124452864', '2017-09-07T10:30:34.166187008', '2017-09-07T10:30:34.207921408', '2017-09-07T10:30:34.249655808', '2017-09-07T10:30:34.291389952', '2017-09-07T10:30:34.333124352', '2017-09-07T10:30:34.374858752', '2017-09-07T10:30:34.416592896', '2017-09-07T10:30:34.458327296', '2017-09-07T10:30:34.500061696', '2017-09-07T10:30:34.541795840', '2017-09-07T10:30:34.583530240', '2017-09-07T10:30:34.625264640', '2017-09-07T10:30:34.666998784', '2017-09-07T10:30:34.708733184', '2017-09-07T10:30:34.750467584', '2017-09-07T10:30:34.792201728', '2017-09-07T10:30:34.833936128', '2017-09-07T10:30:34.875670528', '2017-09-07T10:30:34.917404672', '2017-09-07T10:30:34.959139072', '2017-09-07T10:30:35.000873472', '2017-09-07T10:30:35.042607616', '2017-09-07T10:30:35.084342016', '2017-09-07T10:30:35.126076416', '2017-09-07T10:30:35.167810560', '2017-09-07T10:30:35.209544960', '2017-09-07T10:30:35.251279360', '2017-09-07T10:30:35.293013504', '2017-09-07T10:30:35.334747904', '2017-09-07T10:30:35.376482304', '2017-09-07T10:30:35.418216448', '2017-09-07T10:30:35.459950848', '2017-09-07T10:30:35.501685248', '2017-09-07T10:30:35.543419392', '2017-09-07T10:30:35.585153792', '2017-09-07T10:30:35.626888192', '2017-09-07T10:30:35.668622336', '2017-09-07T10:30:35.710356736', '2017-09-07T10:30:35.752091136', '2017-09-07T10:30:35.793825280', '2017-09-07T10:30:35.835559680', '2017-09-07T10:30:35.877294080', '2017-09-07T10:30:35.919028224', '2017-09-07T10:30:35.960762624', '2017-09-07T10:30:36.002497024', '2017-09-07T10:30:36.044231168', '2017-09-07T10:30:36.085965568', '2017-09-07T10:30:36.127699968', '2017-09-07T10:30:36.169434112', '2017-09-07T10:30:36.211168512', '2017-09-07T10:30:36.252902912', '2017-09-07T10:30:36.294637056', '2017-09-07T10:30:36.336371456', '2017-09-07T10:30:36.378105856', '2017-09-07T10:30:36.419840000', '2017-09-07T10:30:36.461574400', '2017-09-07T10:30:36.503308800', '2017-09-07T10:30:36.545042944', '2017-09-07T10:30:36.586777344', '2017-09-07T10:30:36.628511744', '2017-09-07T10:30:36.670245888', '2017-09-07T10:30:36.711980288', '2017-09-07T10:30:36.753714688', '2017-09-07T10:30:36.795448832', '2017-09-07T10:30:36.837183232', '2017-09-07T10:30:36.878917632', '2017-09-07T10:30:36.920651776', '2017-09-07T10:30:36.962386176', '2017-09-07T10:30:37.004120576', '2017-09-07T10:30:37.045854720', '2017-09-07T10:30:37.087589120', '2017-09-07T10:30:37.129323520', '2017-09-07T10:30:37.171057664', '2017-09-07T10:30:37.212792064', '2017-09-07T10:30:37.254526464', '2017-09-07T10:30:37.296260608', '2017-09-07T10:30:37.337995008', '2017-09-07T10:30:37.379729408', '2017-09-07T10:30:37.421463552', '2017-09-07T10:30:37.463197952', '2017-09-07T10:30:37.504932352', '2017-09-07T10:30:37.546666496', '2017-09-07T10:30:37.588400896'], dtype='datetime64[ns]')
- longitude(atrack, xtrack)float32dask.array<chunksize=(167, 166), meta=np.ndarray>
- standard_name :
- longitude
- units :
- degrees_east
Array Chunk Bytes 110.89 kB 110.89 kB Shape (167, 166) (167, 166) Count 7 Tasks 1 Chunks Type float32 numpy.ndarray - latitude(atrack, xtrack)float32dask.array<chunksize=(167, 166), meta=np.ndarray>
- standard_name :
- latitude
- units :
- degrees_north
Array Chunk Bytes 110.89 kB 110.89 kB Shape (167, 166) (167, 166) Count 7 Tasks 1 Chunks Type float32 numpy.ndarray - elevation(atrack, xtrack)float32dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 110.89 kB 110.89 kB Shape (167, 166) (167, 166) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - incidence(atrack, xtrack)float32dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 110.89 kB 110.89 kB Shape (167, 166) (167, 166) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - sigma0_raw(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 57 Tasks 1 Chunks Type float64 numpy.ndarray - nesz(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 41 Tasks 1 Chunks Type float64 numpy.ndarray - gamma0_raw(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 57 Tasks 1 Chunks Type float64 numpy.ndarray - negz(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 41 Tasks 1 Chunks Type float64 numpy.ndarray - sigma0(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 86 Tasks 1 Chunks Type float64 numpy.ndarray - gamma0(atrack, xtrack)float64dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 86 Tasks 1 Chunks Type float64 numpy.ndarray
- ipf :
- 2.84
- platform :
- SENTINEL-1A
- swath :
- IW
- product :
- GRD
- pols :
- VV VH
- name :
- SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_992F.SAFE:IW
- start_date :
- 2017-09-07 10:30:20.936409
- stop_date :
- 2017-09-07 10:30:45.935264
- footprint :
- POLYGON ((-67.84221143971432 20.72564283093837, -70.22162571215458 21.14758369556577, -70.51434171237564 19.64044158236074, -68.15836401927538 19.21519321274318, -67.84221143971432 20.72564283093837))
- coverage :
- 251km * 170km (xtrack * atrack )
- pixel_atrack_m :
- 10.2
- pixel_xtrack_m :
- 10.0
- Conventions :
- CF-1.7
[10]:
# sigma0 is denoised
sar_ds.sigma0
# sigma0_raw is not denoised
sar_ds.sigma0_raw
[10]:
<xarray.DataArray 'sigma0_raw' (atrack: 167, xtrack: 166)> dask.array<getitem, shape=(167, 166), dtype=float64, chunksize=(167, 166), chunktype=numpy.ndarray> Coordinates: pol <U2 'VV' * atrack (atrack) float64 7.005e+03 7.035e+03 ... 1.196e+04 1.198e+04 * xtrack (xtrack) float64 5.025e+03 5.055e+03 ... 9.945e+03 9.975e+03 Attributes: units: m2/m2
xarray.DataArray
'sigma0_raw'
- atrack: 167
- xtrack: 166
- dask.array<chunksize=(167, 166), meta=np.ndarray>
Array Chunk Bytes 221.78 kB 221.78 kB Shape (167, 166) (167, 166) Count 57 Tasks 1 Chunks Type float64 numpy.ndarray - pol()<U2'VV'
array('VV', dtype='<U2')
- atrack(atrack)float647.005e+03 7.035e+03 ... 1.198e+04
- units :
- 1
array([ 7005., 7035., 7065., 7095., 7125., 7155., 7185., 7215., 7245., 7275., 7305., 7335., 7365., 7395., 7425., 7455., 7485., 7515., 7545., 7575., 7605., 7635., 7665., 7695., 7725., 7755., 7785., 7815., 7845., 7875., 7905., 7935., 7965., 7995., 8025., 8055., 8085., 8115., 8145., 8175., 8205., 8235., 8265., 8295., 8325., 8355., 8385., 8415., 8445., 8475., 8505., 8535., 8565., 8595., 8625., 8655., 8685., 8715., 8745., 8775., 8805., 8835., 8865., 8895., 8925., 8955., 8985., 9015., 9045., 9075., 9105., 9135., 9165., 9195., 9225., 9255., 9285., 9315., 9345., 9375., 9405., 9435., 9465., 9495., 9525., 9555., 9585., 9615., 9645., 9675., 9705., 9735., 9765., 9795., 9825., 9855., 9885., 9915., 9945., 9975., 10005., 10035., 10065., 10095., 10125., 10155., 10185., 10215., 10245., 10275., 10305., 10335., 10365., 10395., 10425., 10455., 10485., 10515., 10545., 10575., 10605., 10635., 10665., 10695., 10725., 10755., 10785., 10815., 10845., 10875., 10905., 10935., 10965., 10995., 11025., 11055., 11085., 11115., 11145., 11175., 11205., 11235., 11265., 11295., 11325., 11355., 11385., 11415., 11445., 11475., 11505., 11535., 11565., 11595., 11625., 11655., 11685., 11715., 11745., 11775., 11805., 11835., 11865., 11895., 11925., 11955., 11985.])
- xtrack(xtrack)float645.025e+03 5.055e+03 ... 9.975e+03
- units :
- 1
array([5025., 5055., 5085., 5115., 5145., 5175., 5205., 5235., 5265., 5295., 5325., 5355., 5385., 5415., 5445., 5475., 5505., 5535., 5565., 5595., 5625., 5655., 5685., 5715., 5745., 5775., 5805., 5835., 5865., 5895., 5925., 5955., 5985., 6015., 6045., 6075., 6105., 6135., 6165., 6195., 6225., 6255., 6285., 6315., 6345., 6375., 6405., 6435., 6465., 6495., 6525., 6555., 6585., 6615., 6645., 6675., 6705., 6735., 6765., 6795., 6825., 6855., 6885., 6915., 6945., 6975., 7005., 7035., 7065., 7095., 7125., 7155., 7185., 7215., 7245., 7275., 7305., 7335., 7365., 7395., 7425., 7455., 7485., 7515., 7545., 7575., 7605., 7635., 7665., 7695., 7725., 7755., 7785., 7815., 7845., 7875., 7905., 7935., 7965., 7995., 8025., 8055., 8085., 8115., 8145., 8175., 8205., 8235., 8265., 8295., 8325., 8355., 8385., 8415., 8445., 8475., 8505., 8535., 8565., 8595., 8625., 8655., 8685., 8715., 8745., 8775., 8805., 8835., 8865., 8895., 8925., 8955., 8985., 9015., 9045., 9075., 9105., 9135., 9165., 9195., 9225., 9255., 9285., 9315., 9345., 9375., 9405., 9435., 9465., 9495., 9525., 9555., 9585., 9615., 9645., 9675., 9705., 9735., 9765., 9795., 9825., 9855., 9885., 9915., 9945., 9975.])
- units :
- m2/m2
XSAR advanced example¶
[11]:
# you can define the specifics chunks
# the default value of chunk is :{xtrack:1000, atrack:1000}
chunks = {'xtrack': 500, 'atrack': 200}
[12]:
# open_dataset funcion return the list of dataset in your SAFE
sar_ds = xsar.open_dataset(filename, chunks=chunks, resolution=resolution)
sar_ds
[12]:
<xarray.Dataset> Dimensions: (atrack: 600, pol: 2, xtrack: 1000) Coordinates: * pol (pol) object 'VV' 'VH' * atrack (atrack) float64 15.0 45.0 75.0 ... 1.796e+04 1.798e+04 * xtrack (xtrack) float64 15.0 45.0 75.0 ... 2.996e+04 2.998e+04 Data variables: digital_number (pol, atrack, xtrack) float32 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> time (atrack) datetime64[ns] 2017-09-07T10:30:20.936409088 ...... longitude (atrack, xtrack) float32 dask.array<chunksize=(600, 1000), meta=np.ndarray> latitude (atrack, xtrack) float32 dask.array<chunksize=(600, 1000), meta=np.ndarray> elevation (atrack, xtrack) float32 dask.array<chunksize=(600, 1000), meta=np.ndarray> incidence (atrack, xtrack) float32 dask.array<chunksize=(600, 1000), meta=np.ndarray> sigma0_raw (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> nesz (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> gamma0_raw (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> negz (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> sigma0 (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> gamma0 (pol, atrack, xtrack) float64 dask.array<chunksize=(1, 600, 1000), meta=np.ndarray> Attributes: (12/13) ipf: 2.84 platform: SENTINEL-1A swath: IW product: GRD pols: VV VH name: SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170... ... ... stop_date: 2017-09-07 10:30:45.935264 footprint: POLYGON ((-67.84221143971432 20.72564283093837, -70.2216... coverage: 251km * 170km (xtrack * atrack ) pixel_atrack_m: 10.2 pixel_xtrack_m: 10.0 Conventions: CF-1.7
xarray.Dataset
- atrack: 600
- pol: 2
- xtrack: 1000
- pol(pol)object'VV' 'VH'
array(['VV', 'VH'], dtype=object)
- atrack(atrack)float6415.0 45.0 ... 1.796e+04 1.798e+04
- units :
- 1
array([1.5000e+01, 4.5000e+01, 7.5000e+01, ..., 1.7925e+04, 1.7955e+04, 1.7985e+04])
- xtrack(xtrack)float6415.0 45.0 ... 2.996e+04 2.998e+04
- units :
- 1
array([1.5000e+01, 4.5000e+01, 7.5000e+01, ..., 2.9925e+04, 2.9955e+04, 2.9985e+04])
- digital_number(pol, atrack, xtrack)float32dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
Array Chunk Bytes 4.80 MB 2.40 MB Shape (2, 600, 1000) (1, 600, 1000) Count 31 Tasks 2 Chunks Type float32 numpy.ndarray - time(atrack)datetime64[ns]2017-09-07T10:30:20.936409088 .....
array(['2017-09-07T10:30:20.936409088', '2017-09-07T10:30:20.978143488', '2017-09-07T10:30:21.019877632', ..., '2017-09-07T10:30:45.851795456', '2017-09-07T10:30:45.893529600', '2017-09-07T10:30:45.935264000'], dtype='datetime64[ns]')
- longitude(atrack, xtrack)float32dask.array<chunksize=(600, 1000), meta=np.ndarray>
- standard_name :
- longitude
- units :
- degrees_east
Array Chunk Bytes 2.40 MB 2.40 MB Shape (600, 1000) (600, 1000) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - latitude(atrack, xtrack)float32dask.array<chunksize=(600, 1000), meta=np.ndarray>
- standard_name :
- latitude
- units :
- degrees_north
Array Chunk Bytes 2.40 MB 2.40 MB Shape (600, 1000) (600, 1000) Count 6 Tasks 1 Chunks Type float32 numpy.ndarray - elevation(atrack, xtrack)float32dask.array<chunksize=(600, 1000), meta=np.ndarray>
Array Chunk Bytes 2.40 MB 2.40 MB Shape (600, 1000) (600, 1000) Count 5 Tasks 1 Chunks Type float32 numpy.ndarray - incidence(atrack, xtrack)float32dask.array<chunksize=(600, 1000), meta=np.ndarray>
Array Chunk Bytes 2.40 MB 2.40 MB Shape (600, 1000) (600, 1000) Count 5 Tasks 1 Chunks Type float32 numpy.ndarray - sigma0_raw(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 55 Tasks 2 Chunks Type float64 numpy.ndarray - nesz(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 39 Tasks 2 Chunks Type float64 numpy.ndarray - gamma0_raw(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
- units :
- m2/m2
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 55 Tasks 2 Chunks Type float64 numpy.ndarray - negz(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 39 Tasks 2 Chunks Type float64 numpy.ndarray - sigma0(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 84 Tasks 2 Chunks Type float64 numpy.ndarray - gamma0(pol, atrack, xtrack)float64dask.array<chunksize=(1, 600, 1000), meta=np.ndarray>
Array Chunk Bytes 9.60 MB 4.80 MB Shape (2, 600, 1000) (1, 600, 1000) Count 84 Tasks 2 Chunks Type float64 numpy.ndarray
- ipf :
- 2.84
- platform :
- SENTINEL-1A
- swath :
- IW
- product :
- GRD
- pols :
- VV VH
- name :
- SENTINEL1_DS:/tmp/S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_992F.SAFE:IW
- start_date :
- 2017-09-07 10:30:20.936409
- stop_date :
- 2017-09-07 10:30:45.935264
- footprint :
- POLYGON ((-67.84221143971432 20.72564283093837, -70.22162571215458 21.14758369556577, -70.51434171237564 19.64044158236074, -68.15836401927538 19.21519321274318, -67.84221143971432 20.72564283093837))
- coverage :
- 251km * 170km (xtrack * atrack )
- pixel_atrack_m :
- 10.2
- pixel_xtrack_m :
- 10.0
- Conventions :
- CF-1.7