Current S3Snow processor version: 2.3
The repository contains 3 tools:
The work requires SNAP 7 and the following experimental SNAP plugins:
Code developed within the Sentinel-3 for Science, Land Study 1: Snow project led by Jason Box. More information at snow.geus.dk.
Development and testing: Maxim Lamare, Jason Box, and Jonas Kvist Andersen.
The s3_extract_snow_products script, developed by the S34Sci Land Study 1: Snow, extracts the outputs of the S3Snow algorithm results for a list of S3 OLCI L1C scenes for a user-supplied list of latitude and longitude coordinates.
The processing of the S3 images is performed with snappy: the SNAP Java API from Python. The installation of the libraries is detailed below. The use of Anaconda is strongly recommended to run the scripts provided in this repository, and the installation steps provided assume the use of a Conda environment.
Note: there are 2 branches on this repository:
There is currently no Windows OS support.
Setup steps:
For MacOS users @mankoff created an installation guide (essentially the same for Linux or Windows systems):
# create conda environement
conda create -n SNAP python=3.4
source activate SNAP
# install pandas
conda install pandas
# install jpy
cd /local/folder/of/your/choice
git clone https://github.com/bcdev/jpy.git
cd jpy/
python setup.py bdist_wheel
cp dist/*.whl ~/.snap/snap-python/snappy
# set up snappy
# NOTE: customize paths here to where SNAP and Anaconda are
installed
~/Applications/snap/bin/snappy-conf ~/local/anaconda/envs/SNAP/bin/python
cd ~/.snap/snap-python/snappy
python setup.py install
# test
python
import snappy # no error message = works.
Note: for advanced users, the Conda environment file is provided in the repository > req.txt
Run python s3_extract_snow_products.py -h
for help.
The scripts needs the following obligatory inputs:
The following optional inputs can be specified:
-p, --pollution: activate the snow pollution option in the S3Snow processor. To run the processor for polluted snow: "yes", "true", "t", "y", or "1"
. To run the processor for clean snow: "no", "false", "f", "n", or "0"
. By default, the snow pollution flag is deactivated.
-d, --delta_p: set the trigger to activate snow polluted mode. If the pollution flag is activated, and if the difference between the measured reflectance and the theoretical reflectance for clean snow is lower than the specified delta_p value, the polluted snow algorithm is activated. If the difference is smaller than the delta_p, the snow is considered clean and the polluted snow algorithm is not activated. Has no effect if the pollution flag is turned off.
-g, --gains: multiply the Bottom-of-Atmosphere reflectance by the gains specified by the Ocean Color SVC before calculating albedo. Expert option only: it is not recommended to activate this option. To activate the use of the gains: "yes", "true", "t", "y", or "1"
. To deactivate the use of the gains: "no", "false", "f", "n", or "0"
. By default, the gains flag is deactivated.
-e, --elevation: run the S3Snow slope processor that calculates the elevation, slope, aspect, and subpixel variance from the DEM. The algorithm currently uses the default DEM band that is provided within the S3 OLCI product. To run the slope processor use: "yes", "true", "t", "y", or "1"
. To run the algorithm without the aforementioned variables in the output specify the options: "no", "false", "f", "n", or "0"
. By default, the option is turned off.
-r, --recovery: run the algorithm in recovery mode. If the processing stopped in the middle of a run for some reason, the output temporary files are not sorted. The recovery mode will attempt to convert the temporary files to final files, therefore reducing the number of images to re-process the next time. A manual selection of the unprocessed scenes in the input folder will be necessary to run only the unprocessed scenes after recovery mode (don't forget to save the recovery mode output files elsewhere or they will be overwritten). In recovery mode, the elevation flag has to be set to the value of the failed run otherwise the code will crash. Activate recovery mode by setting the flag to "yes", "true", "t", "y", or "1"
. To run in normal mode: "no", "false", "f", "n", or "0"
. By default, the option is turned off.
-f, --platform specify the Sentinel-3 platform (i.e. Sentinel-3A, -3B, or both) to include data from. Options are 'A', 'B', or 'AB' (for both platforms).
Example run:
python s3_extract_snow_products.py -i "/path/to/folder/containing/S3/folders"\
-c "/path/to/input/csvfile.csv" -o "/path/to/output/folder" -p false -d 0.05 -g false
Outputs: The output csv file contains:
Run python s3_band_extract.py -h
for help.
The scripts needs the following obligatory inputs:
Oa01_radiance Oa02_radiance
.The following optional inputs can be specified:
"500"
or "1000"
. For specific applications only.Example run:
python s3_band_extract.py -i "/path/to/folder/containing/S3/folders"\
-c "/path/to/input/csvfile.csv" -o "/path/to/output/folder" -b Oa01_radiance quality_flags_bright SZA
Outputs: The output csv file contains:
Run python list_sat_bands.py -h
for help.
The script takes only two inputs:
Example run:
python list_sat_bands.py -i "/path/to/folder/containing/S3/scene"\
-f "/path/to/output/textfile.txt"
Outputs: The output text file contains: