/sentinel1denoised

Thermal noise subtraction, scalloping correction, angular correction

Primary LanguageJupyter NotebookGNU General Public License v3.0GPL-3.0

Sentinel1Denoised

Thermal noise subtraction, scalloping correction, angular correction

Citation

If you use Sentinel1Denoised in any academic work please cite the following papers:

A. Korosov, D. Demchev, N. Miranda, N. Franceschi and J. -W. Park, "Thermal Denoising of Cross-Polarized Sentinel-1 Data in Interferometric and Extra Wide Swath Modes," in IEEE Transactions on Geoscience and Remote Sensing, vol. 60, pp. 1-11, 2022, Art no. 5218411, doi: 10.1109/TGRS.2021.3131036.

Park, Jeong-Won; Korosov, Anton; Babiker, Mohamed; Sandven, Stein; and Won, Joong-Sun (2018): Efficient noise removal of Sentinel-1 TOPSAR cross-polarization channel, IEEE Transactions on Geoscience and Remote Sensing, 56(3), 1555-1565, doi:10.1109/TGRS.2017.2765248

Park, Jeong-Won; Won, Joong-Sun; Korosov, Anton A.; Babiker, Mohamed; and Miranda, Nuno (2019), Textural Noise Correction for Sentinel-1 TOPSAR Cross-Polarization Channel Images, IEEE Transactions on Geoscience and Remote Sensing, 57(6), 4040-4049, doi:10.1109/TGRS.2018.2889381

See the CITATION file for more information.

Installation

The software is written in Python and requires nansat and scipy packages. A simple way to install these packages is to use Anaconda.

# create conda environment with key requirements
conda env create -f environment.yml

# activate environment
conda activate s1denoise

# install s1denoise
pip install https://github.com/nansencenter/sentinel1denoised/archive/v1.4.0.tar.gz

Alternatively you can use Docker:

# build an image with eveything installed
docker build . -t s1denoise

# run Python in container
docker run --rm -it -v /path/to/data:/path/to/data s1denoise python

Example

Do processing inside Python environment:

from s1denoise import Sentinel1Image
# open access to file with S1 data
input_file = '/path/to/data/S1B_EW_GRDM_1SDH_INPUTFILE.zip'
s1 = Sentinel1Image(input_file)

# run thermal noise correction in HV polarisation with the default ESA algorithm
s0hve = s1.remove_thermal_noise('HV', algorithm='ESA')

# run thermal noise correction in HV polarisation with the default NERSC algorithm
s0_hv = s1.remove_thermal_noise('HV')

# run thermal noise correction in HV polarisation with the  NERSC_TG algorithm applicable for old Sentinel-1 data
s0_hv = s1.remove_thermal_noise('HV', algorithm='NERSC_TG')

# run thermal and texture noise correction in HV polarisation
s0_hv = s1.remove_texture_noise('HV')

# High level function for processing both polarisations
from s1denoise.tools import run_correction
d = run_correction(input_file)

Process a single file with thermal, textural and angular correction and export in [dB] in a numpy file:

s1_correction.py INPUTFILE.zip OUTPUTFILE.npz

Process a single file and export as GeoTIFF (requires Nansat):

s1_correction.py INPUTFILE.zip OUTPUTFILE.npz -g

With option -m the script will also save landmask in Numpy format in a separate file with name OUTPUTFILE.tif_mask.npz:

s1_correction.py INPUTFILE.zip OUTPUTFILE.tif -m

Process a single file using Docker (replace input_dir and output_dir with actual directories):

docker run --rm -v /data_dir:/data_dir s1denoise s1_correction.py /data_dir/INPUTFILE.zip /data_dir/OUPUTFILE.tif

Note that for enabling the landmask functionality, you need to download and install the watermask:

# Set the environment variable MOD44WPATH to a writable directory. It is also used by the script.
export MOD44WPATH=/home/user/MOD44W

# Download the landmask and extract:
wget -nc -nv -P $MOD44WPATH https://github.com/nansencenter/mod44w/raw/master/MOD44W.tgz
tar -xzf $MOD44WPATH/MOD44W.tgz -C $MOD44WPATH/
rm $MOD44WPATH/MOD44W.tgz

Experimental scripts

Sub-directories in s1denoise/training and s1denoise/validation contain scripts for training and validation of the noise scaling and power balancing coefficients and extra scaling. See README files in these sub-dirs for details.

License

The project is licensed under the GNU general public license version 3.