https://github.com/umr-lops/xarray-safe-s1
Xarray reader for SAFE Sentinel1 files
https://github.com/umr-lops/xarray-safe-s1
grd level-1 python3 radar reader safe sar sentinel-1 slc xarray xml
Last synced: 5 months ago
JSON representation
Xarray reader for SAFE Sentinel1 files
- Host: GitHub
- URL: https://github.com/umr-lops/xarray-safe-s1
- Owner: umr-lops
- License: mit
- Created: 2023-04-24T09:20:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-23T16:20:00.000Z (5 months ago)
- Last Synced: 2026-01-24T04:44:11.570Z (5 months ago)
- Topics: grd, level-1, python3, radar, reader, safe, sar, sentinel-1, slc, xarray, xml
- Language: Python
- Homepage: https://xarray-safe-s1.readthedocs.io
- Size: 304 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://xarray-safe-s1.readthedocs.io/en/latest/?badge=latest)
# xarray-safe-s1
Xarray Sentinel1 python SAFE files reader
# Install
## Conda
1. Install xarray-safe-s1
```
conda create -n safe_s1
conda activate safe_s1
conda install -c conda-forge xarray-safe-s1
```
## Pypi
1. Install xarray-safe-s1
```
conda create -n safe_s1
conda activate safe_s1
pip install xarray-safe-s1
```
```pycon
>>> from safe_s1 import Sentinel1Reader, sentinel1_xml_mappings
>>> filename = sentinel1_xml_mappings.get_test_file('S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_Z010.SAFE')
>>> Sentinel1Reader(filename).datatree
DataTree('None', parent=None)
├── DataTree('geolocationGrid')
│ Dimensions: (line: 10, sample: 21)
│ Coordinates:
│ * line (line) int64 0 2014 4028 6042 ... 12084 14098 16112 16777
│ * sample (sample) int64 0 1260 2520 3780 ... 21420 22680 23940 25186
│ Data variables:
│ longitude (line, sample) float64 -67.84 -67.96 -68.08 ... -70.4 -70.51
│ latitude (line, sample) float64 20.73 20.75 20.77 ... 19.62 19.64
│ height (line, sample) float64 8.405e-05 8.058e-05 ... 3.478e-05
│ azimuthTime (line, sample) datetime64[ns] 2017-09-07T10:30:20.936147 ...
│ slantRangeTime (line, sample) float64 0.005331 0.005375 ... 0.006382
│ incidenceAngle (line, sample) float64 30.82 31.7 32.57 ... 44.71 45.36 46.0
│ elevationAngle (line, sample) float64 27.5 28.27 29.02 ... 39.89 40.41
│ Attributes:
│ history: longitude:\n annotation/s1a.xml:\n - /product/geolocationGrid...
├── DataTree('orbit')
│ Dimensions: (time: 17)
│ Coordinates:
│ * time (time) datetime64[ns] 2017-09-07T10:29:14.474905 ... 2017-09-...
│ Data variables:
│ velocity_x (time) float64 -116.7 -154.1 -191.4 ... -628.1 -663.4 -698.6
│ velocity_y (time) float64 -3.433e+03 -3.368e+03 ... -2.413e+03 -2.342e+03
│ velocity_z (time) float64 -6.776e+03 -6.808e+03 ... -7.174e+03 -7.194e+03
│ position_x (time) float64 2.892e+06 2.89e+06 ... 2.833e+06 2.826e+06
│ position_y (time) float64 -5.782e+06 -5.816e+06 ... -6.222e+06 -6.246e+06
│ position_z (time) float64 2.869e+06 2.801e+06 ... 1.82e+06 1.748e+06
│ Attributes:
│ orbit_pass: Descending
│ platform_heading: -167.7668824808032
│ frame: Earth Fixed
│ history: orbit:\n annotation/s1a.xml:\n - //product/generalAn...
├── DataTree('image')
│ Dimensions: (dim_0: 2)
│ Dimensions without coordinates: dim_0
│ Data variables: (12/14)
│ LineUtcTime (dim_0) datetime64[ns] 2017-09-07T10:30:20.93640...
│ numberOfLines int64 16778
│ numberOfSamples int64 25187
│ azimuthPixelSpacing float64 10.0
│ slantRangePixelSpacing float64 10.0
│ groundRangePixelSpacing float64 10.0
│ ... ...
│ slantRangeTime float64 0.005331
│ swath_subswath