Package: rabasar
This is a Python 3.10 implementation of RABASAR as described in [4].RABASAR reduces the speckle in multi-temporal intensity, polarimetric or interferometric
Synthetic-Aperture-Radar (SAR, PolSAR, InSAR, resp.) images by first  computing a super
image with a high signal-to-noise ratio, and then processes the residuals between the
multi-temporal stack and the super-image.DescriptionRABASAR is a plug-and-play ADMM approach for speckle reduction in a stack of
(Pol/In)SAR images. It is based on MuLoG and the concepts of super image. It
uses an off-the-shelf Gaussian denoiser and matrix logarithm transform to stabilized
noise and simplify the optimization occuring for denoising the residual matrix fields
between  each image of the stack and the super image.REMARK: Compared to the version of RABASAR described in [3], this one:is not limited to monochanel intensity SAR image. It can be applied like-wise
to mutli-channel SAR image such as PolSAR, InSAR, PolInSAR.does not account for the statistics of the ratio-images (the z-Fisher distribution
of the log of ratio of intensity image). Instead the noise of the log ratio is
approximated by the Wishart-Fisher-Tippet distribution. For the approximation
error to be negligeable, the stack of images must be large enough and ideally
with enough pairs presenting low temporal coherence.InstallationUnless you have Python 3.10 installed and enabled as default, we recommend
installing RABASAR in a virtual environment as described in the following section.Set up a virtual environment (optional)We recommend installing RABASAR in a virtual environment such asvenv. You can
installvenvfor Python 3.10 on Debian/Ubuntu as follows:sudo apt install python3.10-venvIf your system does not have Python 3.10, please refer to the "Troubleshooting"
section below.Create and activate your virtual environment by running the following either directly
in the directory in which you will execute or clone RABASAR or in a parent directory, aspython3 -m venv venv
source venv/bin/activateAlternatively, you can use other environment systems such asconda.Latest stable versionWe recommend installing the latest stable version of RABASAR by runningpip3 install rabasarin a system or environment with Python 3.10.Development versionAlternatively, you can install the development version fromgitaspip3 install -e git+https://bitbucket.org/charles_deledalle/rabasar2019-python.git#egg=rabasaror, directly from the sources asgit clone https://bitbucket.org/charles_deledalle/rabasar2019-python.git
cd rabasar2019-python
python3 setup.py sdist
python3 setup.py installRun RABASARExamples on how to run RABASAR are provided in two scripts that you can execute as:# Run RABASAR on a multlooked synthetic PolSAR image stack with 5 lookspython3-mrabasar.rabasar_synthetic_example-l5For more precisions on how to execute these examples, see:python3 -m rabasar.rabasar_synthetic_example --helpTo run RABASAR on your own data, you need to execute from Python the function
calledrun_rabasarthat you can import as:from rabasar.rabasar_algorithm import run_rabasarThis function takes your data as input through the argumentsar_stackwhich has the format of a covariance matrix field (an image of non negative
definite complex Hermitian matrices). It's your responsibility to load and
format your data in Python to make it compatible with this input. SAR, InSAR,
PolSAR, DualPolSAR PolInSAR images can be formatted as such a matrix field. For
more details, please read [1-4].List of the files in this foldermultilooking.pyThe code to compute the "super-image" of a temporal series of polarimetric images by
averaging them and applying optionally MuLoG on the result with an estimated number
of looks.rabasar_algorithm.pyImplementation of RABASAR for polarimetric SAR images.rabasar_synthetic_example.pyA cli tool to run RABASAR on a synthetic example.sar_image_stack_generation.pyTools to generate synthetic mono-channel and multichannel SAR image stacks.sar_image_stack_rendering.pyTools to render synthetic mono-channel and multichannel SAR image stacks.DevelopersSet upClone the git repository on your machine:git clone https://bitbucket.org/charles_deledalle/rabasar2019-python.git
cd rabasar2019-pythonSet up a Python 3.10 virtual environment as described in the Installation section above.
Once your virtual environment is set up and activated, install dependencies aspip3 install -r requirements.txtContributionAny contributions must be submitted through peer reviews.
Ask for an author account on the bitbucket repository,
create your own branch and raise a pull-request.
All additional code must be cover by a unit test.
Any pull request needs to pass the following commands before being approved:black .
ruff --fix .
pyright .
python3 -m pytest --covIf the last one does not have a 100% test coverage, run:python3 -m pytest --cov --cov-report=htmland inspect the report.Make sure to updaterequirements.txtto include any extra dependencies.DistributionTo distribute the project make sure to uptick the version number insetup.pyand merge that upticked version on themasterbranch.
Once themasterbranch is ready, run the followinggit checkout master
cd $(git rev-parse --show-toplevel)
rm -rf dist/ build/ rabasar.egg-info/
git status --porcelainand make sure the last command did not print anything.
After that, generate the distribution files by runningpython3 setup.py sdist bdist_wheel
python3 -m twine check dist/*
python3 -m twine upload -r testpypi dist/*Test in a different environmentmkdir /tmp/test
cd /tmp/test
python3 -m venv venv
source venv/bin/activate
pip3 install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ rabasar
python3 -m rabasar.rabasar_synthetic_example -l 5Finally, publish the final versionpython3 -m twine upload dist/*Once done, tag themasterbranch with the new version number on Git.LicenseThis software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.ContributorsCharles Deledalle (original version in Matlab)Sébastien Mounier (translation in Python)Cristiano Ulondu Mendes (bug fixes and improvements)Scientific articles describing the methodAny published materials derived from MuLoG must cite [1-2].
Any published materials derived from RABASAR must cite [3-4].[1] Deledalle, C. A., Denis, L., Tabti, S., & Tupin, F. (2017). MuLoG,
or how to apply Gaussian denoisers to multi-channel SAR speckle
reduction?. IEEE Transactions on Image Processing, 26(9), 4389-4403.[2] Deledalle, C. A., Denis, L., & Tupin, F. (2022). Speckle reduction
in matrix-log domain for synthetic aperture radar imaging. Journal
of Mathematical Imaging and Vision, 64(3), 298-320.[3] Zhao, W., Deledalle, C. A., Denis, L., Maître, H., Nicolas, J. M.,
& Tupin, F. (2019). Ratio-based multitemporal SAR images denoising:
RABASAR. IEEE Transactions on Geoscience and Remote Sensing, 57(6),
3552-3565.[4] Deledalle, C. A., Denis, L., Ferro-Famil, L., Nicolas, J. M., &
Tupin, F. (2019, July). Multi-temporal speckle reduction of
polarimetric SAR images: A ratio-based approach. In IGARSS 2019-2019
IEEE International Geoscience and Remote Sensing Symposium (pp. 899-
902). IEEE.