Home

Awesome

DOI

This repository contains the Python code supporting the following paper:

Input and output datasets can be downloaded from Zenodo.

Dependencies

Python dependencies are listed in the environment.yml and the requirements.txt files.

A virtual environment containing all the required dependencies can be automatically created using conda:

# Clone the repository
git clone https://github.com/yannforget/landsat-sentinel-fusion.git
cd landsat-sentinel-fusion

# Create the virtual environment
conda env create --file environment.yml

# Activate the environment
source activate landsat-sentinel-fusion

The code also depends on:

Data

Input and output datasets are available in a Zenodo deposit.

# Download and decompress the data
wget -O data.zip https://zenodo.org/record/1450932/files/data.zip?download=1
unzip data.zip

Validation samples can be found in data/raw/reference (as shapefiles) or in data/processed/reference (as rasters).

Classification outputs and performance metrics are located in data/output for each case study.

Due to storage constraints, input satellite imagery is not included in the Zenodo deposit. However, the product identifiers are available in data/raw/landsat/products.txt and data/raw/sentinel-1/products.txt. This means that they can be automatically downloaded using auxiliary software such as landsatxplore or sentinelsat.

For Landsat 8 scenes:

pip install landsatxplore

# Earth Explorer credentials
export LANDSATXPLORE_USERNAME=<your_username>
export LANDSATXPLORE_PASSWORD=<your_password>

cd data/raw/landsat

# Download each product with landsatxplore
for id in products.txt; do landsatxplore download $id; done

# Decompress each product
for product in *.zip; do unzip $product; done

For Sentinel-1 imagery:

cd ../sentinel-1

# Install and configure sentinelsat
pip install sentinelsat
export DHUS_USER=<your_username>
export DHUS_PASSWORD=<your_password>

# Download Sentinel-1 products
for id in products.txt; do sentinelsat --download --name $id; done

Code

Running the analysis

# Preprocessing of Optical and SAR data
python preprocess_landsat.py
python preprocess_sentinel1.py

# Dimensionality reduction (PCA) of SAR data
python dimreduction.py

# Random forest classification and validation
python classification.py

Modules

Scripts

The following scripts has been used for the study but are not necessary to run the analysis :