CNES / swot-hydrology-toolbox

GNU Lesser General Public License v3.0
52 stars 20 forks source link

SWOT Hydrology Toolbox.

Copyright (C) 2018-2020 Centre National d'Etudes Spatiales

This software is released under open source license LGPL v.3 and is distributed WITHOUT ANY WARRANTY, read LICENSE.txt for further details.

Background

SWOT (Surface Water and Ocean Topography) is an innovative radar altimetry satellite mission projected for launch in 2021, prepared jointly by NASA’s Jet Propulsion Laboratory (JPL) and Centre National d’Etudes Spatiales (CNES), with contributions from the UK Space Agency (UKSA) and the Canadian Space Agency (CSA). SWOT features a high-rate (HR) data mode for continental hydrology, and a low-rate (LR) data mode dedicated mainly to oceanography. For more information, refer to https://swot.cnes.fr/en/ or https://swot.jpl.nasa.gov/.

Objectives

Note that both algorithms and products are still under development and will be updated regularly.

Content

Associated SHT version

release_version_08_23_2022 branch

Associated RiverObs version

develop branch

commit 3ddd70202765298f6ddf7091edfb75c0a7b5ff1c Author: Alex Fore Alexander.Fore@jpl.nasa.gov Date: Wed May 18 05:49:40 2022 -0700

add validate_inputs to rivertile SAS and check for pixc with no pixels

updated batch validation tool for compatibility with plot reach

River database SWORD v12 available here: http://gaia.geosci.unc.edu/SWORD/SWORD_v08.zip

Don't forget to modify parameter_river.rdf reach_db_path (-) = /work/ALT/swot/swotpub/BD/BD_rivers/SWORD_v08/Reaches_Nodes/netcdf

You can also try to use a more recent RiverObs version, but don't forget to use the associated SWORD version.

Caveats

Although the large-scale simulator included in the toolbox provides fairly representative statistical errors, several simplifications or approximations are made:

When to use the simulator:

If a higher degree of realism is necessary to conduct a study, lower-level simulators and processors need to be employed. 
These are not publicly available, but SWOT Science Team members can contact the SWOT Algorithm Development Team for support. 

Product formats and algorithms:

Last modifications: In the large scale simulator:

In the processing chain

Installation procedure

Get the repository

  1. Clone swot_hydrology_toolbox repo
% git clone https://github.com/cnes/swot-hydrology-toolbox.git

The repository swot_hydrology_toolbox should be assignated to the SWOT_HYDROLOGY_TOOLBOX variable.

% export SWOT_HYDROLOGY_TOOLBOX=your_installation_path/swot-hydrology-toolbox
  1. Clone RiverObs repo
% git clone https://github.com/SWOTAlgorithms/RiverObs.git

The repository RiverObs should be assignated to the RIVEROBS variable.

% export RIVEROBS=your_installation_path/RiverObs

Dependencies

The dependencies of swot-hydrology-toolbox are:

Example of environment.yml

name: sht_env_test channels:

Python environment installation

Setting up a conda environment

To create a conda environment, execute

cd $SWOT_HYDROLOGY_TOOLBOX
conda env create -f environment.yml

To activate this environment, if the first option was used, type

conda activate swot-env

To deactivate this environment, type

conda deactivate

Then, you will need to install manually utm and pygeodesy packages with 'pip' or 'easy_install':

pip install utm
pip install PyGeodesy=='20.05.20

Execute the toolbox

After activating your Python environment, you have to set your PYTHONPATH variables:

export PYTHONPATH=$SWOT_HYDROLOGY_TOOLBOX/processing/:$PYTHONPATH
export PYTHONPATH=$SWOT_HYDROLOGY_TOOLBOX/processing/src/:$PYTHONPATH
export PYTHONPATH=$SWOT_HYDROLOGY_TOOLBOX/processing/src/cnes/sas:$PYTHONPATH
export PYTHONPATH=$SWOT_HYDROLOGY_TOOLBOX/sisimp/:$PYTHONPATH
export PYTHONPATH=$RIVEROBS/src:$PYTHONPATH

An example dataset showing how to configure and run simulation and processing is available under /test.

The needed input for the overall chain include:

The difference step are described below :

The WIKI section contains a more details description of the simulation steps and the associated parameters.

PIXC simulation by Large Scale Simulator

% python $SWOT_HYDROLOGY_TOOLBOX/select_orbit_cnes/select_orbit_cnes.py rdf/parameter_orbit.rdf output/orbit
% python $SWOT_HYDROLOGY_TOOLBOX/sisimp/proc_sisimp.py rdf/parameter_sisimp.rdf

River processing

% python $SWOT_HYDROLOGY_TOOLBOX/scripts/l2pixc_to_rivertile.py output/simu output/river rdf/parameter_river.rdf

LakeTile and LakeSP processing

% python $SWOT_HYDROLOGY_TOOLBOX/scripts/rivertile_to_laketile.py output/river output/laketile rdf/parameter_lak
etile.cfg -output_dir_lakesp output/lakesp