Previous: Fst2sig, Up: Other Tools
The trackinfo module is somewhat different from those
listed above in that it is not a stand-alone executable script.
Instead, this python module should be run interactively
by the user from the python command line (for more information,
see www.python.org
here). The most common use of this module is in the plotting
of hurricane tracks from the NHC Best Track archive. The
trackinfo module, can be used to produce the necessary input
files for the func_drawTracks.f90 function of the
NCAR_Utilities SPA module, which in turn
generates track maps and track overlays.
To invoke the python shell, type python at the
prompt. Once the python prompt appears, you will need to load
the trackinfo module by entering:
from trackinfo import *
(For python gurus, a full listing of the classes available in
the trackinfo module can be written by using
import trackinfo and print trackinfo.__doc__ instead of
the above). A list of the methods available to you from the trackinfo
module can be obtained by entering the command:
print TrackList.__doc__
The first step is to initialize a new TrackList
object by entering the command:
nhcBestTrack = TrackList('path/to/nhc/best/track','nhc')
The new object (nhcBestTrack - whatever you decide to call
it - is now filled with all of the best track information from
the NHC best track datafile (available at the
NHC website www.nhc.noaa.gov
here). There are now a number of methods that you can apply to
get useful information from the tracking dictionary. For example,
you can create and list a subset of the 2001 hurricanes:
print TrackList.SubList.__doc__ #get info on the SubList interface
storms2001 = nhcBestTrack.SubList({'year':'2001'})
storms2001.PrintInfo({},'name:year:category')
This information can then be written directly to the format
used by the SPA track plotting subprogram
func_drawTracks.f90 using a write method:
storms2001.WriteList('path/to/output/file')
This generates an SPA-compatible ASCII
output file containing preformatted entries of all storms
in the 2001 instance of the TrackList object. This
file simply needs to be provided to the appropriate plotting
function in the SPA.
Another potentially-useful feature of the trackinfo
module is its ability to quickly identify storm locations.
For example, to get a subset of the storms that have
impacted the northwest coast of Florida, you can run something
like:
FLstorms = nhcBestTrack.InBox([28,30],[83,84])
FLstorms.PrintInfo({},'name:year')
The attributes available to the user are:
trackEntry – full tracking information string.
name – name of the tropical cyclone.
year – year of occurence of the tropical cyclone.
month – month (numeric) of occurence of the tropical cyclone.
day – tropical cyclone start day.
longMonth – full month (string) of occurence of the tropical cyclone.
shortMonth – abbreviated month (string) of occurence of the tropical cyclone.
intensity – a list of intensity indicators for each reporting time.
location – a list of location indicators for each reporting time.
category – the category of maximum intensity for the storm.
Furthermore, a class variable namedOnly is defined for
the TrackList class, which allows the user to control the
reporting of information prior to the advent of NHC naming.
The default pseudological value is 1 (off - no reporting of pre-naming
storms); however, this is easily changed upon request:
TrackList.namedOnly = 0
Note that this value is immediately redefined for all instances of
the TrackList class, and that none of the constructors need
to be rerun.