Skip to main content

ERDDAP plugin for Intake

Project description

forked from https://github.com/jmunroe/intake-erddap.

Intake-ERDDAP

Copyright 2022 Axiom Data Science

See LICENSE

Copyright 2022 James Munroe

For changes prior to 2022-10-19, all contributions are Copyright James Munroe, see PREV-LICENSE.

Build Status Code Coverage License:BSD Code Style Status Python Package Index

Read The Docs

Check out our Read The Docs page for additional documentation

Intake is a lightweight set of tools for loading and sharing data in data science projects. Intake ERDDAP provides a set of integrations for ERDDAP.

  • Quickly identify all datasets from an ERDDAP service in a geographic region, or containing certain variables.
  • Produce a pandas DataFrame for a given dataset or query.
  • Get an xarray Dataset for the Gridded datasets.

The Key features are:

  • Pandas DataFrames for any TableDAP dataset.
  • xarray Datasets for any GridDAP datasets.
  • Query by any or all:
    • bounding box
    • time
    • CF standard_name
    • variable name
    • Plaintext Search term
  • Save catalogs locally for future use.

User Installation

In the very near future, we will be offering the project on conda. Currently the project is available on PyPI, so it can be installed using pip

  pip install intake-erddap

Developer Installation

Prerequisites

The following are prerequisites for a developer environment for this project:

  • conda
  • (optional but highly recommended) mamba Hint: conda install -c conda-forge mamba

Note: if mamba isn't installed, replace all instances of mamba in the following instructions with conda.

  1. Create the project environment with:

    mamba env update -f environment.yml
    
  2. Install the development environment dependencies:

    mamba env update -f dev-environment.yml
    
  3. Activate the new virtual environment:

    conda activate intake-erddap
    
  4. Install the project to the virtual environment:

    pip install -e .
    

Examples

To create an intake catalog for all of the ERDDAP's TableDAP offerings use:

import intake
catalog = intake.open_erddap_cat(
    server="https://erddap.sensors.ioos.us/erddap"
)

The catalog objects behave like a dictionary with the keys representing the dataset's unique identifier within ERDDAP, and the values being the TableDAPSource objects. To access a source object:

source = catalog["datasetid"]

From the source object, a pandas DataFrame can be retrieved:

df = source.read()

Consider a case where you need to find all wind data near Florida:

import intake
from datetime import datetime
bbox = (-87.84, 24.05, -77.11, 31.27)
catalog = intake.open_erddap_cat(
   server="https://erddap.sensors.ioos.us/erddap",
   bbox=bbox,
   start_time=datetime(2022, 1, 1),
   end_time=datetime(2023, 1, 1),
   standard_names=["wind_speed", "wind_from_direction"],
)

df = next(catalog.values()).read()
time (UTC) wind_speed (m.s-1) wind_from_direction (degrees)
0 2022-12-14T19:40:00Z 7.0 140.0
1 2022-12-14T19:20:00Z 7.0 120.0
2 2022-12-14T19:10:00Z NaN NaN
3 2022-12-14T19:00:00Z 9.0 130.0
4 2022-12-14T18:50:00Z 9.0 130.0
... ... ... ...
48296 2022-01-01T00:40:00Z 4.0 120.0
48297 2022-01-01T00:30:00Z 3.0 130.0
48298 2022-01-01T00:20:00Z 4.0 120.0
48299 2022-01-01T00:10:00Z 4.0 130.0
48300 2022-01-01T00:00:00Z 4.0 130.0

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

intake-erddap-0.4.0.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

intake_erddap-0.4.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file intake-erddap-0.4.0.tar.gz.

File metadata

  • Download URL: intake-erddap-0.4.0.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for intake-erddap-0.4.0.tar.gz
Algorithm Hash digest
SHA256 91b4164c9a6b38d62f65cf2400a00c8cc70e07109c0173dea4731dc052ec72ab
MD5 1b8362d1c9616cc732c5701871cd3649
BLAKE2b-256 b5b5dc14378d19770aa44560eedd6977157ad5a3e5de6b5cfd721af04f17e3b1

See more details on using hashes here.

File details

Details for the file intake_erddap-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: intake_erddap-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for intake_erddap-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b992235c7e80d36eff21842d4b18be7981c352d87175233934aa129bac1de3fd
MD5 055df85196d10f73d401d9b2d99690dc
BLAKE2b-256 b1bcf68ea76b5bacdac27d703a976b83a926c9d81a7ff2af4dc5a09ae6eaac8f

See more details on using hashes here.

Supported by

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