Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brews committed Mar 2, 2018
2 parents 38d5d75 + be331cc commit 06cb2b7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# co2syspy v0.0.1a1

*


# co2syspy v0.0.1a0

* Initial release.
56 changes: 33 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,58 @@ This package is not stable, nor fully tested. It is also not very pythonic.

First, import the package:

import co2sys
```python
import co2sys
```

Use the old-school interface with `co2sys.CO2SYS()`. First, lets setup some variables to input:

par1type = 1 # The first parameter supplied is of type "1", which is "alkalinity"
par2type = 2 # The first parameter supplied is of type "2", which is "DIC"
par3type = 3 # The first parameter supplied is of type "3", which is "pH"
presin = 4.036785269144779e3 # Pressure at input conditions
tempout = 0 # Temperature at output conditions.
presout = 0 # Pressure at output conditions.
pHscale = 1 # pH scale at which the input pH is reported ("1" means "Total Scale")
k1k2c = 4 # Choice of H2CO3 and HCO3- dissociation constants K1 and K2 ("4" means "Mehrbach refit")
kso4c = 1 # Choice of HSO4- dissociation constants KSO4 ("1" means "Dickson")
alk_s = 2.337701660156250e3
dic_s = 2.186364257812500e3
sal_s = 34.875812530517578
temp_s = 2.197510004043579
si_s = 49.758834838867188
p_s = 1.458118438720703
```python
par1type = 1 # The first parameter supplied is of type "1", which is "alkalinity"
par2type = 2 # The first parameter supplied is of type "2", which is "DIC"
par3type = 3 # The first parameter supplied is of type "3", which is "pH"
presin = 4.036785269144779e3 # Pressure at input conditions
tempout = 0 # Temperature at output conditions.
presout = 0 # Pressure at output conditions.
pHscale = 1 # pH scale at which the input pH is reported ("1" means "Total Scale")
k1k2c = 4 # Choice of H2CO3 and HCO3- dissociation constants K1 and K2 ("4" means "Mehrbach refit")
kso4c = 1 # Choice of HSO4- dissociation constants KSO4 ("1" means "Dickson")
alk_s = 2.337701660156250e3
dic_s = 2.186364257812500e3
sal_s = 34.875812530517578
temp_s = 2.197510004043579
si_s = 49.758834838867188
p_s = 1.458118438720703
```

Now, take all of this and run with it:

out, niceheaders = co2sys.CO2SYS(alk_s, dic_s, par1type, par2type, sal_s,
temp_s, tempout, presin, presout, si_s,
p_s, pHscale, k1k2c, kso4c)
```python
out, niceheaders = co2sys.CO2SYS(alk_s, dic_s, par1type, par2type, sal_s,
temp_s, tempout, presin, presout, si_s,
p_s, pHscale, k1k2c, kso4c)
```

Our output system variables are now held in `out` and the traditional CO2SYS "nice headers" are in `niceheaders`.

## Installation

Install `co2syspy` from `conda` with:

$ conda install co2syspy -c sbmalev
```bash
conda install co2syspy -c sbmalev
```

Install with `pip`, directly from the master branch using:

$ pip install git+git://github.com/brews/co2syspy.git@master

```bash
pip install co2syspy
```

## Support and development

* Please feel free to report bugs and issues, or view the source code on GitHub (https://github.com/brews/co2syspy).

## License

`co2syspy` is available under the Open Source GPLv3 (https://www.gnu.org/licenses).
`co2syspy` is available under the Open Source GPLv3 (https://www.gnu.org/licenses).
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='co2syspy',
version='0.0.1',
version='0.0.1a0',
description='A Python interpretation of CO2SYS',
license='GPLv3',

Expand Down

0 comments on commit 06cb2b7

Please sign in to comment.