Giter Site home page Giter Site logo

mvdh7 / kgen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palaeocarb/kgen

0.0 1.0 0.0 4.12 MB

Parameters for consistently calculating Ks for carbon calculation.

Home Page: https://palaeocarb.github.io/Kgen/

License: MIT License

Python 43.24% Objective-C 3.82% R 27.53% MATLAB 24.67% Makefile 0.75%

kgen's Introduction

Kgen

Coefficients for consistently calculating and pressure correcting Ks for carbon calculation.

This fork of Kgen provides equilibrium constants in the correct format required for PyCO2SYS via the function Kgen.calc_Ks_PyCO2SYS:

from kgen import calk_Ks_PyCO2SYS
import PyCO2SYS as pyco2

# First, use Kgen to calculate equilibrium constants etc.
kgen_constants = calc_Ks_PyCO2SYS(TempC=20, Salinity=35, Pressure=0, Mg=0.3, Ca=None)

# Then, put these into PyCO2SYS, along with whatever else you need, e.g.:
results = pyco2.sys(par1=2300, par2=2100, par1_type=1, par2_type=2, **kgen_constants)
# See the PyCO2SYS docs for an explanation of par1, par2 etc.

The arguments to calc_Ks_PyCO2SYS are identical to those for calc_Ks described in the Kgen documentation.

In the above code, PyCO2SYS will use the equilibrium constants and total salt concentrations calculated by Kgen for all its calculations, instead of evaluating them internally.

Note that kgen_constants includes the values provided to calc_Ks_PyCO2SYS (or the Kgen defaults if none provided) for temperature, salinity, pressure, pH scale, and total sulfate, fluoride and calcium, so these cannot be provided separately to pyco2.sys().

Test Status

Language-specific packages:

Check K values - Matlab Check K values - Python Check K values - R

Language inter-comparison:

Crosscheck Methods

Development Stuff

What KGen Does

Kgen will provide K's in a consistent, stable output format from specifically defined inputs that have been checked against external reference values and across platforms. We guarantee to keep the input and output format of Kgen stable within major version number (i.e. within the 'X' of version X.y.z), so that updates will not break [your favourite carbon calculator].

What Kgen Does Not Do

Kgen is not intended to provide Ks in the correct format for [your favourite carbon calculator]. We recommend adding Kgen as an [optional] dependency, and implementing any required input/output parsing within [your favourite carbon calculator].

This fork of Kgen does provide Ks in the correct format for PyCO2SYS via the function Kgen.calc_Ks_PyCO2SYS.

Talk to Us!

If you have any ideas for improving Kgen, please Open a New Issue on GitHub to discuss how it might best be implemented.

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.