Package: asf-tools
ASF Tools for Pythonasf_toolsis a Python package for working with Synthetic Aperture Radar (SAR) data.
It was designed for working with datasets generated byHyP3, but several of the tools have the
potential to be used with a variety of rasters, including non-SAR datasets.InstallIn order to easily manage dependencies, we recommend using dedicated project
environments viaAnaconda/Miniconda.
It is also possible to usePython virtual environments,
but installation of non-python dependencies (e.g.,gdal) can be challenging.asf_toolscan be installed into a conda environment with:conda install -c conda-forge asf_toolsor into a virtual environment with:python -m pip install asf_toolsRunning as a Docker containerWe also publish aDockerimage forasf_tools, with all the dependencies
pre-installed, to the GitHub Container Registry:https://github.com/ASFHyP3/asf-tools/pkgs/container/asf-tools.You can pull an image with the latest released version ofasf_toolswith the command:docker pull ghcr.io/asfhyp3/asf-tools:latestOr, the development version with:docker pull ghcr.io/asfhyp3/asf-tools:testAnd then run the container with:docker run --rm -it ghcr.io/asfhyp3/asf-tools:latestwhich will drop you into abashshell inside the container with an activeasf-toolsconda environment.To move data between your local (host) machine and the container, you can mount avolumewith:docker run --rm -it -v /path/to/data:/home/conda/data ghcr.io/asfhyp3/asf-tools:latestQuick UsageLocal Resolution Weighted CompositeThemake_compositetool allows you to create a local-resolution-weighted composite
from a set of Sentinel-1 RTC products (D. Small, 2012).
It is intended to be used with RTC products generated byASF HyP3.You will need to request RTC products using theInclude Scattering Areaoption,
then download and unzip them into an empty directory.To generate a composite of the co-polarization images, navigate to the directory
containing the unzipped RTC products and run:make_composite VV-composite */*VV.tifTo generate a composite of the cross-polarization images, navigate to the directory
containing the unzipped RTC products and run:make_composite VH-composite */*VH.tifUsage TipBecause the imagery has been radiometrically terrain corrected (RTC), geometric and
radiometric distortions have been removed from the files to be composited. One the
strong points of LRW composites is that you combine both ascending and descending
datatakes into a single product. In this manner no layover or shadow masks are
required - what is shadowed on an ascending pass is visible in a descending pass
and vice-versa. Thus, not only is it possible to combine ascending and descending,
but it is highly encouraged. Using many datatakes from both the ascending and
descending satellite passes will make the best composites possible.About Local Resolution Weighting (LRW)In an LRW composite, each satellite pass contributes to creating the output pixels.
The amount of this contribution is scaled by the inverse of the scattering area used
during terrain correction (thus the need for requesting the area map option of HyP3 RTC).
The inverse of the surface scattering area, also referred to as local resolution,
is multiplied by each pixel's backscatter value. The results of all of the images
covering any single pixel are then summed. This total is then divided by the sum
of the weights used to get the output average backscatter.Water extent mapping[!WARNING]
The HydroSAR codes (flood_map,water_mapandhandmodules) are being
moved to theHydroSAR project repositoryand will be provided in a new pip/conda installable packagehydrosar.Theasf_tools.hydrosarsubpackage will be removed in a future release.Thewater_maptool allows you to create a surface water extent map from a Sentinel-1
dual-pol (VV+VH) RTC product. It is intended to be used with RTC products generated byASF HyP3.Additionally, a HAND (height above nearest drainage) GeoTIFF that is pixel aligned to
the RTC images is required, and preferably derived from the same DEM used to correct
the RTC images -- the quality of the HAND used is directly tied to the quality of the
output water extent map.To make a water extent map, run:water_map [OUT_RASTER] [VV_RASTER] [VH_RASTER] [HAND_RASTER]For more information and to see the options available, see:water_map --helpFor details on the algorithm see theasf_tools.water_map.make_water_mapdocstring.Flood depth mapping[!WARNING]
The HydroSAR codes (flood_map,water_mapandhandmodules) are being
moved to theHydroSAR project repositoryand will be provided in a new pip/conda installable packagehydrosar.Theasf_tools.hydrosarsubpackage will be removed in a future release.Theflood_maptool allows you to create an estimated flood depth map from the surface
water extent map created by thewater_maptool.Additionally, a HAND (height above nearest drainage) GeoTIFF that is pixel aligned to
the surface water extent map is required. An ideal candidate is the HAND image created
by thewater_maptool.To make a flood depth map, run:flood_map [OUT_RASTER] [SURFACE_WATER_MAP] [HAND_RASTER]For more information and to see the options available, see:flood_map --helpFor details on the algorithm see theasf_tools.flood_map.make_flood_mapdocstring.