Skip to main content

SolarWindPy

SolarWindPy: A Python Library for in situ solar wind data analysis

Build Status Docs Status Ruff

PyPI Conda

Python License Zenodo

A Python Library for in situ solar wind data analysis.

Quick Start

After installation, import the package and create a plasma object with sample data:

>>> import pandas as pd
>>> from solarwindpy.core.plasma import Plasma
>>> # Create sample solar wind data (3 time points)
>>> epoch = pd.date_range('2023-01-01', periods=3, freq='1h')
>>> columns = pd.MultiIndex.from_tuples([
...     ('n', '', 'p1'), ('n', '', 'a'),           # Number density
...     ('v', 'x', 'p1'), ('v', 'x', 'a'),         # Velocity components
...     ('v', 'y', 'p1'), ('v', 'y', 'a'),
...     ('v', 'z', 'p1'), ('v', 'z', 'a'),
...     ('w', 'par', 'p1'), ('w', 'par', 'a'),     # Thermal speeds
...     ('w', 'per', 'p1'), ('w', 'per', 'a'),
...     ('b', 'x', ''), ('b', 'y', ''), ('b', 'z', '')  # Magnetic field
... ], names=['M', 'C', 'S'])
>>> # Realistic solar wind values
>>> data = pd.DataFrame([
...     [5.0, 0.25, 400, 380, 10, 5, -20, -15, 30, 15, 25, 12, 3.5, -1.2, 0.8],
...     [8.0, 0.40, 450, 420, 15, 8, -25, -18, 35, 18, 28, 14, 4.1, -1.5, 1.2],
...     [7.1, 0.30, 420, 400, 12, 6, -22, -16, 32, 16, 26, 13, 3.8, -1.3, 0.9],
... ], index=epoch, columns=columns)
>>> # Create plasma object with protons and alphas
>>> plasma = Plasma(data, 'p1', 'a')
>>> # Access ion species
>>> print(plasma.species)
('a', 'p1')
>>> # Mean proton density: (5.0 + 8.0 + 7.1) / 3 = 6.7
>>> print(f"Proton density: {plasma.p1.n.mean():.1f} cm⁻³")
Proton density: 6.7 cm⁻³

See the documentation for the quickstart, usage examples and the API reference.

Installation

The supported Python versions and dependency ranges are declared in pyproject.toml (requires-python and dependencies); the PyPI page shows them for each published release.

SolarWindPy is available via PyPI and conda-forge:

User

Install from PyPI:

pip install solarwindpy

Or install from conda-forge:

conda install -c conda-forge solarwindpy

Development

  1. Fork the repository and clone your fork.

  2. Install development dependencies:

    git clone https://github.com/YOUR-USERNAME/SolarWindPy.git
    cd SolarWindPy
    pip install -e ".[dev]"  # Includes all dev tools

    Alternative (Conda environment):

    conda env create -f solarwindpy.yml
    conda activate solarwindpy
    pip install -e ".[dev]"
  3. Run the test suite with pytest:

    pytest -q

Note: pyproject.toml is the only dependency declaration; there are no lockfiles.

  1. Optionally install the pre-commit hooks:

    pre-commit install

    Each commit then runs the hooks that .pre-commit-config.yaml lists, and that file is the full list. Expect a commit that stages a .py file to run the full test suite.

  2. Build the documentation and fail on warnings:

    cd docs
    make html SPHINXOPTS="-W --keep-going -n"

License

SolarWindPy is licensed under a standard 3-clause BSD license. See LICENSE.

How to cite

If SolarWindPy contributes to published work, please cite it:

@software{Alterman_SolarWindPy,
  author    = {Alterman, B. L.},
  title     = {SolarWindPy},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.17042839},
  url       = {https://doi.org/10.5281/zenodo.17042839}
}

Please cite this all-versions DOI rather than a single release’s DOI, and give the version you used in your text. See CITATION.rst for details. GitHub’s “Cite this repository” button reads the same metadata from CITATION.cff.

Metadata

Release files for solarwindpy 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solarwindpy 0.5.0
File Size Uploaded Provenance Actions
solarwindpy-0.5.0.tar.gz 1.7 MB Without provenance Details for solarwindpy-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solarwindpy 0.5.0
File Interpreter ABI Platform Actions
solarwindpy-0.5.0-py3-none-any.whl Python 3 none any Details for solarwindpy-0.5.0-py3-none-any.whl

Total release size: 1.9 MB

Release files / solarwindpy-0.5.0.tar.gz

Download URL solarwindpy-0.5.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
e42cedec4f0abf0b6cd490d0be0226033e4967ebbff528bcf1d0efa8622441da
BLAKE2b-256 checksum
How to use checksums
fcf3a126053eb5c6f612bc47e43aaa2144e721e5dbdd091529ded31ce843930a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / solarwindpy-0.5.0-py3-none-any.whl

Download URL solarwindpy-0.5.0-py3-none-any.whl
Size 248.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb28d7c1f4c376a98e976e75d216b56bc6baa4cae36e38584b4e6c01de276f1d
BLAKE2b-256 checksum
How to use checksums
afdba2b17ee0d7522457b73ac31f1cf1c59c6cb9e87b54c0081287e81a263198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for solarwindpy 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page