Skip to main content

Python software to fetch SuperMag data

Project description

SuperMAG Python Client

The SuperMAG Python Client provides programmatic access to magnetometer data and indices from the SuperMAG web services API. It supports data retrieval, station inventory queries, and data manipulation using Python with built-in pandas support.

Features

  • Inventory Query: Retrieve lists of SuperMAG stations for a given event.
  • Magnetometer Data: Fetch vector magnetic field data (NEZ, geographic) for selected stations.
  • Magnetic Indices: Retrieve SuperMAG indices (SME, SMU, SML, etc.) with support for sunlit/dark/regional variations and solar wind parameters.
  • Flexible Output: Choose between pandas.DataFrame or raw list outputs via FORMAT parameter.
  • Helper Tools: Utility functions to extract nested dictionary structures, process CSV exports, and perform unit tests.

Requirements

  • Python 3
  • pandas (pip install pandas)
  • certifi (required at sites with SSL cert enforcement)

Example Usage

from supermag_api import *
userid = 'YOUR_SUPERMAG_USER_ID'
start = [2019, 11, 15, 10, 40]

# Get inventory
status, stations = SuperMAGGetInventory(userid, start, 3600)

# Fetch data
status, data = SuperMAGGetData(userid, start, 3600, 'all', 'HBK')

# Fetch indices
status, indices = SuperMAGGetIndices(userid, start, 3600, 'all')

# Access nested components
n_nez = sm_grabme(data, 'N', 'nez')

# Quick test
sm_microtest(4, userid)

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

supermag_api-0.0.6.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

supermag_api-0.0.6-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file supermag_api-0.0.6.tar.gz.

File metadata

  • Download URL: supermag_api-0.0.6.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for supermag_api-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e17818ed18ca310bab65cc741c7182d22b44f578fe5f8f174d73595c5f28da29
MD5 fa480ccd2fb1ace091a2156ddcbb0919
BLAKE2b-256 c3b7591b2ae3dd652b75933ab1c9abaa3bbe8ae94346e25d6234cf28fbb426a9

See more details on using hashes here.

File details

Details for the file supermag_api-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: supermag_api-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for supermag_api-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4b0df0f2c7d1dc22fc256b5c7da6d79f596c4c4c95aba9a3cedc1d5153b47688
MD5 8584d609299ff90861100c17f2405caf
BLAKE2b-256 8e4d0e22e260671910980acdf925fb40735a27c6ffbecf311fc924a4c6ce6c02

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