Coder Social home page Coder Social logo

mdn_v2's Introduction

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/ryan-edward-oshea/MDN_V2.git

Alternatively, you may use pip to install:

pip install git+https://github.com/ryan-edward-oshea/MDN_V2


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
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm

import numpy as np
sensor = "S3A"

# Tile should be the output of an atmospheric correction program e.g. SeaDAS
kwargs={'product'  :'chl,tss,cdom,pc',
        'benchmark': False,
        'sat_bands': True}

bands, Rrs = get_tile_data('/path/to/tile.nc', sensor, allow_neg=False,**kwargs)

#Rrs = np.random.rand(4, 5, len(get_sensor_bands(sensor)))

chla_tss_cdom, idxs = image_estimates(Rrs, sensor=sensor,**kwargs)
print(chla_tss_cdom, type(chla_tss_cdom), chla_tss_cdom.shape, idxs)

chla = chla_tss_cdom[:,:,idxs['chl']]
TSS  = chla_tss_cdom[:,:,idxs['tss']]
cdom = chla_tss_cdom[:,:,idxs['cdom']]
pc   = chla_tss_cdom[:,:,idxs['pc']]

print(chla,TSS,cdom)

fig, (ax1, ax2, ax3, ax4) = plt.subplots(1, 4)

chl_im = ax1.imshow(chla,vmin=0.1, vmax=100, cmap='jet', aspect='auto',norm=LogNorm())
fig.colorbar(chl_im, ax=ax1)
ax1.set_title('Chl')

TSS_im = ax2.imshow(TSS,vmin=0.1, vmax=100, cmap='jet', aspect='auto',norm=LogNorm())
fig.colorbar(TSS_im, ax=ax2)
ax2.set_title('TSS')

cdom_im = ax3.imshow(cdom,vmin=0.1, vmax=1, cmap='jet', aspect='auto',norm=LogNorm())
fig.colorbar(cdom_im, ax=ax3)
ax3.set_title('CDOM')

pc_im = ax4.imshow(pc,vmin=0.1, vmax=100, cmap='jet', aspect='auto',norm=LogNorm())
fig.colorbar(pc_im, ax=ax4)
ax4.set_title('PC')
plt.show()

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.





mdn_v2's People

Contributors

brandonsmithj avatar ryan-edward-oshea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.