Skip to main content

spicedmodel

Python wrapper for the Scalable Plasma Ion Composition and Electron Density (SPICED) model.

The paper:

James, M. K., Yeoman, T.K., Jones, P., Sandhu, J. K., Goldstein, J. (2021), The Scalable Plasma Ion Composition and Electron Density (SPICED) model for Earth's inner magnetosphere, J. Geophys. Res. Space Physics, https://doi.org/10.1029/2021JA029565

DOI

Installation

Using pip

This will download the package from PyPI:

pip3 install spicedmodel --user

From Source

Obtain the latest release from https://github.com/mattkjames7/spicedmodel

git clone https://github.com/mattkjames7/spicedmodel
cd spicedmodel

Either install using setup.py:

python3 setup.py install --user

or by building a wheel:

python3 setup.py bdist_wheel
pip3 install dist/spicedmodel-XXX.whl --user

where "XXX" is the rest of the file name, which will vary depending upon the current version.

Usage

Load python3 or ipython3, and import

import spicedmodel

Accessing the models

There are four models, plus two additional combinations of these models:

  • Plasmasphere average ion mass, mav,ps: spicedmodel.MavPS
  • Plasmatrough average ion mass, mav,pt: `spicedmodel.MavPT
  • Combined average ion mass, mav: spicedmodel.Mav
  • Hot average ion mass, mav: spicedmodel.MavHot
  • Probability of being within the plasmasphere, P: spicedmodel.Prob
  • Plasmasphere electron density, ne,ps: spicedmodel.PS
  • Plasmatrough electron density, ne,pt: spicedmodel.PT
  • Combined electron density, ne (a combination of plasmasphere, plasmatrough and probability models): spicedmodel.Density
  • Combined plasma mass density, ρ: spicedmodel.PMD

The average versions of each model can be accessed simply by providing the positions in the equatorial plane where you would like them, e.g.:

#either using SM x and y coordinates
P = spicedmodel.Prob(x,y)

#or using MLT (M) and L-Shell (L)
P = spicedmodel.Prob(M,L,Coord='ml')

The scaled models can be accessed using the same functions, this time including the SMR keyword (for Mav, MavPS, MavPT, Prob, PS, PT, Density or PMD) or F107 (for MavHot), e.g.:

#electron density
ne = spicedmodel.Density(x,y,SMR=-75.0)

#average ion mass
mav = spicedmodel.Mav(x,y,SMR=-75.0)

#plasma mass density, effectively ne*mav
pmd = spicedmodel.PMD(x,y,SMR=-75.0)

Plotting the models

A simple function is included, PlotEq, which allows the plotting of any of the models in the equatorial plane. e.g.:

ax = spicedmodel.PlotEq(ptype,SMR=-75.0)

where ptype is used to tell the function which model to plot, available options are: 'mav'|'mavps'|'mavpt'|'mavhot'|'prob'|'ps'|'pt'|'density'|'pmd'.

The following code produces a plot with all 6 models when SMR = -75 nT

import matplotlib.pyplot as plt
import spicedmodel

#create the plot window
plt.figure(figsize=(8,7))

#set the parameters of the models
smr = -70.0

#plot the average ion mass
ax0 = spicedmodel.PlotEq('mav',SMR=smr,fig=plt,maps=[2,2,0,0])

#plot probability 
ax1 = spicedmodel.PlotEq('prob',SMR=smr,fig=plt,maps=[2,2,1,0])

#plot electron density 
ax4 = spicedmodel.PlotEq('density',SMR=smr,fig=plt,maps=[2,2,0,1])

#plot plasma mass density
ax5 = spicedmodel.PlotEq('pmd',SMR=smr,fig=plt,maps=[2,2,1,1])

#adjust everything to fit
plt.tight_layout()

example.png

For more information and options, see the docstring: spicedmodel.PlotEq?

Metadata

Release files for spicedmodel 1.1.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 spicedmodel 1.1.0
File Size Uploaded Provenance Actions
spicedmodel-1.1.0.tar.gz 884.5 kB Without provenance Details for spicedmodel-1.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for spicedmodel 1.1.0
File Actions
spicedmodel-1.1.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for spicedmodel-1.1.0-py3-none-win_arm64.whl
spicedmodel-1.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for spicedmodel-1.1.0-py3-none-win_amd64.whl
spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl
spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl

Total release size: 2.1 MB

Release files / spicedmodel-1.1.0.tar.gz

Download URL spicedmodel-1.1.0.tar.gz
Size 884.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bc1203ddf51ec3eb84430b65899c1eb535525db3b029b11550f8f0ff646de40e
BLAKE2b-256 checksum
How to use checksums
ed68b9856827616c57f3e25c2f82ca81cb98d51b2d6d9aca9597ab67e1e12e14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-win_arm64.whl

Download URL spicedmodel-1.1.0-py3-none-win_arm64.whl
Size 105.7 kB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
5f585f055bf69c367de88b0e617567a2c4bd3c250f7388029728e31a541ae95e
BLAKE2b-256 checksum
How to use checksums
fe8787c67509fb1145d1212b51307dc6814dd9019e4e78084f2511a700b9336f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-win_amd64.whl

Download URL spicedmodel-1.1.0-py3-none-win_amd64.whl
Size 113.3 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
98b4baf4d1da8c7a262c0081bcfbcd3fcb61e4297ad5bcf77a8b4d2d5b294db6
BLAKE2b-256 checksum
How to use checksums
b7662600e6970343d840a3b611b0cfe2ce1a42f863f88b8f3e1ac831dd2d99a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 308.9 kB
Tags Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9fcbba2808681a3e325cf65ab7a635cccd03617d912ac51d5f0c89ca88b22355
BLAKE2b-256 checksum
How to use checksums
031b8c8afe6b1204a67e7dc4bb845c385e68bafde4022823f0dbb2b27b19b0e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 294.7 kB
Tags Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ee48bf1cee0326ad3faf2c55a50eb732f764c674e6d2e4ca58453b98f7b10a42
BLAKE2b-256 checksum
How to use checksums
b4766d05c326615a72b51dd7b9bbfa71e54ebf4b8fa286422bdf7f9d729bdd3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl

Download URL spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl
Size 190.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a27e1787c734b30df4ff7130dac281ed7c7cf635b73546ef06dd9ab74c6ca99
BLAKE2b-256 checksum
How to use checksums
38de65499deff5af900076ed13615da7fbf40ede7f63bee445143a11938d7408
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl

Download URL spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl
Size 188.0 kB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
9940ae7e4f63d1a75e2b569f9ea700e901165782cb334606c88165f6fe036524
BLAKE2b-256 checksum
How to use checksums
7b1deaba355e8fbee4dcb55eadced9fe762e4d73f10444cc7987a6e270bc667e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for spicedmodel 1.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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

7 release files No provenance

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