SNOW.py
SNOW (Solar Neural Operator for Wind) propagates a complete 20 R☉ solar-wind boundary into a steady-state, three-dimensional MHD prediction. The package runs the published SNOW checkpoint, trained on AWSoM simulations in a Sun-centered inertial frame. It predicts all eight plasma fields every 10 R☉ through 250 R☉. The manuscript analysis ends at 240 R☉.
Installation
After the PyPI release, install Python 3.10 or newer and run:
python -m pip install snow-mhd
snowpy download-checkpoint
From a source checkout, use python -m pip install . in place of the PyPI command. For CUDA, install a CUDA-enabled PyTorch build appropriate for your system.
The optional setup command downloads the 3.05 GB epoch-399 checkpoint from the published Zenodo record. The first prediction downloads it automatically when the cache is empty. The wheel contains package code only and the download runs outside pip's build and installation hooks. The download is verified by size and SHA-256. The default cache is ~/.cache/snowpy or $XDG_CACHE_HOME/snowpy. Override it with SNOW_CACHE_DIR or --cache-dir. A local copy is accepted via --checkpoint /path/to/SNOW.pt for offline use.
Boundary format
Supply a NumPy array named plasma in boundary.npz. Its shape is (8, 91, 180) with axes in field, colatitude, longitude order. The radial coordinate is 20 R☉. Use the following channel order and units.
| Index | Name | Quantity | Unit |
|---|---|---|---|
| 0 | n_p |
Proton number density | cm⁻³ |
| 1 | v_r |
Outward radial velocity | km/s |
| 2 | v_theta |
Southward velocity, along increasing colatitude | km/s |
| 3 | v_phi |
Velocity along increasing longitude | km/s |
| 4 | p |
Thermal pressure | nPa |
| 5 | b_r |
Outward radial magnetic field | nT |
| 6 | b_theta |
Southward magnetic field | nT |
| 7 | b_phi |
Magnetic field along increasing longitude | nT |
Use colatitude 0°, 2°, …, 180° from north to south and periodic longitude 0°, 2°, …, 358°. Include both poles and omit the duplicate 360° column. Use finite values and positive density, radial velocity and pressure. Regrid external boundaries to this angular grid and express vectors in the spherical basis before supplying them. The checkpoint is calibrated to AWSoM-like boundaries.
import numpy as np
from snowpy import write_boundary
plasma = np.stack([n_p, v_r, v_theta, v_phi, p, b_r, b_theta, b_phi])
write_boundary("boundary.npz", plasma)
For an existing manuscript-style AWSoM array in CGS units, the converter follows the original angular subsampling and accounts for the northward convention of the stored meridional components:
snowpy prepare-awsom AwSOM_data_009.npz boundary.npz
The converter expects the original south-to-north latitude ordering and a duplicated longitude endpoint. It accepts a full (8, 231, 181, 361) cube in the original layout or a pre-extracted (8, 181, 361) shell at 20 R☉, stored in an NPY file or under the data key in an NPZ. Use NPY for memory-mapped access to a full volume.
Predict with the CLI
snowpy predict boundary.npz solution.npz
snowpy predict boundary.npz solution-240.npz --outer-radius 240 --device cpu
The solution contains a float32 plasma array with axes (field, radius, colatitude, longitude). At 250 R☉, the shape is (8, 24, 91, 180). At 240 R☉, it is (8, 23, 91, 180). The first shell is the supplied boundary in float32. The remaining shells are autoregressive predictions. The NPZ also includes radius_rs, theta_deg, phi_deg, fields, units, and theta_direction.
Predict from Python
from snowpy import SNOW, read_boundary
model = SNOW(device="auto") # CUDA when available, CPU otherwise
boundary = read_boundary("boundary.npz")
solution = model.predict(boundary, outer_radius=240)
radial_speed_240 = solution.plasma[1, -1]
solution.save("solution-240.npz")
Reuse the same model object for multiple boundaries. outer_radius accepts 30 through 250 R☉ in increments of 10 R☉.
Release checks
python -m pip install build twine
python -m pip install .
python -m unittest discover -s tests -v
SNOW_TEST_CHECKPOINT=/path/to/SNOW.pt python -m unittest discover -s tests -v
python -m build
python -m twine check dist/*
On the first release, check name availability and upload the verified artifacts to PyPI using the project owner's account. snow-mhd is the distribution name, snowpy is the Python module and command, and PyPI normalizes the project name to snow-mhd.
The inference architecture and checkpoint originate from SNOW: Fast and Differentiable MHD Surrogate for Solar Wind using Neural Operator, Prateek Mayank, Enrico Camporeale, Thomas Berger, Zhenguang Huang, and Gabor Toth. Zenodo archive
Metadata
Release files for snow-mhd 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snow_mhd-0.1.0.tar.gz | 20.1 kB | Without provenance | Details for snow_mhd-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snow_mhd-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for snow_mhd-0.1.0-py3-none-any.whl |
Total release size: 41.7 kB
Release files / snow_mhd-0.1.0.tar.gz
| Download URL | snow_mhd-0.1.0.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dafe3d66c0fcd31a80bbb033f02b5b30df0e331a05e6aeb4a46970467dc88aca
|
|
BLAKE2b-256 checksum How to use checksums |
2464ec269cc4a825c8a262231f171de3ef2c97b18ba1bce25865c1abb95e25ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / snow_mhd-0.1.0-py3-none-any.whl
| Download URL | snow_mhd-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c11dd9855e70232b0c51d12b605223f55b3d3bd64a1cf15251a9802e8a98a71
|
|
BLAKE2b-256 checksum How to use checksums |
216cf9378997893d093f070f979721155ba27954a329c693bab2f78dcf1ad41b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for snow-mhd 0.1.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.