Skip to main content

pyRFU

License Python PyPi Format Wheel Status Downloads CI PyLintB CodeQL CodeCov Issues Commits Readthedocs Matrix Black Doi

The Python package pyrfu is a software based on the IRFU-MATLAB library to work with space data, particularly the Magnetospheric MultiScale (MMS) mission.

It is distributed under the open-source MIT license.

Quickstart

Installing pyrfu with pip (more details here):

$ python -m pip install pyrfu
# or
$ python -m pip install --user pyrfu

Import pyrfu.mms package with routines specific to work with the Magnetospheric Multiscale mission (MMS)

from pyrfu import mms

Setup path to MMS data

mms.db_init(default="local", local="/Volumes/mms")

Load magnetic field and ion bulk velocity data

tint = ["2019-09-14T07:54:00.000", "2019-09-14T08:11:00.000"]
b_gsm = mms.get_data("b_gsm_fgm_srvy_l2", tint, 1)
v_gse_i = mms.get_data("vi_gse_fpi_fast_l2", tint, 1)

Import pyrfu.pyrf package with generic routines

from pyrfu import pyrf

Transform ion bulk velocity to geocentric solar magnetospheric (GSM) coordinates

v_gsm_i = pyrf.cotrans(v_gse_i, "gse>gsm")

Import pyrfu.plot package with plotting routines

from pyrfu.plot import plot_line

Plot time series of magnetic field and ion bulk velocity

import matplotlib.pyplot as plt

f, axs = plt.subplots(2, sharex="all")
plot_line(axs[0], b_gsm)
axs[0].set_ylabel("$B~[\\mathrm{nT}]$")
axs[0].legend(["$B_{x}$", "$B_{y}$", "$B_{z}$"], ncol=4)

plot_line(axs[1], v_gsm_i)
axs[1].set_ylabel("$V_i~[\\mathrm{km}~\\mathrm{s}^{-1}]$")
axs[1].legend(["$V_{ix}$", "$V_{iy}$", "$V_{iz}$"], ncol=4)

Documentation

Full documentation can be found on pyrfu.readthedocs.io

Examples

A list of examples is available here

Credits

This software was developed by Louis RICHARD at the Swedish Institute of Space Physics (IRF) in Uppsala, based on the IRFU-MATLAB library, and is now maintained by Louis RICHARD at the Rudolf Peierls Centre for Theoretical Physics, University of Oxford (louis.richard@physics.ox.ac.uk).

Acknowledgement

If pyrfu contributes to work leading to a publication, please cite it and give the version you used (pyrfu.__version__), for example in the acknowledgements or the methods section:

Data analysis was performed using the open-source pyrfu package (Richard et al., 2024), version X.Y.Z.

Reference:

Richard, L., Khotyaintsev, Y. V., Vaivads, A., Graham, D. B., Norgren, C., & Johlander, A. (2024). Python RymdFysik Utilities (PyRFU): An open-source Python package for advanced in-situ space plasma analysis [Software]. Zenodo. https://doi.org/10.5281/zenodo.10678695

BibTeX:

@software{richard2024pyrfu,
  author    = {Richard, Louis and Khotyaintsev, Yuri V. and Vaivads, Andris and
               Graham, Daniel B. and Norgren, Cecilia and Johlander, Andreas},
  title     = {Python RymdFysik Utilities (PyRFU): An Open-Source Python Package
               for Advanced In-Situ Space Plasma Analysis},
  year      = {2024},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.10678695},
  url       = {https://doi.org/10.5281/zenodo.10678695}
}

The same metadata is in CITATION.cff (GitHub’s “Cite this repository”). Many routines implement published methods, given in the References section of their documentation: please cite those as well, and acknowledge the data you use following the policy of each mission (for MMS, the instrument teams and the MMS Science Data Center).

Metadata

Release files for pyrfu 2.5.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 pyrfu 2.5.0
File Size Uploaded
pyrfu-2.5.0.tar.gz 425.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrfu 2.5.0
File Interpreter ABI Platform
pyrfu-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 992.8 kB

Release files / pyrfu-2.5.0.tar.gz

Download URL pyrfu-2.5.0.tar.gz
Size 425.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b2d70457f88907bae0b950374125c5795705683dda71517ab0f523ee17a5dce1
BLAKE2b-256 checksum
How to use checksums
1f8fab01696d9a759bf9cd6107c5fc41bfc0ab99aed728cbfc3746d4f38e484d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pyrfu-2.5.0-py3-none-any.whl

Download URL pyrfu-2.5.0-py3-none-any.whl
Size 567.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee5c925a45bac77bc8c44b63e37f0495db5fdd139c974cdb4097fa5914669d6f
BLAKE2b-256 checksum
How to use checksums
c62e34605bb2de296ec3beeba394424b56ef1a88061edc28a26e3781a0d61498
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.21

2 release files

2.4.19

2 release files

2.4.18

2 release files

2.4.15

2 release files

2.4.13

2 release files

2.4.12

2 release files

2.4.11

2 release files

2.4.10

2 release files

2.4.9

2 release files

2.4.8

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.29

2 release files

2.3.28

2 release files

2.3.26

2 release files

2.3.22

2 release files

2.3.21

2 release files

2.3.18

2 release files

2.3.17

2 release files

2.3.16

2 release files

2.3.15

2 release files

2.3.14

2 release files

2.3.13

2 release files

2.3.12

2 release files

2.3.11

2 release files

2.3.9

2 release files

2.3.8

2 release files

2.3.7

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.4

1 release file

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.9.9

2 release files

1.9.8

2 release files

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.9

2 release files

1.8.8

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

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