pyLTR: Python Tools for the LTR

pyLTR is a repository of Python modules & packages useful to the CISM
community. This includes:

After downloading LTR, look in misc/pyLTR

Setup

Requirements

These can be easily installed in several ways:

pyLTR has has been successfully tested on Intel Macs running OSX 10.5 (Leopard) and 10.6 (Snow Leopard), 10.7 (Lion), 32 & 64 bit Linux environments, and IBM AIX systems.

Install

Once the prerequisites are installed:

  1. Execute 'install.sh'
  2. Set up your environment in one of two ways:
    1. Append /path/to/pyLTR (not /path/to/pyLTR/pyLTR) to $PYTHONPATH:
      export PYTHONPATH=/path/to/LTR-para/misc/pyLTR:$PYTHONPATH
      
    2. Setup a soft link
      ln -s /path/to/LTR-para/misc/pyLTR/pyLTR /path/to/lib/python2.x/site-packages/pyLTR
      

Notes

Although not required, it's a good idea to install Nose & run test.sh to make sure everything has been installed properly (note: Nose should be included with the Enthought Python Distribution).

Usage

pyLTR ships with a variety of convenience scripts in the "scripts" subdirectory.  Learn what a script does by passing the "--about" command-line argument, like so:

Execute with the {{--help }}flag for usage information. For example:

LTR-para/misc/pyLTR/scripts/solarWind.py --about

Execute with the --help flag for usage information. For example:

.LTR-para/misc/pyLTR/scripts/solarWind.py --help

solarWind.py

Generates TIEGCM (NetCDF) or LFM (SW-SM-DAT) solar wind file. Can convert from a variety of data sources (eg. CCMC, Enlil, LFM, MAS, OMNI).

Sample usage:

solarWind.py --filename=OMNI_HRO_1MIN_27372.txt -o TIEGCM

When output is LFM (ie. flag -o LFM), this will generate coefficients for a linear Bx fit; save the SW-SM-DAT file; and generate a Python Pickle file storing the data for further analysis.

Visualization

See the "Usage" section above to learn how to use some of the following visualization tools:

MIX output

MIX output can be visualized with a variety of tools:

LFM output

Magnetosphere:

Ionosphere:

Advanced

Want to write your own custom scripts using the pyLTR developers API? Take a look at source code of files from both the "examples" and "scripts" directories.

BXZERO, BY_COEF, BZ_COEF

The solar wind processor computes a linear regression fit to Bx and writes the coefficients BXZERO, BYCOEF, BZCOEF:

Write these numbers down and use them as input to the corresponding MakeItSo prompt.

BXZERO is currently unsupported due to a bug within the LFM.  If prompted, set BXZERO=0.0 This will be fixed in a future release of the code (refs #143).