Skip to main content

Identify optically shallow and deep waters in satellite imagery

Project description

Optically-Shallow-Deep

This python tool delineates optically shallow and deep waters in Sentinel-2 imagery. The tool uses a deep neural network (DNN) that was trained on a diverse set of global images.

Supported input includes Level-1C (L1C) SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.

Originally coded by by Galen Richardson and Anders Knudby, modified and packaged by Yulun Wu

Home page: https://github.com/yulunwu8/Optically-Shallow-Deep

Installation

1 - Create a conda environment and activate it:

conda create --name opticallyshallowdeep python=3.10
conda activate opticallyshallowdeep

2 - Install tensorflow

For mac OS:

conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos

For windows:

pip3 install tensorflow==2.13.0

For Linux and more on installing tensorflow: https://www.tensorflow.org/install

3 - Install opticallyshallowdeep:

pip3 install opticallyshallowdeep

Quick Start

For L1C files:

import opticallyshallowdeep as osd

# Input file 
file_L1C = 'folder/S2.SAFE' 

# Output folder 
folder_out = 'folder/test_folder_out'

# Run the OSW/ODW classifier 
osd.run(file_L1C, folder_out)

For ACOLITE L2R files:

import opticallyshallowdeep as osd

# Input files 
file_L1C = 'test_folder_in/S2.SAFE' 
file_L2R = 'test_folder_in/L2R.nc' 

# Output folder 
folder_out = 'folder/test_folder_out'

# Run the OSW/ODW classifier 
osd.run(file_L1C, folder_out, file_L2R=file_L2R)

The L1C file is always required as it contains a built-in cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.

Output is a 1-band geotiff, with values of prediction probability of optically shallow water (OSW): 100 means most likely OSW, 0 means most likely optically deep water (ODW). Non-water pixels are masked. It is recommended to treat pixels between 0 and 40 as ODW, and pixels between 60 and 100 as OSW (publication in review).

A log file, an intermediate multi-band geotiff, and a preview PNG are also generated in the output folder. They can be deleted after the processing.

Sample Sentinel-2 scene and output:

Training, test, and validation data

All annotated shapefiles used in training, testing, and validating the DNN model are in the annotated_shapefiles folder, grouped by Sentinel-2 Scene ID.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opticallyshallowdeep-1.2.1.tar.gz (259.0 kB view details)

Uploaded Source

Built Distribution

opticallyshallowdeep-1.2.1-py3-none-any.whl (259.2 kB view details)

Uploaded Python 3

File details

Details for the file opticallyshallowdeep-1.2.1.tar.gz.

File metadata

  • Download URL: opticallyshallowdeep-1.2.1.tar.gz
  • Upload date:
  • Size: 259.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.8

File hashes

Hashes for opticallyshallowdeep-1.2.1.tar.gz
Algorithm Hash digest
SHA256 18d0b87d1c93cd71fb107e842e7f9c2e84e6003645faab4a5a9d00f585fceb89
MD5 263462b84ca7432c37c4ea6f71985851
BLAKE2b-256 82f76e94e1a8630a80c0d25551ed404d684d69ac858608e25be2cafc782e004a

See more details on using hashes here.

File details

Details for the file opticallyshallowdeep-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opticallyshallowdeep-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 471acf39863a76b77eaabedb89cabe1c1ac3a8618570213a9db5bcb2bc8cf466
MD5 bfe497256bbe2a55618998a220233840
BLAKE2b-256 5a26242980fc71b185c4db403c9c3263e75066b7c2eebef125bb4c895fd76cba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page