Skip to content

Mixture Density Network for water constituent estimation

License

Notifications You must be signed in to change notification settings

Dongxianzhang/MDN

 
 

Repository files navigation

Product Estimation

About

This repository contains source code for the following papers:


Usage

The package can be cloned into a directory with:

git clone https://github.com/BrandonSmithJ/MDN

Alternatively, you may use pip to install:

pip install git+https://github.com/BrandonSmithJ/MDN


The code may then either be used as a library, such as with the following:

from MDN import image_estimates, get_tile_data, get_sensor_bands
sensor = "<S2A, S2B, or OLCI>"

# Tile should be the output of an atmospheric correction program e.g. SeaDAS
bands, Rrs = get_tile_data("path/to/my/tile.nc", sensor, allow_neg=False) 

estimates = image_estimates(Rrs, sensor=sensor)
chlor_a   = estimates[0]

# Or, with just random data:
import numpy as np 
rand_data = np.dstack([np.random.rand(3,3) for band in get_sensor_bands(sensor)])
estimates = image_estimates(rand_data, sensor=sensor)
chlor_a   = estimates[0]

Or, a .csv file may be given as input, with each row as a single sample. The .csv contents should be only the Rrs values to be estimated on (i.e. no header row or index column).

python3 -m MDN --sensor <S2A, S2B, or OLCI> path/to/my/Rrs.csv

Note: The user-supplied input values should correspond to Rrs (units of 1/sr).

Current performance is shown in the following scatter plots, with 50% of the data used for training and 50% for testing. Note that the models supplied in this repository are trained using 100% of the in situ data, and so observed performance may differ slightly.



About

Mixture Density Network for water constituent estimation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%