# SPLAT_UTIL

This page was created by the IDL library routine `mk_html_help`. For more information on this routine, refer to the IDL Online Help Navigator or type:

         ? mk_html_help

at the IDL command line prompt.

Last modified: Fri Mar 9 05:48:14 2007.

# List of Routines

- AVERAGE_TPLOT_VARIABLE
- ERR_MSG
- LOADCT2
- POPEN
- TPLOT
- TPLOT_PANEL
- YLINE

# Routine Descriptions

## AVERAGE_TPLOT_VARIABLE

[Next Routine] [List of Routines]

     PROCEDURE: average_tplot_variable

     PURPOSE: to time average any tplot variable

     INPUT:
            var -> variable name - Array of strings or numbers. The '*'
                                   is also accepted.
            avg -> averaging time in seconds

     KEYWORD:
             NEW_NAME -> the averaged variable is stored with a new name that
                         includes the avereging time

     CREATED by: C. Mouikis

     LAST MODIFIED: 09/25/01

     MODIFICATION HISTORY:
       09/25/01 - The time step loop index is declared as a long.

(See .//average_tplot_variable.pro)

## ERR_MSG

[Previous Routine] [Next Routine] [List of Routines]

     PROCEDURE: err_msg

     PURPOSE: Set error message and update log file

     INPUT: msg: error message string

     CREATED BY: C. Mouikis (03/04/07)

     MODIFICATION HISTORY:

(See .//err_msg.pro)

## LOADCT2

[Previous Routine] [Next Routine] [List of Routines]

    PROCEDURE loadct2, colortable

    KEYWORDS:
       FILE:  Color table file
              Uses the environment variable IDL_CT_FILE to determine
              the color table file if FILE is not set.
    common blocks:
       colors_com
    See also:
       "get_colors","colors_com","bytescale"

    Created by Davin Larson;  August 1996
    Version:           1.2
    File:              96/08/30
    Last Modification: loadct2.pro
         7/20/99 -  checks the variable 'ct' to see if it is 41 then
                  opens the file containing 'GSFC Rainbow' color table info

(See .//loadct2.pro)

## POPEN

[Previous Routine] [Next Routine] [List of Routines]

    PROCEDURE: popen, filename
    PURPOSE:
      Change plot device to postscript.
    INPUT:    optional;  if:
      string   :  string used as filename,  '.ps' extension is added automatically
      integer X:  filename set to 'plotX.ps'.  value of x is incremented by 1.
      none:       filename set to 'plot.ps'
    KEYWORDS: See print_options for info.
      COPY:    pass COPY keyword to set_plot
      INTERP:  pass INTERP keyword to set_plot  (default is to have interp off)

    SEE ALSO:	"pclose",
    		"print_options",
    		"popen_com"

    CREATED BY:	Davin Larson
    LAST MODIFICATION:	@(#)popen.pro	1.21 98/06/23
            03/05/2007: If no color table is specified use table 41
                       (from papco.tbl)

(See .//popen.pro)

## TPLOT

[Previous Routine] [Next Routine] [List of Routines]

    PROCEDURE:   tplot  [,datanames]
    PURPOSE:
       Creates a time series plot of user defined quantities.
    INPUT:
       datanames: A string of space separated datanames.
                 wildcard expansion is supported.
                 if datanames is not supplied then the last values are used.
                 Each name should be associated with a data quantity.
                 (see the "STORE_DATA" and "GET_DATA" routines.)
                 Alternatively datanames can be an array of integers or strings.
                 run "TPLOT_NAMES" to show the current numbering.

    KEYWORDS:
       TITLE:    A string to be used for the title. Remembered for future plots.
       ADD_VAR:  Set this variable to add datanames to the previous plot.  If set
    	      to 1, the new panels will appear at the top (position 1) of the
    	      plot.  If set to 2, they will be inserted directly after the
    	      first panel and so on.  Set this to a value greater than the
    	      existing number of panels in your tplot window to add panels to
                 the bottom of the plot.
       LASTVAR:  Set this variable to plot the previous variables plotted in a
    	      TPLOT window.
       PICK:     Set this keyword to choose new order of plot panels
                 using the mouse.
       WINDOW:   Window to be used for all time plots.  If set to -1, then the
                 current window is used.
       VAR_LABEL:  String [array]; Variable(s) used for putting labels along
         the bottom. This allows quantities such as altitude to be labeled.
       VERSION:  Must be 1,2,3, or 4 (3 is default)  Uses a different labeling
    	scheme.  Version 4 is for rocket-type time scales.
       OVERPLOT: Will not erase the previous screen if set.
       NAMES:    The names of the tplot variables that are plotted.
       NOCOLOR:  Set this to produce plot without color.
       TRANGE:   Time range for tplot.
       NEW_TVARS:  Returns the tplot_vars structure for the plot created. Set
    	      aside the structure so that it may be restored using the
                 OLD_TVARS keyword later. This structure includes information
                 about various TPLOT options and settings and can be used to
                 recreates a plot.
       OLD_TVARS:  Use this to pass an existing tplot_vars structure to
    		override the one in the tplot_com common block.
       HELP:     Set this to print the contents of the tplot_vars.options
    	      (user-defined options) structure.

    RESTRICTIONS:
       Some data must be loaded prior to trying to plot it.  Try running
       "_GET_EXAMPLE_DAT" for a test.

    EXAMPLES:  (assumes "_GET_EXAMPLE_DAT" has been run)
       tplot,'amp slp flx2' ;Plots the named quantities
       tplot,'flx1',/ADD          ;Add the quantity 'flx1'.
       tplot                      ;Re-plot the last variables.
       tplot,var_label=['alt']   ;Put Distance labels at the bottom.
           For a long list of examples see "_TPLOT_EXAMPLE"

    OTHER RELATED ROUTINES:
       Examples of most usages of TPLOT and related routines are in
          the crib sheet: "_TPLOT_EXAMPLE"
       Use "TNAMES" function to return an array of current names.
       Use "TPLOT_NAMES" to print a list of acceptable names to plot.
       Use "TPLOT_OPTIONS" for setting various global options.
       Plot limits can be set with the "YLIM" procedure.
       Spectrogram limits can be set with the "ZLIM" procedure.
       Time limits can be set with the "TLIMIT" procedure.
       The "OPTIONS" procedure can be used to set all IDL
          plotting keyword parameters (i.e. psym, color, linestyle, etc) as well
          as some keywords that are specific to tplot (i.e. panel_size, labels,
          etc.)  For example, to change the relative panel width for the quantity
          'slp', run the following:
                OPTIONS,'slp','panel_size',1.5
       TPLOT calls the routine "SPECPLOT" to make spectrograms and
          calls "MPLOT" to make the line plots. See these routines to determine
          what other options are available.
       Use "GET_DATA" to retrieve the data structure (or
          limit structure) associated with a TPLOT quantity.
       Use "STORE_DATA" to create new TPLOT quantities to plot.
       The routine "DATA_CUT" can be used to extract interpolated data.
       The routine "TSAMPLE" can also be used to extract data.
       Time stamping is performed with the routine "TIME_STAMP".
       Use "CTIME" or "GETTIME" to obtain time values.
       tplot variables can be stored in files using "TPLOT_SAVE" and loaded
          again using "TPLOT_RESTORE"

    CREATED BY:	Davin Larson  June 1995
    FILE:  tplot.pro
    VERSION:  1.97
    LAST MODIFICATION:  02/11/01

(See .//tplot.pro)

## TPLOT_PANEL

[Previous Routine] [Next Routine] [List of Routines]

    PROCEDURE: tplot_panel [,time,y]
    INPUTS: (optional)
       time:      dblarr of time values associated with a variable to overplot
    	       in a designated "tplot" panel.
       y:	       array of variable values to be plotted.
    KEYWORDS:
       VARIABLE:  (string) name of previously plotted tplot variable.
       OPLOTVAR:  Data that will be plotted on top of the selected panel
       DELTATIME: Named variable in which time offset is returned.
       PANEL:     Returns panel number of designated tplot variable.
       PSYM:      Sets the IDL plot PSYM value for overplot data.
    PURPOSE:
      Sets the graphics parameters to the specified tplot panel.
      The time offset is returned through the optional keyword DELTATIME.

    LAST MODIFICATION:	@(#)tplot_panel.pro	1.8 98/08/06

(See .//tplot_panel.pro)

## YLINE

[Previous Routine] [List of Routines]

     PROCEDURE: yline

     PURPOSE: Draws a horizontal line as an overplot. Because it is an
              overplot the tplot variable nust be plotted first, and it
              has to be redrawn every time the draw window is
              refreshed. Default is at y = 0.

     INPUT: var -> tplot variable on which the yline will be plotted
                   over. It can be called either by number or name. If
                   var is an array the yline will be overplotted on all
                   tplot variables as long as they are plotted before the
                   yline routine os called.

     KEYWORDS: offset -> y value of the zero line. It can be an array of
                         values but then it has to match the array size
                         of the var variable
               col -> change the color of the line by providing a color
                      number (on my system 1:purple, 2:blue, 3:light
                      blue, 4:green, 5:yellow, 6:red). It can be an array
                      of values and it will cycle over the number of
                      variables.

     CREATED BY: C. Mouikis (03/04/02)

     MODIFICATION HISTORY:
               2005-05-22: The routine checks first if the tplot
               variables exist

(See .//yline.pro)