Skip to main content

GLODAP downloader and importer in Python

Project description

glodap

Tests pypi badge Conda Version License: GPL v3 Ruff

Download GLODAP datasets and import them as pandas DataFrames.

Install

pip install glodap
conda install conda-forge::glodap

Use

The functions arctic, atlantic, indian, pacific and world import the latest version of the GLODAP dataset for the corresponding region, first downloading the file if it's not already saved locally. For example:

import glodap
df_atlantic = glodap.atlantic()

Files are saved by default at "~/.glodap", but this can be controlled with the kwarg gpath. See the function docstrings for more information.

The columns of the imported DataFrames are renamed so that they can be passed directly into PyCO2SYS v2:

import PyCO2SYS as pyco2
co2s_atlantic = pyco2.sys(data=df_atlantic, nitrite=None)

Note nitrite=None - this means PyCO2SYS will ignore the "nitrite" column, which is necessary because PyCO2SYS includes the nitrite-nitrous acid equilibrium but its equilibrium constant is valid only under lab conditions.

The columns are the same as in the original GLODAP .mat files available from glodap.info, except:

  • The "G2" at the start of each parameter has been removed.

  • Flags end with "_f" instead of just "f".

  • There is a "datetime" column, which combines the "year", "month" and "day" but NOT the "hour" and "minute" (because some of these are missing).

  • For compatibility with PyCO2SYS:

    • "tco2" => "dic"
    • "talk" => "alkalinity"
    • "phts25p0" => "ph_lab"
    • "phtsinsitutp" => "ph_insitu"

    Therefore when passing the DataFrame directly to PyCO2SYS as in the example above, the system will be solved from DIC and alkalinity, not pH.

The functions download and read can also be used for finer control, such as specifying a particular GLODAP version rather than using the latest one. See their function docstrings for more information.

The SHA256 checksum of each downloaded file is checked before the file is written to disk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glodap-0.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glodap-0.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file glodap-0.2.tar.gz.

File metadata

  • Download URL: glodap-0.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for glodap-0.2.tar.gz
Algorithm Hash digest
SHA256 c2010963e7511fe1f0bc98ce82a0d2614b08dc61cf5ccbd3162e1c768e73f0eb
MD5 1b14b03482faa2e9906352cb0ec25bf8
BLAKE2b-256 59ca7ab63527f584d12f25661e2a14d5c2cc7964f054c1d0c68b069c7e0002ee

See more details on using hashes here.

File details

Details for the file glodap-0.2-py3-none-any.whl.

File metadata

  • Download URL: glodap-0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for glodap-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d11d16194488e162ba70a6ebebe660f78d174fc556f091ef965d44bb863db91
MD5 d0ede7a2270ca3544ae46b6f90b10dfa
BLAKE2b-256 3f38c0addadeb13639b101dac8f84d992c0c09b678585dafe3289ee1aa46b5a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page