spacepy - main SpacePy module

SpacePy: Space Science Tools for Python

SpacePy is a package of tools primarily aimed at the space science community. This __init__.py file sets the parameters for import statements.

If running the ipython shell, simply type ‘?’ after any command for help. ipython also offers tab completion, so hitting tab after ‘<module name>.’ will list all available functions, classes and variables.

Detailed HTML documentation is available online by typing:

>>> spacepy.help()

Most functionality is in spacepy’s submodules. Each module has specific help available:

Submodules

coordinates

Implementation of Coords class functions for coordinate transformations

data_assimilation

datamodel

The datamodel classes constitute a data model implementation meant to mirror the functionality of the data model output from pycdf, though implemented slightly differently.

empiricals

Module with some useful empirical models (plasmapause, magnetopause, Lmax)

irbempy

module wrapper for irbem_lib Reference for this library https://sourceforge.net/projects/irbem/ D.

LANLstar

Lstar and Lmax calculation using artificial neural network (ANN) technique.

omni

Tools to read and process omni data (Qin-Denton, etc.)

poppy

PoPPy -- Point Processes in Python.

pybats

PyBats! An open source Python-based interface for reading, manipulating, and visualizing BATS-R-US and SWMF output.

pycdf

This package provides a Python interface to the Common Data Format (CDF) library used for many NASA missions, available at http://cdf.gsfc.nasa.gov/.

radbelt

Functions supporting radiation belt diffusion codes

seapy

SeaPy -- Superposed Epoch in Python.

time

Time conversion, manipulation and implementation of Ticktock class

toolbox

Toolbox of various functions and generic utilities.

ae9ap9

Module for reading and dealing with AE9AP9 data files.

Functions

deprecated(version, message[, docstring])

Decorator to deprecate a function/method

help()

Launches web browser with SpacePy documentation

spacepy.deprecated(version, message, docstring=None)[source]

Decorator to deprecate a function/method

Modifies a function so that calls to it raise DeprecationWarning and the docstring has a deprecation note added in accordance with numpydoc format

Parameters:
versionstr

What is the first version where this was deprecated?

messagestr

Message to include in the deprecation warning and in the docstring.

Other Parameters:
docstringstr

New in version 0.2.2.

If specified, docstring will be added to the modified function’s docstring instead of message (which will only be used in the deprecation warning.) It can be a multi-line string (separated with \n). It will be indented to match the existing docstring.

Notes

On Python 2, the deprecated function’s signature won’t be preserved. The function will work but will not have proper argument names listed in e.g. help.

This warning will show as coming from SpacePy, not the deprecated function.

Examples

>>> import spacepy
>>> @spacepy.deprecated('0.2.1', 'Use a different function instead',
...                     docstring='A different function is better\n'
...                               'because of reasons xyz')
... def foo(x):
...     '''This is a test function
...
...     It may do many useful things.
...     '''
...     return x + 1
>>> help(foo)
Help on function foo in module __main__:
foo(x)
    This is a test function
    .. deprecated:: 0.2.1
       A different function is better
       because of reasons xyz
    It may do many useful things.
>>> foo(2)
DeprecationWarning: Use a different function instead
3
spacepy.help()[source]

Launches web browser with SpacePy documentation

Online help is always for the latest release of SpacePy.

Copyright 2010-2016 Los Alamos National Security, LLC.