Python package for solar wind data analysis.
Project description
Python data analysis tools for solar wind measurements.
Quick Start
After installation, import the package and create a plasma object with sample data:
import solarwindpy as swp
import pandas as pd
# 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],
[6.5, 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 = swp.Plasma(data, 'p1', 'a')
# Access ion species
print(plasma.species) # ['p1', 'a']
print(f"Proton density: {plasma.p1.n.mean():.1f} cm⁻³")
See the documentation for detailed usage examples and API reference.
Installation
SolarWindPy requires Python 3.11 or later.
SolarWindPy is available via PyPI and conda-forge:
User
Install from PyPI:
pip install solarwindpy # Requires Python 3.11+
Or install from conda-forge:
conda install -c conda-forge solarwindpy
Note: The conda-forge package for v0.1.5 is temporarily unavailable due to CI infrastructure issues (see issue #8). Install from PyPI to get the latest version. The conda-forge package will be updated once the issue is resolved.
Development
Fork the repository and clone your fork.
Create a Conda environment using the provided YAML file (Python 3.11+):
conda env create -f solarwindpy.yml # Python 3.11+ conda activate solarwindpy pip install -e .Alternatively generate the environment from requirements-dev.txt:
python scripts/requirements_to_conda_env.py --name solarwindpy conda env create -f solarwindpy.yml conda activate solarwindpy pip install -e .Run the test suite with pytest:
pytest -qRegenerate the Conda recipe if the version or dependencies change:
python scripts/update_conda_recipe.pyOptionally install the pre-commit hooks:
pre-commit installThis will run black and flake8 automatically when committing.
Build the documentation and fail on warnings:
cd docs make html SPHINXOPTS=-W
License
SolarWindPy is licensed under a standard 3-clause BSD license. See LICENSE.
Acknowledging and Citing SolarWindPy
See CITATION.rst for instructions on citing SolarWindPy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solarwindpy-0.2.0.tar.gz.
File metadata
- Download URL: solarwindpy-0.2.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39f818a3e9d0473f0796f408b017d42d8edf5a475955491a0204a046b82f7d5
|
|
| MD5 |
4027eb37a1a47d98612dfcf16d445de7
|
|
| BLAKE2b-256 |
285ff57231c00a9a7516f62665ea34e3d21bcb45574437eeb2c71b9a035c8765
|
File details
Details for the file solarwindpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: solarwindpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22668f699f5469cad15db8970ee89711a3269c3cc81a4e00d6bb0501f0029a0f
|
|
| MD5 |
c398d3e86a45ea7fd77886c752ee414e
|
|
| BLAKE2b-256 |
b2fe695db7701389d87122e8ec550000ecc032f635ee494ceb0856deb91faf53
|