Metadata-Version: 2.4
Name: pyrfu
Version: 2.4.21
Summary: Python Space Physics (RymdFysik) Utilities
Author-email: Louis RICHARD <louir@irfu.se>
License: 
        MIT License
        
        Copyright (c) 2020 L. RICHARD
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://pypi.org/project/pyrfu/
Project-URL: documentation, https://pyrfu.readthedocs.io/en/latest/
Project-URL: source, https://github.com/louis-richard/irfu-python
Project-URL: issue-tracker, https://github.com/louis-richard/irfu-python/issues
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft
Classifier: Operating System :: Microsoft :: MS-DOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: boto3>=1.35.0
Requires-Dist: botocore>=1.35.0
Requires-Dist: cdflib>=1.3.0
Requires-Dist: keyring>=25.5.0
Requires-Dist: keyrings.alt>=5.0.2
Requires-Dist: geopack>=1.0.10
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: numba>=0.63.0
Requires-Dist: numpy<2.4,>=2.0
Requires-Dist: pandas>=2.2.3
Requires-Dist: pycdfpp>=0.7.0
Requires-Dist: python-dateutil>=2.9.0
Requires-Dist: requests>=2.32.0
Requires-Dist: scipy>=1.14.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: xarray>=2024.10.0
Provides-Extra: git
Requires-Dist: pre-commit; extra == "git"
Provides-Extra: style
Requires-Dist: black; extra == "style"
Requires-Dist: flake8; extra == "style"
Requires-Dist: isort; extra == "style"
Requires-Dist: pylint; extra == "style"
Provides-Extra: tests
Requires-Dist: ddt; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Provides-Extra: type-checking
Requires-Dist: mypy; extra == "type-checking"
Provides-Extra: docs
Requires-Dist: nbsphinx>=0.9.2; extra == "docs"
Requires-Dist: numpydoc>=1.5.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.13.0; extra == "docs"
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-codeautolink>=0.15.0; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5.0; extra == "docs"
Requires-Dist: sphinx-gallery>=0.13.0; extra == "docs"
Requires-Dist: sphinxcontrib-apidoc>=0.3.0; extra == "docs"
Provides-Extra: dev
Requires-Dist: pyrfu[docs]; extra == "dev"
Requires-Dist: pyrfu[git]; extra == "dev"
Requires-Dist: pyrfu[style]; extra == "dev"
Requires-Dist: pyrfu[tests]; extra == "dev"
Requires-Dist: pyrfu[type-checking]; extra == "dev"
Dynamic: license-file

.. -*- mode: rst -*-

pyRFU
=====

.. start-marker-intro-do-not-remove

.. |License| image:: https://img.shields.io/pypi/l/pyrfu
.. _License: https://opensource.org/licenses/MIT

.. |Python| image:: https://img.shields.io/pypi/pyversions/pyrfu.svg?logo=python
.. _Python: https://pypi.org/project/pyrfu/

.. |PyPi| image:: https://img.shields.io/pypi/v/pyrfu.svg?logo=pypi
.. _PyPi: https://pypi.org/project/pyrfu/

.. |Format| image:: https://img.shields.io/pypi/format/pyrfu?color=blue&logo=pypi
.. _Format: https://pypi.org/project/pyrfu/

.. |Wheel| image:: https://img.shields.io/pypi/wheel/pyrfu?logo=pypi&color=blue
.. _Wheel: https://pypi.org/project/pyrfu/

.. |Status| image:: https://img.shields.io/pypi/status/pyrfu?logo=pypi&color=blue
.. _Status: https://pypi.org/project/pyrfu/

.. |Downloads| image:: https://img.shields.io/pypi/dm/pyrfu?logo=pypi&color=blue
.. _Downloads: https://pypi.org/project/pyrfu/

.. |CI| image:: https://github.com/louis-richard/irfu-python/actions/workflows/tests.yml/badge.svg
.. _CI: https://github.com/louis-richard/irfu-python/actions/workflows/tests.yml

.. |PyLintB| image:: https://github.com/louis-richard/irfu-python/actions/workflows/pylint.yml/badge.svg
.. _PyLintB: https://github.com/louis-richard/irfu-python/actions/workflows/pylint.yml

.. |CodeQL| image:: https://github.com/louis-richard/irfu-python/actions/workflows/codeql.yml/badge.svg
.. _CodeQL: https://github.com/louis-richard/irfu-python/actions/workflows/codeql.yml

.. |CodeCov| image:: https://codecov.io/gh/louis-richard/irfu-python/coverage.svg?branch=main
.. _CodeCov: https://codecov.io/gh/louis-richard/irfu-python/branch/main

.. |Issues| image:: https://img.shields.io/github/issues/louis-richard/irfu-python?logo=github&color=9cf
.. _Issues: https://github.com/louis-richard/irfu-python/issues

.. |Commits| image:: https://img.shields.io/github/last-commit/louis-richard/irfu-python?logo=github&color=9cf
.. _Commits: https://github.com/louis-richard/irfu-python/commits/master

.. |Readthedocs| image:: https://img.shields.io/readthedocs/pyrfu?logo=read-the-docs&color=blueviolet
.. _Readthedocs: https://pyrfu.readthedocs.io/en/latest/

.. |Matrix| image:: https://matrix.to/img/matrix-badge.svg
.. _Matrix: https://matrix.to/#/#pyrfu:matrix.org

.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
.. _Black: https://github.com/psf/black

.. |Doi| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10678695.svg
.. _Doi: https://doi.org/10.5281/zenodo.10678695

|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 <https://pyrfu.readthedocs.io/en/latest/installation.html>`_):

.. code-block:: console

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

Import `pyrfu.mms <https://pyrfu.readthedocs.io/en/latest/dev/pyrfu.mms.html>`_ package with routines specific to work with the
Magnetospheric Multiscale mission (MMS)

.. code:: python

    from pyrfu import mms

Setup path to MMS data

.. code:: python

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


Load magnetic field and ion bulk velocity data

.. code:: python

    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 <https://pyrfu.readthedocs.io/en/latest/dev/pyrfu.pyrf.html>`_ package with generic routines

.. code:: python

    from pyrfu import pyrf

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

.. code:: python

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

Import `pyrfu.plot <https://pyrfu.readthedocs.io/en/latest/dev/pyrfu.plot.html>`_ package with plotting routines

.. code:: python

    from pyrfu.plot import plot_line


Plot time series of magnetic field and ion bulk velocity

.. code:: python

    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)

.. end-marker-intro-do-not-remove

Documentation
=============
Full documentation can be found on `pyrfu.readthedocs.io <https://pyrfu.readthedocs.io/en/latest/index.html>`_

Examples
========
A list of examples is available `here <https://pyrfu.readthedocs.io/en/latest/examples/index.html>`_

Credits
=======
This software was developed by Louis RICHARD (louisr@irfu.se) based on the IRFU-MATLAB library.

Acknowledgement
===============
Please use the following to acknowledge use of pyrfu in your publications:
Data analysis was performed using the pyrfu analysis package available at https://github.com/louis-richard/irfu-python

Additional Information
======================
MMS Science Data Center: https://lasp.colorado.edu/mms/sdc/public/

MMS Datasets: https://lasp.colorado.edu/mms/sdc/public/datasets/

MMS - Goddard Space Flight Center: http://mms.gsfc.nasa.gov/
