{"id":33141246,"url":"https://github.com/bopen/sarsen","last_synced_at":"2025-12-29T23:20:48.250Z","repository":{"id":37235552,"uuid":"437531528","full_name":"bopen/sarsen","owner":"bopen","description":"Algorithms and utilities for Synthetic Aperture Radar (SAR) sensors","archived":false,"fork":false,"pushed_at":"2025-11-06T08:52:25.000Z","size":5931,"stargazers_count":295,"open_issues_count":21,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-11-06T09:08:21.519Z","etag":null,"topics":["algorithms","copernicus","earth-observation","remote-sensing","sar","sentinel-1","synthetic-aperture-radar","xarray"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bopen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-12T11:54:18.000Z","updated_at":"2025-11-05T16:15:47.000Z","dependencies_parsed_at":"2024-01-01T09:52:23.645Z","dependency_job_id":"b744f1ee-89b4-46c8-a997-41c88d5491e2","html_url":"https://github.com/bopen/sarsen","commit_stats":{"total_commits":452,"total_committers":5,"mean_commits":90.4,"dds":"0.15929203539823011","last_synced_commit":"913a0d6a52b32be7563d58b1d5c8e9f884367204"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bopen/sarsen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bopen%2Fsarsen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bopen%2Fsarsen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bopen%2Fsarsen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bopen%2Fsarsen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bopen","download_url":"https://codeload.github.com/bopen/sarsen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bopen%2Fsarsen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284662610,"owners_count":27043071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","copernicus","earth-observation","remote-sensing","sar","sentinel-1","synthetic-aperture-radar","xarray"],"created_at":"2025-11-15T12:00:43.109Z","updated_at":"2025-11-16T05:00:48.386Z","avatar_url":"https://github.com/bopen.png","language":"Jupyter Notebook","readme":"# Sarsen\n\nAlgorithms and utilities for Synthetic Aperture Radar (SAR) sensors.\nEnables cloud-native SAR processing via [*Xarray*](https://xarray.pydata.org)\nand [*Dask*](https://dask.org).\n\nThis Open Source project is sponsored by B-Open - https://www.bopen.eu.\n\n## Features and limitations\n\n*Sarsen* is a Python library and command line tool with the following functionalities:\n\n- provides algorithms to terrain-correct satellite SAR data\n  - geometric terrain correction (geocoding)\n    - *fast mode*: to terrain-correct images\n    - *accurate mode*: for interferometric processing\n  - radiometric terrain correction (gamma flattening)\n- accesses SAR data via [*xarray-sentinel*](https://github.com/bopen/xarray-sentinel):\n  - supports most Sentinel-1 data products as [distributed by ESA](https://scihub.copernicus.eu/dhus/#/home):\n    - Sentinel-1 Single Look Complex (SLC) SM/IW/EW\n    - Sentinel-1 Ground Range Detected (GRD) SM/IW/EW\n  - reads uncompressed and compressed SAFE data products on the local computer or\n    on a network via [*fsspec*](https://filesystem-spec.readthedocs.io) - *depends on rasterio\u003e=1.3*\n- accesses DEM data via [*rioxarray*](https://corteva.github.io/rioxarray):\n  - reads local and remote data in virtually any raster format via\n    [*rasterio*](https://rasterio.readthedocs.io) / [*GDAL*](https://gdal.org)\n- supports larger-than-memory and distributed data access and processing via *Dask*\n  - efficient geometric terrain-correction for a full GRD\n  - efficient radiometric terrain-correction for a full GRD.\n\nOverall, the software is in the **beta** phase and the usual caveats apply.\n\nCurrent limitations:\n\n- documentation needs improvement. See #6.\n\nNon-objectives / Caveat emptor items:\n\n- No attempt is made to support UTC leap seconds. Observations that include a leap second may\n  crash the code or silently return wrong results.\n\n## SAR terrain-correction\n\nThe typical side-looking SAR system acquires data with uniform sampling in azimuth and slant range,\nwhere the azimuth and range represents the time when a given target is acquired and the absolute\nsensor-to-target distance, respectively.\nBecause of this, the near range appears compressed with respect to the far range. Furthermore,\nany deviation of the target elevation from a smooth geoid results in additional local geometric and radiometric\ndistortions known as foreshortening, layover and shadow.\n\n- Radar foreshortening: Terrain surfaces sloping towards the radar appear shortened relative to those sloping away from the radar.\n  These regions are much brighter than other places on the SAR image.\n- Radar layover: It's an extreme case of foreshortening occurring when the terrain slope is greater than the angle of the incident signal.\n- Radar shadows: They occur when ground points at the same azimuth but different slant ranges are aligned in the direction of the line-of-sight.\n  This is usually due to a back slope with an angle steeper than the viewing angle.\n  When this happens, the radar signal never reaches the farthest points, and thus there is no measurement, meaning that this lack of information is unrecoverable.\n\nThe geometric terrain correction (GTC) corrects the distortions due to the target elevation.\nThe radiometric terrain correction (RTC) also compensates for the backscatter modulation generated\nby the topography of the scene.\n\n## Install\n\nThe easiest way to install *sarsen* is in a *conda* environment.\nThe following commands create a new environment, activate it, install the package and its dependencies:\n\n```shell\n  conda create -n SARSEN\n  conda activate SARSEN\n  conda install -c conda-forge dask proj-data sarsen\n```\n\nNote that the `proj-data` package is rather large (500+Mb) and it is only needed to handle input DEM whose\nvertical coordinate is not on a known ellipsoid, for example *SRTM DEM* with heigths over the *EGM96 geoid*.\n\n## Command line usage\n\nThe `sarsen` command line tool corrects SAR data based on a selected DEM and may produce\ngeometrically terrain-corrected images (GTC) or radiometrically terrain-corrected images (RTC).\nTerrain-corrected images will have the same pixels as the input DEM, that should be resampled\nto the target projection and spacing in advance, for example using\n[`gdalwarp`](https://gdal.org/programs/gdalwarp.html).\n\nThe following command performs a geometric terrain correction:\n\n```shell\n  sarsen gtc S1B_IW_GRDH_1SDV_20211217T141304_20211217T141329_030066_039705_9048.SAFE IW/VV South-of-Redmond-10m_UTM.tif\n```\n\nPerforming geometric and radiometric terrain correction is more demanding,\nbut it is possible to produce the RTC of a full GRD product at a 10m resolution\nin one go (and it takes approx 25 minutes on a 32Gb MacBook Pro):\n\n```shell\n  sarsen rtc S1B_IW_GRDH_1SDV_20211217T141304_20211217T141329_030066_039705_9048.SAFE IW/VV South-of-Redmond-10m_UTM.tif\n```\n\n## Python API usage\n\nThe python API has entry points to the same commands and it also gives access to several lower level\nalgorithms, but internal APIs should not be considered stable:\n\nThe following code applies the geometric terrain correction to the VV polarization of\n\"S1B_IW_GRDH_1SDV_20211217T141304_20211217T141329_030066_039705_9048.SAFE\" product:\n\n```python\n\u003e\u003e\u003e import sarsen\n\u003e\u003e\u003e product = sarsen.Sentinel1SarProduct(\n...   \"tests/data/S1B_IW_GRDH_1SDV_20211223T051122_20211223T051147_030148_039993_5371.SAFE\",\n...   measurement_group=\"IW/VV\",\n... )\n\u003e\u003e\u003e gtc = sarsen.terrain_correction(\n...   product,\n...   dem_urlpath=\"tests/data/Rome-30m-DEM.tif\",\n... )\n\n```\n\nThe radiometric correction can be activated using the key `correct_radiometry`:\n\n```python\n\u003e\u003e\u003e rtc = sarsen.terrain_correction(\n...   product,\n...   dem_urlpath=\"tests/data/Rome-30m-DEM.tif\",\n...   correct_radiometry=\"gamma_nearest\"\n... )\n\n```\n\n## Reference documentation\n\nThis is the list of the reference documents:\n\n- the geometric terrain-correction algorithms are based on:\n  [\"Guide to Sentinel-1 Geocoding\" UZH-S1-GC-AD 1.10 26.03.2019](https://sentinel.esa.int/documents/247904/0/Guide-to-Sentinel-1-Geocoding.pdf/e0450150-b4e9-4b2d-9b32-dadf989d3bd3)\n- the radiometric terrain-correction algorithms are based on:\n  [D. Small, \"Flattening Gamma: Radiometric Terrain Correction for SAR Imagery,\" in IEEE Transactions on Geoscience and Remote Sensing, vol. 49, no. 8, pp. 3081-3093, Aug. 2011, doi: 10.1109/TGRS.2011.2120616](https://www.geo.uzh.ch/microsite/rsl-documents/research/publications/peer-reviewed-articles/201108-TGRS-Small-tcGamma-3809999360/201108-TGRS-Small-tcGamma.pdf)\n\n## Project resources\n\n[![on-push](https://github.com/bopen/sarsen/actions/workflows/on-push.yml/badge.svg)](https://github.com/bopen/sarsen/actions/workflows/on-push.yml)\n[![codecov](https://codecov.io/gh/bopen/sarsen/branch/main/graph/badge.svg?token=62S9EXDF0V)](https://codecov.io/gh/bopen/sarsen)\n\n## Contributing\n\nThe main repository is hosted on GitHub.\nTesting, bug reports and contributions are highly welcomed and appreciated:\n\nhttps://github.com/bopen/sarsen\n\nLead developer:\n\n- [Alessandro Amici](https://github.com/alexamici) - [B-Open](https://bopen.eu)\n\nMain contributors:\n\n- [Aureliana Barghini](https://github.com/aurghs) - [B-Open](https://bopen.eu)\n\nSee also the list of [contributors](https://github.com/bopen/sarsen/contributors) who participated in this project.\n\n## Sponsoring\n\n[B-Open](https://bopen.eu) commits to maintain the project long term and we are happy to accept sponsorships to develop new features.\n\nWe wish to express our gratitude to the project sponsors:\n\n- [Microsoft](https://microsoft.com) has sponsored the support for *GRD* products and the *gamma flattening* algorithm.\n\n## License\n\n```\nCopyright 2016-2022 B-Open Solutions srl\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["SAR","Radar Related GitHub Repos"],"sub_categories":["EUMETlab","Software and Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbopen%2Fsarsen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbopen%2Fsarsen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbopen%2Fsarsen/lists"}