GithubHelp home page GithubHelp logo

mpoupon / python-holteandtalley Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garrettdreyfus/python-holteandtalley

0.0 0.0 0.0 3.47 MB

A implementation of the Holte and Talley Mixed layer depth algorithm in Python.

License: MIT License

Python 79.32% Vim Script 20.68%

python-holteandtalley's Introduction

Holte and Talley Mixed Layer Depth algorithm

This is a python port of the mixed layer depth algorithm outlined in Holte and Talley 2009.

Installation

To install from the pypi repository:

pip install holteandtalley

If you would like to install it from source in order to make changes:

#run this in the cloned repository
pip install -e .

this will allow you to import holteandtalley from anywhere on your machine, but any changes you make to the source will be immediately reflected.

Usage

from holteandtalley import HolteAndTalley

 h = HolteAndTalley(pressures,temperaturess,salinities,densities)
 ##The temperature algorithms mixed layer depth
 h.tempMLD
 ##The salinity algorithms mixed layer depth
 h.salinityMLD
 ##The density algorithms mixed layer depth
 h.densityMLD

It is also possible to use only the temperature algorithm

from holteandtalley import HolteAndTalley

 h = HolteAndTalley(pressures,temperatures)
 ##The temperature algorithms mixed layer depth
 h.tempMLD

Metrics

While I tried to make this as close to the Matlab code provided in the supplementary materials of the paper I was unable to make it exactly the same. Below is a table which shows the max,mean, and standard deviation of difference between the output of the matlab library and this one after being run on the 138 profiles provided in the supplementary materials of the original paper.

Algorithm Max Difference Mean Difference Standard Deviation Difference
Temperature 0.5 dbar 0.06 dbar 0.13 dbar
Density 12 dbar 0.275 dbar 1.447 dbar
Salinity 8.0 dbar 0.12 dbar 0.8 dbar

NOTE: The version of the matlab library I used I slightly modified to correct for some quirks of the library which I think are bugs.

The Temperature Algorithm

Summer Flow Graph

summer flow graph

Winter Flow Graph

winter flow graph

The Density and Salinity Algorithms

The original paper does not include flowcharts for the density and salinity algorithms so I have included those below transcribed from the matlab supplementary materials provided.

Glossary of Terms

MLTFit

The MLTFit is defined as the interection of the line of best fit of the thermocline and the mixed layer. The best fit line of the thermocline is the line tangent to the profile at the point where d(T)/d(P) is the greatest. To determine the best fit line of the mixed layer, the algorithm calculates the best fit over progressively more points in the profile, calculates the error over the points included in the fit and then finds the deepest fit line which satisfies an error tolerance ET < 10-10.

TTMLD

The deepest point in the profile which is less than 0.2C compared to the SST

ΔT

T(iMLTFIT)-T(iMLTFIT+2)

range

25 dbar

TDTM

The minimum of the gradient maximum and the temperature maximum if that is less than 100 dbar. Otherwise it is set to 0

DTM

Deepest point such that the gradient is less than 0.005 C/dbar or max if that criteria is not met.

Some results

python-holteandtalley's People

Contributors

garrettdreyfus 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.