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?

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spicedmodel-1.1.0.tar.gz (884.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spicedmodel-1.1.0-py3-none-win_arm64.whl (105.7 kB view details)

Uploaded Python 3Windows ARM64

spicedmodel-1.1.0-py3-none-win_amd64.whl (113.3 kB view details)

Uploaded Python 3Windows x86-64

spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (308.9 kB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (294.7 kB view details)

Uploaded Python 3manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl (190.0 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl (188.0 kB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file spicedmodel-1.1.0.tar.gz.

File metadata

  • Download URL: spicedmodel-1.1.0.tar.gz
  • Upload date:
  • Size: 884.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spicedmodel-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bc1203ddf51ec3eb84430b65899c1eb535525db3b029b11550f8f0ff646de40e
MD5 b5306861fb1fce023ba73bc024909ed0
BLAKE2b-256 ed68b9856827616c57f3e25c2f82ca81cb98d51b2d6d9aca9597ab67e1e12e14

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: spicedmodel-1.1.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 105.7 kB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spicedmodel-1.1.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 5f585f055bf69c367de88b0e617567a2c4bd3c250f7388029728e31a541ae95e
MD5 15dd3d1bdd1c58bedb01f8480c0c5bf1
BLAKE2b-256 fe8787c67509fb1145d1212b51307dc6814dd9019e4e78084f2511a700b9336f

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: spicedmodel-1.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 113.3 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spicedmodel-1.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 98b4baf4d1da8c7a262c0081bcfbcd3fcb61e4297ad5bcf77a8b4d2d5b294db6
MD5 bde9f54d65420400725cc979638ea1d3
BLAKE2b-256 b7662600e6970343d840a3b611b0cfe2ce1a42f863f88b8f3e1ac831dd2d99a2

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spicedmodel-1.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fcbba2808681a3e325cf65ab7a635cccd03617d912ac51d5f0c89ca88b22355
MD5 823789ef57290b15f3cc6858a69b46f8
BLAKE2b-256 031b8c8afe6b1204a67e7dc4bb845c385e68bafde4022823f0dbb2b27b19b0e0

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for spicedmodel-1.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ee48bf1cee0326ad3faf2c55a50eb732f764c674e6d2e4ca58453b98f7b10a42
MD5 9194be833201a2c1c1794a4654c75a2f
BLAKE2b-256 b4766d05c326615a72b51dd7b9bbfa71e54ebf4b8fa286422bdf7f9d729bdd3d

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spicedmodel-1.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a27e1787c734b30df4ff7130dac281ed7c7cf635b73546ef06dd9ab74c6ca99
MD5 9db98e46dc0916da45f31194af19d092
BLAKE2b-256 38de65499deff5af900076ed13615da7fbf40ede7f63bee445143a11938d7408

See more details on using hashes here.

File details

Details for the file spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for spicedmodel-1.1.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9940ae7e4f63d1a75e2b569f9ea700e901165782cb334606c88165f6fe036524
MD5 ee33d6b7888f52c61bcb7e62b0f36a13
BLAKE2b-256 7b1deaba355e8fbee4dcb55eadced9fe762e4d73f10444cc7987a6e270bc667e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

7 files

1.0.0

1 file

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