spacepy

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:

Copyright 2010-2016 Los Alamos National Security, LLC.

Submodules

LANLstar

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

ae9ap9

Module for reading and dealing with AE9AP9 data files.

coordinates

Implementation of Coords class functions for coordinate transformations

ctrans

CTrans: Module for backend coordinate transformations in SpacePy

datamanager

Tools for manipulating paths, data, and subsets

datamodel

Data model conceptually similar to HDF5 and CDF.

empiricals

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

igrf

International Geomagnetic Reference Field model

irbempy

Wrapper for the fortran library irbem_lib

lib

Support for fast C-based versions of spacepy routines.

omni

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

plot

plot: SpacePy plotting routines

poppy

PoPPy -- Point Processes in Python.

pybats

Module for reading, manipulating, and visualizing BATS-R-US and SWMF output.

pycdf

Interface to the Common Data Format (CDF) library

realtime

The realtime module fetches realtime data and forecasts from other sites

rst

Created on Mon Sep 10 13:09:11 2012

seapy

SeaPy -- Superposed Epoch in Python.

time

Time conversion, manipulation and implementation of Ticktock class

toolbox

Toolbox of various functions and generic utilities.

Functions

deprecated(version, message[, docstring])

Decorator to deprecate a function/method

help([keyword])

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

Added 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(keyword=None)[source]

Launches web browser with SpacePy documentation

Parameters:
keywordstr, optional

Added in version 0.7.0.

Search for this keyword. If not specified, opens the front page of the documentation.

Notes

Online help is always for the latest release of SpacePy.

Examples

>>> import spacepy
>>> spacepy.help("coordinates")