pysecs
pysecs is an open-source library for calculating Spherical Elementary Current Systems (SECS).
Features
- Based upon the scikit-learn framework with
fit()andpredict()methods. - The only dependency is NumPy. It is built using fast broadcasting techniques to provide highly scalable calculations.
- Divergence-free and curl-free systems, including the curl-free magnetic field for observations above the current shell (satellite altitudes).
- Uncertainty propagation: amplitude variances and prediction variance maps
(
predict(..., return_var=True)). - Robust fitting (
fit(..., robust='huber'|'bisquare')) that automatically downweights localized single-station disturbances. - Temporal estimation with
KalmanSECS: a Kalman filter / smoother over the SEC amplitudes with innovation gating for impulsive outliers. - Automatic SECS grid generation from an observation network
(
SECS.from_observations(obs_loc, r_shell)), with sensible defaults for spacing and padding and a guard against poles landing on a station.
Examples
Examples can be found in examples/
Install
The easiest method to install pysecs is with pip.
> pip install pysecs
For a source install you can follow these instructions:
-
Clone the git repository
> git clone https://github.com/greglucas/pysecs
-
Build and install the package
> pip install .
-
Testing The package has a test suite that can be run with pytest
> pytest
License
The code is released under an MIT license License described in LICENSE.md
References
This package has been developed from different publications. Please consider citing the papers that are relevant to the work you are doing if you are utilizing this code.
Software
Lucas, G., Rigler, E. J., Murphy, B. (2024). greglucas/pysecs: REL: v0.3.0 (v0.3.0).
Zenodo. https://doi.org/10.5281/zenodo.14511596
Original Paper
Amm, O. "Ionospheric Elementary Current Systems in Spherical Coordinates and Their Application."
Journal of geomagnestism and geoelectricity 49.7 (1997): 947-955. doi:10.5636/jgg.49.947
Applications Paper
Amm, O., and A. Viljanen. "Ionospheric disturbance magnetic field continuation
from the ground to the ionosphere using spherical elementary current systems."
Earth, Planets and Space 51.6 (1999): 431-440. doi:10.1186/BF03352247
Review Chapter (curl-free magnetic field)
The magnetic field of the curl-free system (Equation 2.15) implemented in this package is given in this review chapter.
Vanhamäki, H., and L. Juusola. "Introduction to Spherical Elementary Current Systems."
Ionospheric Multi-Spacecraft Analysis Tools, ISSI Scientific Report Series 17 (2020): 5-33.
doi:10.1007/978-3-030-26732-2_2
Problems or Questions
Release files for pysecs 0.4.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 | |
|---|---|---|---|
| pysecs-0.4.0.tar.gz | 58.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysecs-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.1 kB
Release files / pysecs-0.4.0.tar.gz
| Download URL | pysecs-0.4.0.tar.gz |
|---|---|
| Size | 58.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cacce2d4addc2c2fa0dd560db52cd23d23481aa2457126265e73db6966b6aa8f
|
|
BLAKE2b-256 checksum How to use checksums |
2ec1f47571a79f04a12f8e7752b72798271c13cbb2d5a74f766ae53458900491
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logRelease files / pysecs-0.4.0-py3-none-any.whl
| Download URL | pysecs-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
240e99e04f4788aea3e2c6c0889cbbc28d98f3e9fa369c94bec9cc167cf4b536
|
|
BLAKE2b-256 checksum How to use checksums |
f08b39e6baae4bf38580d82c088ba7cdc7d9610f879a8d5ba21f390b884d87cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency log