Skip to main content

NASA's Coordinated Data Analysis System Web Service Client Library

Project description

Synopsis

This library provides a simple python interface to the heliophysics data and services of NASA's Coordinated Data Analysis System (CDAS). This library implements the client side of the CDAS RESTful web services and can return data from any of these datasets in a SpacePy datamodel, xarray.Dataset, or pandas.DataFrame with all source and ISTP/SPDF metadata. Note that this package is included in the HelioCloud base image, so there is no need to install it there. Frequently asked questions concerning this library are at FAQ. For more general details about the CDAS web services, see https://cdaweb.gsfc.nasa.gov/WebServices/REST/.

Code Example

This package contains example code calling most of the available web services. To run the included example, do the following

python -m cdasws

Also, the following Jupyter notebooks demonstrate different features of the library:

  1. Data Retrieval (ipynb file) demonstrating use of library with results returned in SpacePy data model, xarray.Dataset, and pandas.DataFrame. Launch on Binder.
  2. CDAWeb Binning Example (ipynb file) demonstrating use CDAWeb binning. Launch on Binder.
  3. Magnetic Field Line Conjunction Example (ipynb file) with related data retrieval/plotting using cdasws. Launch on Binder.

And at the bottom of each CDAWeb dataset description is a "Data Access Code Examples" link that contains dataset-specific code utilizing this package to access the data.

Motivation

This library hides the HTTP, JSON/XML, and CDF details of the CDAS web services. A python developer only has to deal with python objects and methods (primarily the SpacePy data model or xarray.Dataset object with full ISTP/SPDF metadata).

Dependencies

The only required dependencies are the following:

  1. python-dateutil.
  2. requests.

If you call the get_data method then one of the following two sets of additional dependencies are required:

  1. To have get_data return the data in the SpacePy data model.
    • SpacePy. Refer to the SpacePy documentation for the details of SpacePy's dependencies.
  2. To have get_data return the data in an xarray.Dataset or pandas.DataFrame.

If you want to take advantage of HTTP caching, then install the following:

  1. requests-cache.

Installation

As noted in the dependencies above, if you intend to call the get_data method, you must install one of the following options.

  1. SpacePy.

     $ pip install -U spacepy
    
  2. cdflib and xarray.

     $ pip install -U cdflib
     $ pip install -U xarray
    

Then, to install this package

$ pip install -U cdasws

or to include the optional cache package

$ pip install -U cdasws[cache]

API Reference

Refer to cdasws package API reference

or use the standard python help mechanism.

from cdasws import CdasWs
help(CdasWs)

Tests

The tests directory contains unittest tests.

Contributors

Bernie Harris.
e-mail for support.

License

This code is licensed under the NASA Open Source Agreement (NOSA).

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

cdasws-1.8.16.tar.gz (43.6 kB view details)

Uploaded Source

Built Distribution

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

cdasws-1.8.16-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

Details for the file cdasws-1.8.16.tar.gz.

File metadata

  • Download URL: cdasws-1.8.16.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.25

File hashes

Hashes for cdasws-1.8.16.tar.gz
Algorithm Hash digest
SHA256 6d914a9ba445bb9f8ff64865170b163b6ca73bcca319b5f6b7a0fdeb40b5ae0a
MD5 70f69d2e0ecc72ad74d374e17f85181d
BLAKE2b-256 7fb9e7e3aec18bcd7c4fbb07f6a43b1a9ae2f7cc303154b6f131b467bcf07e5e

See more details on using hashes here.

File details

Details for the file cdasws-1.8.16-py3-none-any.whl.

File metadata

  • Download URL: cdasws-1.8.16-py3-none-any.whl
  • Upload date:
  • Size: 50.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.25

File hashes

Hashes for cdasws-1.8.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b8582a338f5a53f6a322d63af2ecf7979190d14baafd9242e29ea0563665e84d
MD5 5b90d6b8d63a7c082c731098e2da3171
BLAKE2b-256 af849624ef96385f34fb469199ed98425a28984901c282e1dcf6185b0def35b8

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