PySPEDAS: Python Space Physics Environment Data Analysis Software

repository·master·Indexed 41 days ago

https://github.com/spedas/pyspedas

A Python framework for the retrieval, analysis, and visualization of multi-mission heliophysics time series data. Version 2.1.5 includes routines for magnetic field gradient estimation (lingradest), magnetic null analysis (find_magnetic_nulls_fote, classify_null_types), wave polarization (twavpol), and Tsyganenko magnetic field models via the geopack module (tt89, tt96, tt01, tts04). It provides data loading support for missions including ACE, Akebono, BARREL, Cluster, C/NOFS, CSSWE, and DE2.

Tokens
78.4K
Snippets
377
Records
468
Agent score
53%

What's inside PySPEDAS

  1. Overview of PySPEDAS

    master

    PySPEDAS is a Python implementation of the Space Physics Environment Data Analysis Software (SPEDAS) framework. It provides tools for data loading, analysis, and plotting for various scientific missions (such as NASA and NOAA) and ground magnetometers.

    A primary use case for PySPEDAS is creating multi-mission, multi-instrument figures by combining data from different spacecraft like Solar Orbiter (solo), Parker Solar Probe (psp), MMS (mms), and THEMIS (themis).

  2. Use mission-specific analysis tools in PySPEDAS

    master

    PySPEDAS provides specialized tools for specific space physics missions. These tools are designed to handle mission-specific data structures (such as particle data representations) and custom coordinate systems.

    Use these tools when you need to:

    1. Transform data to and from mission-specific geophysical coordinate frames.
    2. Wrap mission-specific data formats so they are compatible with PySPEDAS general-purpose analysis tools.
    3. Perform analysis that requires knowledge of a particular mission's data architecture.

    Available mission-specific analysis modules include:

    • themis_analysis
    • erg_analysis
    • mms_analysis
    • rbsp_analysis
    • cluster_analysis
  3. PySPEDAS useful resources

    master

    For developers and users looking for more information, the following resources are available:

  4. Load SOHO mission data with PySPEDAS

    master

    The pyspedas.soho module provides routines to load data from the Solar & Heliospheric Observatory (SOHO) mission. To use these routines, you must import pyspedas and tplot from pyspedas for data visualization.

    Supported instruments include:

    • CELIAS: Charge, Element, and Isotope Analysis System
    • COSTEP: Comprehensive Suprathermal and Energetic Particle Analyzer
    • ERNE: Energetic and Relativistic Nuclei and Electron experiment
    • ORBIT: Orbit (ephemeris and attitude) data
    import pyspedas
    from pyspedas import tplot
  5. Use DAS2 utilities to request and parse data

    master

    DAS2 utilities allow you to request data and dataset information from DAS2 servers, parse ASCII responses, and create PySPEDAS tplot variables. These utilities are primarily used by the Juno loader.

    Supported API: DAS 2.1 (ASCII responses only).

    Key Capabilities:

    • Download ASCII response text.
    • Convert ASCII text into tplot variables.
    • Request dataset listings, peer servers, or dataset definitions.
  6. Load Akebono mission data with PySPEDAS

    master

    The pyspedas.akebono module provides routines to load data from the Akebono mission. Supported instruments include:

    • Plasma Waves and Sounder experiment (PWS): Use pyspedas.akebono.pws()
    • Radiation Monitor (RDM): Use pyspedas.akebono.rdm()
    • Orbit data (orb): Use pyspedas.akebono.orb()

    To load and visualize the data, you must import pyspedas and tplot from pyspedas.

    import pyspedas
    from pyspedas import tplot
  7. Load Van Allen Probes (RBSP) data

    master

    The pyspedas.rbsp module provides routines to load data from various instruments on the Van Allen Probes (RBSP) mission. To use these routines, you must import pyspedas and tplot (from pyspedas).

    Supported instruments include:

    • EMFISIS: Electric and Magnetic Field Instrument Suite and Integrated Science
    • EFW: Electric Field and Waves Suite
    • RBSPICE: Radiation Belt Storm Probes Ion Composition Experiment
    • ECT: Energetic Particle, Composition, and Thermal Plasma Suite
    • RPS: Relativistic Proton Spectrometer
    import pyspedas
    from pyspedas import tplot
  8. Load data from the IMAGE mission

    master
    PySPEDAS provides specialized routines to load data from various instruments on the Imager for Magnetopause-to-Aurora Global Exploration (IMAGE) mission. You can access data from neutral atom imagers (LENA, MENA, HENA), plasma imaging (RPI), ultraviolet imagers (EUV, FUV), and mission orbit data.
  9. Load MAVEN mission data with PySPEDAS

    master

    PySPEDAS provides routines to load data from the Mars Atmosphere and Volatile Evolution (MAVEN) mission. Data is sourced from the MAVEN SDC at Colorado or the SPDF repository.

    Supported instruments include:

    • Magnetometer (MAG)
    • Solar Wind Electron Analyzer (SWEA)
    • Solar Wind Ion Analyzer (SWIA)
    • SupraThermal And Thermal Ion Composition (STATIC)
    • Solar Energetic Particle (SEP)
    • Langmuir Probe and Waves (LPW)
    • Extreme Ultraviolet Monitor (EUV)

    Note: kp (Key Parameters) files contain data from multiple instruments.

  10. Override mission defaults using a TOML preference file

    master

    PySPEDAS allows you to override mission-specific defaults (stored in each mission's config.py) using a user TOML file. This prevents the need to edit the installed package directly.

    Precedence Order

    When determining a value, PySPEDAS follows this order of precedence:

    1. Explicit load-function parameter
    2. Existing environment variable
    3. User preference (TOML file)
    4. PySPEDAS default

    Note: A preference cannot override an environment variable already recognized by a mission. Only keys already present in a mission's CONFIG dictionary are supported.

    Configuration File Location

    The default file is preferences.toml located in the platform's user configuration directory (e.g., ~/.config/pyspedas/preferences.toml on Linux). You can find the exact path using pyspedas.preferences.preferences_path().

    You can point PySPEDAS to a different file (for testing or project-specific setups) by setting the PYSPEDAS_CONFIG_FILE environment variable.

    [projects.themis]
    local_data_dir = "/data/themis"
    remote_data_dir = "https://spdf.gsfc.nasa.gov/pub/data/themis/"
    
    [pyspedas.plotting]
    global_display = false
    plot_directory = "pyspedas_plots"
    
    [pyspedas.testing]
    output_dir = "/data/pyspedas-tests"
    validation_dir = "https://github.com/spedas/test_data/raw/refs/heads/main/"
    global_display = false