Help for routines in public IDL libraries used by the tasclib.idl library

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: Mon Nov 07 19:22:55 2011.


List of Routines


Routine Descriptions

ABGRAD

[Next Routine] [List of Routines]
 NAME:
		ABGRAD
 VERSION:
		4.0
 PURPOSE:
		Calculates the absolute value of the gradient of a function represented
		as an array of values.  Works for 1-7 dimensions.
 CATEGORY:
		Array Manipulation.
 CALLING SEQUENCE:
		Result = ABGRAD( ARR [, DELTA])
 INPUTS:
	ARR
		Array, numeric, number of dimensions can be 1 through 7.
 OPTIONAL INPUT PARAMETERS:
	DELTA
		Size of step used to calculate the numeric derivatives.  The approx.
		partial derivative in the i-th direction is calculated as
		(ARR(...,I + DELTA,...) - ARR(...,I - DELTA,...))/(2*DELTA).
		The default value of DELTA is 1l.  If provided, it is rounded to a long
		integer on input.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the absolute value of the gradient as an array of the same size
		and type as ARR.  If ARR is not an array, returns 0.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Due to current limitations of the MAKE_ARRAY system routine, 8
		dimensions are not allowed.
 PROCEDURE:
		Creates an 7-dimensional array, with dummy leading dimensions,
		containing the original array.  Generates the differences using the
		SHIFT system routine and strips the dummy dimensions at the end.
		Uses the functions DEFAULT and FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 15-NOV-1991 by Mati Meron.
		Modified 30-AUG-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\abgrad.pro)


ABS_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ABS_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates absolute values.  A temporary fix needed since the IDL ABS
		function fails with very large or very small complex numbers.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = ABS_MM (X)
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the absolute value of the input.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calling FPU_FIX and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 15-MAR-1996 by Mati Meron as M_ABS.
		Modified 30-AUG-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to ABS_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\abs_mm.pro)


ACOSD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ACOSD

 PURPOSE:
       Return the inverse cosine of a value, in degrees rather then radians.

 CALLING SEQUENCE:
       deg = acosd(x)

 INPUTS:
       value      cosine of angle 

 OPTIONAL INPUTS:

 OUTPUTS:
       Angle in degrees returned.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/07/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\acosd.pro_)


ADC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ADC
 VERSION:
		4.3
 PURPOSE:
		Interface to HISTOGRAM, simulating an Analog to Digital Converter.
 CATEGORY:
		Mathematical.
 CALLING SEQUENCE:
		Result = ADC( ARR [, keywords] )
 INPUTS:
	ARR
		Array, numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	MASK
		Provision for optional data mask.  Needs to be an array of the same
		as ARR.  If given, only data (in ARR) corresponding to locations of
		non-zero elements of MASK is considered.  Equivalent to replacing
		ARR by ARR[ where(mask ne 0)].
	BINSIZE
		Specifies the size of the BIN, same as in HISTOGRAM.  Defaults to full
		range (i.e. a single channel).
	N_CHANNELS
		Number of channels to use in the binning.  If BINSIZE is provided,
		N_CHANNELS is ignored.
	MIN
		The minimal value to consider.  Same as in HISTOGRAM.  The default
		value is min(ARR).
	MAX
		The maximal value to consider.  Same as in HISTOGRAM.  The default
		value is max(ARR).
	/LEFT
		Switch.  If set, the elements within each bin are associated with the
		left bin boundary (i.e. with the minimum of the interval).
	/CENTER
		Switch.  If set, the elements within each bin are associated with the
		center of the bin (i.e. with the middle of the interval).  This is the
		default.
	/RIGHT
		Switch.  If set, the elements within each bin are associated with the
		right bin boundary (i.e. with the maximum of the interval).

		NOTE!!!:  Only one of the switches LEFT, CENTER, RIGHT may be set.

	/ROUND
		Switch.  If set, the upper and lower boundaries are rounded (up and
		down, respectively) to the nearest bin.
	/EXTEND
		Switch.  If set, the upper and lower boundaries are extended (up and
		down, respectively) by half a bin.

		NOTE:  If BINSIZE is not set, ROUND and EXTEND are ignored.

	/TOP_ADJUST
		Switch.  If set, adjusts for the possibility of the uppermost element
		of ARR being counted in a separate channel.
	/NORMALIZE
		Switch.  If set, the output is normalized to a total sum of 1.
	OMIN
		Optional output.  See below.
	OMAX
		Optional output.  See below.
	VALUES
		Optional output.  See below.
 OUTPUTS:
		Returns a histogram of the original array, with either binsize provided
		by BIN or number of channels provided by N_CHANNELS.
 OPTIONAL OUTPUT PARAMETERS:
	OMIN
		Name of a variable to receive the value of MIN used internally.  Same
		as in HISTOGRAM.
	OMAX
		Name of a variable to receive the value of MAX used internally.  Same
		as in HISTOGRAM.
	VALUES
		Returns a vector of the nominal values associated with the bins
		(LEFT, CENTER or RIGHT, according to the keywords).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		ARR must be numeric and BIN must be a positive scalar.  No other
		restrictions.
 PROCEDURE:
		Straightforward.  Calls the IDL function HISTOGRAM.  Also calls ARREQ,
		CAST, DEFAULT, FPU_FIX, ISNUM and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 15-MAY-1996 by Mati Meron.
		Modified 25-JUN-2000 by Mati Meron.  Internal changes only.
		Modified 1-AUG-2001 by Mati Meron.  Checked compatibility with Windows
		and added keywords MASK and ROUND.
		Modified 5-JAN-2002 by Mati Meron.  Added keyword EXTEND and improved
		internal consistency.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\adc.pro)


ADD2HISTORY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	add2history

 PURPOSE:
	This procedure adds information to the history of an ICG structure.

 CATEGORY:
	DATAFILES

 CALLING SEQUENCE:
	add2history, icg_struc [,text]

 INPUTS:
	icg_struc: Name of the ICG structure

 OPTIONAL INPUTS:
	text: String scalar or array which will be added to the history.

 OUTPUTS:
	This procedure writes information to the history of an ICG structure.
	The entry is as follows:
		   []

 EXAMPLE:
	icgs = read_ncdf('S:\links\idl_source\idl_work\fh_lib\examples\sfpo_oh.nc')
	icgs.time.param = icgs.time.param - 7200.D
	add2history, icgs, 'Subtracted 7200 sec from time data to convert from MESZ to UTC.'
	PRINT, TRANSPOSE(STR_SEP(icgs.!global.history, '!C'))

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 19.11.1999
	22.11.1999:	Changed format of history string (no leading blanks anymore)
	17.03.2000:	Added version information to history entry
					Changed code to new version of add_tag

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\add2history.pro)


ADDPATH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  addpath

 PURPOSE:  

 USEAGE:   addpath,pathname,cut=cut

 INPUT:    
   pathname   Name of new path to add to this session's directory path.
              if pathname is already present in !path no action is taken.
              This last feature allows addpath to be repeatedly executed
              (e.g., within a script) without affecting !path after the
              first invocation.

 KEYWORD INPUT:

  cut         If set and pathname is set, the element of !path that
              matches pathname is removed. If pathname is not
              specified, the last element of !path is removed.

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLES:  
           addpath,'/home/paul/idl'            ; add a path

           addpath,'/local/idl/lib/wided',/cut ; remove a specific path

           addpath,/cut                        ; remove last path element 

           addpath                             ; view !path

 AUTHOR:   Paul Ricchiazzi                        04 Nov 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\addpath.pro)


ADD_COMMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	add_comment

 PURPOSE:
	This procedure adds a comment to an ICG structure.

 CATEGORY:
	ICG_STRUCT

 CALLING SEQUENCE:
	add_comment, icg_struc, text

 INPUTS:
	icg_struc: Name of the ICG structure
	text: Comment to be added to the ICG structure (scalar).

 KEYWORD PARAMETERS:
	/OVERWRITE: If set an alread existing comment will be overwritten

 OUTPUTS:
	This procedure adds the (or updates an alread existing) 'COMMENT' tag
	which is part of the '!GLOBAL' tag of an ICG structure.

 EXAMPLE:
	icgs = read_ncdf('S:\links\idl_source\idl_work\fh_lib\examples\sfpo_oh.nc')
	icgs.time.param = icgs.time.param - 7200.D
	add_comment, icgs, 'Subtracted 7200 sec from time data to convert from MESZ to UTC.'
	PRINT, icgs.!global.comment

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 13.03.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\add_comment.pro)


ADD_MARGIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ADD_MARGIN
 PURPOSE:
       Add space to left margin and top of a text file.
 CATEGORY:
 CALLING SEQUENCE:
       add_margin, in, out, n_left, [n_top]
 INPUTS:
       in = Input file.                                    in
       n_left = Number of spaces to add to left margin.    in
       n_top = number of blank lines to add to top.        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = Output file.                                  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 3 Mar, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\add_margin.pro)


ADD_QUALITY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	add_quality

 PURPOSE:
   This function adds the QUALITY flag and array to a given structure of type INHALT

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=add_quality(structure)

 INPUTS:
   inhalt: the by ncdf_gr defined structure

 OUTPUTS:
   A structure type INHALT with a quality field and flag added

 EXAMPLE:
  inhalt=add_quality(inhalt)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-13
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\add_quality.pro)


ADD_TAG

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
    add_tag

 PURPOSE:
   This functions adds a tag on an arbitrary level of a structure.

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result = add_tag(struct, tagname, tagvalue [, sub_structure = sub_structure])

 INPUTS:
   struct  : the structure to which the tag will be added
   tagname : the name of the new tag
   tagvalue: the value of the new tag

 KEYWORD PARAMETERS:
   sub_structure: to define the sub structure where the tag should be added.
		If not given the tag will be added on the main level of the structure (see examples)

 OUTPUT:
   This function returns a structure with a new tag added to it.

 EXAMPLE:

   d = {A: 1, B: {B1: 0, B2: 1}, C: {B1: 0, B2: 1}}

   help,d,/str
   ** Structure <1331608>, 3 tags, length=10, refs=1
   A               INT              1
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]

   result = add_tag(d,'ASA',11)
   HELP, result, /STR
   ** Structure <10530e8>, 4 tags, length=12, refs=1:
   A               INT              1
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]
   ASA             INT             11

   result = add_tag(d, 'ASA', 11, sub = 'B')
   HELP, result.b, /STR
   ** Structure <133ce88>, 3 tags, length=6, refs=1
   B1              INT              0
   B2              INT              1
   ASA             INT             11

   result = add_tag(d, 'BSB', {C11: INDGEN(3)}, sub = 'B.B3')
   HELP, result.b, /STR
   ** Structure <1357758>, 3 tags, length=10, refs=2:
   B1              INT              0
   B2              INT              1
   B3              STRUCT    ->  Array[1]

   result = add_tag(d, 'BSB', {C11: INDGEN(3)}, sub = ['B','C'])
   help,result.b,/str
   ** Structure <1055618>, 3 tags, length=10, refs=2:
   B1              INT              0
   B2              INT              1
   BSB             STRUCT    ->  Array[1]

   help,result.c,/str
   ** Structure <1056968>, 3 tags, length=10, refs=2:
   B1              INT              0
   B2              INT              1
   BSB             STRUCT    ->  Array[1]


   result = add_tag(d, 'BSB', {C11: INDGEN(3)}, sub = ['B.C1','C'])
   help,result.b,/str
   ** Structure <1056168>, 3 tags, length=10, refs=2:
   B1              INT              0
   B2              INT              1
   C1              STRUCT    ->  Array[1]

   result = add_tag(d, 'BSB', {C11: INDGEN(3)}, sub = 'F')
   help,result,/str
   ** Structure <10550f8>, 4 tags, length=16, refs=1:
   A               INT              1
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]
   F               STRUCT    ->  Array[1]

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05
       14.03.2000: Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\add_tag.pro)


ADD_TAG2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	add_tag2

 PURPOSE:
	This function adds a tag to a given structure.
	Both, structure and values can be arrays.

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	x = add_tag2(str, tag, value [, status])

 INPUTS:
	str: variable name of structure or array of structures
	tag: name of tag to be added (STRING)
		 if tag already exists in str its deleted
	value: value of tag (scalar or array)

 KEYWORD PARAMETERS:
	/EXPAND_VALUES: IF set, the last dimension of value is expanded along the dimension of str
	/FIRST:	The new tag is inserted at the beginning of str
	NAME: A unique name for the new structure.

 OPTIONAL OUTPUTS:
	status: Status information 	=0: every thing worked fine;
								=1: something went wrong (see messages on screen)

 SIDE EFFECTS:
	If an array of anonymous structures is passed into the routine an array
	of named structures is returned.

 EXAMPLE:
	as = {Bsp1, a:0, b:'asd'}
	bs = add_tag2(as, 'c', 0.46D00, /FIRST, NAME = 'Bsp2')
	HELP, bs, /STR :
		** Structure BSP2, 3 tags, length=24:
		   C               DOUBLE          0.46000000
		   A               INT              0
		   B               STRING    'asd'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09. Mar. 98.
	This program is based on the procedure add_tag.pro but provides additional features
	27.05.98 - Type of loop variable in FOR loop changed to LONG
	15.11.98:	call to debug deleted
	28.04.1999:	tag_defined exchanged by is_tag
	22.09.1999:	Random structure name will only be generated if a tag is added to an
					array of structures.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\add_tag2.pro)


ADD_TAG_FH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	add_tag_fh

 PURPOSE:
	This function can be used to add tags to a substructure of a given structure

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	result = add_tag_fh(struct, tag_name, value)

 INPUTS:
	struct: Input structure.
	tag_name: Name of new tag (STRING).
	value: Value of new tag.

 KEYWORD PARAMETERS:
	SUB_STR = sub_str: Name (scalar or array) of the substructure(s) under which the tag is added.
		(default: '' e.g. main level)

 OUTPUTS:
	This function returns a structure with the tag 'tag_name' added.

 EXAMPLE:
	s0 = {H2O: {param: 4, units: 'mbar'}, O3: {param: 17, units: 'ppb'}}

	s1 = add_tag_fh(s0, 'NO2', {param: 23.})
	s1 = add_tag_fh(s1, 'units', 'ppb', SUB_STR = 'NO2')
	HELP, s1, /STR

	s2 = add_tag_fh(s1, 'description', 'NONE', SUB_STR = ['NO2', 'H2O', 'O3'])
	HELP, s2, /STR

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 12.01.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\add_tag_fh.pro)


ADJUSTPOSITION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       AdjustPosition

 PURPOSE:

       This is a program for interactively adjusting the plot position
       coordinates. The result of the function is a four-element floating
       point array of normalized coordinates, suitable for passing to the
       POSITION keyword of most IDL graphics commands.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       position = AdjustPosition(startingPosition)

 OPTIONAL INPUTS:

       startingPosition - A four-element array of normalized coordinates
            of the form [x0, y0, x1, y1].

 OUTPUTS:

       position - The adjusted plot position. A four-element array of normalized coordinates.

 INPUT KEYWORDS:

       GROUP_LEADER - The group leader of this program. This keyword
            is required to ensure modal operation when calling from
            another widget program.

       TITLE - The title of the window. "Adjust Plot Position in Window..." by default.

       XOFFSET - The X offset of the program on the display. Calculated from the
            upper left-hand corner of the display.

       YOFFSET - The Y offset of the program on the display. Calculated from the
            upper left-hand corner of the display.

 OUTPUT KEYWORDS:

       CANCEL - Returns a 1 if the user selects the Cancel button. Returns 0 otherwise.
            Note that if the use cancels, the "position" parameter is set to the value of
            the "startingPosition" parameter.

 DEPENDENCIES:

       Reqires FSC_FIELD and FSC_PLOTWINDOW from the Coyote Library:

                     http://www.dfanning.com/programs/fsc_field.pro
                     http://www.dfanning.com/programs/fsc_plotwindow.pro

 MODIFICATION HISTORY:

       Written by David Fanning, March 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\adjustposition.pro)


AFORMAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  aformat

 PURPOSE:
   This procedure is used by plotxy to set the axis-format.

 CATEGORY:
   PLOT/PLOTXY

 CALLING SEQUENCE:
   aformat,plot,xtickformat,ytickformat,xtype,ytype,i_xn,i_yn

 INPUTS:
   plot: plot-structure as defined by pl_init
   i_xn: position number for one of the used x axes
   i_yn: position number for one of the used y axes

 OPTIONAL INPUTS:
   x: name of a netCDF parameter-name containing the array of x values
   y: name of a netCDF parameter-name containing the array of y values


 OUTPUTS:
   xtickformat: string containing the name of the function later used to format xticks
   ytickformat: string containing the name of the function later used to format yticks
   xtype      : set to 1 if format emensch could be used
   ytype      : set to 1 if format emensch could be used

 EXAMPLE:
   aformat,plot,x='TIME',y='NO',xtickformat,ytickformat,xtype,ytype,0,0
   help,xtickformat,ytickformat,xtype,ytype
   XTICKFORMAT     STRING    = ''
   YTICKFORMAT     STRING    = 'emensch'
   XTYPE           INT       =        0
   yTYPE           INT       =        1

   MODIFICATION HISTORY:
   Written by: Franz Rohrer August 1997
   Modified  29.8.97 : plot.xtype und plot.ytype als Felder eingeführt
                       i_xn und i_yn im Prozeduraufruf eingeführt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\aformat.pro)


AIRDENS (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        AIRDENS  (function)

 PURPOSE:
        Compute air mass density for a given pressure and 
        temperature. If the temperature is not provided, a
        temperature is estimated using the US Standard atmosphere.

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        idens = AIRDENS(p [,T])

 INPUTS:
        P  -> pressure in hPa (mbar)

        T  -> temperature in K

 KEYWORD PARAMETERS:
        HELP -> print help information

 OUTPUTS:
        The air mass density in molec/cm^3. The result type will 
        match the type and array dimensions of p unless p is a scalar
        and T an array.

 SUBROUTINES:

 REQUIREMENTS:
        Uses functions USSA_ALT and USSA_TEMP

 NOTES:

 EXAMPLE:
    print,airdens(1013.25,273.15)
    ; prints 2.69000e+19

    p = findgen(5)*100+500
    print,airdens(p,T)     ; T undefined !
    ; prints  1.44840e+19  1.67414e+19  1.89029e+19  2.10104e+19  2.30998e+19
    print,T
    ; prints      250.334      259.894      268.538      276.117      282.534

    print,airdens(800.,T)  ; T from previous calculation
    ; prints  2.31744e+19  2.23218e+19  2.16033e+19  2.10104e+19  2.05332e+19

 MODIFICATION HISTORY:
        mgs, 12 Nov 1998: VERSION 1.00
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\airdens.pro)


AIRMASS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  airmass

 PURPOSE:  compute airmass as a function of angle, sza, including
           spherical earth effects

 USEAGE:   result=airmass(sza)

 INPUT:    
   sza     zenith angle   

 KEYWORD INPUT:

 OUTPUT:   relative airmass,
           by definition the relative airmass = 1 for sza=0.

 References:
   1) Kasten, F 1966: A new table and approximate formula for relative
      airmass. Arch. Meteor. Geophys. Bioklimatol. Ser. B, 14, 206-223

   2) Kasten and Young, 1989: Applied Optics, 28, 4735-4738
      recommended by Yankee Environmental Systems (MFRSR)
  
 EXAMPLE:  

    sza=findrng(0,89.,dx=.1)
    plot,sza,1./cos(sza*!dtor),yran=[1,30]
    plot,sza,cos(sza*!dtor)*airmass(sza)

 AUTHOR:   Paul Ricchiazzi                        09 Jan 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\airmass.pro)


ALIGN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ALIGN
 PURPOSE:
       Vector text justification (positioning).
 CATEGORY:
 CALLING SEQUENCE:
       align, x,y,txt
 INPUTS:
       x,y = Reference point.  in
       txt = Text string.
 KEYWORD PARAMETERS:
       Keywords:
         CHARSIZE=csz Character size.
         AX=ax    Alignment in X (fraction).
         AY=ax    Alignment in Y (fraction).
           AX=0, AY=0 is lower left corner of text.
           AX=1, AY=1 is upper right corner of text.
         /DEVICE  Means work in device coordinates.
         /DATA    Means work in data coordinates.
         /NORMAL  Means work in normalized coordinates.
         XOUT=xx  Output x position.
         YOUT=yy  Output x position.
           xyouts,xx,yy,txt,charsize=csz.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Currently works only for horizontal text.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 4.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\align.pro)


ALT_INHALT_DEF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	alt_inhalt_def

 PURPOSE:
    This routine holds the definitons for the structure INHALT
    It's an alternative to inhalt_def

 CATEGORY:
  DATAFILES/NETCDF

 CALLING SEQUENCE:
	alt_inhalt_def,inhalt_def=inhalt_def,[array_de_descriprion=array_de_descriprion]


 OUTPUTS:
 inhalt_def=inhalt_def:                     an array defining ncdf and idl names

 OPTIONAL OUTPUTS:
 array_de_description=array_de_description: an array holding german expressions for additional parameters

 EXAMPLE:
 alt_inhalt_def,inhalt_def=inhalt_def

 MODIFICATION HISTORY:
 	Written by:	R. Bauer ICG-1 , May 1997
  R.Bauer 1997-Sep-16 debug added
  R.Bauer 1998-Mar-3 filter extended by using uppercase definitions
  R.Bauer 1998-Nov-16 added 4*s+o
  R.Bauer 1998-Nov-16 added user definitions for INHALT
  R.Bauer 1999-May-28 added time_description and time_de_description
  R.Bauer 1999-Sep-07 median added
  R.Bauer 2000-Jan-25 dataset_forecast_hours added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\alt_inhalt_def.pro)


AMES2ICGS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ames2icgs

 PURPOSE:
   This functions reads the nasa Ames datafiles to the icg  data structure

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   result=ames2icgs(file)

 INPUTS:
   file: name of the nasa ames file


 PROCEDURE:
  This routine uses the ames library interface

 EXAMPLE:
   struct=ames2icgs('al970626.ea1')
   write_ncdf,'al970626.nc',struct

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Nov-30
       This routine is not quite finished at the moment.
       I will change the "cases" later on
       2000-01-18 Abfrage für das Einbinden von stdev erweitert.
       2000-01-21 useable fomats at the moment are: 1001, 1020, 2110
       2000-01-24 short_names for some files expanded
       2000-01-25 short_names for more files expanded (jug)
       2000-02-24 'ALTITUDE OF OBSERVATION' added
       2000-06-13 is_tag  auf 'time' added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\jug_lib\ames2icgs.pro)


ANGLE_INC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ANGLE_INC
 VERSION:
		4.1
 PURPOSE:
		Calculates the angle increments between segments of a polygonal line.
 CATEGORY:
		Mathematical.
 CALLING SEQUENCE:
		Result = ANGLE_INC( X [, Y] [, keywords])
 INPUTS:
	X
		Numeric vector or [2,N] array.  In the first case:
			1)	If Y is given, X represents the X coordinates of the vertices.
			2)	If Y is not given, X represents the Y coordinates and the X
				coordinates are generated internally as [1, 2, ...N-1]
		In the second case X represents both X and Y coordinates and Y should
		not be given.
 OPTIONAL INPUT PARAMETERS:
	Y
		Numeric vector, optional when X given as vector, forbidden when X is a
		[2,N] array.  Represents the Y coordinates.
 KEYWORD PARAMETERS:
	/ABSOLUTE
		Switch.  If set the absolute values of the angles are calculated.
	/CLOSED
		Switch.  If set, the shape is closed prior to calculation (unless it
		is already closed.
	/TOTAL_ONLY
		Switch.  If set, only the sum of the angles is returned.
 OUTPUTS:
		Returns the N-2 (or N-1, for a closed curve) external angles generated
		by the vertices.  Note, the external angles are the angles by which
		each segment deviates from the previous one.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The value of N (the vector length) must be >=3.  Also, if both X and Y
		are given, they must be of same length.
 PROCEDURE:
		Straightforward from the geometric definitions.  Calls CAST, DIF,
		SIGN, SPLIT_XY and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-MAY-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\angle_inc.pro)


ANIMALS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ANIMALS
 PURPOSE:
       Return a string array of animals.
 CATEGORY:
 CALLING SEQUENCE:
       a = animals()
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       a = string array of animals.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 24 Jul, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\animals.pro)


APODIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       APODIZE
 PURPOSE:
       Weighting array for apodizing an image.  Cosine taper.
 CATEGORY:
 CALLING SEQUENCE:
       a = apodize(w, r)
 INPUTS:
       w = size of square array a to make.             in
       r = radius of flat top as a fraction 0 to 1.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       a = resulting array.                            out
 COMMON BLOCKS:
 NOTES:
       Notes: Output array is square.  To convert to rectangular
          use congrid to specify desired size and shape:
          b = congrid(a, 100,50)
 MODIFICATION HISTORY:
       Written by R. Sterner, 6 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\apodize.pro)


ARC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ARC
 VERSION:
		4.0
 PURPOSE:
		Draws a circular arc in the currently defined plot area.
		Alternatively, a *SHAPE* representation (see SHAPE_VER for definition)
		of the arc may be returned through the SHAPEOUT keyword.  DATA
		coordinates are used.  The method of drawing depends on the number of
		input parameters provided (see details in CALLING SEQUENCE below).
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		There are two possible modes of operation, and accordingly two
		different calling sequences:
		Mode 1:
			ARC, R1, CENTER = CENT, ANGLE = ANG [, optional keywords]
		In this mode an arc with angular measure ANG is drawn around the point
		CENT, in the mathematical-positive direction, starting from point R1.
		Mode 2:
			ARC, R1, R2, {RADIUS = RAD, ANGLE = ANG} [, optional keywords]
		In this mode the arc is drawn in the mathematical-positive direction,
		from point R1 to point R2.  The arc is either drawn with radius RAD, or
		corresponding to an angle ANG (both RAD and ANG cannot be specified).
 INPUTS:
	R1, R2
		2-dimensional vectors in the [x,y] format, representing points in the
		plotting area.  R1 is mandatory.  The presence of R2 indicates that
		Mode 2 is being used.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	CENTER
		2 dimensional vector, arc center location, format [x,y].
		Mandatory in Mode 1, forbidden in Mode 2.
	RADIUS
		Scalar, the radius of the arc.			|
		Forbidden in Mode 1, allowed in Mode 2.	|  In Mode 2
	ANGLE										|  one and only one
		Scalar, the angle measure of the arc.	|  needs to be provided.
		Mandatory in Mode 1, allowed in Mode 2. |
	/DEGREES
		Switch.  Indicates that the angle ANG is given in degrees (default is
		radians).
	/BIGARC
		Switch.  When drawing in Mode 2, with the radius provided, there are two
		possible arcs that can be drawn, corresponding to angles smaller and
		bigger than 180 degrees (the sum of both angles is 360 degrees).  By
		default the smaller arc is drawn. Setting BIGARC selects the bigger arc.
	/SYMMETRIC
		Switch.  In Mode 1 causes the arc to be drawn symmetrically on both
		sides of R1.  Forbidden in Mode 2.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable, on return the variable
		contains the *SHAPE* representation of the arc.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The arc will appear as a true circular arc only if the aspect ratio of
		the X to Y axes is 1:1.
		The keywords passed through _EXTRA are transferred to the PLOTS
		routine.  No keyword verification is performed by ARC.
 PROCEDURE:
		Uses calls to ONE_OF and SHAPE_COCON from MIDL.
		Generates a (2,N) array containing a sufficient number of the arc
		points to yield a smooth curve.  N is variable, depending both on the
		arc size and on the pixel size of the current output device.
 MODIFICATION HISTORY:
		Created 15-DEC-1991 by Mati Meron.
		Modified 15-DEC-1993 by Mati Meron.  Now ARC takes advantage of the
		keyword inheritance property and accepts all PLOTS keywords.
		Modified 15-JUN-1995 by Mati Meron.  Removed the ALT_EXT keyword which
		is no longer needed (_EXTRA has been fixed).
		Modified 25-JUL-1999 by Mati Meron.  Added keywords NO_SHOW and
		SHAPEOUT.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\arc.pro)


ARCS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARCS
 PURPOSE:
       Plot specified arcs or circles on the current plot device.
 CATEGORY:
 CALLING SEQUENCE:
       arcs, r, a1, a2, [x0, y0]
 INPUTS:
       r = radii of arcs to draw (data units).                  in
       [a1] = Start angle of arc (deg CCW from X axis, def=0).  in
       [a2] = End angle of arc (deg CCW from X axis, def=360).  in
       [x0, y0] = optional arc center (def=0,0).                in
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means use device coordinates .
         /DATA means use data coordinates (default).
         /NORM means use normalized coordinates.
         /NOCLIP means do not clip arcs to the plot window.
         COLOR=c  plot color (scalar or array).
         LINESTYLE=l  linestyle (scalar or array).
         THICKNESS=t  line thickness (scalar or array).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: all parameters may be scalars or arrays.
 MODIFICATION HISTORY:
       Written by R. Sterner, 12 July, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.
       R. Sterner, 17 Jun, 1992 --- added coordinate systems, cleaned up.
       R. Sterner, 1997 Feb 24 --- Added THICKNESS keyword.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\arcs.pro)


ARG_PRESENT[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ARG_PRESENT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Determine whether output parameter has been passed (IDL4 compatibility)

 CALLING SEQUENCE:
   PRESENT = ARG_PRESENT(ARG)

 DESCRIPTION: 

   ARG_PRESENT tests whether an argument to a function or procedure
   can be used as an output parameter.  The behavior of this function
   is identical to that of the built-in ARG_PRESENT function in IDL
   version 5 or greater, and is meant to give the same functionality
   to programs in IDL 4.

   An IDL procedure or function can use ARG_PRESENT to decide whether
   the value of a positional or keyword parameter will be returned to
   the calling procedure.  Generally, if the caller did not pass the
   parameter then there is no need to compute the value to be
   returned.

   To be a valid output parameter, the caller must have passed a
   named variable into which the result is stored.  If the caller
   passed the parameter by value (e.g., an expression or a
   subscripted array) the value cannot be returned and ARG_PRESENT
   returns 0.

 INPUTS:

   ARG - the parameter to be tested.  It can be either a positional
         or a keyword parameter.  Passing a normal local variable
         (i.e., not a passed parameter) will cause ARG_PRESENT to
         return zero.

 RETURNS:

   Returns a value of 1 if ARG is a valid output parameter, and a
   value of 0 otherwise.


 EXAMPLE:

   Consider the following procedure:
      PRO TESTARG, ARG1
        print, ARG_PRESENT(ARG1)
      END

   This procedure will print 1 when an ARG1 can be used as an output
   parameter.  Here are some examples of the results of TESTARG.

      IDL> testarg
             0
      IDL> testarg, x      
             1
      IDL> testarg, findgen(10)
             0
   
   In the first case, no argument is passed, so ARG1 cannot be a
   return variable.  In the second case, X is undefined, but it is
   still a legal named variable capable of receiving an output
   parameter.  In the third case, FINDGEN(10) is an expression which
   cannot receive an output parameter.

 SEE ALSO:

   ARG_PRESENT in IDL version 5

 MODIFICATION HISTORY:
   Written, CM, 13 May 2000
   Small documentation and bug fixes, CM, 04 Jul 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\arg_present.pro)


ARG_PRESENT[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ARG_PRESENT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Determine whether output parameter has been passed (IDL4 compatibility)

 CALLING SEQUENCE:
   PRESENT = ARG_PRESENT(ARG)

 DESCRIPTION: 

   ARG_PRESENT tests whether an argument to a function or procedure
   can be used as an output parameter.  The behavior of this function
   is identical to that of the built-in ARG_PRESENT function in IDL
   version 5 or greater, and is meant to give the same functionality
   to programs in IDL 4.

   An IDL procedure or function can use ARG_PRESENT to decide whether
   the value of a positional or keyword parameter will be returned to
   the calling procedure.  Generally, if the caller did not pass the
   parameter then there is no need to compute the value to be
   returned.

   To be a valid output parameter, the caller must have passed a
   named variable into which the result is stored.  If the caller
   passed the parameter by value (e.g., an expression or a
   subscripted array) the value cannot be returned and ARG_PRESENT
   returns 0.

 INPUTS:

   ARG - the parameter to be tested.  It can be either a positional
         or a keyword parameter.  Passing a normal local variable
         (i.e., not a passed parameter) will cause ARG_PRESENT to
         return zero.

 RETURNS:

   Returns a value of 1 if ARG is a valid output parameter, and a
   value of 0 otherwise.


 EXAMPLE:

   Consider the following procedure:
      PRO TESTARG, ARG1
        print, ARG_PRESENT(ARG1)
      END

   This procedure will print 1 when an ARG1 can be used as an output
   parameter.  Here are some examples of the results of TESTARG.

      IDL> testarg
             0
      IDL> testarg, x      
             1
      IDL> testarg, findgen(10)
             0
   
   In the first case, no argument is passed, so ARG1 cannot be a
   return variable.  In the second case, X is undefined, but it is
   still a legal named variable capable of receiving an output
   parameter.  In the third case, FINDGEN(10) is an expression which
   cannot receive an output parameter.

 SEE ALSO:

   ARG_PRESENT in IDL version 5

 MODIFICATION HISTORY:
   Written, CM, 13 May 2000
   Small documentation and bug fixes, CM, 04 Jul 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmarg_present.pro)


ARMBASETIME

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  armbasetime

 PURPOSE: The base_time variable provided by ARM net_cdf files is the
          number of seconds since jan 1, 1970 00:00:00 UTC.  This
          procedure converts base_time to the current date in yymmdd
          format, and the number of hours since the most recent
          Grenich midnight (00:00:00 UTC).

 USEAGE:  armbasetime,base_time,time,yymmdd,file=file

 INPUT:    
   bt     number of seconds since jan 1, 1970 00:00:00 UTC.

 KEYWORD_INPUT

  file    name arm net_cdf file. If this quantity is set the value
          of bt is set from the value read from the file.


 OUTPUT:

  time    time since Grenich midnight of the current day
  yymmdd  date string in yymmdd format

  
 EXAMPLE: 
    file='/home/paul/arm/iop_97/mfrsr/sgpmfrsrC1.a1.970915.000000.cdf'
    armbasetime,file=file,bt,time,yymmdd
    print,bt,time,"   ",hms(3600*time)," ",yymmdd

 AUTHOR:   Paul Ricchiazzi                        05 Jun 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\armbasetime.pro)


ARR2STRING

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   arr2string

 PURPOSE:
   This function will combine elements of a stringarray; e.g. [' A ',' B ']->'A,B'

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   result=arr2string(array)

 INPUT PARAMETERS:
   strarray

 KEYWORD PARAMETERS:
   sep  : separator, default:' '
   limit: string length limit (default 32767); longer strings will be put into a stringvector

 OUTPUTS:
   result: str-vector; combination of elements of the array separated by a separator
           undefined array will return result=''

 EXAMPLE:
   result=arr2string(['A','BCD','DCB'],sep=':')
   result:'A:BCD:DCB'

   result=arr2string()
   result:''

 MODIFICATION HISTORY:
   Written by Reimar Bauer, Franz Rohrer Aug 1998
   Modified 10.03.2000 Franz Rohrer : limit string length to 32765

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\arr2string.pro)


ARRAY2HTMLTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   array2htmltable

 PURPOSE:
   This functions creates a table in html from an array of numbers or text

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = ARRAY2HTMLTABLE(Array)

 INPUTS:
   Array:  array of numbers or text

 KEYWORD PARAMETERS:
   MAX_ARRAY:  cuts the size of the output to max_array columns and rows
   MAX_COLS:   cuts the size of the output to max_cols columns
   MAX_ROWS:   cuts the size of the output to max_rows rows
   BORDER: if this keyword is set a border will be produced for each
           table entry
   CAPTION: if this keyword is set to a string this will be printed
           as a table caption
   COL_NUMBERS: if this keyword is set a column number is printed
   ROW_NUMBERS: if this keyword is set a row number is printed
   COL_TITLES: if an array of column title is provided they will be printed
           instead of numbers
   ROW_TITLES: see COL_TITLES
   CORNER_TITLE: if a string is provided it wil be set in the corner created
                   by row an col titles
   ALIGNMENT: Specifies the alignment of the caption text. An alignment
           of 0.0 (the default) aligns left, 1.0 right and 0.5 centered

   parsed to tab_i
   SMALL:      use small fonts for table entries
   FIXED:      use fixed fonts for table entries
   NOBREAK:    no line breaks in table entries

 OUTPUTS:
   This function returns a string array containing html-code for table
   which correponds to the content of an IDL array

 EXAMPLE:
   see also html_example.pro and html_example2.pro

   print, array2htmltable([[11,12],[21,22]])
       
11 12
21 22

print, array2htmltable([['11','12'],['21','22']], /BORDER)
11 12
21 22

MODIFICATION HISTORY: Written by: Theo Brauers, 1998-JAN-19 Modified 1998 Jul 29 new corner_title Corrected T.B. 1998 Aug 6 keyword_set for n_elements Modified 2000 Feb 1 new keyw HORIZOTAL_1D Modified 2000 Mar 13 new keyw max_array, max_rows, max_cols

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\array2htmltable.pro)


ARRAY2TEXTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   array2textable

 PURPOSE:
   This functions creates a table in tex from an array of numbers or text

 CATEGORY:
   PROG_TOOLS/TEX

 CALLING SEQUENCE:
   Result = array2textable(array,[vspace=vspace],[format=format],[/table],[/grid])

 INPUTS:
   Array:  array of numbers or text

 OPTIONAL INPUTS:
   vspace:  a string holding the vertical space behind the table
   format:  the formatcode for the whole table without {}


 KEYWORD PARAMETERS:
  table : \table will be included before \begin {tabular}
  grid:  \grid will give hor and vertical lines

 OUTPUTS:
   This function returns a string array containing tex-code for table
   which correponds to the content of an IDL array

 EXAMPLE:
  test=sindgen(10,4)
  f=array2textable(test,/table)
  print,f

  \begin{table}
  \begin{tabular}{rrrrrrrrrr}
  0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
  10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 \\
  20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 \\
  30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \\
  \end{tabular}
  \end{table}


 MODIFICATION HISTORY:
   Written by: Reimar Bauer, 1998-Jun-29
   1998-Jul-05 format added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\array2textable.pro)


ARRAY_LIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARRAY_LIST
 PURPOSE:
       List an array in a form useful to cut and paste.
 CATEGORY:
 CALLING SEQUENCE:
       array_list, a
 INPUTS:
       a = array to list.       in
 KEYWORD PARAMETERS:
       Keywords:
         OUT=out Returned list in a text array.
         FRONT=frnt Text to add to front (def=none).
           Can space in and give a variable name: '  a = '
           Use spaces, not tabs, to get correct line length.
         INDENT=itxt Text string used to indent continued lines.
            Default is 10 spaces.
         /QUIET do not display list.
         MAXLEN=mx Max length before line continue (def=72).
           May be one longer for continued lines.
         FORMAT=fmt Format for values (def=none).
         /TRIM means trim leading and trailing 0s (and spaces).
           Useful with FORMAT to get minimum strings.
         TYPE=typ  Name of data type function (def=none).
           Will apply to array.  Ex: uint([1,2,3])
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Nov 30

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\array_list.pro)


ARRDELETE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ARRDELETE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Remove a portion of an existing array.

 CALLING SEQUENCE:
   NEWARR = ARRDELETE(INIT, [AT=POSITION,] [LENGTH=NELEM])

 DESCRIPTION: 

   ARRDELETE will remove or excise a portion of an existing array,
   INIT, and return it as NEWARR.  The returned array will never be
   larger than the initial array.

   By using the keywords AT and LENGTH, which describe the position
   and number of elements to be excised respectively, any segment of
   interest can be removed.  By default the first element is removed.

 INPUTS:

   INIT - the initial array, which will have a portion deleted.  Any
          data type, including structures, is allowed.  Regardless of
          the dimensions of INIT, it is treated as a one-dimensional
          array.  If OVERWRITE is not set, then INIT itself is
          unmodified.

 KEYWORDS:

   AT - a long integer indicating the position of the sub-array to be
        deleted.  If AT is non-negative, then the deleted portion
        will be NEWARR[AT:AT+LENGTH-1].  If AT is negative, then it
        represents an index counting from then *end* of INIT,
        starting at -1L.
        Default: 0L (deletion begins with first element).

  LENGTH - a long integer indicating the number of elements to be
           removed.  

  OVERWRITE - if set, then INIT will be overwritten in the process of
              generating the new array.  Upon return, INIT will be
              undefined.

  COUNT - upon return, the number of elements in the resulting array.
          If all of INIT would have been deleted, then -1L is
          returned and COUNT is set to zero.

  EMPTY1 - if set, then INIT is assumed to be empty (i.e., to have
           zero elements).  The actual value passed as INIT is
           ignored.

 RETURNS:

   The new array, which is always one-dimensional.  If COUNT is zero,
   then the scalar -1L is returned.

 SEE ALSO:

   STORE_ARRAY in IDL Astronomy Library

 MODIFICATION HISTORY:
   Written, CM, 02 Mar 2000
   Added OVERWRITE and EMPTY1 keyword, CM 04 Mar 2000

  $Id: arrdelete.pro,v 1.2 2001/03/25 18:10:41 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\arrdelete.pro)


ARREQ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ARREQ
 VERSION:
		4.0
 PURPOSE:
		Compares arrays for equality.  The arrays qualify as equal if:
			1) They are of the same general type (num., char., or struct.).
			2) Number of dimensions is the same.
			3) Size of each dimension is the same.
			4) Respective elements are equal.
 CATEGORY:
		Mathematical Function (general).
 CALLING SEQUENCE:
		Result = ARREQ( ARR1, ARR2 [, keywords])
 INPUTS:
	ARR1, ARR2
		Arrays, type and number of dimensions arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/WARN
		Switch. If set, a warning message is issued for incompatible data types.
	/NOVALUE
		Switch.  If set, only number of elements and structure are compared.
 OUTPUTS:
		Returns 1 if the arrays are equal, 0 otherwise.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the SIZE function and ISNUM from MIDL to obtain information about
		the arrays.  Compares, in order, number of dimensions, size of each
		dimension, data types, and (unless NOVALUE is set) individual elements.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 30-AUG-1998 by Mati Meron.  Scope broadened to pointer arrays.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\arreq.pro)


ARREX (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ARREX  (function)

 PURPOSE:
        This function extracts a multi-dimensional subset
        of an array. For each dimension the start index,
        end index (or count), and stride can be specified - default 
        values are 0 (i.e. first start index), "all" (i.e. last end
        index), and 1 (i.e. every element). A negative stride
        causes reversion of the respective array dimension.

 CATEGORY:
        Array Tools

 CALLING SEQUENCE:
        Result = ARREX( Array [, Startindex=]  $
                              [, Endindex= | Count=]    $
                              [, Stride=]      $
                              [, /Reform] )

 INPUTS:
        ARRAY -> The parent array from which the extraction shall be made.
            Currently up to 6 dimensions are supported.

 KEYWORD PARAMETERS:
        STARTINDEX -> An array with starting indices. Each element of
            startindex corresponds to one dimension of ARRAY. If
            startindex has less elements than ARRAY dimensions, the
            remainder is assumed 0. 

        ENDINDEX -> An array with ending indices. Each element of
            endindex corresponds to one dimension of ARRAY. If
            endindex has less elements than ARRAY dimensions, the
            remainder is set to the maximum possible value for that
            dimension. Endindex cannot be use together with count.

        COUNT -> An array with the number of elements to be extracted
            along each dimension. Count values must be greater 0 and
            are automatically adjusted so that startindex +
            (count-1)*stride is a valid index for that
            dimension. Count and Endindex cannot be used together.
 
        STRIDE -> An array with stride values. A stride of 1 (default)
            signifies extraction of every element, 2 returns every 
            second element for that dimension, etc. Negative values
            cause the respective dimension to be reversed and are
            only allowed when the count keyword is not used.
            Each value of stride corresponds to one dimension of ARRAY. 
            If stride has less elements than ARRAY dimensions, the 
            remainder is assumed 1.

        /REFORM -> Set this keyword to eliminate unnecessary dimensions
            in the result.

 OUTPUTS:
        A subset of the original array. This will have the same 
        dimensionality as ARRAY unless the REFORM keyword is set.

 SUBROUTINES:
        Function arrex_ComputeInd

 REQUIREMENTS:
        Uses the reverse function from the IDL library

 NOTES:
        Created after discussion in newsgroup idl-pvwave.

 EXAMPLE:
        A = indgen(10,10)
        print,arrex(A,[2,1],-1,[2,4])
        ; yields  12  14  16  18
        ;         52  54  56  58
        ;         92  94  96  98
        print,arrex(A,[10,1],[1,10],[5,5])
        ; yields  19  15
        ;         69  65
        ; note that stride for dimension 1 is adjusted automatically.

 MODIFICATION HISTORY:
        mgs, 20 May 1999: VERSION 1.00
            - with a lot of input from L. Gumley, S. Vidar, and
              others
        mgs, 15 Aug 2000: VERSION 2.00
            - added DEBUG keyword and extended for up to 6
              dimensions.
            - changed from arguments to keywords.
            - added count keyword to enhance usability together with
              netcdf type access.
            - changed error behaviour. Now stops instead of returning
              the unchanged array.
            - changed copyright notice to Open Source.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\arrex.pro)


ARRINSERT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ARRINSERT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Insert one array into another

 CALLING SEQUENCE:
   NEWARR = ARRINSERT(INIT, INSERT, [AT=POSITION] )

 DESCRIPTION: 

   ARRINSERT inserts the contents of one array (INSERT) into
   another (INIT), and returns the new array (NEWARR).

   ARRINSERT will handle empty lists, which are represented as
   undefined variables.  If both input arrays are empty, then the
   scalar -1L is returned, and the keyword COUNT is set to 0L.

 INPUTS:

   INIT - the initial array, into which INSERT will be inserted.  Any
          data type, including structures, is allowed.  Regardless of
          the dimensions of INIT, it is treated as a one-dimensional
          array.  If OVERWRITE is not set, then INIT itself is
          unmodified.

   INSERT - the array to be inserted into INIT, which must be of the
            same or similar type to INIT.  If INSERT is empty, then
            INIT is returned unchanged.  Regardless of the dimensions
            of INSERT, it is treated as a one-dimensional array.

 KEYWORDS:

    AT - a long integer indicating the position of the newly inserted
         sub-array.  If AT is non-negative, then INSERT will appear
         at NEWARR[AT].  If AT is negative, then INSERT will appear
         at NEWARR[AT + (N+1)] where N is the number of elements in
         INIT, which is to say if AT is negative, it indexes from the
         end side of the array rather than the beginning.

         Default: 0L (INSERT appears at beginning of INIT)

   OVERWRITE - if set, then the initial array INIT will be
               overwritten by the new array.  Upon exit INIT becomes
               undefined.

   COUNT - upon return, the number of elements in the resulting
           array.

  EMPTY1, EMPTY2 - if set, then INIT (for EMPTY1) or INSERT (for
                   EMPTY2) are assumed to be empty (i.e., to have
                   zero elements).  The actual values passed as INIT
                   or INSERT are then ignored.

 RETURNS:

   The new array, which is always one-dimensional.  If COUNT is zero,
   then the scalar -1L is returned.

 SEE ALSO:

   ARRDELETE, STORE_ARRAY in IDL Astronomy Library

 MODIFICATION HISTORY:
   Written, CM, 02 Mar 2000
   Added OVERWRITE and EMPTY keywords, CM, 04 Mar 2000
   Improved internal docs, and AT keyword docs, CM, 28 Sep 2000
   Doc clarifications, CM, 29 Sep 2001

  $Id: arrinsert.pro,v 1.3 2001/09/30 03:17:06 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\arrinsert.pro)


ARRLOC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ARRLOC
 VERSION:
		4.0
 PURPOSE:
		Converts array indices from expanded (multi dimensional) form to
		contracted (one dimensional) form and vice versa.
 CATEGORY:
		Array Function.
 CALLING SEQUENCE:
		Result = ARRLOC( INDS, SIZ [, keywords])
 INPUTS:
	INDS
		Numeric, converted to long integer on input.  Structure depends on
		usage mode (EXPAND versus CONTRACT) and on the input parameter SIZ, as
		follows:
			EXPAND mode  :  INDS can be a scalar or a vector (1-dim array).
			CONTRACT mode:  If SIZ(0) = 0 then INDS arbitrary.  Else INDS can
			be a scalar, vector or a 2-dim array, subject to the following
			restrictions:
			INDS is scalar:  SIZ(0) must be 1.
			INDS is vector:  SIZ(0) must equal the length of INDS.
			INDS is M*N array:  SIZ(0) must equal M (first array dimension).
	SIZ
		Vector in the form of the standard output of the system function SIZE.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/EXPAND
		Switch, specifies expansion mode.  This is the default.
	/CONTRACT
		Switch, specifies contraction mode.
 OUTPUTS:
		Depending on mode, as follows:
		EXPAND mode:  Returns an M*N array, where M is the number of dimensions
			of the object charactarized by SIZ (i.e. SIZ(0)) and N is the
			number of elements in INDS.  For example, if S = [2,3,8,4,24]
			(corresponding to a 3*8 real array) then ARRLOC(5,S) will return
			the vector [2,1] (the indices of the 5th element) while
			ARRLOC([2,5,22]) will return:	2	0
											2	1
											1	7
		CONTRACT mode:  Reverses the action of expand.  When fed an array in
			the form of the output of ARRLOC with EXPAND, returns a vector of
			1-dimensional indices.  For example a call to ARRLOC using S and
			the output array from the example above will return:	2
																	5
																	22
		In either mode, if any of the resulting indices is out of bounds for
		the array specified by SIZ, it is replaced by -1.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than those specified in the description of INDS, above.
 PROCEDURE:
		Straightforward.  Calls ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 30-MARCH-1994 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\arrloc.pro)


ARRO.

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ARRO.
 VERSION:
		4.0
 PURPOSE:
		Draws an arrow in the current plot area, from the FROM to the TO
		location.  DATA coordinates are used, unless one of the keywords
		/DEVICE or /NORMAL is set.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		ARRO, FROM = tail, TO = head [, keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	FROM
		Two dimensional vector, start location, mandatory.
	TO
		Two dimensional vector, end location, mandatory.
	SIZE
		Scalar, specifies size of head [and tail], default is 1.
	/TAIL
		Switch.  Puts a tail on the arrow.
	/TWOSIDED
		Switch.  Draws a twosided arrow (heads on both ends).
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The keywords passed through _EXTRA are transferred to the PLOTS
		routine.  No keyword verification is performed by ARRO.
 PROCEDURE:
		Uses DEFAULT, ONE_OF, SHAPE_COCON, SHAPE_TRANS and WHERINSTRUCT
		from MIDL.  All the coordinates are converted to DEVICE coordinates for
		shape generation and plotting purposes.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-DEC-1991 by Mati Meron.  Added keywords COLOR and TWOSIDED.
		Modified 15-DEC-1993 by Mati Meron.  Now ARROW takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Modified 5-OCT-1994 by Mati Meron.  Name changed to ARRO to avoid
		conflicts with library routines.
		Modified 15-JUN-1995 by Mati Meron.  Utilizes WHERINSTRUCT for improved
		keyword inheritance.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\arro.pro)


ARROW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARROW
 PURPOSE:
       Draw arrows on screen.
 CATEGORY:
 CALLING SEQUENCE:
       arrow, xt, yt, xh, yh
 INPUTS:
       xt, yt = x,y of arrow tail.     in
       xh, yh = x,y of arrow head.     in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA means use data coordinates (def).
         /NORM means use normalized coordinates.
         /DEVICE means use device coordinates.
         COLOR=c arrow outline color (def=255).
           Make same as FILL for no outline.
         THICK=t arrow outline thickness (def=0).
         LINESTYLE=s arrow outline line style (def=0).
         FILL=f set arrow fill color (0-255, def = -1 = no fill).
         LENGTH=l  Arrow head length in % plot width (def = 3).
         WIDTH=w  Arrow head width in % plot width (def = 2).
         SHAFT=s  Arrow shaft width in % plot width (def = 1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 21 Sep, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\arrow.pro)


ARROW2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARROW2
 PURPOSE:
       Draw arrows on screen.
 CATEGORY:
 CALLING SEQUENCE:
       arrow2, xt, yt, xh, yh
 INPUTS:
       xt, yt = x,y of arrow tail.     in
       xh, yh = x,y of arrow head.     in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA means use data coordinates (def).
         /NORM means use normalized coordinates.
         /DEVICE means use device coordinates.
         COLOR=c arrow outline color (def=255).
           Make same as FILL for no outline.
         THICK=t arrow outline thickness (def=0).
         LINESTYLE=s arrow outline line style (def=0).
         FILL=f set arrow fill color (0-255, def = -1 = no fill).
         LENGTH=l  Arrow head length in % plot width (def = 3).
         WIDTH=w  Arrow head width in % plot width (def = 2).
         SHAFT=s  Arrow shaft width in % plot width (def = 1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 21 Sep, 1990
       R. Sterner, 11 Nov, 1993 --- renamed from arrow.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\arrow2.pro)


ARR_EQUAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	arr_equal

 PURPOSE:
       This function returns always an array with the founded multiple values

 CATEGORY:
       MATH

 CALLING SEQUENCE:
       Result=arr_equal(array,[/sort])

 INPUTS:
       array: the input array

 KEYWORD PARAMETERS:
       sort:   sorts the array

 OUTPUTS:
       This function returns an array with the equal values

 EXAMPLE:
       a=['1','2','2']
       print,arr_equal(a)
       2
       help,arr_equal(a)   STRING    = Array(1)



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 20, 1997
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\arr_equal.pro)


ASC2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	asc2ncdf

 PURPOSE:
   will translate ascii data with the icg-1 experimental header into netCDF Files

 CATEGORY:
   DATAFILES/FILTER


 CALLING SEQUENCE:
   asc2ncdf,inpath, outpath, filename, [data_sep=data_sep],[kritererium=kriterium],[inhalt=inhalt],[param_zeile=param_zeile]

 INPUTS:
	inpath:   Path where the data is
   outpath:  Path where the netCDF File will be saved
   filename: The filename of the ascii file which should be translated

 OPTIONAL INPUTS:
   data_sep: separator sign for the data
   kriterium: will give the posibility whith an input listfile
              to translate only logical parameters into netCDF
              kriterium='trans.fish.t'

 OPTIONAL OUTPUTS:
 inhalt:      the structure inhalt for the last parameter
 param_zeile: the whole Array field of the Ascii File

 PROCEDURE
 Examples of the two kinds of headers will be found at:
 http://ich313.ich.kfa-juelich.de/netcdf/icg1_header_datum.html
 and
 http://ich313.ich.kfa-juelich.de/netcdf/icg1_header_sekunden.html

 EXAMPLE:
  asc2ncdf,'/home1/icg105/data/','/home1/icg105/data/','test.dat'

 MODIFICATION HISTORY:
 	Written by:	R. Bauer , June, 13 , 1997
                       R.Bauer , Aug, 21 1997  data_sep added to choose column separator
                       R.Bauer,1997-9-16 debug added
 R.Bauer 1998-08-29 ncdf_ws mehtod changed to ncdf_w
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\asc2ncdf.pro)


ASCII2HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ascii2html

 PURPOSE:
   This functions creates html code for a given string array input

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = ASCII2HTML(string, [/SMALL] ,[/FIXED])

 INPUTS:
   string:   array

 KEYWORD PARAMETERS:
   SMALL:      use small fonts for table entries
   FIXED:      use fixed fonts for table entries

 OUTPUTS:
   String array

 EXAMPLE:
   see html_example.pro and html_example2.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998
   Modified T.B. Apr 2000 caption keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\ascii2html.pro)


ASD_MEAN

[Previous Routine] [Next Routine] [List of Routines]
 usage:        asd_mean, tag,wvl,spec,sigma,view=view
 keyword input:
    tag        string used to match a certain subset of scan files listed
               an index file, 'asd_scan_list', which is read from the current
               working directory.

               Each record in 'asd_scan_list' consists of three fields
               separated by white space: the name of an asd scan file, 
               the utc time in hours, and the tag name, for example:

               spectrum.001   15.003 scan1
               spectrum.002   15.102 scan1
               spectrum.003   15.233 scan2
               spectrum.004   15.312 scan2

               setting tag to 'scan1' whould select spectrum.001 and
               spectrum.002, setting tag to ' ' or 'scan' would select
               all four files.  Since tag is compared to the whole record
               you can also select a single file by setting tag to a 
               particular file name or time.

    view       make a plot of the scan
               view=f makes an overplot with color=f*(!d.n_colors-1)

 output:
    wvl        wavelength values
    spec       averaged spectra
    sigma      standard deviation of spectral scans (same size as spec)

 example:
;;
 w8x11
 !p.multi=[0,2,2]
 asd_mean,tag='60_NE',wvl,s60ne
 asd_mean,tag='zenith',wvl,s0
 asd_mean,tag='60_SW',wvl,s60sw
 plot,wvl,s0
 oplot,wvl,s60ne
 oplot,wvl,s60sw

;; dont know tag name, use menu to find the one you want

 asd_mean,wvl,s00

;;

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\asd_mean.pro)


ASIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ASIND

 PURPOSE:
       Return the inverse sine of a value, in degrees rather then radians.

 CALLING SEQUENCE:
       deg = asind(x)

 INPUTS:
       value      sine of angle 

 OPTIONAL INPUTS:

 OUTPUTS:
       Angle in degrees returned.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/07/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\asind.pro_)


ASPECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ASPECT

 PURPOSE:

  This function calculates and returns the normalized position
  coordinates necessary to put a plot with a specified aspect ratio
  into the currently active graphics window. It works on the display
  output window as well as in a PostScript output window.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

  Graphics

 CALLING SEQUENCE:

  position = ASPECT(aspectRatio)

 INPUTS:

  aspectRatio: A floating point value that is the desired aspect
     ratio (ratio of heigth to width) of the plot in the current
     graphics output window. If this parameter is missing, an aspect
     ratio of 1.0 (a square plot) is assumed.

 KEYWORD PARAMETERS:

  MARGIN:  The margin around the edges of the plot. The value must be
     a floating point value between 0.0 and 0.5. It is expressed in
     normalized coordinate units. The default margin is 0.15.

  WINDOWASPECT: The aspect ratio of the target window. If not provided,
     the value is obtained from the current graphics window.

 OUTPUTS:

  position: A four-element floating array of normalized coordinates.
     The order of the elements is [x0, y0, x1, y1], similar to the
     !P.POSITION system variable or the POSITION keyword on any IDL
     graphic command.

 EXAMPLE:

  To create a plot with an aspect ratio of 1:2 and a margin of
  0.10 around the edge of the output window, do this:

     plotPosition = ASPECT(0.5, Margin=0.10)
     PLOT, Findgen(11), POSITION=plotPosition

  Notice this can be done in a single IDL command, like this:

     PLOT, Findgen(11), POSITION=ASPECT(0.5, Margin=0.10)

 MODIFICATION HISTORY:

  Written by: David Fanning, November 1996.
       Added better error checking, 18 Feb 1997, DWF.
       Added WindowAspect keyword. 10 Feb 2000. DWF
       Added double precision tolerance for aspectRatio. 9 NOV 2001 BT

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\aspect.pro)


ASP_CORR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ASP_CORR
 VERSION:
		4.0
 PURPOSE:
		Corrects the aspect ratio of a 2-dimensional shape, in order to make up
		for for different scaling in the x and y dimensions.
 CATEGORY:
		Array Manipulation /General Graphics.
 CALLING SEQUENCE:
		Result = ASP_CORR( SHAPE, REFERENCE = reflin)
 INPUTS:
	SHAPE
		(2,*) numeric array, mandatory.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	REFERENCE
		Defines the scaling procedure, according to the provided character
		value.  Accepts one of the following six values (only the first two
		characters matter):
			'XLO' :  Scale x, keeping lowest x-value constant.
			'XCEN':  Scale x, keeping center x-value constant.
			'XHI' :  Scale x, keeping highest x-value constant.
			'YLO' :  Scale y, keeping lowest y-value constant.
			'YCEN':  Scale y, keeping center y-value constant.
			'YHI' :  Scale y, keeping highest y-value constant.
 OUTPUTS:
		0 in case of failure (bad or missing shape or keyword value), otherwise
		the transformed shape is returned as a floating array (double if the
		input is of type double).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Three dimensional shapes aren't currently accepted.
 PROCEDURE:
		Uses calls to CAST, DEFAULT, SHAPE_VER and STRMATCH_MM from MIDL.  The
		scaling is done using the sizes of the plotting area in device
		coordinates, provided by the system variables !d.x_vsize and
		!d.y_vsize.  Therefore the scaling is always proper for the current
		output device.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\asp_corr.pro)


AUTORANGE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    autorange

 PURPOSE:    given a range of values find a good tick mark interval
             and return a properly formatted tick label.  This routine
             can be used with the axis procedure to add additional
             axis which are not linearly related to the original 
             axis (see example)

 USEAGE:     autorange,range,ntick,tickv,tickl,ntickmax=ntickmax,$
                       cv=cv,log=log,colors=colors

 INPUT:      

   range     array of values

 keyword input

   ntickmax  maximum allowed number of tick marks (default=10)

   cv       if present and non-zero, the tick values will cover a bit
            less than the full range.  Otherwise tick values cover a
            bit more than the full range.  Set CV when you want exactly
            NTICK contour levels to appear on a contour plot.

 OUTPUT:

   ntick     number of tick marks
   tickv     array of tick values
   tickl     formatted tick labels   

 KEYWORD OUTPUT
   colors    vector of color values covering full color range and having
             one less element than ntick

; EXAMPLE:

   autorange,[.011,.022],ntick,tickv,tickl & print,tickl
   0.010 0.012 0.014 0.016 0.018 0.020

; plot solar spectrum with wavenumber on the lower x axis
; and wavelength on the upper x-axis
          
   solar,wn,f
   plot,wn,f,xstyle=5,xrange=[10000,40000],ymargin=[4,4]
   axis,xaxis=0,xstyle=1,xtitle='Wavenumber (cm-1)'
   autorange,1.e7/!x.crange,ntick,tickv,tickl 
   axis,xaxis=1,xticks=ntick-1,xtitle='Wavelength (nm)',$
               xtickv=1.e7/tickv,xtickname=tickl
          
          
 REVISIONS:

  author:  Paul Ricchiazzi                            mar94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\autorange.pro)


AVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION: This procedure computes the AVERAGE of a the nk 
           fields stored in the array tab (nbcol,nblign,nk).

 INPUTS  : tab  --> 3 dimensional array (nbcol x nblign x nk)

 OUTPUTS : moy  --> average of the fields (nbcol x nblign)
           stdv --> standard deviation (nbcol x nblign)
           nb   --> number of points used in the average

 USE     : vertaver, array1, array2, outaver,outstdc,outelmts

 CONTACT : Didier JOURDAN   didier@esrg.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\average.pro)


AXGAP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  axgap,pos

 PURPOSE:  draw a "gap symbol" to indicate a gap in the axis number scale.

 USEAGE:   axgap,pos

 INPUT:    
   pos     two element vector indicating x,y data coordinates of the
           axis break

 KEYWORD INPUT:
   one     gap symbol drawn on one axis only

   size    size of gap symbol (default = 1, which corresponds to size
           of default minor tick marks)

   skew    control skewness of gap symbol (default 0)

   gap     controls gap size (default 1)

 OUTPUT:
   none

 DISCUSSION:
   

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE: 

   y=smooth(randomn(iseed,100),5)
   plot,y,xticks=5,xtickn=['1','2','3','4','5','20']
   axgap

 AUTHOR:   Paul Ricchiazzi                        31 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\axgap.pro)


AXIS_2C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	axis_2c

 PURPOSE:
	This procedure plots an axis and its title in different colors

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	axis_2c [[[, x], y], z]

 OPTIONAL INPUTS:
	x, y, z: Scalars giving the starting coordinates of the new axis.
		For details see the IDL AXIS routine.

 KEYWORD PARAMETERS:
	AXIS_TITLE = axis_title: Title of the axis
	COLOR = color: Color of the axis.
	TCOLOR = tcolor: Color of the title.

	Any other keyword parameters which are accepted by the IDL AXIS procedure.

 EXAMPLE:
	def_color_sysv
	PLOT, EXP(FINDGEN(10)), /YLOG
	axis_2c, YAXIS = 0, TCOLOR = !F.red, AXIS_TITLE = 'Y title'
	axis_2c, XAXIS = 0, TCOLOR = !F.green, AXIS_TITLE = 'X title'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 27.10.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\axis_2c.pro)


AXLABEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        AXLABEL

 PURPOSE:
        Put previously calculated axis labels onto the screen
        at proper position. This routine was designed to work 
        together with LOGLEVELS to produce fancy log plots.
        It involves several coordinate transformations in order
        to be device independent and take into account the 
        character size. The user can specify a label format
        and use 'external' formatting functions similar to
        the [XYZ]TICKFORMAT keyword of PLOT.

 CATEGORY:
        General Graphics

 CALLING SEQUENCE:
        AXLABEL,Value [,/XAxis] [,keywords]

 INPUTS:
        VALUE -> A vector with the values to be labelled on the 
             axis.

 KEYWORD PARAMETERS:
        /XAxis -> If set, the labels are placed on the X achis
             rather than on the Y axis

        /YAxis -> Place the labels on the Y axis (this is the default,
             and this keyword is there for purely aesthetic reasons)

        CHARSIZE -> The character size of the label

        FORMAT -> An IDL format string (used as argument to the
              STRING function) or the name of a function that returns
              formatted labels. This function must accept three
              arguments, the third of which is the current value
              (see the online help to [XYZ]TICKFORMAT for more details).
              AXLABEL always passes 0 to the first two arguments.

        _EXTRA  keywords are passed on to XYOUTS (e.g. COLOR or
              ORIENTATION). Note that the ALIGN keyword value is 
              determined automatically.

 OUTPUTS:
        Axis labels without fuss.

 SUBROUTINES:
        None.

 REQUIREMENTS:
        A DATA coordinate system must be established by a previous
        PLOT command.

 NOTES:
        AXLABEL currently operates only on the left and bottom axes.

 EXAMPLE:
          xrange = [0.3,3.0]   ; define axis range
          yrange = [0.3,3.0]
          plot,[1],xr=xrange,yr=yrange, $   ; do the plot
          	title='Logarithmic X axis, Logarithmic Y axis',$
          	xtickf='(a1)',ytickf='(a1)', /ylog,/xlog
          ; important: turn the tick labeling off with ?tickformat='(A1)'
          xlblv = loglevels(xrange)   ; get nice label values (0.5, 1., 2.)
          ylblv = loglevels(yrange)
          axlabel,xlblv, /xaxis       ; plot the labels
          axlabel,ylblv, /yaxis

 MODIFICATION HISTORY:
        mgs, 10 Sep 1999: VERSION 1.00
        mgs, 23 Sep 1999: - bug fix for log-log plots
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\axlabel.pro)


AXVAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       AXVAL
 PURPOSE:
       Find nice axis values.
 CATEGORY:
 CALLING SEQUENCE:
       v = axval(x1,x2,n)
 INPUTS:
       x1 = Range minimum.                           in
       x2 = Range maximum.                           in
       n = Suggested number of divisions (def=5).    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       v = array of labeled tick positions.          out
 COMMON BLOCKS:
 NOTES:
       Notes: Useful when exact axis and number of ticks
         are both specified.  For this case IDL forces
         labeled ticks to start and end at the axis ends,
         which in general gives poor tick spacing.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 8

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\axval.pro)


AZIMUTH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          azimuth

 PURPOSE:          given a smoothly varying 2d field, AZIMUTH
                   computes the angle between the gradient direction
                   of the field and the y direction (angle measured
                   clockwise).  This is is useful for computing the
                   satellite or solar azimuth angle when all you know
                   are the satellite or solar zenith angles.  For
                   example the relative azimuth at each point in a
                   satellite image is given by

                    relaz=abs(azimuth(satzen,1,1)-azimuth(-sunzen,1,1))

                   which is the angle between the satellite unit
                   vector and the solar ray vector, both projected
                   onto the surface.

 CALLING SEQUENCE:
                   result=azimuth(image,dx,dy)
 INPUT:
    image          smoothly varying image quantity (e.g., solar zenith angle)
    dx             pixel spacing, x direction
    dy             pixel spacing, y direction

 OUTPUT:
    result         angle between grad(image) and downward direction
                   (angle increases clockwise) 
 
 LIMITATION:       the image is fit by a quadratic function of x and y
                   which is analytically differentiated to find the
                   gradient directions.  An image which is not well
                   approximated by a quadratic function may produce
                   weird results.


 EXAMPLE:
   f=cmplxgen(400,400,/center)
   tvim,f,/scale
   f=abs(f)^2      ; should be perfectly fit by a quadratic function
   a=azimuth(f,1,1)
   loadct,5
   tvim,a,scale=2,range=[-180,180,45]

  author:  Paul Ricchiazzi                            apr94
           Institute for Computational Earth System Science
           University of California, Santa Barbara


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\azimuth.pro)


A_AND_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	a_and_b

 PURPOSE:
	This function applies the boolean AND operator to two vectors.
	It returns a vector with those elements which occur in both vectors.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = a_and_b(vec1, vec2)

 INPUTS:
	vec1, vec2: The two vectors to which the AND operation should be applied.

 KEYWORD PARAMETERS:
	/NO_SORT: If set the returned vector is not sorted. However, in that case
		multiple instances of single elements in the shorter of the two input
		vectors will show up in the output vector.

 OUTPUTS:
	This function returns a vector with those elements which occur in both input vectors.
	In the case of an empty output vector, -1 is returned. The elements are sorted in
	increasing order.

 RESTRICTIONS:
	Repeated elements in the input vectors are returned only once in the output vector
	(see example).

 EXAMPLE:
	A = [1, 2, 2, 2, 3, 4, 13, 6, 7, 8, 9, 14, 20]
	B = [0, 2, 2, 4, 6, 10, 12, 13]
	C = a_and_b(A, B) = [2, 4, 6, 13]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.12.97
	History:	29.10.98:	FOR i = 0, ... changed to FOR i = 0L, ...
								debug statement removed
	25.02.2000:	New keyword parameter /NO_SORT

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\a_and_b.pro)


A_NOT_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	a_not_b

 PURPOSE:
	This function applies the negation of the boolean AND operator to two vectors.
	It returns a vector with those elements which occur in the first but not in the second vector.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = a_not_b(vec1, vec2)

 INPUTS:
	vec1, vec2: The two vectors to which the negation of the AND operation should be applied.

 OUTPUTS:
	It returns a vector with those elements which occur in the first but not in the second vector.
	In the case of an empty output vector, -1 is returned.

 RESTRICTIONS:
	Repeated elements in the input vectors are returned only once in the output vector
	(see example).

 EXAMPLE:
	A = [1, 2, 2, 2, 3, 4, 13, 6, 7, 8, 9, 14, 20]
	B = [0, 2, 2, 4, 6, 10, 12, 13]
	C = a_not_b(A, B) = [1, 3, 7, 8, 9, 14, 20]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.12.97
	History:	29.10.98:	FOR i = 0, ... changed to FOR i = 0L, ...
								debug statement removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\a_not_b.pro)


A_OR_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	a_or_b

 PURPOSE:
	This function applies the boolean OR operator to two vectors.
	It returns a vector with those elements which occur in one or the other vector.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = a_or_b(vec1, vec2)

 INPUTS:
	vec1, vec2: The two vectors to which the OR operation should be applied.

 OUTPUTS:
	It returns a vector with those elements which occur in one or the other vector.
	In the case of an empty output vector, -1 is returned.

 RESTRICTIONS:
	Repeated elements in the input vectors are returned only once in the output vector
	(see example).

 EXAMPLE:
	A = [1, 2, 2, 2, 3, 4, 13, 6, 7, 8, 9, 14, 20]
	B = [0, 2, 2, 4, 6, 10, 12, 13]
	C = a_or_b(A, B) = [0, 1, 2, 3, 2, 6, 7, 8, 9, 10, 12, 13, 14, 20]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.12.97
	History:	29.10.98:	debug statement removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\a_or_b.pro)


A_XOR_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	a_xor_b

 PURPOSE:
	This function applies the boolean XOR operator to two vectors.
	It returns a vector with those elements which occur in one or the other vector
	but not in both.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = a_xor_b(vec1, vec2)

 INPUTS:
	vec1, vec2: The two vectors to which the XOR operation should be applied.

 OUTPUTS:
	It returns a vector with those elements which occur in one or the other vector
	but not in both.
	In the case of an empty output vector, -1 is returned.

 RESTRICTIONS:
	Repeated elements in the input vectors are returned only once in the output vector
	(see example).

 EXAMPLE:
	A = [1, 2, 2, 2, 3, 4, 13, 6, 7, 8, 9, 14, 20]
	B = [0, 2, 2, 4, 6, 10, 12, 13]
	C = a_xor_b(A, B) = [0, 1, 3, 7, 8, 9, 10, 12, 14, 20]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.12.97
	History:	29.10.98:	debug statement removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\a_xor_b.pro)


BALLOON_DRAG

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   balloon_drag 

 PURPOSE:   compute drag on shere

 USEAGE:    result=balloon_drag(r,rho,v,cd)

 KEYWORD INPUT:    
   r        balloon radius in meters      (default=1.0 m)
   v        wind velocity (mph)           (default=5 m/s)
   rho      air density                   (default=1.29 kg/m3)
   cd       drag coefficient              (default=0.2)

 NOTE:      1 m/s = 3.60 km/hr = 2.23 mph = 1.94 knots

 OUTPUT:   
 
 result     drag force in newtons 

            
 SOURCE:    Steve Robinson
            NASA/MIT
            stever@space.mit.edu

            Drag on sphere = .5 * Cd * rho * v^2 * pi * r^2

            Cd = function of sphere Reynolds number 
                 (V*2*r)/(kinematic viscosity),
                 but 0.2 should be close.
            
 EXAMPLE:
            r=1. & v=10. & cd=.2
            rho=rhoz(p0=1013.,t0=273.,z=1.,lr=7.)
            print,balloon_drag(r,rho,v,cd)
            
  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\balloon_drag.pro)


BALLOON_LIFT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   balloon_lift 

 PURPOSE:   compute and print lifting capacity of a helium balloon in kg

 USEAGE:    balloon_lift,r=r,volume=volume,alt=alt,pres=pres,temp=temp,lr=lr

 KEYWORD INPUT:    
   r        balloon radius in meters              (default=1.0 m)
   volume   ignor r and use this value for volume (default=4.18 m3)
   alt      altitude in km                        (default=1 km)
   pres     pressure in mb                        (default=1013 mb)
   temp     surface temperature in K              (default=273 K)
   brho     balloon mass density (kg/m2)          (default=0.35 kg/m2)
   bwt      balloon weight (kg)                   (default=10 kg)
   trho     tether mass density (kg/km)           (default=6.25 kg/km, dacron)
   kevlar   if set use kevlar tether at 2.1kg/kg

            rubberized polyvinyl 0.35 kg/m2
            for dacron, 2.4 mm diam, trho=6.25kg/km, 260 lb pull
            for kevlar, 1.5 mm diam, trho=2.1kg/km,  750 lb pull

   english  if set all the above inputs are
            in units of feet or pounds (pounds/sq in for pressure)

 EXAMPLE:   lifting capacity of a 1 m radius helium balloon at an 
            altitude of 1 km. 
      
            rho=rhoz(p0=1013.,t0=273.,z=1.,lr=7.)
            print,balloon_lift(1.,rho)

 EXAMPLE:   lifting capacity of a non-stretching 1 m radius helium
            balloon at an altitude of 1 km.  To prevent the balloon
            from bursting at high altitude the balloon should not be
            filled to full capacity with helium at sealevel. Assume
            the helium retains its sealevel temperature (maybe less
            than ambient).

 balloon_lift,r=1,alt=1

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\balloon_lift.pro)


BARGRAPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        BARGRAPH

 PURPOSE:
        Creates a bar graph from a vector of data points

 CATEGORY:
        2D Graphics

 CALLING SEQUENCE:
        BARGRAPH, DATA, BASELINE [,keywords]

 INPUTS
        DATA -> Vector of data points to be plotted as a bargraph
 
        BASELINE -> Vector of points to be used as a baseline for DATA
             (i.e. Y(I) = DATA(I) + BASELINE(I)).  If BASELINE
             is not specified, its default value will be an
             array of zeroes.

 KEYWORD PARAMETERS:
        OVERPLOT -> /OVERPLOT will not cause the current plot window
             to be erased.  This is useful for producing
             stacked bar plots with successive calls to BARGRAPH.
 
        BARWIDTH -> The width of the bars.  If BARWIDTH is not
            specified, its default value will be 1.0.

        BARCOLOR -> a value or an array containing the colorindex for
            all boxes or each box, respectively. If a single value
            is given, *all* boxes will have this color. If an array 
            is passed that has less elements than there are groups to 
            plot, the remaining colors will be filled with 15 (grey 
            in MYCT standard-scheme).  

        BARLABELS -> A string array of labels to be plotted above each
            bar.  If BARLEVELS may be originally set equal to the
            DATA vector, and it will be converted to the string 
            representation of DATA, using the FORMAT statement 
            contained in L_FORMAT.

        COLOR -> Color index for the plot axes and labels.  Default
            is 1 (which is BLACK for a MYCT color table).

        L_FORMAT -> The FORMAT statement used to convert BARLABELS
            from a numeric array to a string array.

        NO_LABELS -> /NO_LABELS will suppress printing the labels
            contained in the BARLABELS atop each bar.  This is
            useful for producing stacked bar plots.

        XLABELS -> X-axis labels corresponding to each bar.

        YRANGE -> YRANGE keyword for the PLOT command.  If YRANGE is
            not specified then YRANGE will be computed based on the 
            maximum value of the DATA array.  For stacked plots, it 
            is useful to compute YRANGE in the calling program and 
            pass it to BARGRAPH.

        _EXTRA=e -> Passes extra keywords to plot

 OUTPUTS:
        None

 SUBROUTINES:
        None
        
 REQUIREMENTS:
        None

 NOTES:
        (1) This routine has been modified to be more general and 
            more robust than the original version in the IDL 5.0 User's
            Guide (p. 170).

        (2) IDL 5.x array notation [] is now used.

 EXAMPLE:
        (1) Create a simple bar graph with bars of 3 different colors,
            using a baseline of zero.

        BARGRAPH, Data=[1,2,3], BarWidth=1.0, BarColor=[10,11,12]
           XLabels=['Bart', 'Lisa', 'Maggie']

        (2) Use successive calls to BARGRAPH to create a "stacked" bar
            graph with two different data vectors.  The first vector is
            used as the baseline for the second.  The BARLABELS array
            is created from the actual data values.

        Data   = [2,3.5,6,7,2,1]
        Data2  = 0.0*DATA + 2

        BARGRAPH, Data, Xlabels=['A','B','C','D','E','F'], 
        XStyle=1, BarWidth=0.8

        BARGRAPH, Data2, Data, BarWidth=0.8 ,/OverPlot, $
           BarColor=2, BarLabels=Data+Data2, L_Format='(F8.2)'             

 MODIFICATION HISTORY:
        bmy, 18 Nov 1997: VERSION 1.00
        bmy, 19 Nov 1997: VERSION 1.01
        bmy, 29 Apr 1999: VERSION 1.10
                          - added COLOR keyword
                          - eliminated help screen 
                          - enhanced readability & updated comments

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\bargraph.pro)


BARPLOT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  barplot

 PURPOSE:  produce a bar plot

 USEAGE:   barplot

 INPUT:  
   y       bar values fltarr(n)  

 KEYWORD INPUT:
   nbar    number of barplot overlays. Should only be set on the first
           call to BARPLOT

   over    if set, overplot new bar values.  

   dx      width of a bar (default=1).  An individual bar is sized to
           fill a fraction .5*DX/nn of the total plot width, where nn
           is the number of elements in y. Setting DX=2 eliminates
           blank space between adjacent bars.

   xinc    How far to move overplot bars to the left or right of the
           previous bar position (in units of the bar width).  Use
           with NBAR and XOFF to control degree to which overplot
           bars overlap previous bars. A positive value causes latter
           overplots to overlap bars starting from the left and
           finishing on the right. A negative value does the
           opposite.  (default = 0.6666)

   xoff    offset of bar with respect to labeled points on x-axis
           (default=0).  XOFF should be in the argument list and assigned
           to a named variable if NBAR, DX and XINC are used to control 
           bar overlap in multiplots.

           The xaxis labels are located at data coordinates 
           xlab=findgen(nn)+.5, where nn =n_elements(y)

   color   color index used to fill bars

   xtitle  string, x title of plot

   ytitle  string, y title of plot

   title   string, title of plot

   xlabels vector of strings used to label bar groups 

   xlabvec vector of x values at which to put XLABELS.
           if XLABVEC is not set, XLABELS are ploted at points
           .5+findgen(n_elements(xlabels))
           range of XLABVEC 0-1

   grid    if set, draw a y axis grid.  The numerical value of grid 
           is used to set the grid style (1=dotted line)

   yrange  a two element vector specifying the y axis range

   ynozero if set, y range may not include zero if all y values are
           are positive.

   xmargin two element vector specifies left and right margin around plot
           frame in units of character width.  (default = !x.margin)

   ymargin two element vector specifies bottom and top margin around plot
           frame in units of character height.  (default = !y.margin)


 OUTPUT:


 DISCUSSION:
   For best results try to arrange the order of overplots so that larger
   values of y are ploted first. See examples.

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

  loadct,5
  y=randomu(iseed,6)
  color=[.8,.6,.3]*!d.n_colors
  dx=.6
  barplot,y,dx=dx,xlabels=1990+indgen(6),title='test',xtitle='Year',$
      ytitle='power (Watts)',color=color(0),/grid,xoff=xoff,nbar=3
  barplot,y^2,dx=dx,color=color(1),/over,xoff=xoff
  barplot,y^3,dx=dx,color=color(2),/over,xoff=xoff

; A fancier example

  y=randomu(iseed,5) & y=y(sort(y))
  xlabels=['January','February','March','April','May']
  color=[.2,.4,.6,.8]*!d.n_colors
  dx=.32
  barplot,y,dx=dx,xtitle='---- Month ----',$
        ytitle='power (Watts)',color=color(3),yrange=[0,1.],ymargin=[5,7],$
        /grid,xlabels=xlabels,charsize=1.5 ,xoff=xoff,nbar=4
  barplot,y^2,dx=dx,color=color(2),/over,   xoff=xoff
  barplot,y^3,dx=dx,color=color(1),/over,   xoff=xoff
  barplot,y^4,dx=dx,color=color(0),/over,   xoff=xoff
  x_axis,findgen(5)+.5,1.,xtickn=(y+y^2+y^3+y^4)/4,yspace=-1.5,$
         xtitle='----- Cumulative Average -----'
  x_axis,findgen(5)+.5,[1,4],xtitle='Plot Title',yspace=-.5,charsize=1.2,/ext
  legend,'.cSensor\\AVHRR 1\AVHRR 2\GTR-200\PSP',color=color,$
          /clrbox,bg=0,/box,pos=[0.06,0.57,0.23,0.98]

; use with histogram to make nicer histogram plots

  y=randomn(iseed,2000)
  yy=histogram(y,binsize=.5,min=-3)
  yy=yy(0:11)
  xlabel=string(f='(f3.0)',findrng(-3,3,12))
  ;plot,findrng(-3,3,12),yy,/xsty,psym=10  ; compare to this
  barplot,yy,dx=2,color=20,xlabel=['-3','-2','-1','0','1','2','3']
  
 AUTHOR:   Paul Ricchiazzi                        31 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\barplot.pro)


BASECON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BASECON
 PURPOSE:
       Convert a number from one base to another.
 CATEGORY:
 CALLING SEQUENCE:
       out = basecon(in)
 INPUTS:
       in = input number as a text string.         in
 KEYWORD PARAMETERS:
       Keywords:
         FROM=n1    Original number base (def=10).
           From 2 to 36.
         TO=n2      Resulting number base (def=10).
           From 2 to 36.
         DIGITS=n   Minimum number of digits in output.
           If result has fewer then 0s are placed on left.
         GROUP=g    Number of digits to group together (def=all).
           Spaces will be placed between groups.  Useful for
           showing bytes or words for example.
         ERROR=err  error flag:
           0 = ok
           1 = input digit not 0-9 or A-Z.
           2 = FROM base not in the range 2-36.
           3 = TO base not in the range 2-36.
           4 = input digit too big for FROM base.
           5 = input number too big to handle.
 OUTPUTS:
       out = converted number as a text string.    out
         If an error occurs a null string is returned.
 COMMON BLOCKS:
 NOTES:
       Notes: maximum number base is 36.  Example:
         out = basecon('1010',from=2,to=16) gives out='A'.
         May give an array of input values.
 MODIFICATION HISTORY:
       R. Sterner, 5 Mar, 1993
       R. Sterner, 30 Sep, 1993 --- Added DIGITS keyword.
       R. Sterner, 1999 Jun 3 --- Added GROUP keyword.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\basecon.pro)


BC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        bc

 PURPOSE:
        wall to wall cross hairs to help read numbers off of plot
        axis. The graphics function is set to 6 for eXclusive OR.
        This allows the cross hairs to be drawn and erased without
        disturbing the contents of the window.  Hit RMB to exit

 CALLING SEQUENCE:
        bc

 INPUTS/OUTPUTS: none

 RESTRICTIONS:
        Works only with window system drivers.

 CATEGORY:
        Interactive graphics.


 author   Paul Ricchiazzi      April, 1993

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\bc.pro)


BELL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BELL
 PURPOSE:
       Ring terminal bell.
 CATEGORY:
 CALLING SEQUENCE:
       bell, [n]
 INPUTS:
       n = number of rings (def=1).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 20 Oct, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\bell.pro)


BESELK_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		BESELK_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates an approximation to Bessel K functions or their integrals.
 CATEGORY:
		Mathemetical Function (General).
 CALLING SEQUENCE:
		Result = BESELK_MM (X, NI [, /INTEGRAL ])
 INPUTS:
	X
		Numerical, otherwise arbitrary.
	NI
		Scalar, the order of the function.
 OPTIONAL INPUT PARAMETERS:
	EPS
		Allowed relative error.  Default is machine precision.
 KEYWORD PARAMETERS:
	/INTEGRAL
		Switch, if set the integral of the K function from X to infinity is
		calculated.
 OUTPUTS:
		Returns the value(s) of K_ni(X) or, if INTEGRAL is set, of the integral
		of K_ni(t) from X to infinity.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the Kostroun approximation, see NIM 172, 371-374 (1980).
		Calls CAST, DEFAULT, FPU_FIX, ISNUM and TOLER from MIDL.
 MODIFICATION HISTORY:
		Created 1-MARCH-1993 by Mati Meron as BESELK.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to BESELK_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\beselk_mm.pro)


BEST_FFT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BEST_FFT
 PURPOSE:
       Attempts to find size of fastest FFT from given choices.
 CATEGORY:
 CALLING SEQUENCE:
       m = best_fft(n)
 INPUTS:
       n = proposed FFT size.                         in
 KEYWORD PARAMETERS:
       Keywords:
         DELTA=d  The range to search in samples or percent.
           Default = +/-1.
         /PERCENT means DELTA is in percent of n.
         /DOWN  Search from n down to n-DELTA.
 OUTPUTS:
       m = Predicted fastest FFT size within range.   out
 COMMON BLOCKS:
 NOTES:
       Notes: the selection is made based on the prime factors
         of the possible values.  The largest prime factor of
         each candidate is determined and the value with the
         smallest max prime factor is considered the best to use.
         For multiple matches the one with the smallest sum
         of the prime factors is selected.
 MODIFICATION HISTORY:
       R. Sterner, 8 Feb, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\best_fft.pro)


BINARY (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   binary (function)
 PURPOSE:
   This function returns the binary representation
   of a number. Numbers are converted to LONG integers
   if necessary.
 CATEGORY:
   General Programming
 EXAMPLE:
   Binary representation of 11B:
     IDL> print, binary(11B)                                           
     0 0 0 0 1 0 1 1
   If data extraction is used instead of conversion ->
   Binary representation of pi (little endian IEEE representation):
     IDL> print, format='(z9.8,5x,4(1x,8a1))', long(!pi,0), binary(!pi)
     40490fdb      01000000 01001001 00001111 11011011
 AUTHOR:
      Kevin Ivory                           Tel: +49 5556 979 434
      Max-Planck-Institut fuer Aeronomie    Fax: +49 5556 979 240
      Max-Planck-Str. 2                     mailto:Kevin.Ivory@linmpi.mpg.de
      D-37191 Katlenburg-Lindau, GERMANY

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\binary.pro)


BINBOUND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BINBOUND
 PURPOSE:
       For binary image return array with boundary points set to 1.
 CATEGORY:
 CALLING SEQUENCE:
       b = binbound(bin_image)
 INPUTS:
       bin_image = byte binary image (only 0 or 1).   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = array with boundary points set to 1.       out
 COMMON BLOCKS:
 NOTES:
       Notes: The boundary of a binary image is the set of points
         in the image that are 1 and also touch a 0.
         A binary image may be made using logical operators.
         For example, if an image has both positive and negative
         values the boundary between them may be found as
         b = binbound(img gt 0). To put this boundary into
         another image, A, do:
         w = where(b eq 1) & a(w) = 255.
 MODIFICATION HISTORY:
       R. Sterner.  24 June, 1987.
       R. Sterner, 4 Dec, 1989 --- Converted to Sun.
	R. Sterner, 21 Nov, 1991 --- removed a multiply.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\binbound.pro)


BIN_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		bin_data

 PURPOSE:
		This function returns the density function (histogram) of an array
		together with the lower bound values of the single bins.

 CATEGORY:
		MATH

 CALLING SEQUENCE:
		Result = bin_data(Array)

 INPUTS:
		Array:  Data for which the density function will be calculated.

 OPTIONAL INPUTS:
		B_WIDTH = bw:	Set the bin width of the density function. (Default = 1)
		B_MIN = bmin:	Set the lower bound of the first bin. (Default = MIN(array))
		B_MAX = bmax:	Maximum value to consider. (Default = MAX(array))

		see also IDL HISTOGRAM Function

 KEYWORD PARAMETERS:
		/PLOT:	Set this keyword to display a plot of the histogram.

 OUTPUTS:
		The return value of this funktion is a structure of arrays where the
		array dimension n is equal to the number of bins in the density function:
		result.bin	: 		Array with lower bound values of the single bins.
		result.freq	:		Array with frequency of occurrence.
		result.bin_width:	Bin width used to calculate the frequency distribution (scalar).
		In the case that B_MIN > MAX(array) the number -1 is returned.

 OPTIONAL OUTPUTS:
		REV_INDEX = ri:	Set this keyword to a named variable to return the
			reverse index vector of the density function.
		ERROR = err:		Set this keyword to a named variable to return the
			error status of the routine (err = 0: no error; otherwise: err = 1).

 EXAMPLE:
		A = [0.5, 1.5, 1.6, 2.0, 2.3, 2.5, 2.7, 2.9, 3.2, 5.1, 5.6, 5.7, 6.0]
		Result = bin_data(A, B_WIDTH = 2.0, B_MIN = 0.0, /PLOT)

		- The histogram should be plotted

		- HELP, result, /STR
			** Structure <5a844c8>, 3 tags, length=36, refs=1:
			   BIN             FLOAT     Array[4]
			   FREQ            LONG      Array[4]
			   BIN_WIDTH       FLOAT           2.00000

		- PRINT, Result.bin :
		     0.000000      2.00000      4.00000      6.00000		- lower bound of bins
		- PRINT, Result.freq :
    		         3            6            3            1		- frequency of occurrence

 MODIFICATION HISTORY:
		Written by:	F. Holland (ICG-3), 22.09.97.
		Revised: 	F. Holland, 01.06.99.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\bin_data.pro)


BIN_STAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		bin_stat

 PURPOSE:
		This function returns the statistics of a binned data set where the
		partitition of the data set into the different bins is determined by the
		reverse index vector of a preceding call to the IDL HISTOGRAM function.

 CATEGORY:
		MATH

 CALLING SEQUENCE:
       Result = BIN_STAT(Array, Riv, Nobs)

 INPUTS:
		Array:  Data for which the statistical parameters should be calculated.
		Riv:	Reverse Index Vektor from the Functions BIN_DATA or HISTOGRAM
		Nobs:	Number of bins which correspond to the Riv.

 OUTPUTS:
		The return value of this funktion is a structure of arrays where the
		array dimension n is equal to the number of bins in the density function.
		For each bin the statistical parameters mean, stdev, sterr, n, and
		median are returned (tag names: mean, stdev, sterr, n, median).
		If a quantity is not defined (e.g. stdev for only one point in the bin),
		the value !VALUES.F_NAN is returned.

 EXAMPLE:
		A = [0.5, 1.3, 1.5, 1.6, 2.0, 2.5, 2.9, 3.2, 5.1, 5.6, 5.7, 6.0]
		B = [3.1, 2.0, 4.1, 8.2, 1.0, 0.0, 2.2, 5.3, 5.5, 0.7, 7.8, 5.1]
		Result = bin_data(A, B_WIDTH = 2.0, B_MIN = 0.0, REV_INDEX = Riv)
		nobs = N_ELEMENTS(Result.bin(*))
		stat = bin_stat(B, Riv, Nobs)

		HELP, stat, /STR
		** Structure <1855a28>, 7 tags, length=112, refs=1:
			MEAN            FLOAT     Array[4]
			STDEV           FLOAT     Array[4]
			STERR           FLOAT     Array[4]
			N               LONG      Array[4]
			MEDIAN          FLOAT     Array[4]
			MIN             FLOAT     Array[4]
			MAX             FLOAT     Array[4]

		PRINT, stat.mean
			4.35000      2.12500      4.66667      5.10000
		PRINT, stat.stdev
			2.70617      2.29982      3.62261          NAN
		PRINT, stat.n
			4            4            3            1
		PRINT, stat.min
			2.00000      0.000000     0.700000     5.10000

 MODIFICATION HISTORY:
		Written: F. Holland (ICG-3), 22.09.97.
		Revised: F. Holland (ICG-3), 01.06.99.
		14.06.1999:	Function returns now also min and max of dataset.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\bin_stat.pro)


BLEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BLEND
 PURPOSE:
       Sets up weighting array for blending arrays together.
 CATEGORY:
 CALLING SEQUENCE:
       WT = BLEND(N,I1,I2)
 INPUTS:
       N = size of array to make.				  in
       I1, I2 = indices of first and last values to blend.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       WT = weighting array.                                 out
          WT(0:I1) = 0
          WT(I1:I2) = cosine shaped weighting from 0 to 1.
          WT(I2:*) = 1
 COMMON BLOCKS:
 NOTES:
       Notes: to blend arrays A and B: A*(1-WT) + B*WT
         starts with pure A and ends with pure B.
 MODIFICATION HISTORY:
       Written by R. Sterner  6 Jan, 1986.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\blend.pro)


BMP_DEFINITIONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  bmp_definitions

 PURPOSE:
  This function returns the widget_button symbol array

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result=bmp_definitions(name)

 EXAMPLE:
   result=bmp_definitions('play')


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999, June 11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\bmp_definitions.pro)


BOOTSTRAP_MPFITFUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   bootstrap_mpfitfun

 PURPOSE:
   This function does a bootstrap simulation of a (non-linear) fit of
   a given function to a set of data using the mpfitfun function
   (MPFIT, MPFITFUN were provided by Craig Markwardt)

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = BOOTSTRAP_MPFITFUN(MYFUNCT, X, Y, ERR, start_params, ...)

 INPUTS:

   (text copied from from mpfitfun)
   MYFUNCT - a string variable containing the name of an IDL function.
             This function computes the "model" Y values given the
             X values and model parameters.  It should be declared in
             the following way:

             FUNCTION MYFUNCT, X, parms, dparms
               ; X are the independent variable values
               ; parms are the parameter values
               ; dparms - analytical derivative matrix - NOT REQUIRED
               YMOD   = ...
               IF N_PARAMS() EQ 3 THEN $
                 DPARMS = ...  ;; compute derivatives - NOT REQUIRED
               RETURN, YMOD
             END

             The returned array YMOD should be of the same size and
             dimensions as the "measured" Y values.

             See the discussion of AUTODERIVATIVE and MYFUNCT in
             MPFIT.PRO if you wish to compute your derivatives for
             yourself.  AUTODERIVATIVE is accepted by MPFITFUN and
             passed directly to MPFIT.

   X - Array of independent variable values.

   Y - Array of "measured" dependent variable values.  Y should have
       the same data type as X.  The function MYFUNCT should map
       X->Y.

   ERR - Array of "measured" 1-sigma uncertainties.  ERR should have
         the same data type as Y.  ERR is ignored if the WEIGHTS
         keyword is specified.

   START_PARAMS - An array of starting values for each of the
                  parameters of the model.  The number of parameters
                  should be fewer than the number of measurements.
                  Also, the parameters should have the same data type
                  as the measurements (double is preferred).

                  This parameter is optional if the PARINFO keyword
                  is used (see MPFIT).  The PARINFO keyword provides
                  a mechanism to fix or constrain individual
                  parameters.  If both START_PARAMS and PARINFO are
                  passed, then the starting *value* is taken from
                  START_PARAMS, but the *constraints* are taken from
                  PARINFO.

 OUTPUTS:

   Returns a structure array containing the best-fit parameters of
   each bootstrap replication.


 KEYWORD PARAMETERS:

   all input keyword parameters of MPFITFUN are parsed via _EXTRA

   NBOOTSTRAP: number of bootstrap replications (def =10)
   VERBOSE:    if set a message is printed before any call of mpfit
   KEEP_INITIAL:   start every new call of mpfit with the same set
                   of starting values (def: use the result of the
                   last fit, which is normally faster)

 DESCRIPTION:

   The description of MPFITFUN is given in the header of these functions.
   Basically BOOTSTRAP_MPFITFUN repeatatively calls MPFITFUN using a
   bootstrap resanpled input data set and fit a user-supplied model to
   easch set of the user-supplied data.

   The idea of bootstrap is to evaluate errors of the estimated parameters
   when the erros of y are not know precisely or when the model  which
   is fitted does not represent a full description of the dependence
   of y on x. A discussion of bootstrap estimates is givern in the
   references (see below)

 EXAMPLE:

   (text modified from from mpfitfun)

   FUNCTION gauss2, x, p & RETURN, gauss1(x,p[0:2])+p[3] & END
   ;  First, generate some synthetic data
   npts = 200
   x  = dindgen(npts) * 0.1 - 10.                  ; Independent variable
   yi = gauss1(x, [2.2D, 1.4, 3000.]) + 1000.      ; "Ideal" Y variable
   y  = yi + randomn(seed, npts) * sqrt(1000. + yi); Measured, w/ noise
   sy = sqrt(1000.D + y)                           ; Poisson errors

   ; Now fit a Gaussian to see how well we can recover
   p0 = [1.D, 1., 1000., 1234.]                           ; Initial guess
   r = bootstrap_mpfitfun('GAUSS2', x, y, sy, p0, NBOOT = 50)
                                                   ; Fit and replicate 50 times
   HELP, /STR, r
   ; compare all
   PLOT, x, y, PSYM=1
   FOR i=1,50 DO OPLOT, x, GAUSS2(x,r[i].p), COLOR=2
   OPLOT, x, GAUSS2(x,r[0].p), COLOR=3

   FOR i=0,3 DO PRINT, r[0].perror[i], STDDEV(r[1:*].p[i])


   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then the same function is fitted to the
   data (with different starting parameters) to see how close we can
   get.

 REFERENCES:

   For details on bootstrap methods see:
       A.C.Davison and D.V.Hinkley
       Bootstrap methods and their applications
       Cambridge series in statistical  and probabilistical Mathematics
       Cambridge, UK, 1997
   and references therein

   For details on MPFIT see:
   http://cow.physics.wisc.edu/~craigm/idl/fitting.html

 REVISION HISTORY:
       Written         Theo Brauers, Mar 2000
       Corrected
       Revised
       Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\bootstrap_mpfitfun.pro)


BOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		BOX
 VERSION:
		4.0
 PURPOSE:
		Creates an empty plot area, with boundaries defined by XLIMS and YLIMS.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		BOX, XLIMS, YLIMS [, keywords]
 INPUTS:
	XLIMS, YLIMS
		2 dimensional vectors, format: [xmin,xmax] and [ymin,ymax] respectively.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/BORDER
		Switch.  Draws a border around the plot area.  Default - no border.
	/OVER
		Switch.  Creates the plot area over an existing plot.  Default - new
		plot area.
	TRUASP
		Corrects the XLIMS or YLIMS values to yield a 1:1 aspect ratio.
		Accepts six possible character values (only first 2 characters matter):
			'XLO' :  Scale x, keeping lowest x-value constant.
			'XCEN':  Scale x, keeping center x-value constant.
			'XHI' :  Scale x, keeping highest x-value constant.
			'YLO' :  Scale y, keeping lowest y-value constant.
			'YCEN':  Scale y, keeping center y-value constant.
			'YHI' :  Scale y, keeping highest y-value constant.
	/UPDATE_LIMS
		Switch.  If set, XLIMS and YLIMS are updated to the values used in
		plotting.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.  See comment in RESTRICTIONS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		If UPDATE_LIMS is set, the values of XLIMS, YLIMS may change.
 RESTRICTIONS:
		The keywords passed through _EXTRA are transferred to the PLOTS
		routine.  No keyword verification is performed by BOX.
 PROCEDURE:
		Uses calls to CAST, and STRMATCH_MM from MIDL.  The scaling is done
		using the sizes of the plotting area in device coordinates, provided by
		the  system variables !d.x_vsize and !d.y_vsize.  Therefore the scaling
		is always proper for the current output device.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-DEC-1991 by Mati Meron.  Added keyword COLOR.
		Modified 15-DEC-1993 by Mati Meron.  Now BOX takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Modified 1-MAY-1995 by Mati Meron.  Improved aspect ratio correction.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\box.pro)


BOX1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BOX1
 PURPOSE:
       Single mouse button interactive box on image display.
 CATEGORY:
 CALLING SEQUENCE:
       box1, x, y, dx, dy
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE         Work in device coordinates (default).
         /NORMAL         Work in normalized coordinates.
         /DATA           Work in data coordinates.
         COLOR=clr       Box color.  -2 for dotted box.
         DXRANGE=dxr     X size range [min, max].
         DYRANGE=dyr     Y size range [min, max].
         SHAPE=shp       If given box shape is locked: Shape=dy/dx.
         /NOSTATUS       Inhibits status display widget.
         TEXT=txt        Text array to display in status widget.
         MENU=txtarr     Text array with exit menu options.
           Def=['OK','Abort','Continue'].  'Continue is added.'
         /NOMENU         Inhibits exit menu.
         EXITCODE=code.  0=normal exit, 1=alternate exit.
           If MENU is given then code is option index.
         SETSTAT=st      May use the same status display widget on
           each call to box1 (stays in same position).
           On first call: the status widget structure is returned.
           Following calls: send st.  Must use with /KEEP.
           To delete status display widget after last box1 call: 
             widget_control,st.top,/dest (or drop /KEEP)
         /KEEP           Do not delete status widget on exit.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Jan 10
       R. Sterner, 1995 Mar 22 --- Added /NOMENU option.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\box1.pro)


BOX2B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BOX2B
 PURPOSE:
       Simple two mouse button interactive box on image display.
 CATEGORY:
 CALLING SEQUENCE:
       box2b, x1, x2, y1, y2
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /STATUS  means display box size and position.
         MENU=txtarr     Text array with exit menu options.
           Def=['OK','Abort','Continue'].  'Continue is added.'
         /NOMENU         Inhibits exit menu.
         EXITCODE=code.  0=normal exit, 1=alternate exit.
           If MENU is given then code is option index.
         /YREVERSE makes y=0 be the top line.
 OUTPUTS:
       x1, x2 = min and max X.   out
       y1, y2 = min and max Y.   out
 COMMON BLOCKS:
 NOTES:
       Notes: Works in device coordinates.
         Drag open a new box.  Corners or sides may be dragged.
         Box may be dragged by clicking inside.
         Click any other button to exit.
         A returned value of -1 means box undefined.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Nov 10
       R. Sterner, 1998 Feb  5 --- Fixed first erase box problem.
       Better but not perfect.
       R. Sterner, 1998 Jul 21 --- Added List Box Position.
       R. Sterner, 1999 Mar 15 --- Added /YREVERSE keyword.

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\box2b.pro)


BOXAREA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BOXAREA
 PURPOSE:
       Select an area with a box.
 CATEGORY:
 CALLING SEQUENCE:
       boxarea, x1, y1, x2, y2
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FLAG=flg  Exit flag: 0=ok, 1=abort.
 OUTPUTS:
       x1,y1 = first box point.   out
       x2,y2 = second box point.  out
 COMMON BLOCKS:
 NOTES:
       Notes: Open a box by dragging with left mouse button.
         Repeat to get desired box.
         Accept box with middle button.
         Reject box with right button.
         All coordinates are device coordinates.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Oct 31

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\boxarea.pro)


BOXAREA2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       boxarea2

 PURPOSE:
       Select an area with a box.

 CATEGORY:
 PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
       boxarea2, x_1, y_1, x_2, y_2 ,[/flag],[/js],[color=color]

 KEYWORD PARAMETERS:
         FLAG  Exit flag: 0=ok, 1=abort.
         JS  Means X axis is time in Julian seconds. Example:
           x=maken(-2e8,-1.9e8,200) & y=maken(20,30,200)
           z=bytscl(makez(200,200))
           izoom,x,y,z,/js
           boxarea2,/js

 OUTPUTS:
       x_1,y_1 = first box point.   out
       x_2,y_2 = second box point.  out


 PROCEDURE:
       Notes: Open a box by dragging with left mouse button.
              Return by right button
         All coordinates are device coordinates.

 MODIFICATION HISTORY:
       R. Sterner, 1995 Oct 31
       R. Bauer, 1996, April 1   changed for data coordinates


 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.
1998-Mar-11 return variables changed
   1999-Nov-06 help added
 2000-Mar-13 color keyword added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\boxarea2.pro)


BOXONMAP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:
   BOXONMAP, derived from IDL User Library Procedure BOX_CURSOR

 PURPOSE:
   Emulate the operation of a variable-sized box cursor (also known as
   a "marquee" selector).

 CATEGORY:
   Interactive graphics.

 CALLING SEQUENCE:
   BOXONMAP, wx0, wy0, wx1, wy1 [, INIT = init] [, FIXED_SIZE = fixed_size]

 INPUTS:
  No required input parameters.

 OPTIONAL INPUT PARAMETERS:
 wx0, wy0, wx1, and wy1 give the initial location of the lower left
       (wx0, wy0) and upper right (wnx, wny) corners of the box if the
 keyword INIT is set.  Otherwise, the box is initially drawn in the
 center of the screen.  Both input and output parameters are in
       Longitude (X) and Latitude (Y).

 KEYWORD PARAMETERS:
 INIT:  If this keyword is set, wx0, wy0, wx1, and wy1 contain the
       initial parameters for the box.

 FIXED_SIZE:  If this keyword is set, the initial parameters fix the
 size of the box.  This size may not be changed by the user.

 MESSAGE:  If this keyword is set, print a short message describing
 operation of the cursor.

 OUTPUTS:
 wx0:  X value (Lon) of lower left corner of box.
 wy0:  Y value (Lat) of lower left corner of box.
 wx1:  X value (Lon) of upper right corner of box.
 wy1:  Y value (Lat) of upper right corner of box.

 The box is also constrained to lie entirely within the window.

 COMMON BLOCKS:
 None.

 SIDE EFFECTS:
 A box is drawn in the currently active window.  It is erased
 on exit.
       A window for display of numeric latitude and longitude is created.
       It is destroyed on exit.

 RESTRICTIONS:
 Works only with window system drivers.

 PROCEDURE:
 The graphics function is set to 6 for eXclusive OR.  This
 allows the box to be drawn and erased without disturbing the
 contents of the window.

 Operation is as follows:
 Left mouse button:   Move the box by dragging.
 Middle mouse button: Resize the box by dragging.  The corner
  nearest the initial mouse position is moved.
 Right mouse button:  Exit this procedure, returning the
        current box parameters.

 MODIFICATION HISTORY:
 DMS, April, 1990.
 DMS, April, 1992.  Made dragging more intutitive.
 NFH, March, 1993,  Warp box & use map coordinates,
                          display Lat & Lon in text box.
 PJR/ESRG, March, 1994, display lat & lon in xmessage window

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\boxonmap.pro)


BOXPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        BOXPLOT

 PURPOSE:
        This procedure produces a box and whisker plot of a data
        vector and provides many options to customize the appearance
        of the plots. The data can be supplied as one vector and the
        statistics will be computed according to the group
        index. Alternatively, the data can be supplied as
        precalculated percentile values if the Is_Percentile flag is
        set. Boxes may be plotted staggered along the x axis or the y
        axis.

 CATEGORY:
        2D Graphics

 CALLING SEQUENCE:
        BOXPLOT, DATA [,GROUP=] [,MINGROUP=]  $
                 [,MAXGROUP=] [,LABEL=]       $
                 [,COLOR=] [,BOXCOLOR=]      $
                 [,BOXWIDTH=] [,BOXPOSITION=]      $
                 [,MEDIANCOLOR=] [,MEDIANTHICK=]$
                 [,MEANSYMBOL=]    $
                 [,MEANCOLOR=] [,FILLCOLOR=] $
                 [,MISSING=] [,MIN_VALID=]         $
                 [,MAX_VALID=] [,PRINTN=]           $
                 [,CHARSIZE=] [,OVERPLOT=]          $
                 [,VERTICAL=]                              $
                 [,ORIENTATION=] [,IS_PERCENTILE=]  $
                 [,PERCVAL=] [,QUIET=]

 INPUTS:
        DATA  --> The data vector. This can be an array of 
           any dimensions but is always treated as 1-dimensional
           vector. If the Is_Percentiles keyword is set, data must be
           an array of dimensions 5,N, where the first dimension
           denotes the percentile values.

 KEYWORD PARAMETERS:
        GROUP --> array of the same dimension as DATA which
           contains grouping information. One box is plotted for
           each group. If MINGROUP or MAXGROUP are given, boxes and
           whiskers are only plotted for group values within this
           range. Group can also be a string array. In this case
           MINGROUP and MAXGROUP make no sense of course.
           If GROUP contains more than 28 values, the major tick
           marks will no longer be aligned with the groups and a
           warning message is printed.

        MINGROUP --> the minimum group value for which a box
           shall be plotted.

        MAXGROUP --> the maximum group value for which a box
           shall be plotted

        LABEL --> Label values for different *groups*.
           NOTE: The user must take care that one label is passed for
           each group to be plotted. If label is not specified, the
           group values will be used as axis labels. Note that
           group itself can be a string array.

        COLOR --> plotting color for axis (default: !P.Color).

        BOXCOLOR --> color of the boxes (frames). Default
           is the COLOR value, i.e. !P.COlor if not specified. This
           color will also be used as default for MEDIANCOLOR and
           MEANCOLOR. Set BoxColor to a negative value to suppress
           the box outlines. In this case the default for MEDIANCOLOR
           and MEANCOLOR will be the COLOR value.

        BOXWIDTH --> Width of boxes relative to major tick
           marks (default: 0.8). 

        BOXPOSITION --> Position of boxex relative to tick
           marks on x axis (default: 0.). This parameter is useful
           together with the OVERPLOT keyword in order to plot
           multiple groups of boxes in one graph. 

        MEDIANCOLOR --> a color value for the median bar
           (default: value of BOXCOLOR)

        MEDIANTHICK -> thickness of the median line

        MEANSYMBOL --> symbol to be used for mean values. If no
           symbol is given, no mean values will be drawn.

        MEANCOLOR --> color for mean symbols (default:
           value of BOXCOLOR) 

        FILLCOLOR --> a value or an array containing the
           colorindex for all boxes or each box, respectively. If a
           single value is given, *all* boxes will be filled with
           this color. If an array is passed that has less elements
           than there are groups to plot, the remaining colors will
           be filled with the default background color (!P.background). 
           If no FILLCOLOR is specified, the boxes will not be filled
           at all. 

        MISSING --> a value that represents missing data. If
           given, any data with a value of missing will be filtered
           out before plotting. 

        MIN_VALID -> any data below this value will be ignored
           from the analysis.

        MAX_VALID -> any data above this value will be ignored
           from the analysis.

        PRINTN --> print number of elements on top of each
           box/whisker. 

        CHARSIZE --> character size of the PRINTN labels
           (default: 0.8) 

        OVERPLOT --> do not draw a new coordinate system but
           overlay new data. For 2 sets of data it is recommended to
           use BOXWIDTH=0.4 and BOXPOSITION=-0.25 and 0.25,
           respectively. 

        ORIENTATION -> orientation for axis labels (see XYOUTS
           procedure) 

        VERTICAL -> Set this keyword to have boxes staggered
           along y axis (i.e. boxes are horizontal).

        IS_PERCENTILE --> data are already processed
           percentiles. In this case data must be an array with
           dimensions 5,N. The GROUP keyword is ignored, and each set
           of the N percentiles will be treated as one group.

        PERCVAL --> percentile values (default: 0.05, 0.25,
           0.5, 0.75, 0.95). See the percentiles function for
           deatils. This keyword has only effect if Is_Percentile is
           not set. 

        QUIET -> suppress printing of statistics for each
           group.

        _EXTRA keywords are passed to the PLOT routine and can be used
        to determine the appearance of the plot (e.g. XTITLE,YTITLE,
        YSTYLE,YRANGE,/YLOG,COLOR,THICK,FONT)

 OUTPUTS:

 SUBROUTINES:
        xboxplot : produces plot with groups along x axis
        yboxplot : produces plot with boxes along y axis

 REQUIREMENTS:
        function PERCENTILES is called and must either be compiled
        or located in the IDL_PATH

 NOTES:

 EXAMPLE:
            o3 = data(where(header eq 'O3'),*)
            alt = data(where(header eq 'ALT'),*)
            ialt=2.*fix(alt/2.)
            boxplot,o3,group=ialt

         produces a boxplot with ozone percentiles in altitude bins of
         2 (km). Axis, box frames and labels will be plotted in the
         default color, boxes are not filled.

            boxplot,o3,group=ialt,fillc=15,meansym=sym(1),meancol=2, $
                 boxwidth=0.6,ytitle='O3',xtitle='alt. bin',  $
                 missing=-999.99,/printn

         produces boxes that are filled with color index 15 and have the
         frame and median line in the default color. The mean values
         are deonted by a circle filled with color index 2. 
         Titles are assigned to the x and y axis. The number of valid 
         observations is printed on top of each box. The boxes are
         reduced in size.

            co = data(where(header eq 'CO'),*)
            boxplot,o3,group=ialt,missing=-999.99,boxcol=4, $
                 boxwidth=0.4,boxpos=-0.25
            boxplot,co,group=ialt,missing=-999.99,boxcol=2, $
                 boxwidth=0.4,boxpos=+0.25,/overplot

         produces a plot with different colored box frames for ozone
         and CO data.
            

 MODIFICATION HISTORY:
        mgs, 30 Jul 1997: VERSION 1.00
        mgs, 03 Aug 1997: added template
        mgs, 27 Nov 1997: some revisions and suggested changes by T.Brauers:
             - better color handling (NOTE: meaning of BOXCOLOR has changed)
             - optional overlay of mean value
             - box frames
             - variable boxwidth
             - error fixing lower upper boundaries in log plots
             - bug fix with label keyword
             - added OVERPLOT and BOXPOSITION keywords
        mgs, 22 Jan 1998: added IS_PERCENTILE keyword to allow
               plotting of data that has been processed already
        mgs, 17 Apr 1998: 
             - x-axis handling improved (now uses axis command and xyouts)
             - orientation and medianthick keywords added
        mgs, 21 May 1998:
             - added percval keyword
        mgs, 24 Aug 2000:
             - changed copyright to open source
             - changed default colors to system values
             - improved documentation and modernized code
             - bug fix: n_elements instead of keyword_set
             - added min_valid, max_valid, and quiet keywords
             - added vertical keyword, thus yboxplot is obsolete
             - [] array notation throughout

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\boxplot.pro)


BOXPOS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   boxpos
 USEAGE:
            result=boxpos()
            result=boxpos(aspect=aspect,rmarg=rmarg,xpos=xpos,ypos=ypos,$
                         get=get,curbox=curbox,print=print)

 PURPOSE:   returns the 4 element position of a properly shaped data window.
            output is in normalized coordinates

 INPUT:

    none required

 keyword input:

    aspect       x/y aspect ratio of map (default = 1)

    rmarg        the amount of margin to leave on the right side of the
                 box.  The margin is specified in units of 10 character
                 widths, so merely setting the RMARG parameter provides
                 enough space for COLOR_KEY

    get          if set, retrieve the position information of the last
                 plot drawn. 
 
    xpos         two element vector specifying x position of a multi frame
                 plot,  the first element specifies the frame number, the
                 second element specifies the number of frames
                
    ypos         two element vector specifying y position of a multi frame
                 plot, the first element specifies the frame number, the
                 second element specifies the number of frames

    print        if set, print out the normal coordinates of the box
                 edges in format,
                                   pos=[x0,y0,x1,y1]

                 where (x0,y0) and (x1,y1) are the normal coordiates
                 of the lower left and upper right corners of the box
                 The default value of PRINT is 1 if the CURSOR keyword
                 is set.

                
 OUTPUT:
                 result=[x1,y1,x2,y2], 
                 where (x1,y1) and (x2,y2) are the lower left hand
                 and upper right hand corner of the new data window
                 in normalized coordinates.
                 
 EXAMPLE:        Draw a map over a TVIM image

     tvim,dist(200)
     map_set,0,0,/orth,/cont,/grid,pos=boxpos(/get),/noerase

                 Draw a map of the southern hemisphere with 2:1 aspect
                 ratio

     map_set,-90,0,/orth,/cont,/grid,pos=boxpos(aspect=2)
                  
                    now try a 1:1 aspect ratio

     map_set,-90,0,/orth,/cont,/grid,pos=boxpos(/aspect)

                  now allow room for color key, and draw color key

     map_set,-90,0,/orth,/cont,/grid,pos=boxpos(/aspect,/rmarg)
     color_key


                Draw a multframe plot 
 
     x=findgen(100)
     plot,x,x,pos=boxpos(aspect=1,ypos=[3,3])
     plot,x,x^2,pos=boxpos(aspect=1,ypos=[2,3]),/noerase
     plot,x,x^3,pos=boxpos(aspect=1,ypos=[1,3]),/noerase


;    NOTE: the XMULTI and YMULTI proceedures (in this directory) can
;          also be used to make multiframe plots and are more flexible
;          than BOXPOS for positioning the individual frames.

  author:  Paul Ricchiazzi                            25jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\boxpos.pro)


BOX_SIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BOX_SIZE
 PURPOSE:
       Used by MOVBOX to change box size using the cursor.
 CATEGORY:
 CALLING SEQUENCE:
       BOX_SIZE, x, y, dx, dy, showflag
 INPUTS:
       x,y = lower left corner device coordinates.    in
 KEYWORD PARAMETERS:
       Keywords:
         /POSITION prints box position and size on exit.
         XSIZE = factor.  Mouse changes Y size, computes X size.
         YSIZE = factor.  Mouse changes X size, computes Y size.
         /YREVERSE means y is 0 at screen top.
         XFACTOR=xf convsersion factor from device coordinates
           to scaled coordinates.
         YFACTOR=yf convsersion factor from device coordinates
           to scaled coordinates.
         DXMIN=dxmn  Minimum allowed box x size (def=1).
         DYMIN=dymn  Minimum allowed box y size (def=1).
         COLOR=clr  Box color (-2 for dotted box).
 OUTPUTS:
       dx, dy = box size.                             in, out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  25 July, 1989.
       R. Sterner, 16 Mar, 1992 --- upgraded box list.
       R. Sterner,  7 Dec, 1993 --- Added min box size.
       R. Sterner, 1994 Nov 27 --- Switched !err to !mouse.button.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\box_size.pro)


BREAK_LINES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  break_lines

 PURPOSE:
   This function breaks the linesin a string array into multiple records if the record is longer
   than the reclength parameter. By default, the break is always located at
   [' ','+','/','(',')','|'] charackters.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=break_lines(Str, Reclength, [LIST=list] )

 INPUTS:
   Str       : array of (string) records
   Reclength : maximum recordlength allowed

 KEYWORD PARAMETERS:
   LIST:   a list of locations where a break might occur
           default: [' ','+','/','(',')','|']

 OUTPUTS:
   Result:  string array with string length of all elements less than revlength

 EXAMPLE:
   str_new=break_lines(['a=3+45+87/15;','b=3;'],10)
   print,transpose(str_new)
   gives :
   a=3+45+87
   /15;
   b=3;

 MODIFICATION HISTORY:
   Written by: Franz Rohrer 1998-Jan-15
   Modified:   Theo Brauers, 1999-Jan-7
               new keyword list

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\break_lines.pro)


BUILD_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	build_structure

 PURPOSE:
	This routine accumulates values into a structure or concatinates two structures

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   build_structure,structure,declaration,value,[name=name],[/random_structure_name],[/counted_structure_name]

 INPUTS:
   structure : if it's present the structure which will be accumulated to
   declaration: the tag which will be added to the structure
   value  : the value which will be added to the structure

 KEYWORD PARAMETERS:
    name: to set the Structure name
    random_structure_name: if set the structure name is performed by random_hex_name()
    counted_structure_name: if set the structure name is performed by count_name(name)

 OUTPUTS:
	structure: A structure holding value

 EXAMPLE:
   build_structure,def,'test',5
   help,test,/str
** Structure <117e2f8>, 1 tags, length=2, refs=1:
   TEST            INT              5
   build_structure,def,'AN',5
   help,def,/str
** Structure <117ec88>, 2 tags, length=4, refs=1:
   TEST            INT              5
   AN              INT              5


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-27
   1999-02-23 Problem if tag is alread defined in structure by is_tag resolved
   1999-03-16 random_structure_name added
   1999-03-20 counted_structure_name added
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\build_structure.pro)


BUILD_VECTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	build_vector

 PURPOSE:
	This routine accumulates values into a vector

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   build_vector,vector,value

 INPUTS:
   vector : if it's present the vector which will be accumulated to
   value  : the value which will be added to the vector

 OUTPUTS:
	vector: A vector holding value

 EXAMPLE:
   build_vector,test,5
   print,test
   5

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\build_vector.pro)


BYT2STRARR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BYT2STRARR
 PURPOSE:
       Unpack a string array from a byte array
 CATEGORY:
 CALLING SEQUENCE:
       byt2strarr, barr, tarr
 INPUTS:
       barr = byte array with text.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       tarr = text string array.      out
 COMMON BLOCKS:
 NOTES:
       Notes: The format of barr is:
         byte 0: NUM = Number of strings (255 max).
         byte 1: MAX = Length of longest string (255 max).
         byte 2: LEN1 = Length of 1st string.
         byte 3: C1_0 = 1st char of 1st string.
         byte 4: C1_1 = 2nd char of 1st string.
         byte 5: C1_2 = 3rd char of 1st string.
         . . .
         byte x1 (2+LEN1): C1_last = last char of 1st string.
         byte x1+1: LEN2 = Length of 2nd string.
         . . .
         To last char of last string in tarr.
         NUM, MAX, LEN1, C1, C2, ..., Clast, LEN2, C1, C2, ...
       
         Advantage: saves space, allows storing text arrays of
         various lengths.  See also strarr2byt, the inverse.
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 29

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\byt2strarr.pro)


BYTARR_GET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BYTARR_GET
 PURPOSE:
       Extract a byte array from a byte buffer.
 CATEGORY:
 CALLING SEQUENCE:
       bytarr_get, buf, out
 INPUTS:
       buf = byte buffer to extract output from.  in
 KEYWORD PARAMETERS:
       Keywords:
         INDEX=indx  Index of byte array to extract:
           0=1st, 1=2nd, ...  Returned by bytarr_put
           array was inserted.  Out of range indices return
           a single 0 byte (no error).
         The inverse routine, bytarr_put, is used to insert
         arrays into the buffer.
         You must handle converting from byte to correct
         data type when extracting.
 OUTPUTS:
       out = byte array extracted from buffer.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 30

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\bytarr_get.pro)


BYTARR_PUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BYTARR_PUT
 PURPOSE:
       Insert a byte array into a byte buffer.
 CATEGORY:
 CALLING SEQUENCE:
       bytarr_put, buf, in
 INPUTS:
       in = byte array to add to buffer.   in
 KEYWORD PARAMETERS:
       Keywords:
         INDEX=indx  Returned index of inserted byte array:
           0=1st, 1=2nd, ...  Can be used with bytarr_get to
           retrieve a given array.
         ADDRESS=a  returned byte address into buffer for in.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: To start set input buffer b to 1 element:
         b = [0B] before using in bytarr_put.
         Can use this routine to build up an array of
         variable lengths arrays, or pack arrays of any data
         type together in a compact form.  Must convert input
         to a byte array first using field extraction.  Ex:
         a=indgen(10) & b=byte(a,0,2*n_elements(a)) will create
         an int array and convert it to a byte array.
         The inverse routine, bytarr_get, allows extraction by
         index number (1st input is 0, 2nd is 1, ...).
         You must handle converting from byte when extracting.
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 30

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\bytarr_put.pro)


BYTES2STRARR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   bytes2strarr

 PURPOSE:
   This function convertes a byte array to a string array
   cut at the LF character (10B), all CR (13B) are removed

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=BYTES2STRARR(Bytes)

 INPUTS:
   Bytes:  bytearray

 KEYWORD PARAMETERS:
   REMOVE_10B: if set 10b is removed

 OUTPUTS:
   an string array containing the text converted from bytearrary

 EXAMPLE:
   b=GET_FILE('....', /BYTE)
   s=BYTES2STRARR(b)

 REVISION HISTORY:
   Written         Theo Brauers, June 1997
   Modified by     R.Bauer, F.Rohrer, 1998-Nov-10 added REMOVE_10B

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\bytes2strarr.pro)


CACHE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cache

 PURPOSE:
   This procedure is used to remember previously loaded data from file for the last plot;

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   cache,plot,file,x,y,z,[i_xn=i_xn],[i_yn=i_yn]

 INPUTS:
   plot:    The by pl_init defined structure plot
   file:    The filename of the netCDF file
   x:       The name of parameter x
   y:       The name of parameter y
   z:       The name of parameter z

 OPTIONAL INPUTS:
   i_xn: number of x page position
   i_yn: number of y page position

 OUTPUTS:
   x:       Structure
   y:       Structure
   z:       Structure

  All structures of the same tag names:

  .name               : the name of the parameter
  .file               : the filename of the file
  .param              : the param field
  .valid              : the valid field
  .time               : the time field
  .param_long_name    : the long_name of the parameter
  .param_units        : the units of the parameter
  .time_long_name     : the long_name of the time
  .time_units         : the units of the time



 COMMON BLOCKS:
   plot_data
         pl_data: A structure holding parameters, names, titles and the file name of a loaded dataset


 EXAMPLE:
  cache,plot,file,x,y,z,i_xn=i_xn,i_yn=i_yn

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cache.pro)


CACHE_DEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   cache_del

 PURPOSE:
   This procedure clears the common block plot_data variable pl_data

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   cache_del


 COMMON BLOCKS:
   plot_data: This is the common block where file and data information for plot2d and plotxy are saved


 EXAMPLE:
   cache_del

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cache_del.pro)


CACHE_ENZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       cache_enz

 PURPOSE:
       Read-cache for enz-files

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       cache_enz,file,dvalue,ix,iy,fb,text,header,err

 INPUTS:
       file: name of enz-file

 KEYWORD PARAMETERS:
       js_time   : time values in julian seconds, calculated with appropriate dvalue-columns
       errmess   : error message text
       fill_value: fill value for non-existing data
       nocache   : to supress generation of *.sav-file

 OUTPUTS:
       dvalue: matrix of values, field[ix,iy]
       ix    : number of rows
       iy    : number of columns
       fb    : errorbar-flag for compatibility with zusammen-files, should be 0 for enz-files
       text  : array of headertext of columns
       header: raw header information
       err   : file read error flag

 SIDE EFFECTS:
       stores and restores information in the file filename.enz.sav

 EXAMPLE:
       cache_enz,'test.enz',dvalue,ix,iy,fb,text,header,err,js_time=js_time,fillvalue=-12345

 MODIFICATION HISTORY:
       Written         Franz Rohrer, May 1997
       Modified: 25.9.1998  renamed fillvalue in fill_value
                            included nocache
                 10.11.1998 FR file_info used to determine time difference
                 16.03.1999 FR file=file_in included
                 06.06.1999 FR if result2[0] eq '' and result1[0] ne '' then dt=10 else begin
                            damit das sav-file auch eingelesen wird, wenn kein Original vorhanden ist

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\cache_enz.pro)


CACHE_ZUS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       cache_zus

 PURPOSE:
       Read-cache for zus-files

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       cache_zus,file,dvalue,ix,iy,fb,text,header,err

 INPUTS:
       file: name of zus-file

 KEYWORD PARAMETERS:
       js_time  : time values in julian seconds, calculated with appropriate dvalue-columns
       errmess  : error message text
       fillvalue: fill value for non existing data
       high_err : upper end of errorbar
       low_err  : lower end of errorbar

 OUTPUTS:
       dvalue: matrix of values, field[ix,iy], errorbars are taken out and stored in high_err and low_err
       ix    : number of rows
       iy    : number of columns
       fb    : errorbar-flag, should be 0 for enz-files
       text  : array of the headertext of columns
       header: raw header information
       err   : file read error flag

 SIDE EFFECTS:
       stores and restores information in file filename.zus.sav

 EXAMPLE:
       cache_zus,'test.zus',dvalue,ix,iy,fb,text,header,err,js_time=js_time,fillvalue=-12345,high_err=high_err,low_err=low_err

 MODIFICATION HISTORY:
       Written         Franz Rohrer, May 1997
       Corrected

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\cache_zus.pro)


CALCTYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CALCTYPE
 VERSION:
		4.0
 PURPOSE:
		Identifies maximal (and, optionally) minimal data type for calculation.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = CALCTYPE( V_0 [,V_1, ... V_7] [, VALUE = VAL])
 INPUTS:
	V_0 through V_7
		Numeric, otherwise arbitrary, at least one should be given.  If the
		keyword /STRICT is set, unsigned integers of all lengths are not
		considered numerical.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/TYPES
		Switch.  If set, the V_i parameters are taken to represent data types
		of inputs rather then the inputs themselves.
	/MAXTYP
		Switch.  If set, the numerically *highest* of the data types is
		returned.  This is the default, so there is really no need to set
		/MAXTYP, it is just provided for completeness.
	/MINTYP
		Switch.  If set, the numerically *lowest* of the data types is
		returned.
	DEFAULT
		Accepts an integer value to be used as default type for those input
		variables which happen to be undefined.  If not given, undefined
		inputs result in error.
	/EXACT
		Switch.  Disables the resetting of lower value to 4 and higher to 9
		when the inputs types are 5,6.  Has no impact in other cases.
	/STRICT
		Switch.  If set, unsigned integers are *NOT* considered numbers.
	/QUIET
		Switch.  Determines error handling.  See OUTPUTS below.
 OUTPUTS:
		If the data types of all inputs (or the inputs themself, when /TYPES
		is set) correspond to valid numeric types (excluding unsigned integers
		if /STRICT is set), CALCTYPE returns the numerically highest (or, if
		/MINTYP is set, numerically lowest) of the types present.  Note that
		the numeric order of the types is (excluding unsigned types):

				1, 2, 3, 14, 4, (5-6), 9

		As neither of (5,6) is equivalent or higher to the other, in case the
		inputs are of types 5 and 6, the return value is 9 (for higher) or 4
		(for lower) unless /EXACT is set.

		The types of unsigned integers (when accepted) are converted to these
		of signed ones of same length.

		The types of undefined inputs are converted to DEFAULT if given, else
		are left at 0 (which is *not* a valid numeric type).

		If some of the data types do not correspond to valid numeric types,
		the outcome depends on the /QUIET switch.  If /QUIET is set, the
		routine returns 0, else it stops with an error message.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		All the V_i present have to be valid numeric inputs (or numeric data
		types) else an error results (unless /QUIET is set).
 PROCEDURE:
		Straightforward.  Using ISNUM and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 15-FEB-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\calctype.pro)


CALC_AV_RESIDUAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       calc_av_residual

 PURPOSE:
       calculate geometric average of residuals

 CATEGORY:
       MATH

 CALLING SEQUENCE:
       calc_av_residual,x,y,a,b

 INPUTS:
       x,y : x/y data dublets
       a,b : offset and slope of line

 OUTPUTS:
       returns geometric average of residuals =mean( sqrt(sum((y-a-b*x)^2)/n) )

 EXAMPLE:
       calc_av_residual,x,y,a,b

 MODIFICATION HISTORY:
       Written         Franz Rohrer, May 1997
       Corrected

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\calc_av_residual.pro)


CALC_BIN_AVERAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_bin_averages

 PURPOSE:
   This function calculates averages of y-values for given x-intervals

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   result=calc_bin_averages(x,y[,log=log][,number=number][,min=min][,max=max])

 INPUTS:
   x:vector of x-values
   y:vector of y-values

 OUTPUTS:
   result.occurrence   :number of occurrencies
         .mean         :mean of y-data inside bin-interval
         .stddev       :standard deviation of y-data inside bin-interval
         .position     :average x-position of bin-intervals
         .left         :left margins of bin-intervals
         .right        :right margins of bin-intervals
         .binposition  :average of left and right margins

 KEYWORD PARAMETERS:
   log   : make equidistant bins on a logarithmic scale
   number: number of bins, default=10
   min   : left margin,  default=MIN(x)
   max   : right margin, default=MAX(x)

 EXAMPLE:
   x=findgen(1000) & y=randomn(seed,1000)
   r=calc_bin_averages(x,y)
   print,r.position,r.mean,format='(10f12.7)'
   49.5000000 149.5000000 249.5000000 349.5000000 449.5000000 549.5000000 649.5000000 749.5000000 849.5000000 949.5000000
   -0.0238803   0.0346891  -0.0060972  -0.0419993   0.1417571  -0.0071263   0.0606227   0.1793810   0.0087501   0.0297610

 MODIFICATION HISTORY:
 	Written by:	F. Rohrer (ICG-3), 1998-Nov-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\calc_bin_averages.pro)


CALC_GEOMETRY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_geometry

 PURPOSE:
   This function calculates the area and volume of a different geometrical
   figures which are stacked into/onto another.

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CALC_GEOMETRY(X)

 INPUTS:
   X:  the thicknes of one layer of the figures, can be a single value, all
       layer are of the same thickness, or an array. The length of this array
       defines the size of the output structure array. If n_elements(x) ==1
       then the num_box keyword is tested.

 OPTIONAL INPUTS:
   Y:  see GEOMETRY keyword
   Z:  see GEOMETRY keyword

 KEYWORD PARAMETERS:

   KDIFF:    set this keyword to a number or array with same elements as X  the kd in
               all layers will be set to the number or array (default=0.0)

   GEOMETRY: possible options:

           'SPHERE':   concentric spheres
                       volume and area are calculated from the thickness input
                       only, Y and Z are disregarded

           'TUBE':     concentric cylinders, no length
                       volume and area are calculated from the thickness input
                       If Y is given it is taken as length of the tubes and
                       Z are disregarded

           'BARREL':   concentric barrels, length is total lenght if y is scalar
                       if Y is vector then these values are taken.
                       volume and area are calculated from the thickness and length
                       input, Z is disregarded

           'CUBE':     concentric cubes
                       volume and area are calculated from the thickness input
                       only, Y and Z are disregarded

           'COLUMN':   stacked boxes, if Y is area and volume, is calcualted

           'UNKNOWN':  Y and Z are area and volume, if not
                       provided they are set to 1.D0 in all boxes

   NUM_BOX:  number of boxes in a equal layer thickness model, if x is provided
             as a scalar value

 OUTPUTS:
   This function returns an array of structure which contains the thickness , the
   area, and the volume. Result.ar[k] is the area between layer k and k+1.
   Result.vl[k] is the volume of layer[k]

 EXAMPLES:
   In order to calculate the volume and area of a 4m cube surrounded by a
   4.2m cube one has to enter the following function call:

   IDL> x=calc_geometry([2.,.1 ], g='cube') & print, x & help, x,/str
   {       2.0000000       64.000000       96.000000    0.0000 }
   {      0.10000000       10.088000       105.84000    0.0000 }
   ** Structure <1062420>, 3 tags, length=24, refs=1:
      DH              DOUBLE           2.0000000
      VL              DOUBLE           64.000000
      AR              DOUBLE           96.000000

   A set of 10 concentric spheres of .05m layers is calculated

   IDL> x=calc_geometry(.05D, g='sphere', n=10) & print, x[0:1],  x[9]
   {     0.050000000   0.00052359879     0.031415927    0.010000 }
   {     0.050000000    0.0036651915      0.12566371    0.010000 }
   {     0.050000000      0.14189527       3.1415927    0.010000 }

   note that the diameter of the last sphere is 1m corresponding to
   a surface area of 3.1415..m


 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-Feb-5
   Modified:   T.B.        1998-FEB-6
                           calc of cube/ tube / barrel corrected

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_geometry.pro)


CALC_LINEAR_INTERPOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_linear_interpol

 PURPOSE:
   This functions calls the linear interpolation for TIMES_SERIES_SYNC

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CALC_LINEAR_INTERPOL(client_t, client_v, master_t)

 INPUTS:
   Client_t:   client time array
   Client_v:   client value array
   Master_t:   master time array

 KEYWORD PARAMETERS:
   FILL_VALUE:  value for missing entries in the output array
   ERROR:      if set to a named variable an error status is returned (0: OK)

 OUTPUTS:
   This function returns an array of the interpolated values

 EXAMPLE:
   see TIME_SERIES_SYNC

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_linear_interpol.pro)


CALC_LINEAR_WITH_LIMIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_linear_with_limit

 PURPOSE:
   This functions performs the linear interpolation with time limits for TIMES_SERIES_SYNC

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CALC_LINEAR_WITH_LIMIT(client_t, client_v, master_t, master_w)

 INPUTS:
   Client_t:   client time array
   Client_v:   client value array
   Master_t:   master time array

 KEYWORD PARAMETERS:
   FILL_VALUE:  value for missing entries in the output array
   ERROR:      if set to a named variable an error status is returned (0: OK)

 OUTPUTS:
   This function returns an array of the interpolated values

 EXAMPLE:
   see TIME_SERIES_SYNC

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_linear_with_limit.pro)


CALC_NUMBER_FREQUENCY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_number_frequency
 PURPOSE:
   This function calculates the frequencies of the first digit of numbers
 CATEGORY:
   MATH
 CALLING SEQUENCE:
   result=calc_number_frequency(arr)
 INPUTS:
   arr: array of numbers
 OUTPUTS:
   result: frequency distribution of the first digits
 EXAMPLE:
   arr=[1.2,0.0122222,200]
   print,calc_number_frequency(arr),format='(f45.2)'
    0.00 0.67 0.33 0.00 0.00 0.00 0.00 0.00 0.00 0.00
 MODIFICATION HISTORY:
 	Written by:	F. Rohrer (ICG-3), 1998-Nov-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\calc_number_frequency.pro)


CALC_PROP_INTERPOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_prop_interpol

 PURPOSE:
   This functions performs the proportional interpolation for TIMES_SERIES_SYNC

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CALC_PROP_INTERPOL(client_t, client_v, master_t, master_v)

 INPUTS:
   Client_t:   client time array
   Client_v:   client value array
   Master_t:   master time array
   Master_v:   master value array

 KEYWORD PARAMETERS:
   FILL_VALUE:  value for missing entries in the output array
   ERROR:      if set to a named variable an error status is returned (0: OK)

 OUTPUTS:
   This function returns an array of the interpolated values

 EXAMPLE:
   see TIME_SERIES_SYNC

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_prop_interpol.pro)


CALC_SOLAR_ZENITH_ANGLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_solar_zenith_angle

 PURPOSE:
   This function calcutes the solar zenith

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result = calc_solar_zenith_angle(time, longitude, latitude)

 INPUTS:
   Time:       julian seconds or string [d.m.y h:m:s] or [yyyy-mm-dd hh:mm:ss]
               (Julian Sec =0 : 2000-JAN-1 0:00:00 UTC)
   Longitude:  eastern longitude
   Latitude:   northern latitude

 KEYWORD PARAMETERS
   STRUCTURE:  if set a structure with input and output params will be returned as structure

 OUTPUT:
   This functions returns an array of solar zenith angles or a structure
   including the input parameters

 PROCEDURE:
   This set of routines is based on Yoshio Kubo, Rep. of Hydrographic Res. No. 15 1980
   Sun position for 1970 - 2030 (see calc_sun_pos for details)

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1998
   Modified    Theo Brauers, June 1999
               bugs removed !!!!

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_solar_zenith_angle.pro)


CALC_SPLINE_INTERPOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_spline_interpol

 PURPOSE:
   This functions call the spline interpolation for TIMES_SERIES_SYNC

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CALC_SPLINE_INTERPOL(client_t, client_v, master_t)

 INPUTS:
   Client_t:   client time array
   Client_v:   client value array
   Master_t:   master time array

 KEYWORD PARAMETERS:
   FILL_VALUE:  value for missing entries in the output array
   ERROR:      if set to a named variable an error status is returned (0: OK)

 OUTPUTS:
   This function returns an array of the interpolated values

 EXAMPLE:
   see TIME_SERIES_SYNC

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_spline_interpol.pro)


CALC_SUN_POS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_sun_pos

 PURPOSE:
   This function calcutes the declination or right ascension of the sun

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result = calc_sun_pos(jdf, [/RIGHT_ASCENSION] , [/DECLINATION])

 INPUTS:
   Jdf: julian day with fractions of day

 KEYWORD PARAMETERS:
   RIGHT_ASCENSION:    if set only right ascension will be returned
   DECLINATION:        if set only declination be returned

 OUTPUTS:
   Result:     sun positions given in degrees

 EXAMPLE:

 PROCEDURE:
   This set of routines is based on
   Yoshio Kubo, Rep. of Hydrographic Res. No. 15 1980
   Sun position for 1970 - 2030
   ( copied from MFC199m source code, GETMOON2.C, GETMOON.C, ..)
   typed by K. Pfeilsticker 13.9.1989)

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_sun_pos.pro)


CALC_UNIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	calc_unit

 PURPOSE:
 This function returns a structure with the result and other informations to calculate with units

 CATEGORY:
  MATH

 CALLING SEQUENCE:
   Result=calc_unit(value,inunit,outunit)

 INPUTS:
   value:   one or an array of values that should be transformed
   inunit:  The input unit of the value
   outunit: The output unit of the result

 EXAMPLE:
   result=calc_unit(5,'ppb','ppt')
   help,result,/str
   ** Structure <302d43bc>, 5 tags, length=32, refs=1:
      PARAM_UNITS_IN  STRING    'ppb'
      PARAM_UNITS_OUT STRING    'ppt'
      PARAM           INT              5
      RESULT          FLOAT           1000.00
      FUNC            STRING    '*1.e-09/1.e-12'

 MODIFICATION HISTORY:
  Written by:	R.Bauer (ICG-1), August , 12 1997
  1998-01-14  additional: seconds since 2000-01-01 00:00:00 UTC
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\calc_unit.pro)


CALC_WINDOW_AVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   calc_window_average

 PURPOSE:
   This functions performs the averaging over the provided tme windows for TIME_SERIES_SYNC

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = calc_window_average(client_t, client_v, master_t, master_w)

 INPUTS:
   Client_t:   client time array
   Client_v:   client value array
   Master_t:   master time array
   Master_w:   master window array

 KEYWORD PARAMETERS:
   FILL_VALUE:  value for missing entries in the output array
   ERROR:      if set to a named variable an error status is returned (0: OK)

 OUTPUTS:
   This function returns an array of the window averaged values

 EXAMPLE:
   see TIME_SERIES_SYNC

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\calc_window_average.pro)


CALC_ZENITH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	calc_zenith

 PURPOSE:
   This function calculates zenith and azimuth angle for a given location/time

 CATEGORY:
	MATH

 CALLING SEQUENCE:
   zenit=calc_zenith(js,long,lat,azimuth=azimuth)

 INPUTS:
       date:    the speciefied day; scalar string
       time:    the time in UT    ; scalar string
       long:    longitude of the geograhical position; scalar float
       lat:     latitude  of the geograhical position; scalar float

 OUTPUTS:
       zenith : zenith angle
       azimuth: azimuth angle

 PROCEDURE:
  This function is based on the publication by Sirri Aydinli,
  Fortschrittberichte der VDI-Zeitschriften (Fortschr.Ber. VDI-Z.), 1981, Reihe 6, Nr.79, p5-12,
  'Ueber die Berechnung der zur Verfuegung stehenden Solarenergie und des Tageslichtes'

 EXAMPLE:
   print,calc_zenith(str2js('12:00:00 08.11.1996'),6.35,50.92)
     67.9200

   print,calc_zenith(str2js('12:00:00 28.10.1997'),0.,0.)
     13.1800
     sollte 13.819 sein nach Ralf's astronomischen Tabellen

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer August 1998
   Modified  : 9.11.1998 FR, calc_zenit->calc_zenith,zenit->zenith,azimut->azimuth

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\calc_zenith.pro)


CALL_HELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	call_help

 PURPOSE:
	The result of this function is the text below CALLING SEQUENCE from a called routine

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=call_help()

 EXAMPLE:
   message,call_help(),/info

 MODIFICATION HISTORY:
 	Written by	R.Bauer (ICG-1), 1999-Nov-06
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\call_help.pro)


CAPTION

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  caption

 PURPOSE:  CAPTION can be used to print captions above or below a
           figures.  The character size is determined by the number
           of characters per line.  

 USEAGE:   caption,cap,xx,ybot=ybot,yt=ytop,nchar=nchar

 INPUT:    

   cap     string used for caption.  Normally all text within CAP 
           is line wrapped to produce a multiline caption. All
           white space within CAP is preserved in the caption.
           Within CAP the character "\" can be used to force a line
           break (i.e., to start a new line).  Extra white space
           following the "\" causes the text to be indented.

           t='this is a test \     junk test test'+$
             ' \     junk test \ \    junk: this is a test'

           caption,t

                             PRODUCES:

           this is a test
                junk test test
                junk test

                junk: this is a test

           Note that the backslash character must be surrounded by
           whitespace to be recognized

  
   xx      normal coordinates of left and right edge of caption
   

 KEYWORD INPUT:

   ytop       normal coordinates of top of caption
              (default=!y.window(0)-.15)

   nchar      number of characters per line

   vspace     vertical space factor, controls vertical space between
              lines (default = 1)

   bg_color   background color

   color      foreground color

   exdent     number of character positions to indent all lines except
              the first. (default=0)

   nowrap     if set do not line wrap the input text, instead use
              embedded backslash characters to control line breaks.

 KEYWORD OUTPUT:

   ybot       normal coordinates of bottom of caption. The value of
              of ybot can be used append more text with another call
              to CAPTION.

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

    t1='CAPTION can be used to print captions above or below a '+$
      'figures.  The character size is determined by the number '+$
      'of characters per line.   here is a list of items: \ '+$
      '     1. item 1 \ '+$
      '     2. item 2 \ '+$
      'END OF FIRST CAPTION
       
    t2='BEGINNING OF SECOND CAPTION \ HERE is more text to add to  '+$
      'the previous text. Note how the  '+$
      'text starts immediately below the last line of the previous  '+$
      'written text. The use of ybot allows concatenation of text with  '+$
      'different right and left margins'
       
    w8x11 & !p.multi=[0,1,2]
    plot,dist(10)
       
    caption,t1,nchar=80,ybot=yy
    xwid=.5*(!x.window(1)-!x.window(0))
    xmid=.5*(!x.window(0)+!x.window(1))
    caption,t2,xwid+.5*[-xwid,xwid],nchar=40,ytop=yy

;; FILL option

    t= 'HERE is more sample text to demonstrate the use of CAPTION''s, '+$
       '"fill" option.  Note how the text is stretched to fill the '+$
       'entire width of the line.  It is probably a good idea not '+$
       'to force linebreaks using the backslash symbol while in this '+$
       'mode.  The "fill" option works best when NCHAR is large'
        
    erase
    caption,t,[.1,.9],ytop=.9,/fill,nchar=80
       
;; CAPTION used with READ_TEXT 

   caption,read_text('caption.txt','Figure 1.'),nchar=60
  

 AUTHOR:   Paul Ricchiazzi                        12 Mar 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\caption.pro)


CAST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CAST
 VERSION:
		4.0
 PURPOSE:
		Generalized type casting.  Converts variables whose type code is out
		of the range [LO,HI] into this range.
 CATEGORY:
		Programming (type conversion).
 CALLING SEQUENCE:
		Result = CAST( X, [LO [,HI]])
 INPUTS:
	X
		Numerical, arbitrary (see /STRICT for possible limitations).
	LO
		Number representing a type code, range (1:15).  If out of this range,
		an error results.  If not given, it is set to 1.
 OPTIONAL INPUT PARAMETERS:
	HI
		Type code, same as LO.  Default value is 9 (note that, though higher
		number codes exist, 9 corresponds to the "numerically highest" type).
		If HI is provided and corresponds to a "numerically lower" type than
		LO, it is set to LO.
 KEYWORD PARAMETERS:
	/STRICT
		Switch.  If set, unsigned values are not accepted as numbers.
	/ROUND
		Switch.  If set AND the casting is to any integer type, rounding is
		performed prior to type casting.
	/FIX
		Switch.  If set, the output is filtered through FPU_FIX, eliminating
		floating underflow errors.
 OUTPUTS:
		If the type of X is < LO, CAST returns X converted to type LO.
		If the type of X is > HI, CAST returns X converted to type HI.
		Otherwise CAST returns X.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		And attempt to call CAST with non-numerical input or with type codes
		not corresponding to known numerical codes, will yield an error.
 PROCEDURE:
		Identifies the type of X, and if out of the range given by [LO,HI]
		calls the proper conversion routine using the system routine
		CALL_FUNCTION.  The "range" follows the numerical order of types, i.e.

				1, 2, 3, 14, 4, (5-6), 9

		Unsigned types (Uint, Ulong, Ulong64) are either ignored (if /STRICT
		is set) or converted to the signed types of same length.

		CAST uses CALCTYPE, FPU_FIX and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 25-DEC-1991 by Mati Meron.
		Modified 15-JUN-1995 by Mati Meron to accept the new DOUBLECOMPLEX type.
		Modified 25-SEP-1998 by Mati Meron.  Underflow filtering added.
		Modified 25-DEC-2000 by Mati Meron.  Added keyword ROUND.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.
		Totally rewritten by Mati Meron, on 15-FEB-2001, to accomodate all new
		numeric types.  Added keyword STRICT.  Eliminated type conversion for
		CHARACTER type as it serves no useful purpose.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\cast.pro)


CATALOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   catalog

 PURPOSE:
   This procedure writes the html catalog files

 CATEGORY:
  CASE_TOOLS

 CALLING SEQUENCE:
   catalog,[path],[/no_examples],[/no_error],[/no_mail],[out_path=out_path],[/publish]

 EXAMPLE:
   catalog

 MODIFICATION HISTORY:
 Written by:     R.Bauer (ICG-1), 1997
 new version: 2000-Jan-25
 2000-Feb-08 get_template_one_value keywords added
 2000-Apr-02 examples now without dbase and example icon

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\catalog.pro)


CATALOG_DB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   catalog_db

 PURPOSE:
   This procedure writes the html catalog database files and the tar and sav files of the routines

 CATEGORY:
  CASE_TOOLS

 CALLING SEQUENCE:
   catalog_db,[path],[out_path=out_path]

 INPUTS:
  path: the routine path to search routines

 PROCEDUE:
  idl_work and idl_model are the routine directories which will be scanned by resolve_dependencies.
  with the key /no_publish all our routine directories will be scanned


 MODIFICATION HISTORY:
 Written by:     R.Bauer (ICG-1), 1997
 new version: 2000-Jan-25
 2000-Feb-08 : get_template_one_value keywords added
 2000-Jun-18 : link files sampled in a script and this will executed at the end of the routine
 catalog_db,['j:/links/idl_source/idl_work','j:/links/idl_source/idl_model'],out_path='j:\links\idl_source\'
 catalog_db,['/usr/local/icg/icg/idl_test/idl_source/idl_work','/usr/local/icg/icg/idl_test/idl_source/idl_model'],out_path='/usr/local/icg/icg/idl_test/idl_source'

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\catalog_db.pro)


CBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CBAR
 PURPOSE:
       Make a color bar.
 CATEGORY:
 CALLING SEQUENCE:
       cbar
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         VMIN=vmn  Minimum value of color bar parameter (def=0).
         VMAX=vmx  Maximum value of color bar parameter (def=top).
         CMIN=cmn  Color that represents vmn (def=0).
         CMAX=cmx  Color that represents vmx (def=top).
           where top = !d.table_size-1.
         CCLIP=cc  Actual max color index allowed (def=!d.table_size-1)
         /HORIZONTAL Colors vary horizontally (def).
         /VERTICAL   Colors vary vertical.
         /BOTTOM   Horizontal axis on bottom (def).
         /TOP      Horizontal axis on top.
         /RIGHT    Vertical axis on right (def).
         /LEFT     Vertical axis on left.
         Plus all keywords accepted by PLOT.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Bar is positioned using the POSITION keyword.
         To display a title use TITLE and so on.
 MODIFICATION HISTORY:
       R. Sterner, 13 Dec, 1993
       R. Sterner, 1994 Jul 5 --- Added axis positioning.
       R. Sterner, 1995 Dec 10 --- Allow position to be in device coords.
       R. Sterner, 1995 Dec 18 --- Fixed to not clobber current xy scaling.
       R. Sterner, 1996 Dec  9 --- Added CCLIP keyword.
       R. Sterner, 1998 Jan 23 --- Added charthick keyword.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cbar.pro)


CED1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CED1
 PURPOSE:
       Simple widget to edit a single color table entry.
 CATEGORY:
 CALLING SEQUENCE:
       ced1, index
 INPUTS:
       index = color table index to edit.   in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=txt  Title text to display.
         /HSV  means work in Hue, Saturation, and Value
           coordinates (def=Red, Green, Blue).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 29 Oct, 1993
       R. Sterner, 29 Oct, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ced1.pro)


CENTERTLB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CENTERTLB

 PURPOSE:

       This is a utility routine to position a widget program
       on the display at an arbitrary location. By default the
       widget is centered on the display.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Utilities

 CALLING SEQUENCE:

       CenterTLB, tlb, [x, y, /NOCENTER]

 REQUIRED INPUTS:

       tlb: The top-level base identifier of the widget program.

 OPTIONAL INPUTS:

       x:  Set this equal to a normalized position for the center
       of the widget as measured from the left-hand side of the screen.
       The default value is 0.5 (the center)  Setting this equal to 1.0
       places the widget at the far right-hand side of the screen.

       y:  Set this equal to a normalized position for the center
       of the widget as measured from the bottom of the screen.
       The default value is 0.5 (the center) Setting this equal to 1.0
       places the widget at the top of the screen.

 KEYWORDS:

      NOCENTER:  By default, the center of the widget is positioned at the
      location specified by the x and y parameters.  If NOCENTER is set
      to a non-zero value, then the upper left corner of the widget
      is postioned at the specifed location.

 PROCEDURE:

       The program should be called after all the widgets have
       been created, but just before the widget hierarchy is realized.
       It uses the top-level base geometry along with the display size
       to calculate offsets for the top-level base that will center the
       top-level base on the display.

 COMMENT:
       Regardless of the values set for x, y and NOCENTER, the widget
       is not permitted to run off the display.

 MODIFICATION HISTORY:

       Written by:  Dick Jackson, 12 Dec 98.
       Modified to use device-independent Get_Screen_Size
            function. 31 Jan 2000. DWF.
       Added x, y, NOCENTER and run-off protection. 26 Jan 2001. BT.

###########################################################################

 LICENSE

 This software is OSI Certified Open Source Software.
 OSI Certified is a certification mark of the Open Source Initiative.

 Copyright © 1998-2000 Fanning Software Consulting

 This software is provided "as-is", without any express or
 implied warranty. In no event will the authors be held liable
 for any damages arising from the use of this software.

 Permission is granted to anyone to use this software for any
 purpose, including commercial applications, and to alter it and
 redistribute it freely, subject to the following restrictions:

 1. The origin of this software must not be misrepresented; you must
    not claim you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation
    would be appreciated, but is not required.

 2. Altered source versions must be plainly marked as such, and must
    not be misrepresented as being the original software.

 3. This notice may not be removed or altered from any source distribution.

 For more information on Open Source Software, visit the Open Source
 web site: http://www.opensource.org.

###########################################################################

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\centertlb.pro)


CGM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CGM
 PURPOSE:
       Toggles graphics redirection to a *.cgm file on or off.
 CATEGORY:
 CALLING SEQUENCE:
       cgm, [file]
 INPUTS:
       file = optional cgm file name.   in
         Default file name is seconds after midnight, like
         31412.cgm.
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       cgm
 NOTES:
       Notes: Computer Graphics Metafile (CGM) format files are
         useful because they may be imported into word processor
         documents.  An initial color table warning message appears
         to be harmless.
 MODIFICATION HISTORY:
       R. Sterner 2 Dec, 1992
       R. Sterner, 29 Jan, 1993 --- Revised.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cgm.pro)


CHEBCOEF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CHEBCOEF

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Estimate Chebyshev polynomial coefficients of a function on an interval

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   p = CHEBCOEF(FUNC, PRIVATE, FUNCTARGS=functargs, /DOUBLE, /EXPRESSION, $
                PRECISION=prec, ERROR=err, NMAX=nmax, INTERVAL=interval, $
                REDUCE_ALGORITHM=, STATUS=)

 DESCRIPTION:

   CHEBCOEF estimates the coefficients for a finite sum of Chebyshev
   polynomials approximating the function FUNC(x) over an interval.
   The user can choose the desired precision and maximum number of
   chebyshev coefficients.

   This routine is intended for functions which can be evaluated to
   full machine precision at arbitrary abcissae, and which are smooth
   enough to ensure that the coefficients are a decreasing sequence.
   For already-tabulated or potentially noisy data, the routines
   CHEBGRID or CHEBFIT should be used instead.

   The function to be approximated may either be the name of an IDL
   function (the default behavior), or an IDL expression (using the
   /EXPRESSION keyword).

   The procedure uses a modified form of the classic algorithm for
   determining the coefficients, which relies the orthogonality
   relation for Chebyshev polynomials.  The interval [a,b] is
   subdivided successively into sets of subintervals of length
   2^(-k)*(b-a),(k = 0,1,2...). After each subdivision the
   orthogonality properties of the Chebyshev polynomials with respect
   to summation over equally-spaced points are used to compute two
   sets of approximate values of the coefficients cj, one set
   computed using the end-points of the subintervals, and one set
   using the mid-points.  Certain convergence requirements must be
   met before terminating.  If the routine fails to converge with 64
   coefficents, then the current best-fitting coefficients are
   returned, along with an error estimate in the ERROR keyword.
   CHEBCOEF never returns more than 64 coefficients.

   The coefficients may be further refined.  If the keyword
   REDUCE_ALGORITHM is set to a value of 1, then any high order
   coefficients below a certain threshold are discarded.  If
   REDUCE_ALGORITHM is set to 2 (the default), then all coefficients
   below the threshold are discarded rather than just the high order
   ones.  The threshold is determined by the PRECISION keyword.

 INPUTS:

   FUNC - a scalar string, the name of the function to be
          approximated, or an IDL string containing an expression to
          be approximated (if /EXPRESSION is set).

  PRIVATE - any optional variable to be passed on to the function to
            be integrated.  For functions, PRIVATE is passed as the
            second positional parameter; for expressions, PRIVATE can
            be referenced by the variable 'P'.  CHEBCOEF does not
            examine or alter PRIVATE.

 RETURNS:

   An array of Chebyshev coefficients which can be passed to
   CHEBEVAL.  NOTE: the convention employed here is such that the
   constant term in the expansion is P(0)*T0(x) (i.e., the convention
   of Luke), and not P(0)/2 * T0(x).

 KEYWORD PARAMETERS:

   DOUBLE - if set, then computations are done in double precision
            rather than single precision.

   ERROR - upon return, this keyword contains an estimate of the
           maximum absolute error in the approximation.

   EXPRESSION - if set, then FUNC is an IDL expression to be
                approximated, rather than the name of a function.

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by FUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.  By default, no extra parameters
               are passed to the user-supplied function.

   INTERVAL - a 2-element vector describing the interval over which
              the polynomial is to be evaluated.
              Default: [-1, 1]

   NMAX - a scalar, the maximum number of coefficients to be
          estimated.   This number may not exceed 64. 
          Default: 64

   PRECISION - a scalar, the requested precision in the
               approximation.  Any terms which do not contribute
               significantly, as defined by this threshold, are
               discarded.  If the function to be estimated is not
               well-behaved, then the precision is not guaranteed to
               reach the desired level.  Default: 1E-7

   REDUCE_ALGORITHM - a scalar integer, describes how insignificant
               terms are removed from the fit.  If 0, then all terms
               are kept, and none are dicarded.  If 1, then only
               trailing terms less than PRECISION are discarded.  If
               2, then both trailing and intermediate terms less than
               PRECISION are discarded.
               Default: 2

   STATUS - upon return, this keyword contains information about the
            status of the approximation.  A value of -1 indicates bad
            input values; a value of 0 indicates the required
            accuracy was not obtained; a value of 1 indicates
            success.

 EXAMPLE:

   x = dindgen(1000)/100     ; Range of 0 to 10
   p = chebcoef('COS(x)', /expr, interval=[0d, 10d])  ;; Compute coefs
   y = chebeval(x, p, interval=[0d,10d])              ;; Eval Cheby poly
   plot, x, y - cos(x)       ; Plot residuals

 REFERENCES:

   Abramowitz, M. & Stegun, I., 1965, *Handbook of Mathematical
     Functions*, 1965, U.S. Government Printing Office, Washington,
     D.C. (Applied Mathematical Series 55)
   CERN, 1995, CERN Program Library, Function E406
   Luke, Y. L., *The Special Functions and Their Approximations*,
     1969, Academic Press, New York

 MODIFICATION HISTORY:
   Written and documented, CM, June 2001
   Copyright license terms changed, CM, 30 Dec 2001
   Added usage message, CM, 20 Mar 2002
   Changed docs slightly, CM, 25 Mar 2002

  $Id: chebcoef.pro,v 1.6 2002/05/03 18:40:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\chebcoef.pro)


CHEBEVAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CHEBEVAL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Evaluate a Chebyshev polynomial on an interval, given the coefficients

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   y = CHEBEVAL(X, P, INTERVAL=interval, DERIVATIVE=deriv)

 DESCRIPTION:

   CHEBEVAL computes the values of a Chebyshev polynomial function at
   specified abcissae, over the interval [a,b].  The user must supply
   the abcissae and the polynomial coefficients.  The function is of
   the form:

               N
       y(x) = Sum p_n T_n(x*)     x in [a,b]
              i=0

   Where T_n(x*) are the orthogonal Chebyshev polynomials of the
   first kind, defined on the interval [-1,1] and p_n are the
   coefficients.  The scaled variable x* is defined on the [-1,1]
   interval such that (x*) = (2*x - a - b)/(b - a), and x is defined
   on the [a,b] interval.

   The derivative of the function may be computed simultaneously
   using the DERIVATIVE keyword.  

   The is some ambiguity about the definition of the first
   coefficient, p_0, namely, the use of p_0 vs. the use of p_0/2.
   The p_0 definition of Luke is used in this function.

 INPUTS:

   X - a numerical scalar or vector, the abcissae at which to
       evaluate the polynomial.  If INTERVAL is specified, then all
       values of X must lie within the interval.

   P - a vector, the Chebyshev polynomial coefficients, as returned
       by CHEBFIT or CHEBCOEF.

 RETURNS:

   An array of function values, evaluated at the abcissae.  The
   numeric precision is the greater of X or P.

 KEYWORD PARAMETERS:

   DERIVATIVE - upon return, a vector containing the derivative of
                the function at each abcissa is returned in this
                keyword.

   INTERVAL - a 2-element vector describing the interval over which
              the polynomial is to be evaluated.
              Default: [-1, 1]

 EXAMPLE:

   x = dindgen(1000)/100     ; Range of 0 to 10
   p = chebcoef('COS(x)', /expr, interval=[0d, 10d])  ;; Compute coefs
   y = chebeval(x, p, interval=[0d,10d])              ;; Eval Cheby poly
   plot, x, y - cos(x)       ; Plot residuals

 REFERENCES:

   Abramowitz, M. & Stegun, I., 1965, *Handbook of Mathematical
     Functions*, 1965, U.S. Government Printing Office, Washington,
     D.C. (Applied Mathematical Series 55)
   CERN, 1995, CERN Program Library, Function E407
   Luke, Y. L., *The Special Functions and Their Approximations*,
     1969, Academic Press, New York

 MODIFICATION HISTORY:
   Written and documented, CM, June 2001
   Copyright license terms changed, CM, 30 Dec 2001
   Added usage message, CM, 20 Mar 2002

  $Id: chebeval.pro,v 1.5 2002/03/25 06:42:50 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\chebeval.pro)


CHEBFIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CHEBFIT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Fit Chebyshev polynomial coefficients to a tabulated function

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   p = CHEBFIT(X, Y, ERR, INTERVAL=interval, NMAX=nmax,
               PRECISION=prec, /EVEN, /ODD, REDUCE_ALGORITHM=)

 DESCRIPTION:

   CHEBFIT fits a series of Chebyshev polynomials to a set of
   tabulated and possibly noisy data points.  The functions MPFIT and
   CHEBEVAL, available from the above web page, must also be in your
   IDL path for this function to work properly.  The user can choose
   the desired precision and maximum number of chebyshev
   coefficients.

   This function is intended for use on already-tabulated data which
   are potentially noisy.  The user should never expect more than
   NPOINTS terms, where NPOINTS is the number of (x,y) pairs.  For
   functions which can be evaluated to full machine precision at
   arbitrary abcissae, the routine CHEBCOEF should be used instead.
   For exact data tabulated on a regular grid, the routine CHEBGRID
   should be tried.

   The user can also specify that the function is even or odd, using
   the keywords EVEN or ODD.  This saves computation time because
   certain terms in the expansion can be ignored.  For the purposes
   of this function even and odd refer to the symmetry about the
   center of the interval.

   The algorithm is employed in three steps.  In the first step, the
   coefficients are estimated at a crude level.  In the second step,
   it is determined whether certain coefficients are deemed
   "ignoreable", i.e., they do not contribute significantly to the
   function and are discarded.  The operation of this step is
   determined by the REDUCE_ALGORITHM keyword.  Finally, the
   remaining "good" coefficients are re-fitted to achieve the best
   fit.

 INPUTS:

   X, Y - the x- and y- tabulated values to be fitted.

   ERR - (optional) the y-error bar associated with each (x,y) pair.
         Default: 1

 RETURNS:

   An array of Chebyshev coefficients which can be passed to
   CHEBEVAL.  NOTE: the convention employed here is such that the
   constant term in the expansion is P(0)*T0(x) (i.e., the convention
   of Luke), and not P(0)/2 * T0(x).

 KEYWORD PARAMETERS:

   EVEN, ODD - if set, then the fitting routine assumes the function
               is even or odd, about the center of the interval.

   INTERVAL - a 2-element vector describing the interval over which
              the polynomial is to be evaluated.
              Default: [-1, 1]

   NMAX - a scalar, the maximum number of polynomial terms to be
          fitted at one time.
          Default: 16

   PRECISION - a scalar, the requested precision in the fit.  Any
               terms which do not contribute significantly, as
               defined by this threshold, are discarded.  If the
               function to be fitted is not well-behaved, then the
               precision is not guaranteed to reach the desired
               level.
               Default: 1E-7

   REDUCE_ALGORITHM - a scalar integer, describes how insignificant
               terms are removed from the fit.  If 0, then all terms
               are kept, and none are dicarded.  If 1, then only
               trailing terms less than PRECISION are discarded.  If
               2, then both trailing and intermediate terms less than
               PRECISION are discarded.
               Default: 2

 EXAMPLE:

   x = dindgen(1000)/100     ; Range of 0 to 10
   y = cos(x) + randomn(seed,1000)*0.01  ; Function with some noise
   p = chebfit(x, y, interval=[0d,10d])
   plot, x, y - chebeval(x,p, interval=[0d,10d])

 REFERENCES:

   Abramowitz, M. & Stegun, I., 1965, *Handbook of Mathematical
     Functions*, 1965, U.S. Government Printing Office, Washington,
     D.C. (Applied Mathematical Series 55)
   CERN, 1995, CERN Program Library, Function E407
   Luke, Y. L., *The Special Functions and Their Approximations*,
     1969, Academic Press, New York

 MODIFICATION HISTORY:
   Written and documented, CM, June 2001
   Copyright license terms changed, CM, 30 Dec 2001
   Added usage message, CM, 20 Mar 2002
   Slight docs change, CM, 25 Mar 2002

  $Id: chebfit.pro,v 1.6 2002/05/03 18:40:19 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\chebfit.pro)


CHEBGRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CHEBGRID

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Estimate Chebyshev polynomial coefficients of a function on a grid

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   p = CHEBGRID(T, X, [ DXDT, NPOINTS=, NPOLY=, NGRANULE= , $
                RMS=, DRMS=, RESIDUALS=, DRESIDUALS= , $
                XMATRIX=, DXMATRIX=, RESET=, 
                DERIV_WEIGHT= ] )

 DESCRIPTION:

   CHEBGRID estimates the coefficients for a finite sum of Chebyshev
   polynomials approximating a continuous tabulated function over an
   interval.  The function (and optionally its derivative) must be
   tabulated on a regularly sampled grid.  The implementation of this
   function is taken from a method described by X. X. Newhall, used
   in estimating coefficients for ephemerides in the solar system.

   The tabulated function is assumed to be continuous over the entire
   interval.  A Chebyshev series is fitted to the function over small
   segments, called granules.  The size of each granule, the number
   of points in each granule, and the number of Chebyshev polynomials
   are all configurable.

   Users may specify either the function alone, or the function and
   its first derivative.  By also giving the tabulated derivative, a
   more accurate Chebyshev polynomial can be developed.  Aside from
   the constraints mentioned in the next paragraph, the polynomial
   that is returned is the best-fit polynomial in a least-squares
   sense.

   Here is a definition of terms:

      GRANULE - a single continuous fitted segment.  The length of the
         granule, NGRANULE, is specified in units of the tabulated
         grid size.  Because of the continuity requirements developed
         below, granules will always overlap at their endpoints.
         Thus, then length of a granule should be a factor of
         N_ELEMENTS(X)-1.  For simple functions over short intervals,
         the granule size can be equal to N_ELEMENTS(X)-1

      NUMBER OF POINTS the number of points, NPOINTS, within a
         granule to be fitted to the polynomial, not necessarily
         equal to the granule size.  The greater the number of
         points, the more computation time and storage is required.
         This number *must* be a factor of NGRANULE.  Typically
         NPOINTS is a number between 8 and 12.  Because of the
         single-point overlap between granules (see below), the
         actual number of points per fit is NPOINTS+1.

      NUMBER OF POLYNOMIALS the number of Chebyshev polynomial terms,
         NPOLYNOMIAL, to be fitted per granule.  The greater the
         number of polynomial terms, the more computation time and
         storage is required, but also the greater the approximating
         precision of the fit.

   The particular set of Chebyshev polynomial coefficients developed
   by this function have some special properties.  If both the
   function and its derivative are specified, then the value and
   derivative of the interpolating polynomial at the granule
   endpoints will be exactly equal to the tabulated endpoint values.
   This feature allows many approximations to be strung together
   piecewise, and the function value and first derivative will be
   continuous across granule boundaries.

   If only the function value is specified, then only the function
   value will be continuous at the granule endpoints, and not the
   derivative.

   An extensive set of statistics are computed to assess the quality
   of the Chebyshev polynomial fit.  The keywords RESIDUALS and
   DRESIDUALS return the residuals of the fit after subtracting the
   interpolation.  The RMS and DRMS keywords return the root mean
   squared deviations between data and model.

   If the user does not know how many granules, points, or polynomial
   coefficients to use, then he or she should try several
   combinations and see which minimizes the r.m.s. value with the
   fewest number of coefficients.

   If the XMATRIX and DXMATRIX keywords are passed, then CHEBGRID
   attempts to avoid recomputing several of the matrices it uses in
   estimating the coefficients.  If multiple calls to CHEBGRID are to
   be made, some compution time savings can be made.  In the first
   call CHEBGRID the required matrices are computed and returned.  In
   subsequent calls, CHEBGRID detects the XMATRIX and DXMATRIX
   keyword values and uses those values if it can.

   The user can also estimate their own coefficients.  The matrices
   returned are (NPOINTS+1)x(NPOLYNOMIAL).  The coefficients from a
   NPOINTS+1 tabulation, X, are found by:

      PCHEB = XMATRIX ## X  +  DXMATRIX ## DXDT

   if derivative information is known, or

      PCHEB = XMATRIX ## X

   if no derivative information is known.  [ Note: the matrices are
   different, depending on whether derivative information is known or
   not. ]

   
 INPUTS:

   T - array of regularly sampled *independent* variables.  The number
       of elements in T should be a multiple of NGRANULE, plus one.

   X - array of regularly sampled *dependent* variables.  The number
       of elements in X should be equal to the number of elements in
       T.

   DXDT - optionally, a tabulated array of first derivatives of X
          with respect to T, at the same grid points.

 KEYWORD PARAMETERS:

   NGRANULE - size of a "granule", in grid intervals.  NGRANULE must
              be at least 2, and a factor of N_ELEMENTS(T)-1.
              Default: 8

   NPOINTS - number of points per granule that are fitted.  NPOINTS
             must be at least 2, and a factor of NGRANULE. 
             Default: NGRANULE

   NPOLYNOMIAL - number of Chebyshev polynomial terms per fit.
                 NPOLYNOMIAL must be at least 2 and less than
                 2*(NPOINTS+1), when derivative information is
                 specified; or less than NPOINTS+1, when no
                 derivative information is specified.
                 Default: 7

  RESIDUALS - upon return, an array of size N_ELEMENTS(T), with
              residuals of the tabulated function minus the
              interpolated function.

  DRESIDUALS - same as RESIDUALS, but for the function's first
               derivative.

  RMS - upon return, the root mean square of the function value
        residuals.

  DRMS - same as RMS, but for the function's first derivative.

  XMATRIX - upon return, the matrix used to compute Chebyshev
            polynomial coefficients from the function value.

            Upon input, CHEBGRID determines if XMATRIX will apply to
            the data, and if so, XMATRIX is reused rather than
            computed.  If XMATRIX cannot be reused, then it is
            computed afresh, and the new value is returned in the
            XMATRIX keyword.

            The user should not modify the contents of the is array.

  DXMATRIX - same as XMATRIX, but for the function's first
             derivative.

  RESET - if set, force a recomputation of XMATRIX and/or DXMATRIX.

  DERIV_WEIGHT - amount of weight to give to function derivative,
                 relative to the function value.
                 Default: 0.16d


 RETURNS:

   An array of coefficient values.  The dimensions of the array are
   NPOLYNOMIALxNSEGS, where NSEGS is the number of granules in the
   entire interval.


 EXAMPLE:

   ;; Estimate Chebyshev coefficients for the function SIN(X), on the
   ;; interval [-1,+1].  
   xx = dindgen(9)/4d - 1d   ;; Regular grid from -1 to 1 (9 points)
   yy = sin(xx)              ;; Function values, sin(x), ...
   dy = cos(xx)              ;; ... and derivatives

   ;; Estimate coefficients using CHEBGRID (single granule of 8 intervals)
   p = chebgrid(xx, yy, dy, npoints=8, ngranule=8, npoly=10)

   xxx = dindgen(1001)/500 - 1d   ;; New grid for testing
   res = sin(xxx) - chebeval(xxx, p)
   plot, xxx, res

   ;; Same as example above, except extended range to [-1, +15],
   using eight granules.
   xx2 = dindgen(65)/4d - 1
   yy2 = sin(xx2)
   dy2 = cos(xx2)
   p = chebgrid(xx2, yy2, dy2, ngranule=8, npoint=8, npoly=10)
   help, p
       P               DOUBLE    = Array[10, 8]
   ;; (i.e., 10 polynomial coefficients over 8 granules)


 REFERENCES:

   Abramowitz, M. & Stegun, I., 1965, *Handbook of Mathematical
     Functions*, 1965, U.S. Government Printing Office, Washington,
     D.C. (Applied Mathematical Series 55)
   Newhall, X. X. 1989, Celestial Mechanics, 45, p. 305-310

 MODIFICATION HISTORY:
   Written, CM, Feb 2002
   Documented, CM, 24 Mar 2002
   Corrected documentation, CM, 28 Apr 2002

  $Id: chebgrid.pro,v 1.3 2002/05/02 07:00:43 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\chebgrid.pro)


CHEBYSHEV_POL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CHEBYSHEV_POL
 VERSION:
		4.0
 PURPOSE:
		Calculates Chebyshev polynomials Tn and associated functions.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = CHEBYSHEV_POL( X, N, [ /ASSOCIATED])
 INPUTS:
	X
		Numeric, absolute values must be <= 1, otherwise arbitrary.
	N
		Nonnegative scalar, rounded to integer on input.  Defaults to 0.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/ASSOCIATED
		Switch.  When set, an associated function, SIN(N*ARCCOS(X)) is returned.
 OUTPUTS:
		Returns the values of the Chebyshev polynomial T(n,x), defined as
		COS(N*ARCCOS(X)) or (when ASSOCIATED is set), the values of the
		associated Chebyshev function, SIN(N*ARCCOS(X)).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other then the restrictions on X, and N as mentioned above.
 PROCEDURE:
		Using the mathematical definition.  Calling DEFAULT and FPU_FIX from
		MIDL.
 MODIFICATION HISTORY:
		Created 20-DEC-1994 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\chebyshev_pol.pro)


CHECK5

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CHECK5
 PURPOSE:
       Check if running IDL version 5 or greater.
 CATEGORY:
 CALLING SEQUENCE:
       flag = check5()
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       flag = 0 if false, 1 if true.   out
 COMMON BLOCKS:
 NOTES:
       Notes: Useful to check if the current IDL version
       supports features from version 5 or greater.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Jan 23

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\check5.pro)


CHECKER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CHECKER
 PURPOSE:
       Return a checker board pattern array of 0 and 1.
 CATEGORY:
 CALLING SEQUENCE:
       checker, nx, ny, pat
 INPUTS:
       nx, ny = array size in x and y.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       pat = resulting array.              out
 COMMON BLOCKS:
 NOTES:
       Note: an example 4 x 4 array:
            0 1 0 1
            1 0 1 0
            0 1 0 1
            1 0 1 0
 MODIFICATION HISTORY:
       R. Sterner, 30 Dec, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\checker.pro)


CHGCOLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CHGCOLOR

 PURPOSE:
       The purpose of this routine is to allow the user to change
       the color at a particular color index. The user is able to
       mix their own color by manipulating red, green, and blue
       sliders. This routine is ideal for changing axes or background
       colors of a plot, for example. The routine works on 8-bit,
       16-bit, and 24-bit displays.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, Colors.

 CALLING SEQUENCE:
       CHGCOLOR, index

 REQUIRED INPUTS:
       INDEX: The color index to be changed. It must be a value
       between 0 and 255.

 KEYWORD PARAMETERS:

       LABEL: Text that goes next to the color window. The default is
       "Resulting Color".

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       NOTIFYID: A a 2 column by n row array that contains the IDs of widgets
       that should be notified when CHGCOLOR changes a color. The first
       column of the array contains widgets that should be notified. The
       second column contains IDs of widgets that are at the top of the
       hierarch in which the corresponding widgets in the first column
       are located. (The purpose of the top widget IDs is to make it
       possible for the widget in the first column to get the "info"
       structure of the widget program.) An CHGCOLOR_LOAD event will be
       sent to the widget identified in the first column. The event
       structure is defined like this:

       event = {CHGCOLOR_LOAD, ID:0L, TOP:0L, HANDLER:0L, $
          r:(!D.N_COLORS < 256), g:(!D.N_COLORS < 256), b:(!D.N_COLORS < 256)}

       The ID field will be filled out with NOTIFYID(0, n) and the TOP
       field will be filled out with NOTIFYID(1, n).

       TITLE: This is the window title. It is "Modify Drawing Color" by
       default. The program is registered with the name "chgcolor " plus
       the TITLE string. The register name is checked before the widgets
       are defined. This gives you the opportunity to have multiple copies
       of CHGCOLOR operating simultaneously. (For example, one will change
       the background color and one will change the plotting color.)

       XOFFSET: This is the X offset of the program on the display. The
       program will be placed approximately in the middle of the display
       by default.

       YOFFSET: This is the Y offset of the program on the display. The
       program will be placed approximately in the middle of the display
       by default.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       Color at the specified index is changed. Events are sent to widgets
       if the NOTIFYID keyword is used.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To change the background color of a plot, type:

       CHGCOLOR, !P.Background

       To see a more complete example, look at the program SLICE
       in the Coyote Software Library:

          ftp://ftp.frii.com/pub/dfanning/outgoing/idl_examples

 MODIFICATION HISTORY:
       Written by David Fanning, 23 April 97.
       12 May 97, Fixed a bug in the way colors were loaded when
          a tracking event occurred. DWF
       13 May 97, Added a JUST_REGISTER keyword and set it up for
          running in IDL 5.0 as a non-blocking widget.
       27 Sept 98. Fixed problems caused by IDL 5.1 color changes.
       27 Sept 98. Removed JUST_REGISTER keyword. Made widget non-blocking.
       03 Nov 98. Modified layout and added slider ganging. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\chgcolor.pro)


CHINIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CHINIT
 PURPOSE:
       Initializes chart setup.  Good for viewgraphs.
 CATEGORY:
 CALLING SEQUENCE:
       chinit
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /HARD means plot on postscript printer (else screen).
         /LAND means use landscape mode (else portrait mode).
         UNITS=u  Set plot units to 'inches' (def) or 'cm'.
         BPOSITION=p scalar or array giving list of outline
           offsets in UNITS from edge of page. Def=no outline.
         BTHICKNESS=t scalar or array giving outline thicknesses
           for each outline given in BPOS.  Def=1.
         XOFFSET=xoff  Set chart X offset in UNITS (def=0).
         YOFFSET=yoff  Set chart Y offset in UNITS (def=0).
         /MOVE means just move origin.  The only other keywords
           recognized with /MOVE are XOFFSET and YOFFSET.
           /MOVE should be used on the second and later calls to
           CHINIT to reposition the position of graphics.
         WINSIZE=sz Multiply default screen window size by this factor.
        Output keywords:
         LAST=lst Highest available plot color, returned.
         FONT=f "!17" for screen, null string for /HARD.
           Put in front of first string printed to make
           device independent.
         FACTOR=f text size factor. 1 for /HARD, 0.68 for screen.
           Multiply text size by this for device independence.
 OUTPUTS:
 COMMON BLOCKS:
       chinit_com
 NOTES:
       Notes: Also erases to white and sets default plot
         color to black.  All plot commands may then be
         given in units of inches or cm, whichever were set.
         Plot size:
           Portrait:  7.5 by 10 inches (360 by 480 on screen)
           Landscape: 9.5 by  7 inches (640 by 472 on screen)
         The screen view is not always close to the hard copy.
         Spaces are handled differently, and strings that fit
         for the hardcopy are sometimes too long on the screen.
 MODIFICATION HISTORY:
       R. Sterner, 17 Aug, 1991
       R. Sterner,  9 Jan, 1992 --- added /MOVE, also common.
       R. Sterner,  1 Sep, 1992 --- added WINSIZE

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\chinit.pro)


CHISQR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	    CHISQR

 PURPOSE:

	    Compute the Chi Square statistic of a function and a fit
	    to the function.  

 CALLING SEQUENCE:
 
	    Result=CHISQR(Y,SIGMA_Y,YFIT)
	    
 INPUTS:
	    Y - Input array.
	    
	    SIGMA_Y - Uncertainty in Y.
	    
	    YFIT - Fit to Y.

 PROCEDURE:
 
           CHISQR=TOTAL((Y-YFIT)^2/SIGMAY^2)

 MODIFICATION HISTORY:
 
    David L. Windt, Bell Labs, November 1989
    windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\chisqr.pro)


CHKSTRU (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CHKSTRU  (function)

 PURPOSE:
        Check validity of a structure and test if necessary
        fields are contained. The result of this function will 
        be 0 if the argument is not a structure (this includes
        undefined values) or if the argument does not contain
        all the tags requested with the FIELDS argument.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        res=CHKSTRU(STRUCTURE,FIELDS [,/VERBOSE]) 

 INPUTS:
        STRUCTURE --> the structure to be tested. If STRUCTURE is
             not of type structure, the function will return 0

        FIELDS --> a string or string array with field names to 
             be contained in STRUCTURE. CHKSTRU returns 1 (true)
             only if all field names are contained in STRUCTURE.
             The entries of FIELDS may be upper or lowercase.

 KEYWORD PARAMETERS:
        INDEX --> a named variable that will contain the indices of
             the required field names in the structure. They can then
             be assessed through structure.(index(i)) . Index will
             contain -1 for all fields entries that are not in the
             structure.

        /VERBOSE --> set this keyword to return an error message 
             in case of an error.

 OUTPUTS:
        CHKSTRU returns 1 if successful, otherwise 0.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        This routine should still work with IDL 5.0 or even 4.0

 EXAMPLE:
        test = { a:1, b:2, c:3 }
        required = ['a','c']
        if CHKSTRU(test,required) then print,'found a and c.'

 MODIFICATION HISTORY:
        mgs, 02 Mar 1998: VERSION 1.00
        mgs, 07 Apr 1998: - second parameter (FIELDS) now optional
        mgs, 23 Aug 2000: - changed copyright to open source
                          - changed array indices to [] and "emacsified"

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\chkstru.pro)


CHOICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CHOICE

 PURPOSE:
        Allows user to choose interactively from several options

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        RESULT = CHOICE(VALUES [,options])

 INPUTS:
        VALUES  -> a string array containing the selectable options

 KEYWORD PARAMETERS:
        TITLE -> title to be displayed on top of the selection menu
        DEFAULT -> a default selection (to allow user to simply press enter)
        BY_INDEX  -> return selection index rather than value
        /NOABORT -> prevents addition of 'ABORT' to selection

 OUTPUTS:
        CHOICE returns a string containing the selected value or
            the index of the selection if keyword /BY_INDEX is set.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        CHOICE automatically adds 'ABORT' to the list of selections.
            If keyword BY_INDEX is set then ABORT will return -1
            (unless /NOABORT keyword is set)

 EXAMPLE:
        DIRNAMES = ['~my/dir/','~your/dir/','~any/dir']
        DIR = CHOICE(DIRNAMES,TITLE='Select Directory')

        IF (DIR ne 'ABORT') THEN BEGIN
            OPENR, U1, DIR+FILE, /GET_LUN
            READF, U1, DATA
            CLOSE, U1
            FREE_LUN,U1
        ENDIF ELSE PRINT,'ABORTED !'


 MODIFICATION HISTORY:
        mgs, 26 Sep 1997: VERSION 1.00
        mgs, 17 Nov 1998: - added DEFAULT and NOABORT keywords
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\choice.pro)


CINDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CIndex

 PURPOSE:
       This is a program for viewing the current colors in the
       colortable with their index numbers overlayed on each color.
       On 24-bit systems you must click the cursor in the graphics window
       to see the colors in the current color table.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY: Graphics

 CALLING SEQUENCE:  CIndex

 INPUTS:   None.

 Optional Inputs:   None

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 KEYWORD Parameters:   None

 COMMON BLOCKS:  None

 SIDE EFFECTS:   None

 RESTRICTIONS:   Reqires XCOLORS and TVIMAGE from the Coyote Library:

                     http://www.dfanning.com/programs/xcolors.pro
                     http://www.dfanning.com/programs/xtvimage.pro

 PROCEDURE:

  Draws a 31x25 set of small rectangles in 256 different colors.
  Writes the color index number on top of each rectangle.

 MODIFICATION HISTORY:  Written by David Fanning, May 1995

  Widgetized and made it work in 24-bit color. Colors are
     updated by clicking in window. 22 Oct 98. DWF
  Replace POLYFILL with TV command to avoid underflow error in
     Z-buffer. 8 March 99. DWF
  Fixed a problem with 24-bit devices with color decomposition ON. 15 Feb 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\cindex.pro)


CIRCLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CIRCLE
 VERSION:
		4.0
 PURPOSE:
		Draws a circle, around CENTER, with radius given by RADIUS, X_RADIUS,
		or Y_RADIUS.  The drawing is done in the currently defined plot area.
		One and ONLY ONE of the three radius values MUST be provided.  RADIUS
		and X_RADIUS are equivalent.  Alternatively, a *SHAPE* representation
		(see SHAPE_VER for definition) of the circle may be returned through
		the SHAPEOUT keyword.  DATA coordinates are used unless one of the
		keywords /DEVICE or /NORMAL is set.  The circle is drawn so as to
		appear visually as a circle, regardless of the coordinates used.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		CIRCLE, CENTER = C, {RADIUS=R, X_RADIUS=XR, Y_RADIUS = YR} [, keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	CENTER
		Two dimensional vector, circle center location, mandatory.
	RADIUS							|
		Scalar, value of radius (measured in the X direction).	| One
	X_RADIUS							| and only one
		Scalar, value of radius (measured in the X direction).	| must be
	Y_RADIUS							| provided.
		Scalar, value of radius (measured in the Y direction).	|
	/FILL
		Switch.  causes the circle to be filled with a solid pattern.
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.  See comment in RESTRICTIONS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable, on return the variable
		contains the *SHAPE* representation of the circle.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		While nominally all graphics keywords can be passed (through _EXTRA),
		care should be exercised to use only the applicable ones (ELLIPSE and
		PLOTS keywords usually, POLYFILL keywords when /FILL is used.
 PROCEDURE:
		Uses calls to COO_CONV, ONE_OF and SHAPE_COCON from MIDL.  Converts all
		parameters to device coordinates and calls ELLIPSE (also from MIDL)
		to do the actual plotting.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-DEC-1993 by Mati Meron.  Now CIRCLE takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Modified 25-JUL-1999 by Mati Meron.  Added keywords NO_SHOW and
		SHAPEOUT.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\circle.pro)


CLASSIFY

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:         CLASSIFY

 FUNCTION:
            Display the physical locations of points selected on the
            basis of image quantities, xa and ya.  An interactive
            cursor box is used to select clusters of points from the
            2-d scatter plot of xa vs ya. These points are drawn on a
            satellite image to indicate their actual physical
            location.

 CALLING SEQUENCE:

       classify,xa,ya,class_out,image=image,class_in=class_in,select=select, $
              n_samples=n_samples,blow_up=blow_up,title=title,ytitle=ytitle, $
              xtitle=xtitle,ititle=ititle

 CATEGORY:
       Interactive graphics

 REQUIRED INPUTS:
       XA       First channel parameter, x-axis of scatter plot
       YA       Second channel parameter, y-axis of scatter plot

 OPTIONAL INPUTS (keyword parameters):
       IMAGE    Image of a particular satellite channel over which 
                points are ploted.  If not supplied points are ploted
                over blank plot

    CLASS_IN    (Byte array) Pixel color class initialization.  Each
                element corresponds to one pixel in the sample set
                (see n_samples, below). An initial run of CLASSIFY
                will generate the byte array, CLASS_OUT.  This can be
                used in a subsequent run of CLASSIFY with
                CLASS_IN=CLASS_OUT to restart CLASSIFY in its former
                state.  When set, CLASS_IN overrides the effect of
                SELECT and N_SAMPLES, below.

    N_SAMPLES   2 element vector specifying the number of samples in the
                x and y directions.  E.g., if N_SAMPLES=[100,150],
                then the scatter plot will consist of a 100x150
                element subset of the original image.  If N_SAMPLES
                is not set, a default number of samples in the x and
                y directions is used.
                
                
       SELECT   Vector of pre-selected indices (longword integers). 
                For example, SELECT=WHERE(XX LT 10) chooses only
                those sample points for which parameter xx
                is less than 10.

      BLOW_UP   Two element vector of specifying the image size blowup factor 

       TITLE    Title of scatter plot 
       XTITLE   Scatter plot x-axis label
       YTITLE   Scatter plot y-axis label
       ITITLE   Plot title of satellite image
       NO_COLOR don't use color, show points with unique symbols

 OUTPUTS
     CLASS_OUT  (Byte array) Color class of each sample point.  Values
                between 1 - 6 indicate different selected color
                classes.  Greater values indicate unselected points
                which can be selected with the cursor. CLASS_OUT can
                be used in another call to CLASSIFY, e.g.,
                CLASSIFY,XA,YA,CLASS_OUT ; followed by,
                CLASSIFY,XA,YA,CLASS_IN=CLASS_OUT


 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       Two windows are created to contain the scatter plot (window 0) and
       the physical image (window 2).  Calls TVLCT to load a customized 
       color table with grey scale for byte values greater than 10 and
       discreet colors for byte values between 1 and 10.

 RESTRICTIONS:
       Works only on window system drivers

 PROCEDURE:
       Points which enter into the cursor box are hi-lighted and stored
       for plotting on the satellite image.  The left mouse button increases
       the size of the cursor box while the middle mouse button decreases it
       The right mouse button stops the selection process and displays a 
       pop-up menu with 4 options:

       (n) select a new selection class (assign a new color)
       (r) reset the selection set
       (d) display the selection set on the satellite image
       (p) save current plot to postscript file "plot.ps"
       (q) clean up displays and quit

  author:  Paul Ricchiazzi                            oct92 
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\classify.pro)


CLASSPLT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   classplt

 USEAGE:    classplt,xx

            classplt,xx,yy,alat,alon,$
                    [title=title,xtitle=xtitle,ytitle=ytitle,sym=sym]

 PURPOSE:   Draws two seperate plots to the graphics device:
            1. 2-d scatter plot of yy vs xx
            2. physical position of selected classes with respect
               to coastline features.
 
 INPUT:
     xx       index array of selected points for a class 
              (class definition mode)

     xx       2-D array, x quantity of scatter plot (ploting mode)
     yy       2-D array, y quantity of scatter plot     
     alat     latitude array
     alon     longitude array
     title    plot title (optional).  One or two element string array
              if two strings are specified the first string is used to
              title the scatter plot while the second titles the mapped
              plot
     xtitle   x title (optional)
     ytitle   y title (optional)
     sym      a vector of symbol index values.  Classes are assigned symbols
              in the sequence specified in SYM. (default=[1,4,7,5,6,2])
              (1=+, 2=*, 3=., 4=diamond, 5=triangle, 6=square, 7=x)


 PROCEDURE:   At least two steps are required to make plots with CLASSPLT: 

              1. In class definition mode CLASSPLT is called with a single 
                 argument one or more times to accumulate class definitions
                 to be used later in the ploting mode.
              2. In plotting mode CLASSPLT is called with at least 4 
                 arguments.  In this mode CLASSPLT produces a scatter 
                 plot and position plot of the previously defined classes.

 EXAMPLE:

 a4=congrid(avhrr4,40,30)                        ; reduce size of sample set
 a3=congrid(avhrr3,40,30)                        ;   could also use SUPERPIX

 classplt,inside(a4,a3-a4,[3,6,5,3],[4,3,5,4])   ; define classes
 classplt,where(a4 gt -6 and a3-a4 lt 8)         ;
 classplt,where(a4 gt -17 and a3-a4 gt 8)        ; 

 classplt,a4,a3-a4,alat,alon                     ; make the plot

 Here is a sequence of commands which uses the interactive graphics
 procedure, INSIDE, to simplify class specifcation.
 
 classplt,inside(a4,a3-a4)
 classplt,inside(a4,a3-a4)
 classplt,inside(a4,a3-a4)
 classplt,a4,a3-a4,alat,alon

 COMMON BLOCKS: classblk


  author:  Paul Ricchiazzi                            oct92 
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\classplt.pro)


CLIPBOARD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CLIPBOARD

 PURPOSE:

       The purpose of this program is to copy the contents of a
       graphics window to the clipboard for subsequent pasting into
       applications such as Photoshop or Powerpoint.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

      Graphics.

 CALLING SEQUENCE:

      CLIPBOARD, window_index

 OPTIONAL INPUTS:

       window_index:    The window index number of the graphics window to
                        copy. If absent, the current graphics window is used
                        by default.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 DEPENDENCIES:

       Uses the IDLgrClipboard object introduced in IDL 5.2(?).

 PROCEDURE:

       Copies the window contents to a clipboard object.

 EXAMPLE:

        IDL> Window
        IDL> Plot, Findgen(11)
        IDL> CLIPBOARD

 RESTRICTIONS:

       May not work for all applications. Applications tested successfully
       include: Framemaker, Powerpoint, Photoshop, Excel, Microsoft Word.
       Converts 24-bit images to 2D images with color tables.

 MODIFICATION HISTORY:

       Written by: David W. Fanning, 24 October 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\clipboard.pro)


CLIPRANGE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    cliprange

 PURPOSE:    compute greyscale range for images, allowing for a fixed 
             percentage of the pixels to be within the greyscale range.

 USEAGE:     result=cliprange(qval,clip_top,clip_bot)

 INPUT:
   qval      image array
   clip_top  fraction of pixels to be clipped off top of range
   clip_bot  fraction of pixels to be clipped off bottom of range

 OUTPUT:     result=[range_bot,range_top], where range_bot and range_top
             are the numerical range of the color scale
             
 EXAMPLE:    compute colorscale range such that 99% of the pixels are
             within the range:
 
             range=cliprange(image,.005,.005) 

  author:  Paul Ricchiazzi                            sep93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cliprange.pro)


CLOSEDEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   closedev

 PURPOSE:
   This procedure close teh open graphic device

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   CLOSEDEV

 MODIFICATION HISTORY:
   Written by:    F. Holland, 19 Jun, 1997
   Modified:      T.B. 1997-Nov

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\closedev.pro)


CLOSE_DEVICE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CLOSE_DEVICE

 PURPOSE:
        CLOSE_DEVICE closes the PostScript device and spawns
        a print job to the printer specified by the user or
        it can be used to close a graphics window.

 CATEGORY:
        Printing

 CALLING SEQUENCE:
        CLOSE_DEVICE [,OLD_DEVICE] [,keywords]

 INPUTS:
        OLD_DEVICE (str) -> Name of device that shall become the active
             plotting device. If omitted, "X", "WIN" or "MAC" will be
             set depending on !VERSION.OS_FAMILY. Hence, specification of
             OLD_DEVICE is only rarely needed.
             This parameter works together with the OLD_DEVICE parameter
             of OPEN_DEVICE which returns the device name before the
             postscript device (or a graphics device) is opened.
             The OLD_DEVICE parameter can be misused to set the output 
             device to anything! Therefore, it's probably safest to not 
             use it and stick with the operating system dependent default.

 KEYWORD PARAMETERS:
        LABEL -> a string that contains an annotation for a postscript
             plot (usually a user name and/or filename). The current 
             data and time will be appended if TIMESTAMP is set. 
             NOTE: TIMESTAMP will produce an annotation even if LABEL
             is not provided. The annotation is only added to postscript 
             plots and only if the ps file is actually open.

        /TIMESTAMP  -> add date and time to the LABEL on the plot.
             If no LABEL is provided, the username and filename (value 
             of FILENAME will be used or the filename of the current 
             postscript file will be added). The timestamp is only added 
             to postscript plots and only on the last page.

        PRINTER    (str) -> name of the printer queue to send output to.
             Default is 'none', i.e. the postscript file will only be 
             closed and can then be manually printed e.g. using the Unix 
             lpr command. Direct printing only works in Unix environments.

        WINDOW -> window number to be closed (or -1 if current)

        _EXTRA -> any additional keywords to CLOSE_DEVICE will be
             passed on to STRDATE which is used to format the date
             and time string. Possible values are: /SHORT, /SORTABLE,
             /GERMAN.

        LCOLOR -> the color value for the LABEL (default 1).

        LPOSITION -> the position of the LABEL in normalized coordinates
             (a two-element vector with default [0.98,0.007]).

        LSIZE -> the charcter size of the LABEL (default 0.7).

        LALIGN -> the alignment of the LABEL (default 1).

        FILENAME   (str) -> name of the PostScript file.
             This keyword is now obsolete since the name of the postscript 
             file is determined automatically. It is kept as a surrogate 
             for LABEL to ensure compatibility with older implementations. 

 OUTPUTS:
        If postscript device is active, a *.ps file will be closed and 
        optionally sent to the printer.

 SUBROUTINES:

 REQUIREMENTS:
        Needs STRDATE for the TIMESTAMP option.

 NOTES: 
        The WINDOW keyword is only evaluated if the current device supports 
        windows [!D.FLAGS AND 256) GT 0]. If you only want to close a 
        postscript file and don't fuss around with your screen windows
        then simply don't set this keyword.

        23 Aug 2000:
        I am about to change to Liam Gumley's method for opening
        postscript files. This routine is merely kept for compatibility!

 EXAMPLE:
        CLOSE_DEVICE
            closes a postscript file (if opened) and resets the current
            plotting device to 'X', 'WIN', or 'MAC' depending on the
            OS_FAMILY.

        CLOSE_DEVICE, PRINTER='hplj4', LABEL='mgs', /TIMESTAMP
            If current device name is PS then the postscript file will
            be closed, a user, date and time label will be added and 
            the file will be spooled to the  printer queue 'hplj4'. 
            NOTE: Printing of the file fails if you specified FILENAME as 
            a relative path in the OPEN_DEVICE command and you changed your 
            working directory while the device was opened.
  
        CLOSE_DEVICE, WIN=-1
            If current device name is PS then the postscript file will
            be closed. If the current device is a screen device (that 
            supports windows), then the active window will be deleted.
 
 MODIFICATION HISTORY:
        bmy, 18 Aug 1997: VERSION 1.00
        bmy, 19 Aug 1997: VERSION 1.01
        mgs, 20 Aug 1997: VERSION 1.02
        mgs, 08 Apr 1998: VERSION 2.00 
           - automatic filename detection
           - default device depending on OS_FAMILY
        mgs, 21 May 1998: 
           - added L.. keywords to control label and timestamp output
        mgs, 18 Nov 1998:
           - added output of username as default in timestamp

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\close_device.pro)


CLOSE_DEVICE[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   close_device

 PURPOSE:
   This procedure close the open graphic device

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   CLOSE_DEVICE

 KEYWORD PARAMETERS:
   If the following graphical keywords are provided they are multiplied by
   the quoted factors if a non-screen device is closed.

         CHARSIZE = charsize (factor 1./1.72)
         SYMSIZE = symsize (factor 1./1.72)
         THICK = thick (factor 1./2.0)
         CHARTHICK = charthick (factor 1./2.0)
         XTHICK = xthick (factor 1./2.0)
         YTHICK = ythick (factor 1./2.0)

 MODIFICATION HISTORY:
   Written by:    F. Holland, 19 Jun, 1997
   Modified:      T.B. 1997-DEC-16
   15.02.2000:    charsize and symsize are divided by 1.72 (size_factor),
                       thick, charthick, xthick, and ythick are divided by 2.0 (thick_factor)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\close_device.pro)


CLOUD_ART

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  cloud_art

 PURPOSE:  draw an idealized cloud

 USEAGE:   cloud_art,pos,bumps=bumps

 INPUT:    
  pos      normal coordinates of cloud frame, [xll,yll,xur,yur]
           where ll=lower left corner and ur=upper right corner


 KEYWORD INPUT:
  bumps    number of bumps on upper side of cloud. (default=6)
  

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

    w8x11
    cloud_art,[.1,.8,.9,.9],bumps=8

 AUTHOR:   Paul Ricchiazzi                        15 Mar 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cloud_art.pro)


CLR_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CLR_SCALE
 PURPOSE:
       Clear image scaling values embedded by put_scale.
 CATEGORY:
 CALLING SEQUENCE:
       clr_scale, [img]
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Pixel value 90 is used to overwrite pixels 0 to 89
         if 1234567890 is found in the first 10 pixels.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Feb 28

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\clr_scale.pro)


CLSTRSHD

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:           clstrshd

 USEAGE:            result=clstrshd(a, binsz)
                    result=clstrshd(a, binsz, /align, /compare)

 PURPOSE:           compute super pixel cluster shade statistical test
                    of a scene. the cluster shade is a test of skewness
                    in the greylevel histogram of each superpixel.

 INPUT:
         a          image array

         binsz      A scalar specifying the number of horizontal and 
                    vertical sub-pixels in one super pixel. 
                    BINSZ must be an odd integer.

         align      If set, output arrays are REBINed back up to the 
                    original size and output array cell centers are aligned
                    with input array cell centers.

         compare    if set, compare A and ABIN with the FLICK procedure

 OUTPUT:
                    cluster shade value at superpixel cell centers.

 AUTHOR:            Paul Ricchiazzi    oct92 
                    Earth Space Research Group, UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\clstrshd.pro)


CM2NORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CM2NORM
 PURPOSE:
       Convert from cm to normalized coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       cm2norm, xcm, ycm, xn, yn
 INPUTS:
       xcm, ycm = coordinates of a point in cm.   in
       poscm = plot page position in cm.          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       xn, yn = same point in normalized system.  out
       or
       cm2norm, poscm, posn
         posn = page position in normalized system. out
           the page position arrays have the format: [x1,y1,x2,y2]
           where (x1,y1) = lower left corner,
           and (x2,y2) = upper right corner of plot area.
 COMMON BLOCKS:
 NOTES:
       Notes: Be sure plot device is set first.
         For postscript plots call psinit first.
 MODIFICATION HISTORY:
       R. Sterner 13 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cm2norm.pro)


CMAPPLY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMAPPLY

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Applies a function to specified dimensions of an array

 MAJOR TOPICS:
   Arrays

 CALLING SEQUENCE:
   XX = CMAPPLY(OP, ARRAY, DIMS, [/DOUBLE], [TYPE=TYPE])

 DESCRIPTION:
   CMAPPLY will apply one of a few select functions to specified 
   dimensions of an array.  Unlike some IDL functions, you *do* have
   a choice of which dimensions that are to be "collapsed" by this
   function.  Iterative loops are avoided where possible, for 
   performance reasons.

   The possible functions are:             (and number of loop iterations:)
     +     - Performs a sum (as in TOTAL)       number of collapsed dimensions
     AND   - Finds LOGICAL "AND" (not bitwise)  same
     OR    - Finds LOGICAL "OR"  (not bitwise)  same
     *     - Performs a product                 LOG_2[no. of collapsed elts.]

     MIN   - Finds the minimum value            smaller of no. of collapsed
     MAX   - Finds the maximum value            or output elements

     USER  - Applies user-defined function      no. of output elements


   It is possible to perform user-defined operations arrays using
   CMAPPLY.  The OP parameter is set to 'USER:FUNCTNAME', where
   FUNCTNAME is the name of a user-defined function.  The user
   defined function should be defined such that it accepts a single
   parameter, a vector, and returns a single scalar value.  Here is a
   prototype for the function definition:

      FUNCTION FUNCTNAME, x, KEYWORD1=key1, ...
         scalar = ... function of x or keywords ...
         RETURN, scalar
      END

   The function may accept keywords.  Keyword values are passed in to
   CMAPPLY through the FUNCTARGS keywords parameter, and passed to
   the user function via the _EXTRA mechanism.  Thus, while the
   definition of the user function is highly constrained in the
   number of positional parameters, there is absolute freedom in
   passing keyword parameters.

   It's worth noting however, that the implementation of user-defined
   functions is not particularly optimized for speed.  Users are
   encouraged to implement their own array if the number of output
   elements is large.


 INPUTS:

   OP - The operation to perform, as a string.  May be upper or lower
        case.

        If a user-defined operation is to be passed, then OP is of
        the form, 'USER:FUNCTNAME', where FUNCTNAME is the name of
        the user-defined function.

   ARRAY - An array of values to be operated on.  Must not be of type
           STRING (7) or STRUCTURE (8).

 OPTIONAL INPUTS:

   DIMS - An array of dimensions that are to be "collapsed", where
          the the first dimension starts with 1 (ie, same convention
          as IDL function TOTAL).  Whereas TOTAL only allows one
          dimension to be added, you can specify multiple dimensions
          to CMAPPLY.  Order does not matter, since all operations
          are associative and transitive.  NOTE: the dimensions refer
          to the *input* array, not the output array.  IDL allows a 
          maximum of 8 dimensions.
          DEFAULT: 1 (ie, first dimension)

 KEYWORDS:

   DOUBLE - Set this if you wish the internal computations to be done
            in double precision if necessary.  If ARRAY is double 
            precision (real or complex) then DOUBLE=1 is implied.
            DEFAULT: not set

   TYPE - Set this to the IDL code of the desired output type (refer
          to documentation of SIZE()).  Internal results will be
          rounded to the nearest integer if the output type is an
          integer type.
          DEFAULT: same is input type

   FUNCTARGS - If OP is 'USER:...', then the contents of this keyword
               are passed to the user function using the _EXTRA
               mechanism.  This way you can pass additional data to
               your user-supplied function, via keywords, without
               using common blocks.
               DEFAULT: undefined (i.e., no keywords passed by _EXTRA)

 RETURN VALUE:

   An array of the required TYPE, whose elements are the result of
   the requested operation.  Depending on the operation and number of
   elements in the input array, the result may be vulnerable to
   overflow or underflow.

 EXAMPLES:
   Shows how CMAPPLY can be used to total the second dimension of the
   array called IN.  This is equivalent to OUT = TOTAL(IN, 2)

   IDL> IN  = INDGEN(5,5)
   IDL> OUT = CMAPPLY('+', IN, [2])
   IDL> HELP, OUT
   OUT             INT       = Array[5]

   Second example.  Input is assumed to be an 5x100 array of 1's and
   0's indicating the status of 5 detectors at 100 points in time.
   The desired output is an array of 100 values, indicating whether
   all 5 detectors are on (=1) at one time.  Use the logical AND
   operation.

   IDL> IN = detector_status             ; 5x100 array
   IDL> OUT = CMAPPLY('AND', IN, [1])    ; collapses 1st dimension
   IDL> HELP, OUT
   OUT             BYTE      = Array[100]

   (note that MIN could also have been used in this particular case,
   although there would have been more loop iterations).

   Third example.  Shows sum over first and third dimensions in an
   array with dimensions 4x4x4:

   IDL> IN = INDGEN(4,4,4)
   IDL> OUT = CMAPPLY('+', IN, [1,3])
   IDL> PRINT, OUT
        408     472     536     600

   Fourth example. A user-function (MEDIAN) is used:

   IDL> IN = RANDOMN(SEED,10,10,5)
   IDL> OUT = CMAPPLY('USER:MEDIAN', IN, 3)
   IDL> HELP, OUT
   OUT             FLOAT     = Array[10, 10]

   (OUT(i,j) is the median value of IN(i,j,*))

 MODIFICATION HISTORY:
   Mar 1998, Written, CM
   Changed usage message to not bomb, 24 Mar 2000, CM
   Signficant rewrite for *, MIN and MAX (inspired by Todd Clements
     ); FOR loop indices are now type
     LONG; copying terms are liberalized, CM, 22, Aug 2000
   More efficient MAX/MIN (inspired by Alex Schuster), CM, 25 Jan
     2002
   Make new MAX/MIN actually work with 3d arrays, CM, 08 Feb 2002
   Add user-defined functions, ON_ERROR, CM, 09 Feb 2002

  $Id: cmapply.pro,v 1.4 2002/02/09 16:32:23 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmapply.pro)


CMCONGRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CMCONGRID

 PURPOSE:
       Shrink or expand the size of an array by an arbitrary amount.
       This IDL procedure simulates the action of the VAX/VMS
       CONGRID/CONGRIDI function.

	This function is similar to "REBIN" in that it can resize a
       one, two, or three dimensional array.   "REBIN", however,
       requires that the new array size must be an integer multiple
       of the original size.   CONGRID will resize an array to any
       arbitrary size (REBIN is somewhat faster, however).
       REBIN averages multiple points when shrinking an array,
       while CONGRID just resamples the array.

 CATEGORY:
       Array Manipulation.

 CALLING SEQUENCE:
	array = CONGRID(array, x, y, z)

 INPUTS:
       array:  A 1, 2, or 3 dimensional array to resize.
               Data Type : Any type except string or structure.

       x:      The new X dimension of the resized array.
               Data Type : Int or Long (greater than or equal to 2).

 OPTIONAL INPUTS:
       y:      The new Y dimension of the resized array.   If the original
               array has only 1 dimension then y is ignored.   If the
               original array has 2 or 3 dimensions then y MUST be present.

       z:      The new Z dimension of the resized array.   If the original
               array has only 1 or 2 dimensions then z is ignored.   If the
               original array has 3 dimensions then z MUST be present.

 KEYWORD PARAMETERS:
       INTERP: If set, causes linear interpolation to be used.
               Otherwise, the nearest-neighbor method is used.

	CUBIC:	If set, uses "Cubic convolution" interpolation.  A more
		accurate, but more time-consuming, form of interpolation.
		CUBIC has no effect when used with 3 dimensional arrays.

       MINUS_ONE:
               If set, will prevent CONGRID from extrapolating one row or
               column beyond the bounds of the input array.   For example,
               If the input array has the dimensions (i, j) and the
               output array has the dimensions (x, y), then by
               default the array is resampled by a factor of (i/x)
               in the X direction and (j/y) in the Y direction.
               If MINUS_ONE is present (AND IS NON-ZERO) then the array
               will be resampled by the factors (i-1)/(x-1) and
               (j-1)/(y-1).

       HALF_HALF:
               If set, will tell CONGRID to extrapolate a *half* row
               and column on either side, rather than the default of
               one full row/column at the ends of the array.  If you
               are interpolating images with few rows, then the
               output will be more consistent with this technique.
               This keyword is intended as a replacement for
               MINUS_ONE, and both keywords probably should not be
               used in the same call to CONGRID.

 OUTPUTS:
	The returned array has the same number of dimensions as the original
       array and is of the same data type.   The returned array will have
       the dimensions (x), (x, y), or (x, y, z) depending on how many
       dimensions the input array had.

 PROCEDURE:
       IF the input array has three dimensions, or if INTERP is set,
       then the IDL interpolate function is used to interpolate the
       data values.
       If the input array has two dimensions, and INTERP is NOT set,
       then the IDL POLY_2D function is used for nearest neighbor sampling.
       If the input array has one dimension, and INTERP is NOT set,
       then nearest neighbor sampling is used.

 EXAMPLE:
       ; vol is a 3-D array with the dimensions (80, 100, 57)
       ; Resize vol to be a (90, 90, 80) array
       vol = CONGRID(vol, 90, 90, 80)

 MODIFICATION HISTORY:
       DMS, Sept. 1988.
       DMS, Added the MINUS_ONE keyword, Sept. 1992.
 	Daniel Carr. Re-wrote to handle one and three dimensional arrays
                    using INTERPOLATE function.
 	DMS, RSI, Nov, 1993.  Added CUBIC keyword.
       Craig Markwardt, Dec, 1997.  Added halfhalf keyword to
                        more evenly distribute "dead" pixel row
       Use uniformly spaced grid points for half_half W. Landsman   Feb. 2000
              (and slightly modified by C. Markwardt 14 Feb 2000)

  $Id: cmcongrid.pro,v 1.2 2001/03/25 18:10:47 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmcongrid.pro)


CMDHISTORY[1]

[Previous Routine] [Next Routine] [List of Routines]
 This routine retrieves the recall buffer and
 reverses its order to make useful in a text
 widget, skipping empty lines.

 @Hidden

 @Returns
   This function returns the recall buffer in
   reverse order.

 @Author
   JLP - RSI Global Services

 @History
   March 31, 2005 - Initial version

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\cmdhistory.pro)


CMDHISTORY[2]

[Previous Routine] [Next Routine] [List of Routines]
 This procedure updates the text widget with the
 command buffer values, positioning the scrolling
 text window so the most recent commands are visible.

 @Hidden

 @Param
   Text {in}{required}{type=long}
       Set this parameter to the ID of the text
       widget to be populated.
 @Param
   Commands {in}{required}{type=string vector}
       Set this parameter to the vector of strings
       to populate the text widget.

 @Author
   JLP - RSI Global Services

 @History
   March 31, 2005 - Initial version

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\cmdhistory.pro)


CMDHISTORY[2]

[Previous Routine] [Next Routine] [List of Routines]
 This procedure manages events from the application.

 @Param
   Event {in}{required}{type=event structure}
       Set this parameter to the event structure generated
       by the GUI.

 @Hidden

 @Uses
   CmdHistory_Get_Commands

 @Author
   JLP - RSI Global Services

 @History
   March 31, 2005 - Initial version

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\cmdhistory.pro)


CMDHISTORY[3]

[Previous Routine] [Next Routine] [List of Routines]
 This procedure continuously updates a text widget
 with the contents of the IDL command line recall
 buffer.  This allows the user to copy, edit and
 paste useful sequences of commands back to the
 command line, or to an IDL procedure source file.

 @Examples 
   IDL> CMDHISTORY 
@Uses CmdHistory_Event
CmdHistory_Get_Commands @Author JLP - RSI Global Services @History March 31, 2005 - Initial version @File_Comments This tool may be helpful to people who make extensive use of the IDL command line. It creates a continuously- updating editable text widget containing the command line history from which you can copy, edit and paste back to the IDL command line. It is built around the IDL 6.2 function RECALL_COMMANDS.
Learn more about the IDLdoc documentation style at http://www.rsinc.com/codebank/search.asp?FID=100

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\cmdhistory.pro)


CMPLXGEN

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      cmplxgen

 USEAGE:       result=cmplxgen(nx,ny[,/center])

 INPUT:
   nx,ny       dimensions of output
 
 KEYWORD INPUT:
   center      if set RESULT is shifted so that the (0,0) point
               is the central element of the complex array

 OUTPUT:     
               float(result)     = array of column indecies
               imaginary(result) = array of row indecies

 EXAMPLE:      r=cmplxgen(4,3)

                          0 1 2 3                      0 0 0 0
               float(r) = 0 1 2 3       imaginary(r) = 1 1 1 1
                          0 1 2 3                      2 2 2 2

 AUTHOR:       Paul Ricchiazzi              oct92
               Earth Space Research Group,  UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cmplxgen.pro)


CMPRODUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMPRODUCT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   CMPRODUCT() is the multiplicative equivalent of TOTAL().

 CALLING SEQUENCE:
   Result = CMPRODUCT(ARRAY)

 DESCRIPTION: 

   Calculates the product of all the elements of an array.  Vector
   multiplication in groups of powers of two make this operation
   faster than a simple FOR loop.  The number of actual
   multiplications is still N_ELEMENTS(ARRAY).  Double precision
   should be used for the highest accuracy when multiplying many
   numbers.

 INPUTS:

   ARRAY - Array of elements to multiply together.  For instance,
           ARRAY could contain the dimensions of another array--then
           CMPRODUCT(ARRAY) would be the total number of elements of
           that other array.

 RETURNS:
  The result of the function is the total product of all the elements
  of ARRAY.

 EXAMPLE:

 SEE ALSO:

   TOTAL, PRODUCT (from Astronomy User's Library)

 MODIFICATION HISTORY:
   Written, CM, 28 Mar 2000
     (based on outline of PRODUCT by William Thompson)

  $Id: cmproduct.pro,v 1.2 2001/03/25 18:10:42 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmproduct.pro)


CMPS_FORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMPS_FORM

 PURPOSE:
   This function puts up a form the user can configure a PostScript
   device driver. The function result (if the user selects either the
   ACCEPT or CREATE FILE buttons) can be sent directly to the DEVICE
   procedure by means of its _Extra keyword.  User's predefined
   configurations may be retrieved from a common block.

 AUTHOR:
   *********** CM 01 Feb 2000 VERSION *************
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   $Id: cmps_form.pro,v 1.4 2001/12/11 20:20:37 craigm Exp $

   Based almost entirely on, but a totally revamped version of, CMPS_FORM by 
   FANNING SOFTWARE CONSULTING (David Fanning Ph.D.) http://www.dfanning.com

 MAJOR TOPICS:
   Device Drivers, Hardcopy Output, PostScript Output

 PROCEDURE:
   This is a pop-up form widget. It is a modal or blocking widget.
   Keywords appropriate for the PostScript DEVICE command are returned.

   Use your LEFT mouse button to move the "Plot Window" around the page.
   Use your RIGHT mouse button to draw your own "Plot Window" on the page.

 HELP:
   formInfo = CMPS_FORM(/Help)

 CALLING SEQUENCE:
    formInfo = CMPS_FORM(xoffset, yoffset, Cancel=cancelButton)

 OPTIONAL INPUTS:

    XOFFSET -- Optional xoffset of the top-level base of cmps_form. Default is
    to try to center the form on the display.

    YOFFSET -- Optional yoffset of the top-level base of cmps_form. Default is
    to try to center the form on the display.

 INPUT KEYWORD PARAMETERS:

    BITS_PER_PIXEL -- The initial configuration of the bits per pixel button.

    BLOCKING -- Set this keyword to make this a blocking widget under IDL 5.0.
    (All widget programs block under IDL 4.0.)

    COLOR -- The initial configuration of the color switch.

    DEFAULTS -- A stucture variable of the same type and structure as the
    RETURN VALUE of cmps_form. It will set initial conditions. This makes
    it possible to start cmps_form up again with the same values it had the
    last time it was called. For example:

       mysetup = cmps_form()
       newsetup = cmps_form(Defaults=mysetup)

    ENCAPSULATED -- The initial configuration of the encapsulated switch.

    FILENAME -- The initial filename to be used on the form.

    HELP -- Prints a helpful message in the output log.

    INCHES -- The initial configuration of the inches/cm switch.

    INITIALIZE -- If this keyword is set, the program immediately returns the
    "localdefaults" structure. This gives you the means to configue the
    PostScript device without interrupting the user.

    SELECT -- used only when INITIALIZE is set.  Set SELECT to a
              string which identifies the predefined configuration to
              be returned by cmps_form when INITIALIZE is set.  This is
              a convenient way to select a predefined config
              non-interactively.

    LANDSCAPE -- The initial configuration of the landscape/portrait switch.

    LOCALDEFAULTS -- A structure like the DEFAULTS structure. If specified,
    then it is added as a predefined configuration entry called "Local".
    See below for a further discussion of predefined configurations.

    PREDEFINED -- An alternate way to specify predefined
                  configurations.  Pass an array of structures to
                  populate the "predefined" dropbox in the
                  dialog. This array, if specified, overrides the the
                  common block technique.

    XOFFSET -- The initial XOffSet of the PostScript window.

    YOFFSET -- The initial YOffSet of the PostScript window.

    XSIZE -- The initial XSize of the PostScript window.

    YSIZE -- The initial YSize of the PostScript window.

    ASPECT -- The aspect ratio of the window (Y/X).  This keyword can
              substitute for one of XSIZE or YSIZE.
 
    PRESERVE_ASPECT -- Set this keyword if you want to hold the
                       aspect ratio constant.

    PAPERSIZE -- If set, allows user to specify the size of the paper
                 media to be printed on, as a scalar string.  NOTE:
                 this specification cannot be passed to DEVICE, but
                 can be selected for completeness's sake.  Default is
                 'Letter'.

    MARGINSIZE -- Size of the margins on all sides.  Default is 0.25 inches.
                  When MARGINSIZE is non-zero, a graphic cannot directly
                  abut the edge of the page.  This is normally a good thing,
                  since there is often a  non-printable region which borders
                  the page.

   DEFAULTPAPER -- Default paper size to use, when it is unspecified
                   in a predefined, "local", or "default"
                   configuration.  This value also overrides any
                   configuration from common blocks.  European users
                   will probably set this to 'A4'.

   PARENT -- if this widget is invoked by another widget program,
             then this keyword parameter must be set to the top level
             widget which is to serve as the group leader.  Failure
             to do so will result in unexpected behavior.  IDL 4
             programs do not need to pass this parameter.  Default:
             NONE.

 OUTPUT KEYWORD PARAMETERS

    CANCEL -- This is an OUTPUT keyword. It is used to check if the user
    selected the "Cancel" button on the form. Check this variable rather
    than the return value of the function, since the return value is designed
    to be sent directly to the DEVICE procedure. The varible is set to 1 if
    the user selected the "Cancel" button. Otherwise, it is set to 0.

    CREATE -- This output keyword can be used to determine if the user
    selected the 'Create File' button rather than the 'Accept' button.
    The value is 1 if selected, and 0 otherwise.

    PAPERSIZE -- If set to a named variable, any newly selected paper
    size is returned in that variable.

    XPAGESIZE -- Size of paper in "X" dimension, in units given by
                 the returned config structure.

    YPAGESIZE -- Size of paper in "Y" dimension, in units given by
                 the returned config structure.

    PAGEBOX -- specifies the page rectangle relative to the plot
               window, in normalized units.  A 4-vector of the form
               [XLL, YLL, XUR, YUR] is returned, giving the positions
               of the lower left (LL) and upper right (UR) corners of
               the page with respect to the plot window.  Thus, the
               following command:

                    PLOT, x, y, position=PAGEBOX

               will construct a graphic whose plot region exactly
               fills the page (with no margin around the edges).

               Naturally, the page is usually larger than the
               graphics window, so the normalized coordinates will
               usually fall outside the range [0,1].

               However, the bounding box constructed by the
               Postscript driver includes only the graphics window.
               Anything drawn outside of it may be clipped or
               discarded.

 RETURN VALUE:

     formInfo = { cmps_form_INFO, $
                  xsize:0.0, $        ; The x size of the plot
                  xoff:0.0, $         ; The x offset of the plot
                  ysize:0.0, $        ; The y size of the plot
                  yoff:0.0 $          ; The y offset of the plot
                  filename:'', $      ; The name of the output file
                  inches:0 $          ; Inches or centimeters?
                  color:0, $          ; Color on or off?
                  bits_per_pixel:0, $ ; How many bits per image pixel?
                  encapsulated:0,$    ; Encapsulated or regular PostScript?
                  isolatin1:0,$       ; Encoded with ISOLATIN1?
                  landscape:0 }       ; Landscape or portrait mode?

 USAGE:

  The calling procedure for this function in a widget program will
  look something like this:

     info.ps_config = cmps_form(/Initialize)

     formInfo = cmps_form(Cancel=canceled, Create=create, $
                          Defaults=info.ps_config)

     IF NOT canceled THEN BEGIN
        IF create THEN BEGIN
           thisDevice = !D.Name
           Set_Plot, "PS"
           Device, _Extra=formInfo

           Enter Your Graphics Commands Here!

           Device, /Close
           Set_Plot, thisDevice
           info.ps_config = formInfo
        ENDIF ELSE
           info.ps_config = formInfo
     ENDIF

 MAJOR FUNCTIONS and PROCEDURES:

   None. Designed to work originally in conjunction with XWindow, a
   resizable graphics window.  [ NOTE: this modified version of
   cmps_form, by Craig Markwardt, is incompatible with the original
   version of XWINDOW. ]

 MODIFICATION HISTORY:

   Based on cmps_form of : David Fanning, RSI, March 1995.
   Major rewrite by: Craig Markwardt, October 1997.
     - Drawing and updating of form and sample box are now modular
     - Option of storing more than one predefined postscript configuration
     - Selection of paper size by name
     - Access to predfined configurations through (optional) common
       block
   Several additions, CM, April 1998  VERSION CM2.0
     - better integration of paper sizes throughout program.
       Predefined configurations now also know about paper.
     - allow passing predefined configurations instead of using
       common block
     - addition of ISOLATIN selection, and streamlining of dialog
       appearance
   Fixed bug in INITIALIZE w.r.t. paper sizes, CM, Nov 1998
   Added SELECT keyword, CM, 09 Dec 1998
   Added Parent keyword to allow modal widgets in IDL 5, 19 Jan 1999
   Added "Choose" button for filename selection, 19 Sep 1999
   Added ability to program different button names, 19 Sep 1999
   Added ASPECT and PRESERVE_ASPECT, based on work by Aaron Barth, 18
     Oct 1999
   Removed NOCOMMON documentation and logic, 19 Oct 1999, CM
   Added aspect to cmps_form_numevents (per Aaron Barth), 18 Oct 1999
   Corrected small bug under Initialize keyword (inches), 18 Oct 1999
   Made call to *_pscoord more consistent, 18 Oct 1999
   Added XPAGESIZE, YPAGESIZE and PAGEBOX keywords, 19 Oct 1999
   Small cosmetic cleanup, CM, 01 Feb 2000
   Fix for IDL 5.5's handling of structures with arrays, CM, 11 Dec 2001

 COMMON BLOCKS:
 
   The user may store frequently used or helpful configurations in a 
   common block, and cmps_form() will attempt to access them.  This
   provides a way for the user to have persistent, named,
   configurations.

   NOTE: this format has changed since the last version.  You may
   have to quit your IDL session for the changes to take effect
   properly.  If you have place a predefined configuration in your
   startup file, you should review the new format.
   
     COMMON CMPS_FORM_CONFIGS, cmps_form_DEFAULT_PAPERSIZE, $
                               cmps_form_STDCONFIGS

        cmps_form_DEFAULT_PAPERSIZE - a string designating the default
                                    paper size, when none is given.
                                    The predefined configurations
                                    offerred by this program will
                                    respect the default value.  (See
                                    also the DEFAULTPAPER keyword.)

        cmps_form_STDCONFIGS - An array of cmps_form_CONFIG structures,
                             each containing information about one
                             predefined configuration, such as its
                             name and size of paper.  Each "config"
                             element is a cmps_form_INFO structure,
                             which contains the actual postscript
                             configuration.

   See the IDL source code cmps_form_LOAD_CONFIGS for an example of how
   to make a list of configurations.  One possibility would be to
   declare and populate the common block from within the user's
   start-up script, allowing the same configurations to appear in
   every session.

   cmps_form() takes its initial list of configurations from this
   common block if it exists.  A default list is provided ala the
   procedure cmps_form_LOAD_CONFIGS.  Any modifications that take place
   during the cmps_form() widget session are not transferred back to
   the common block upon return.  It might be useful to be able to do
   this, through some form of 'save' procedure.

   Also, if the PREDEFINED keyword is used, then the common block is
   not consulted.

  $Id: cmps_form.pro,v 1.4 2001/12/11 20:20:37 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmps_form.pro)


CMREPLICATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMREPLICATE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Replicates an array or scalar into a larger array, as REPLICATE does.

 CALLING SEQUENCE:
   ARRAY = CMREPLICATE(VALUE, DIMS)

 DESCRIPTION: 

   The CMREPLICATE function constructs an array, which is filled with
   the specified VALUE template.  CMREPLICATE is very similar to the
   built-in IDL function REPLICATE.  However there are two
   differences:

      * the VALUE can be either scalar or an ARRAY.

      * the dimensions are specified as a single vector rather than
        individual function arguments.

   For example, if VALUE is a 2x2 array, and DIMS is [3,4], then the
   resulting array will be 2x2x3x4.

 INPUTS:

   VALUE - a scalar or array template of any type, to be replicated.
           NOTE: These two calls do not produce the same result:
                  ARRAY = CMREPLICATE( 1,  DIMS)
                  ARRAY = CMREPLICATE([1], DIMS)
           In the first case the output dimensions will be DIMS and
           in the second case the output dimensions will be 1xDIMS
           (except for structures).  That is, a vector of length 1 is
           considered to be different from a scalar.

   DIMS - Dimensions of output array (which are combined with the
          dimensions of the input VALUE template).  If DIMS is not
          specified then VALUE is returned unchanged.

 RETURNS:
   The resulting replicated array.  

 EXAMPLE:
   x = [0,1,2]
   help, cmreplicate(x, [2,2])
         INT       = Array[3, 2, 2]
   Explanation: The 3-vector x is replicated 2x2 times.

   x = 5L
   help, cmreplicate(x, [2,2])
         LONG      = Array[2, 2]
   Explanation: The scalar x is replicated 2x2 times.

 SEE ALSO:

   REPLICATE

 MODIFICATION HISTORY:
   Written, CM, 11 Feb 2000
   Fixed case when ARRAY is array of structs, CM, 23 Feb 2000 
   Apparently IDL 5.3 can't return from execute().  Fixed, CM, 24 Feb
     2000
   Corrected small typos in documentation, CM, 22 Jun 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmreplicate.pro)


CMRESTORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMRESTORE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Restore variables from an IDL SAVE file.

 CALLING SEQUENCE: (various)
   CMRESTORE, filename                           (implicit)
   CMRESTORE, filename, var1, var2, ..., [, NAMES=names]
   CMRESTORE, filename, DATA=pointers, NAMES=names, PASS_METHOD='POINTER'
   CMRESTORE, filename, DATA=handles,  NAMES=names, PASS_METHOD='HANDLE'
   CMRESTORE, filename, DATA=structure,             PASS_METHOD='STRUCT'
   
 DESCRIPTION: 

   CMRESTORE is a replacement for the built-in IDL procedure RESTORE.
   It restores variables and data from an existing IDL SAVE file,
   written either by SAVE or CMSAVE.  The CMSV utility library must
   be installed in your IDL path to use CMSAVE and CMRESTORE.

   The primary advantage to CMRESTORE is the ability to selectively
   restore only certain variables from the input file (based on
   name).  CMRESTORE provides a number of ways to pass the data
   between routines, typically using a pointer or structure, which
   avoids the unsafe practice of restoring variables in the caller's
   namespace.  However, CMRESTORE can restore variables into the
   caller's namespace, but users should be aware that this capacity
   is somewhat limited in IDL versions 5.2 and below.


 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 COMPATIBILITY:

   -- File Format --

   CMRESTORE should be able to read files written by SAVE and CMSAVE
   from IDL version 4 to version 5.4.

   CMRESTORE cannot restore objects, pointers, compressed files, or
   data sets larger than 2 gigabytes.
   
   Data types available in newer versions of IDL, such as pointers
   and long integers, will not be readable in older versions of IDL
   which do not have those data types.

   -- Calling Interface --

   For the most part, all capabilities of CMRESTORE are available to
   the user.  However, it should be noted that passing variables by
   positional parameter is not available under IDL 4, unless NAMES is
   used to name the variables explicitly.  Also, under IDL versions
   5.2 and previous, it is not possible for CMRESTORE to restore
   variables into the caller's name space if they are not yet
   defined.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 INPUTS:

   FILENAME - the name of the SAVE file.
              Default: none, this parameter must be specified.

   VAR{i} - The values to be restored.  By default the save name is
            taken from the named variables that are passed.  These
            default names can be overridden by using the NAMES
            keyword.

            If no variables are passed as positional parameters, they
            can still be saved using the DATA keyword.  By invoking
            CMRESTORE without positional parameters or DATA,
            CMRESTORE automatically will attempt to restore the
            variables to the calling routine's name space (the
            "implicit" technique).

               NOTE: in IDL 5.2 and below, user routines are not
               allowed to *CREATE* new variables in the caller's name
               space.  CMRESTORE may fail if the variable in
               undefined in the caller.  Therefore you must define it
               before calling CMRESTORE.  The safer practice is to
               use the VAR{i} positional parameters, or the DATA
               keyword.

 KEYWORDS:

   FILENAME - the name of the SAVE file.  The positional FILENAME
              parameter takes precedence over the keyword FILENAME
              parameter.

   PASS_METHOD - a scalar string, describing the method of passing
                 data between the caller and CMRESTORE.  The keyword
                 can take the value 'ARGUMENT', 'POINTER', 'HANDLE'
                 or 'STRUCT'.  A value of 'ARGUMENT' indicates that
                 data values will be passed by command line argument,
                 and is the default.  Other values are described
                 below.

   DATA - A list of data elements to be restored from the output
          file.  The data elements can be one of the following,
          depending on the value of PASS_METHOD.  The means of
          extracting the data, and the method of naming each
          variable, are also indicated.

            * PASS_METHOD='POINTER': An array of pointers to the variables
                    Data: pointed-to value     Name: from NAMES keyword
            * PASS_METHOD='HANDLE':  An array of handles to the variables
                    Data: pointed-to value     Name: from NAMES keyword
            * PASS_METHOD='STRUCT':  A structure containing data to be saved
                    Data: tag value            Name: tag name

          Data values are restored one by one, using the appropriate
          name.  Note that any variables passed as positional
          parameters will cause the DATA keyword to be ignored.

          CMRESTORE will allocate any pointer or handle resources.
          The calling routine is responsible for deallocating any
          pointer or handle resources.

   NAMES - a string array, giving the names for each variable.  

           If the data are passed by positional parameters, the names
           are assigned according to the position of the parameter in
           the procedure call.  

           If the data are passed by an array of pointers or handles,
           then the names are assigned according to the position of
           the data in the array.  In this case there is no other way
           to supply the variable name.  NAMES is required.

           If the data are passed in a structure, then the names are
           assigned according to the position of the data in the
           structure.  The values specified in the names keyword
           override the tag names.

   STATUS - upon return, an integer indicating the status of the
            operation.  A value of 1 indicates success, while 0
            indicates failure.  A failure condition does not
            necessarily indicate that an individual variable could
            not be restored; use the VARSTATUS keyword to detect such
            situations.

   VARSTATUS - upon return, an integer array indicating the status of
               the restore operation for each variable.  A value of 1
               at position i in the array indicates success for the
               ith variable, while a value of 0 indicates failure.

   ERRMSG - upon return, a string indicating the status of the
            operation.  The empty string indicates success, while a
            non-empty string indicates failure and describes the
            error condition.

   QUIET - if set, then the error message is returned to the calling
           routine.  By default an error condition causes execution
           to stop and the message to be printed on the console.

   VERBOSE - if set, then a short message is printed for each
             variable.

 EXAMPLE:

   CMSAVE, VAR1, VAR2, FILENAME='test.sav'
   CMSAVE, VAR1, VAR2, FILENAME='test.sav', NAMES=['A','B']

     Save the data in VAR1 and VAR2 to the file test.sav.  In the
     first case the saved variable names will be VAR1 and VAR2.  In
     the second case the saved variable names will be A and B.

   POINTERS = [ptr_new(VAR1), ptr_new(VAR2)]
   CMSAVE, DATA=POINTERS, NAMES=['A','B'], FILENAME='test.sav'

     Save the data in VAR1 and VAR2 to the file test.sav.  The saved
     variable names will be A and B.

   STRUCTURE = {A: VAR1, B: VAR2}
   CMSAVE, DATA=STRUCTURE, FILENAME='test.sav'

     Save the data in VAR1 and VAR2 to the file test.sav.  The saved
     variable names will be A and B.

 SEE ALSO:

   CMSAVE, SAVE, RESTORE

 MODIFICATION HISTORY:
   Written, 14 May 2000
   Documented, 22 Sep 2000
   Restore into caller's name space now permitted, 11 Jan 2001
   Documented "implicit" restore a little better, w/ errors, 01 Mar 2001
   Make version checks with correct precision, 19 Jul 2001, CM
   Restore with no args automatically does ALL, is this right?,
     CM, 20 Aug 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmrestore.pro,v 1.18 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmrestore.pro)


CMSAVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSAVE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Save IDL variables to a file.  (IDL v5 and greater)

 CALLING SEQUENCE: (various)
   CMSAVE, var1, var2, ..., FILENAME=filename [, NAMES=names]
   CMSAVE, DATA=pointers, NAMES=names, FILENAME=filename
   CMSAVE, DATA=handles, NAMES=names,  FILENAME=filename
   CMSAVE, DATA=structure,             FILENAME=filename
   
 DESCRIPTION: 

   CMSAVE is a replacement for the built-in IDL procedure SAVE, with
   more flexibility and increased capabilities.

   CMSAVE produces output files that are compatible with the standard
   save format of IDL versions 4 and 5 (and perhaps greater).
   Variables may be restored by using either the built-in procedure
   RESTORE, or CMRESTORE.  The CMSV utility library must be installed
   in your IDL path to use CMSAVE and CMRESTORE.

   The primary advantages to CMSAVE are the ability to append
   additional variables to an existing SAVE file, and several
   flexible ways to pass the data and variable names to be saved.
   CMSAVE also attempts to run on all IDL versions.

   To append variables to an existing file, simply specify the APPEND
   keyword, and the filename of an existing writable SAVE file.
   Variables will be appended to the end of the file.  It is possible
   to append a variable with the same name as an existing variable in
   a file.  Both data values are stored in the file.  However the
   results upon restore are undefined.  There is also a limitation
   that only one series of heap values -- pointed-to data -- may be
   saved in a file.

   By the normal convention of the built-in SAVE command, both the
   data and variable names to be saved are passed as parameters on
   the command line.  Each parameter must be a named variable; both
   the name and value are saved.

   This convention may be used in invoking CMSAVE as well.  However,
   in addition to passing the data by positional parameter, the user
   can pass the data using the DATA keyword.  If the DATA keyword is
   used, then an array of pointers or handles may be passed, or a
   structure of values may be passed.  (see below)  If both are
   passed, then the positional parameters take precedence.

   It is also possible to explicitly rename the saved variables: the
   saved name does not need to be the name of the named variable.
   Use the NAMES keyword to override the default name.  By default
   the name is drawn from any named variables, or from the structure
   tag names if the DATA keyword is used with a structure.  The NAMES
   keyword takes precedence over these values.  NOTE: Values passed
   by pointer or handle are not named by default, and so will not be
   saved unless the NAMES keyword is used.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 COMPATIBILITY:

   -- File Format --
   Files written by CMSAVE should be readable with all known versions
   of IDL at the time of this writing (version 4 - version 5.4).  It
   is expected that this compatibility will persist.

   CMSAVE cannot write objects, compressed files, or data sets larger
   than 2 gigabytes.

   Data types available in newer versions of IDL, such as pointers
   and long integers, will not be readable in older versions of IDL
   which do not have those data types.

   -- Calling Interface --

   For the most part, all capabilities of CMSAVE are available to the
   user.  However, it should be noted that passing variables by
   positional parameter is not available under IDL 4, unless NAMES is
   used to name the variables explicitly.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 INPUTS:

   VAR{i} - The variables to be saved.  By default the save name is
            taken from the named variables that are passed.  These
            default names can be overridden by using the NAMES
            keyword.

            Variables can also be specified by passing an array of
            handles or pointers in the DATA keyword.

            If no variables are passed as positional parameters or
            using DATA, then CMSAVE will assume that *all* variables
            at the caller's level should be saved (this is similar
            behavior to the built-in SAVE routine).  Note that system
            variables cannot be saved with CMSAVE.

 KEYWORDS:

   ALL - for compatibility with the built-in SAVE routine.  Ignored.
         Note that CMSAVE cannot save system variables.

   FILENAME - the name of the output file.
              Default: 'cmsave.sav'

   DATA - A list of data elements to be saved to the output file.
          The data elements can be one of the following.  The means
          of extracting the data, and the method of naming each
          variable, are also indicated.

            * An array of pointers to the variables
                    Data: pointed-to value     Name: from NAMES keyword
            * An array of handles to the variables
                    Data: pointed-to value     Name: from NAMES keyword
            * A 1-element structure containing data to be saved.
                    Data: tag value            Name: tag name

          Data values are saved one by one, using the appropriate
          name.  Note that any variables passed as positional
          parameters will cause the DATA keyword to be ignored.

          The calling routine is responsible for deallocating any
          pointer or handle resources.

   COMPATIBILITY - a string, which describes the format to be used in
          the output file.  Possible values are:

                  'IDL4' - format of IDL version 4;
                  'IDL5' - format of IDL versions 5.0-5.3;
                  'IDL6' - not supported yet, for versions 5.4-above;
                  'RIVAL1' - same as 'IDL5', plus a directory entry is
                            written to the file.
           Note that files written in IDL5 format may still be
           readable by IDL v.4.
           Default: 'IDL5'

   NAMES - a string array, giving the names for each variable.  

           If the data are passed by positional parameters, the names
           are assigned according to the position of the parameter in
           the procedure call.  This can be especially useful to
           rename local variables, and to give names to expressions.

           If the data are passed by an array of pointers or handles,
           then the names are assigned according to the position of
           the data in the array.  In this case there is no other way
           to supply the variable name.  NAMES is required.

           If the data are passed in a structure, then the names are
           assigned according to the position of the data in the
           structure.  The NAMES keyword values override the tag
           names.

   APPEND - if set, then the specified variables are appended to an
            existing file.  

            Repeated variables will not cause an error, however they
            may not be restored properly using the built-in RESTORE
            procedure.  It may also not be permitted to append
            variables that contain heap pointers, to a save file
            which already contains heap data.

   STATUS - upon return, an integer indicating the status of the
            operation.  A value of 1 indicates success, while 0
            indicates failure.  A failure condition does not
            necessarily indicate that an individual variable could
            not be written; use the VARSTATUS keyword to detect such
            situations.

   VARSTATUS - upon return, an integer array indicating the status of
               the save operation for each variable.  A value of 1 at
               position i in the array indicates success for the ith
               variable, while a value of 0 indicates failure.

   ERRMSG - upon return, a string indicating the status of the
            operation.  The empty string indicates success, while a
            non-empty string indicates failure and describes the
            error condition.

   QUIET - if set, then the error message is returned to the calling
           routine.  By default an error condition causes execution
           to stop and the message to be printed on the console.

   VERBOSE - if set, then a short message is printed for each
             variable.

   XDR - for compatibility with the built-in SAVE routine.  Ignored.

 EXAMPLE:

   CMSAVE, VAR1, VAR2, FILENAME='test.sav'
   CMSAVE, VAR1, VAR2, FILENAME='test.sav', NAMES=['A','B']

     Save the data in VAR1 and VAR2 to the file test.sav.  In the
     first case the saved variable names will be VAR1 and VAR2.  In
     the second case the saved variable names will be A and B.

   POINTERS = [ptr_new(VAR1), ptr_new(VAR2)]
   CMSAVE, DATA=POINTERS, NAMES=['A','B'], FILENAME='test.sav'

     Save the data in VAR1 and VAR2 to the file test.sav.  The saved
     variable names will be A and B.  Data are passed by pointer.

   STRUCTURE = {A: VAR1, B: VAR2}
   CMSAVE, DATA=STRUCTURE, FILENAME='test.sav'

     Save the data in VAR1 and VAR2 to the file test.sav.  The saved
     variable names will be A and B.  Data are passed by structure.

 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 14 May 2000
   Documented, 22 Sep 2000
   Made "more" compatible with SAVE; additional documentation, 11 Jan
     2001, CM
   Make version checks with correct precision, 19 Jul 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsave.pro,v 1.14 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsave.pro)


CMSAVEDIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSAVEDIR

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Display a directory of the variables in an IDL SAVE file.

 CALLING SEQUENCE:
   CMSAVEDIR, filename [, /VERBOSE, /QUIET, ... ]
   
 DESCRIPTION: 

   CMSAVEDIR will display a listing of the variables and other
   objects stored in an IDL SAVE file.

   For command-line users the primary function of CMSAVEDIR will be
   to find out what data is stored in a file and when it was saved.
   For that, they simply need to type: CMSAVEDIR, 'myfile.sav'

   CMSAVEDIR also offers a number of features for programmers.
   CMSAVEDIR essentially interrogates the save file and discovers the
   numbers, names and types of each of the variables stored in the
   file.  Programmers can use that information to decide whether or
   how to open a file using the other routines in the CMSVLIB.
   Various keyword parameters are used return this information, as
   documented below.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 COMPATIBILITY:

   -- File Format --

   CMSAVEDIR cannot examine compressed save files, or files larger
   than 2 gigabytes.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 INPUTS:

   FILENAME - a scalar string, the name of the file to be examined.

 KEYWORDS:

   VERBOSE - if set, print more detailed information about the input file.

   QUIET - if set, then do not print any output.  Programmers can use
           this keyword to allow CMSAVEDIR to return information
           about the file silently.

   STATUS - upon output, 1 for success, otherwise to indicate
            failure.
   ERRMSG - upon output, if a failure occurs, a message describing
            the error condition.
  
   N_VARIABLES - upon output, the number of variables in the file.
   VAR_NAMES - upon output, contains a string array of the names of
               the variables stored in the file.
   TYPES - upon output, an 11xN_VARIABLES array containing the SIZE
           information of each variable in the file.

   N_PRO - upon output, the number of procedures stored in the file.
   PRO_NAMES - upon output, the names of the procedures stored in the
               file, as a string array.

   N_FUNCTION - upon output, the number of functions stored in the
                 file.
   FUNC_NAMES - upon output, the names of the functions stored in the
                file, as a string array.

   NAMED_STRUCTS - upon output, a string array listing any named
                   structures which appear in the SAVE file.
   NAMED_CLASSES - upon output, a string array listing any named
                   class structures which appear in the SAVE file.

   TIMESTAMP - upon output, contains the timestamp record information
               in a structure.  The fields of the structure are:
                    SAVE_DATE - string - date saved
                    SAVE_USER - string - user who saved file
                    SAVE_HOST - string - host name on which file
                                         saved

   VERSION - upon output, contains the version record information in
             a structure.  The fields of the structure are:
                    FORMAT_VERSION - integer - major format version
                    ARCH    - string - saving host's !VERSION.ARCH
                    OS      - string - saving host's !VERSION.OS
                    RELEASE - string - saving host's !VERSION.RELEASE

   FORCE - if set, will force CMSAVEDIR to open the file even if it
           detects a potential incompatibility.

 EXAMPLE:

   IDL> cmsavedir, 'int_str_intarr.sav'
   ** int_str_intarr.sav
   ** Sun Apr  9 20:28:25 2000 (craigm@beach.gsfc.nasa.gov)
   ** IDL v5.2 (linux)
     A               INT       =        0
     B               STRING    = 'hello'
     C               INT       = Array[3]
   ** 3 variable(s), 0 heap value(s) and 0 procedure(s) in 1376 bytes

 SEE ALSO:

   CMRESTORE, CMSAVE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Documented, 12 Jan 2001, CM
   Added USAGE message, 09 Jun 2001, CM
   Fixed bug in printing common variables, 17 Mar 2002, CM
   Added notification about RSI License, 13 May 2002, CM
   

 $Id: cmsavedir.pro,v 1.16 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsavedir.pro)


CMSET_OP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSET_OP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Performs an AND, OR, or XOR operation between two sets

 CALLING SEQUENCE:
   SET      = CMSET_OP(A, OP, B)

 DESCRIPTION: 

   SET_OP performs three common operations between two sets.  The
   three supported functions of OP are:

        OP          Meaning
      'AND' - to find the intersection of A and B;
      'OR'  - to find the union of A and B;
      'XOR' - to find the those elements who are members of A or B 
              but not both;

   Sets as defined here are one dimensional arrays composed of
   numeric or string types.  Comparisons of equality between elements
   are done using the IDL EQ operator.

   The complements of either set can be taken as well, by using the
   NOT1 and NOT2 keywords.  For example, it may be desireable to find
   the elements in A but not B, or B but not A (they are different!).
   The following IDL expressions achieve each of those effects:

      SET = CMSET_OP(A, 'AND', /NOT2, B)   ; A but not B
      SET = CMSET_OP(/NOT1, A, 'AND', B)   ; B but not A

   Note the distinction between NOT1 and NOT2.  NOT1 refers to the
   first set (A) and NOT2 refers to the second (B).  Their ordered
   placement in the calling sequence is entirely optional, but the
   above ordering makes the logical meaning explicit.

   NOT1 and NOT2 can only be set for the 'AND' operator, and never
   simultaneously.  This is because the results of an operation with
   'OR' or 'XOR' and any combination of NOTs -- or with 'AND' and
   both NOTs -- formally cannot produce a defined result.

   The implementation depends on the type of operands.  For integer
   types, a fast technique using HISTOGRAM is used.  However, this
   algorithm becomes inefficient when the dynamic range in the data
   is large.  For those cases, and for other data types, a technique
   based on SORT() is used.  Thus the compute time should scale
   roughly as (A+B)*ALOG(A+B) or better, rather than (A*B) for the
   brute force approach.  For large arrays this is a significant
   benefit.

 INPUTS:

   A, B - the two sets to be operated on.  A one dimensional array of
          either numeric or string type.  A and B must be of the same
          type.  Empty sets are permitted, and are either represented
          as an undefined variable, or by setting EMPTY1 or EMPTY2.

   OP - a string, the operation to be performed.  Must be one of
        'AND', 'OR' or 'XOR' (lower or mixed case is permitted).
        Other operations will cause an error message to be produced.

 KEYWORDS:

   NOT1, NOT2 - if set and OP is 'AND', then the complement of A (for
                NOT1) or B (for NOT2) will be used in the operation.
                NOT1 and NOT2 cannot be set simultaneously.

   EMPTY1, EMPTY2 - if set, then A (for EMPTY1) or B (for EMPTY2) are
                    assumed to be the empty set.  The actual values
                    passed as A or B are then ignored.

   INDEX - if set, then return a list of indices instead of the array
           values themselves.  The "slower" set operations are always
           performed in this case.

           The indices refer to the *combined* array [A,B].  To
           clarify, in the following call: I = CMSET_OP(..., /INDEX);
           returned values from 0 to NA-1 refer to A[I], and values
           from NA to NA+NB-1 refer to B[I-NA].

   COUNT - upon return, the number of elements in the result set.
           This is only important when the result set is the empty
           set, in which case COUNT is set to zero.

 RETURNS:

   The resulting set as a one-dimensional array.  The set may be
   represented by either an array of data values (default), or an
   array of indices (if INDEX is set).  Duplicate elements, if any,
   are removed, and element order may not be preserved.

   The empty set is represented as a return value of -1L, and COUNT
   is set to zero.  Note that the only way to recognize the empty set
   is to examine COUNT.

 SEE ALSO:

   SET_UTILS.PRO by RSI

 MODIFICATION HISTORY:
   Written, CM, 23 Feb 2000
   Added empty set capability, CM, 25 Feb 2000
   Documentation clarification, CM 02 Mar 2000
   Incompatible but more consistent reworking of EMPTY keywords, CM,
     04 Mar 2000
   Minor documentation clarifications, CM, 26 Mar 2000
   Corrected bug in empty_arg special case, CM 06 Apr 2000
   Add INDEX keyword, CM 31 Jul 2000
   Clarify INDEX keyword documentation, CM 06 Sep 2000
   Made INDEX keyword always force SLOW_SET_OP, CM 06 Sep 2000
   Added CMSET_OP_UNIQ, and ability to select FIRST_UNIQUE or
     LAST_UNIQUE values, CM, 18 Sep 2000
   Removed FIRST_UNIQUE and LAST_UNIQUE, and streamlined
     CMSET_OP_UNIQ until problems with SORT can be understood, CM, 20
     Sep 2000 (thanks to Ben Tupper)
   Still trying to get documentation of INDEX and NOT right, CM, 28
     Sep 2000 (no code changes)

  $Id: cmset_op.pro,v 1.2 2001/03/25 18:10:42 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmset_op.pro)


CMSVLIB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSVLIB

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Initialize the CMSVLIB save library

 CALLING SEQUENCE:
   VALUE = CMSVLIB(/QUERY)
   
 DESCRIPTION: 

   This function initializes the CMSVLIB library to read, write and
   interrogate IDL save files.  Use the QUERY keyword to determine
   whether the full CMSVLIB library is present.

   The procedures in the library are:

    High-level
      CMSAVE - save variables to a save file
      CMRESTORE - restore variables from a save file
      CMSAVEDIR - list contents of a save file 
      CMSVLIB (function) - this file

    Mid-level  
      CMSV_OPEN - open a save file for reading or writing
      CMSVREAD - read non-pointer data from file
      CMSVWRITE - write non-pointer data to file

    Low-level
      CMSV_RREC - read record from save file
      CMSV_RVTYPE - read variable type information from file
      CMSV_RDATA - read variable data from file
      CMSV_WREC - write record to save file
      CMSV_WVTYPE - write variable type information to file
      CMSV_WDATA - write variable data to file

    Utility
      CMSV_RRAW (function) - read raw integer or string data from file
      CMSV_WRAW - write raw integer or string data to file
      CMSV_PTRSUM - create a heap data inventory
      CMSV_TEST - test the library
      TAGSIZE (function) - determine the types of all tags in a structure
      HELPFORM (function) - create HELP-like string describing a variable

   Users should consult 

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 INPUTS:

   None

 KEYWORDS:

   QUERY - if set, determine whether the CMSVLIB library is
           installed.  Function returns 1 upon success, 0 upon
           failure.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsvlib.pro,v 1.3 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsvlib.pro)


CMSVREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSVREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Read a single variable from an open SAVE file

 CALLING SEQUENCE:

   CMSVREAD, UNIT, DATA [, NAME=NAME, /NO_DATA, VERSION=VERSION,
                           TIMESTAMP=TIMESTAMP ]
   
 DESCRIPTION: 

   CMSVREAD reads a single IDL variable from an open IDL SAVE file.
   The file should already have been opened as a normal file using
   OPENR.

   CMSVREAD is a simplified version of the CMSVLIB package, and as
   such is not capable of reading heap data (pointers) or object
   data.  Strings, structures, and all array types are supported.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 INPUTS:

   UNIT - the open file unit.

   DATA - a named variable, into which the new data is to be read.

 KEYWORDS:

   NAME - upon output, the name of the saved variable is returned in
          this keyword.  If a failure or end of file condition
          occurs, name will be undefined upon return.

   STRUCTURE_NAME - if the data to be read is a structure, upon
                    output, this keyword will contain the name of the
                    structure.  A value of '' indicates an anonymous
                    structure.

   SIZE - upon output, the SIZE type of the data is returned in this
          keyword.

   NO_DATA - if set, no data is read from the file, only the variable
            name and type.

   TIMESTAMP - after the first call to CMSVREAD on a newly opened
               file, this keyword will contain the file timestamp
               structure.

   VERSION - after the first call to CMSVREAD on a newly opened file,
             this keyword will contain the file version information,
             if available.

   QUIET - if set, error messages are not printed.
           Default: an error causes errors to be printed with MESSAGE

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:

   Read all variables from a file, and print help on them.

   openr, 50, 'test.sav'
   name = ''
   while n_elements(name) GT 0 do begin   ;; EOF signalled by NAME undefined
      cmsvread, 50, data, name=name
      help, name, data
   end
   close, 50

 SEE ALSO:

   CMSVWRITE, CMRESTORE, CMSAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written and documented, 11 Jan 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsvread.pro,v 1.7 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsvread.pro)


CMSVWRITE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSVWRITE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Write a single variable to an open SAVE file

 CALLING SEQUENCE:

   CMSVWRITE, UNIT, DATA [ , NAME=NAME, COMPATIBILITY=COMPAT ]
   
 DESCRIPTION: 

   CMSVWRITE writes a single IDL variable to an open IDL SAVE file.
   The file should already have been opened for writing as a normal
   file using OPENW or OPENU.

   CMSVWRITE is a simplified version of the CMSVLIB package, and as
   such is not capable of writing heap data (pointers) or object
   data, or structures that contain them.  Strings, structures, and
   all array types are supported.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 INPUTS:

   UNIT - the open file unit.

   DATA - the data to be written.

 KEYWORDS:

   NAME - the optional name of the variable to be written (must be a
          valid variable name).
          Default: CMSVWRITE automatically creates a valid name.
  
   COMPATIBILITY - a string, which describes the format to be used in
          the output file.  Possible values are:

                  'IDL4' - format of IDL version 4;
                  'IDL5' - format of IDL versions 5.0-5.3;
                  'IDL6' - not supported yet, for versions 5.4-above;
                  'RIVAL1' - same as 'IDL5'
           Note that files written in IDL5 format may still be
           readable by IDL v.4.
           Default: 'IDL5'

   NO_END - a save file must terminate with an "end" record.  By
            default, CMSVWRITE will append such a record after the
            variable is written, and then rewind the file pointer.
            The end record must be written after the last variable,
            but is optional otherwise.  Set this keyword to disable
            writing the end record (for performance reasons).

   QUIET - if set, error messages are not printed.
           Default: an error causes errors to be printed with MESSAGE

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:

   Write variables A, B, C and D to a file.

   openw, 50, 'test.sav'       ;; Add /STREAM under VMS !
   cmsvwrite, 50, a, name='a'
   cmsvwrite, 50, b, name='b'
   cmsvwrite, 50, c, name='c'
   close, 50

 SEE ALSO:

   CMSVREAD, CMRESTORE, CMSAVE, SAVE, CMSVLIB

 MODIFICATION HISTORY:
   Written and documented, 11 Jan 2001, CM
   Make version checks with correct precision, 19 Jul 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsvwrite.pro,v 1.11 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsvwrite.pro)


CMSV_OPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_OPEN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Open IDL SAVE file for reading or writing

 CALLING SEQUENCE:
   CMSV_OPEN, UNIT, FILENAME, OFFSET, $
          ACCESS=ACCESS, /FORCE, /GET_LUN, /REOPEN, $
          COMPATIBILITY=COMPATIBILITY, $
          STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   CMSV_OPEN opens an IDL SAVE-formatted file for reading or writing.
   The mode of operation is controlled by the ACCESS keyword, which
   may be either 'R' for reading, 'W' for writing, or 'RW' for
   read/write access.

   'R': In the case of reading, the specified file is opened with
   read-only access, and the first bytes are examined to verify that
   it is indeed a valid IDL SAVE file.  

   'W': In the case of writing, the specified file is opened with
   write access, and the initial file signature is written.  

   'RW': In the case of read-write access, the file must already
   exist as a valid SAVE file.  Users are advised that every time
   they switch between reading and writing operations, they must use
   POINT_LUN to flush the file buffers.

   The CMSVLIB routines do not support file sizes greater than 2 GB,
   nor SAVE files created with the COMPRESS option.

   Upon return, the file pointer is positioned at the start of the
   first valid SAVE record.  The file offset is returned in OFFSET.
   The user is responsible for reading or writing the remainder of
   the file with other library routines.

   The file unit is determined based on the following criteria.  This
   behavior is similar to the OPEN family of procedures, except for
   the REOPEN keyword.

     * If REOPEN is set then it is assumed that UNIT is an
       already-open file, and FILENAME is ignored.  

     * If GET_LUN is set then a file unit is allocated with GET_LUN,
       and upon success this unit is returned in UNIT.

     * Otherwise it is asssumed that UNIT is a valid but unopened
       file unit.  Upon successful return, UNIT is opened.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================


 INPUTS:

   UNIT - a logical unit number (a scalar).  In the case of GET_LUN,
          a file unit will be allocated and returned in UNIT.  In the
          default case, or REOPEN, UNIT must be a valid file unit
          upon input.  For REOPEN the corresponding file must be
          seekable.

   FILENAME - a scalar string specifying the filename path (ignored
              for REOPEN).

   OFFSET - upon return, the file offset of the next available SAVE
            record.


 KEYWORDS:

   ACCESS - a scalar string, case insensitive:
               'R' - read-only access
               'W' - write access (new file)
               'RW' - read-write access (existing file)
            Default: 'R' - read-only

   GET_LUN - if set, the file unit is allocated using GET_LUN

   FORCE - if set, then the file is opened despite a detected file
           format inconsistency.

   REOPEN - if set, then an already-opened file is manipulated.  The
            valid file unit must be specified by UNIT, and FILENAME
            is ignored.

   COMPATIBILITY - a string, which describes the format to be used in
          the output file.  Possible values are:

                  'IDL4' - format of IDL version 4;
                  'IDL5' - format of IDL versions 5.0-5.3;
                  'IDL6' - not supported yet, for versions 5.4-above;
                  'RIVAL1' - same as 'IDL5', plus a directory entry is
                            written to the file.
           Note that files written in IDL5 format may still be
           readable by IDL v.4.
           Default: 'IDL5'


   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Change BLOCK to STREAM to support VMS properly, 14 Feb 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_open.pro,v 1.12 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_open.pro)


CMSV_PTRSUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_PTRSUM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Construct an inventory of heap data accessible to a variable

 CALLING SEQUENCE:
   CMSV_PTRSUM, VAR, LIST
   
 DESCRIPTION: 

   This procedure constructs an inventory of heap data that is
   accessible to a single variable.  It searches all array elements,
   recursively through structure tags, and by dereferencing pointers.
   Users can use this procedure to determine all heap variables that
   need to be saved to disk.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt. 

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 INPUTS:

   VAR - the variable to be examined

   LIST - upon output, an array of pointers, each of which points to
          a heap variable accessible to VAR.  If there are no heap
          data pointed to by VAR, then LIST returns a NULL value.

 KEYWORDS:

   NULL - if set, return the null value in LIST instead of the
          pointer list.  VAR is ignored.

   HAS_OBJECTS - upon return, the value is 1 if VAR contains or
                 points to an object reference, and 0 if not.


 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Make version checks with correct precision, 19 Jul 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_ptrsum.pro,v 1.7 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_ptrsum.pro)


CMSV_RDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_RDATA

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Read SAVE-formatted data variable record from input block or file unit

 CALLING SEQUENCE:
   CMSV_RDATA, BLOCK, POINTER, SIZE, DATA, UNIT=UNIT, $
          TEMPLATE=TEMPLATE, /TEMPORARY, PTR_INDEX=PTR_INDEX, $
          PTR_CALLBACK=PTR_CALLBACK, PTR_OFFSETS=PTR_OFFSETS, $
          OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   CMSV_RDATA reads the data portion of an IDL SAVE variable record.
   An IDL variable is stored in two components: the type descriptor
   which describes the name, type, and dimensions of the variable;
   and the data record, which contains the raw data of the variable.
   This procedure reads the raw data and returns it to the user.  The
   initial type portion of the record must have already been read
   using the CMSV_RVTYPE procedure.

   CMSV_RDATA supports the following variable types:

     BYTE(1),INT(2),LONG(3) - integer types
     UINT(12),ULONG(13),LONG64(14),ULONG64(15) - integer types (IDL >5.2 only)
     FLOAT(4),DOUBLE(5),COMPLEX(6),DCOMPLEX(9) - float types
     STRING(7) - string type
     STRUCT(8) - structure type
     POINTER(10) - pointer type - SEE BELOW
     NOT SUPPORTED - OBJ(11) - object reference type - NOT SUPPORTED

   Arrays and structures containing any of the supported types are
   supported (including structures within structures).

   For scalars and arrays of numeric or string types, the caller must
   only supply the SIZE parameter, which specifies the type and
   dimensions of the variable to be read.  This information can be
   obtained from the CMSV_RVTYPE routine. The data is returned in the
   output parameter DATA.

   For structure data, in addition to specifying the SIZE array, the
   user must also supply a "template" describing the structure into
   which the data will be read.  This template is simply a "blank"
   form of the data structure, and is returned by CMSV_RVTYPE.

   Thus, a simple way to read structure, numeric or string data is
   the following code (with error checking removed)

     CMSV_RVTYPE, block, pointer, name, size, template=template, unit=unit
     CMSV_RDATA, block, pointer, size, data, template=template, unit=unit

   [ This code assumes the record header has been read with
   CMSV_RREC. ]

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 POINTER DATA

   Pointer data stored in IDL SAVE files are particularly difficult
   to manage, because the actual heap variables are stored in
   separate records which *precede* the record of interest.  Thus, if
   your application requires the reading of pointer data, you must
   perform special processing in your own code in order to support
   it.  In essence, you must maintain an inventory of heap variables
   as they are encountered in the file.

   If these procedures are not followed then pointer data will not be
   read, and a LONG integer value appears in the pointers' places.
   Under IDL 4, pointer data can never be read.

   This is accomplished by placing some additional logic in your file
   processing loop.  There are four separate components to this: (1)
   loop initialization; (2) reading a HEAP_INDEX record; (3) parsing
   a HEAP_DATA record; and (4) passing extra arguments to CMSV_RDATA.
   The additional state information is maintained in two variables
   named PTR_INDEX, which keeps track of the heap variable numbers,
   and PTR_OFFSETS, which stores the file location of each variable.

   (1) Loop initialization: is quite simple, use the following code:
       ptr_index   = [0L]
       ptr_offsets = [0L]
       ptr_data    = [ptr_new()]

   (2) Reading HEAP_INDEX, which is an array of values indicating
       the heap variable numbers of each heap variables.  These
       values are stored in PTR_INDEX:

          CMSV_RHEAP, block, pointer, index, unit=unit
          ptr_index   = [ptr_index, index]
          ptr_offsets = [ptr_offsets, lonarr(n_elements(index))]
          ptr_data    = [ptr_data, ptrarr(n_elements(index))]

   (3) Parse the HEAP_DATA record.  Here were are interested in the
       heap variable number, and the file offset.
       
       opointer = pointer
       CMSV_RVTYPE, block, pointer, vindex, /heap, unit=unit
       
       vindex = floor(vindex(0))
       wh = where(ptr_index EQ vindex)
       ptr_offsets(wh(0)) = offset + opointer

       Keep in mind that the file offset is OFFSET+POINTER.

   (4) Pass extra parameters to CMSV_RDATA.  The user simply passes
       these extra variables to the CMSV_RDATA procedure, which
       automatically recognizes heap data and reads it from the
       appropriate location.

       CMSV_RVTYPE, block, pointer, name, size, unit=unit, template=tp
       CMSV_RDATA, block, pointer, size, data, template=tp, $
         unit=unit, ptr_offsets=ptr_offsets, $
         ptr_index=ptr_index, ptr_data=ptr_data

   If this technique is used properly, only those heap variables
   which are needed are read.  Thus, there are never any lost or
   dangling pointers.  Since each bit of heap data is stored in a
   variable returned to the user, it is not necessary to
   PTR_FREE(ptr_data); in fact, doing so would corrupt the input
   data.

 BLOCK, POINTER, OFFSET

   This procedure can read data from a byte array, a file unit, or
   both.  In fact, this procedure is designed to implement "lazy"
   reading from a file, which is to say, it normally reads from a
   byte array of data.  However, if the requested data goes beyond
   the end of the byte array, more data is read from the file on
   demand.  This way the user gets the benefit of fast memory access
   for small reads, but guaranteed file access for large reads.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.

   SIZE - an array of integers describing the type and dimensions of
          the variable to be read, in the format returned by the
          SIZE() routine.  This parameter is required.

   DATA - upon output, the data variable.  If any heap data is read,
          the user is ultimately responsible for freeing it.


 KEYWORDS:

   UNIT - a file unit.  If a library routine reads to the end of
          BLOCK, or if BLOCK is undefined, then this file UNIT will
          be accessed for more data.  If undefined, then BLOCK must
          contain the entire file in memory.

   TEMPLATE - for structure data (data type 8), a "blank" structure
              containing the fields and data values to be read in.
              This structure is returned by CMSV_RVTYPE.
              This keyword is mandatory for structure data.

   TEMPORARY - if set, BLOCK becomes undefined upon return.

   PTR_OFFSETS - array of file offsets, as described above.  Default:
                 pointer data is converted to an integer.

   PTR_INDEX - array of heap variable indices, as described above.
               Default:  pointer data is converted to an integer.

   PTR_DATA - array of pointers, as described above.  
               Default:  pointer data is converted to an integer.

   OFFSET - the file offset of byte zero of BLOCK.  Default: 0
            (OFFSET is used by this routine)

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added UNDEFINED data type for IDL >5.3, CM, 21 Apr 2001
   Fixed bug for pointers within structures, CM, 21 Apr 2001
   Add support for IDL 4 byte-compiled strings, CM, 22 Apr 2001
   Make version checks with correct precision, 19 Jul 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_rdata.pro,v 1.10 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_rdata.pro)


CMSV_RRAW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_RRAW

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Read raw SAVE data from input block or file unit

 CALLING SEQUENCE:
   DATA = CMSV_RRAW( BLOCK, POINTER, NELT, UNIT=UNIT, $
                     STRING=STRING, LONG=LONG, BYTE=BYTE, TYPE=TYPE, $
                     OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG )
   
 DESCRIPTION: 

   This function reads raw integer or string data from an IDL SAVE
   file.  This is the lowest level reading function in the library,
   intended for developers who are investigating new and existing
   SAVE file formats.

   The primary use of this function will be to read raw integer and
   string data from the input.  By default, a single value is read as
   a scalar; however a vector of values can be read using the NELT
   parameter.  Special keywords are provided for the common data
   types STRING, LONG and BYTE.  Other integer types can be read
   using the TYPE keyword.  Users who want to read the data from an
   IDL variable should use CMSV_RDATA, which can handle
   multidimensional data, as well as floating point and structure
   data.

   A secondary use of this function is to buffer the data in BLOCK.
   This will ensure that BLOCK contains enough data to convert NELT
   integers without reading from disk.  CMSV_RRAW itself does not
   convert any values so the return value should be ignored.


 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 BLOCK, POINTER, OFFSET

   This procedure can read data from a byte array, a file unit, or
   both.  In fact, this procedure is designed to implement "lazy"
   reading from a file, which is to say, it normally reads from a
   byte array of data.  However, if the requested data goes beyond
   the end of the byte array, more data is read from the file on
   demand.  This way the user gets the benefit of fast memory access
   for small reads, but guaranteed file access for large reads.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.

   NELT - optional parameter specifying the number of values to read.
          If unspecified, then a scalar value is read and returned.
          If specified, then a vector of NELT values is read and
          returned.


 KEYWORDS:

   BUFFER - if set, CMSV_RRAW will ensure that BLOCK contains at
            least NELT values without converting them.  The return
            value should be ignored.  This keyword is ignored for
            strings.

   LONG - if set, the values are converted as LONG integers.

   BYTE - if set, the values are converted as BYTEs.

   STRING - if set, the values are converted as STRINGs.  Each string
            may be of variable length.

   TYPE - if none of the above keywords is set, then values of type
          TYPE are read.  TYPE should be a string, one of 'BYTE',
          'FIX', 'LONG', 'ULONG', 'LONG64', or 'ULONG64'.
          If no type is specified then BYTEs are read.

   UNIT - a file unit.  If a library routine reads to the end of
          BLOCK, or if BLOCK is undefined, then this file UNIT will
          be accessed for more data.  If undefined, then BLOCK must
          contain the entire file in memory.

   OFFSET - the file offset of byte zero of BLOCK.  Default: 0
            (OFFSET is used by this routine)

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_rraw.pro,v 1.6 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_rraw.pro)


CMSV_RREC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_RREC

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Read SAVE-formatted record header from input block or file unit

 CALLING SEQUENCE:
   CMSV_RREC, BLOCK, POINTER, DATA, UNIT=UNIT, $
        BLOCK_TYPE=BLOCK_TYPE, BLOCK_NAME=BLOCK_NAME, NEXT_BLOCK=NEXT_BLOCK, $
        INITIALIZE=INITIALIZE, FULL=FULL, PROMOTE64=PROMOTE64, $
        OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   This procedure reads the header of an IDL SAVE record.  The header
   consists of four bytes at the beginning of each record which
   indentifies the type and size of the record.  This procedure also
   additionally reads many full records as noted below.

   Users can determine the block type by examining the values
   returned in the BLOCK_TYPE and BLOCK_NAME keywords.  The following
   values are supported.  Some record types contain additional data.
   CMSV_RREC reads some of these record types automatically (those
   entries below marked with [this procedure]).  Other records do not
   contain any additional data at all (those entries marked with an
   [empty]), and thus require no further processing.

    BLOCK_TYPE      BLOCK_TYPE         READ RECORD DATA WITH...

       0         = 'START_MARKER'      [empty]
       1         = 'COMMON_BLOCK'      [this procedure]
       2         = 'VARIABLE'          CMSV_RVTYPE / CMSV_RDATA
       3         = 'SYSTEM_VARIABLE'   CMSV_RVTYPE / CMSV_RDATA
       6         = 'END_MARKER'        [empty]
       10        = 'TIMESTAMP'         [this procedure]
       12        = 'COMPILED'          no published procedure
       13        = 'IDENTIFICATION'    [this procedure]
       14        = 'VERSION'           [this procedure]
       15        = 'HEAP_INDEX'        [this procedure]
       16        = 'HEAP_DATA'         CMSV_RVTYPE
       17        = 'PROMOTE64'         [empty]

   For records that contain variable data, the external procedures
   CMSV_RVTYPE and CMSV_RDATA must be used, as noted above.
   Otherwise CMSV_RREC will read and convert the appropriate data
   automatically and return it in the DATA positional parameter.

   The offset of the next record is returned in the NEXT_BLOCK
   keyword.  For file input, the command, "POINT_LUN, UNIT,
   NEXT_BLOCK" will position the file pointer to the next block.

   Users should be aware that the SAVE files produced by IDL version
   5.4 appear to have a different header format.  The new header size
   is five bytes, and is incompatible with the older format.  In
   order to activate the longer header size, the PROMOTE64 keyword
   must be set.

   By default the entire record is not read from the file at once.
   Users that wish to operate on the entire record immediately should
   set the FULL keyword.

   After issuing a POINT_LUN the block cache in BLOCK must be reset
   using the /INITIALIZE keyword.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 SPECIFIC RECORD TYPES

   CMSV_RREC reads certain specific record types automatically and
   returns the data in the positional parameter data.  Users should
   pass a named variable in this parameter to retrieve the return
   value.

   When a record of type 'VERSION' (14) is encountered, it is read,
   and returned as a structure. The returned data are of the form:

         { FORMAT_VERSION: 0L, $   ; Format version number of file
           ARCH: '', $             ; !VERSION.ARCH of creating host
           OS: '', $               ; !VERSION.OS of creating host
           RELEASE: '' }           ; !VERSION.RELEASE of creating host

   When a record of type 'TIMESTAMP' (10) is encountered, it is read,
   and returned as a structure. The returned data are of the form:

          { SAVE_DATE: '', $  ; Date the save file was created
            SAVE_USER: '', $  ; User name who  created file
            SAVE_HOST: '' }   ; Host name that created file

   Save files created by IDL version 4 do not contain a timestamp
   record.

   When a record of type 'IDENTIFICATION' (13) is encountered, it is
   read, and returned as a structure.  The returned data are of the
   form:

          { AUTHOR: '', $  ; Author of SAVE file
            TITLE:  '', $  ; Title of SAVE file
            IDCODE: '' }   ; Identifying code for SAVE file

   It appears that this record is not used in IDL version 5 or later.

   When a record of type 'COMMON_BLOCK' (1) is encountered, it is
   read and returned.  A common block descriptor consists of an array
   of strings whose first element is the common block name, and whose
   remaining elements are the common block variable names.  No
   variable data are stored with the common block definition.

   When a record of type 'HEAP_INDEX' (15) is encountered, it is read
   and returned in DATA.  The heap index specifies a list of which
   heap variables are stored in the current save file.  These indices
   are simply numbers which identify each heap variable (i.e.,
   "" would have an index of 2).  Users should note that
   the heap index will not necessarily be sequentially increasing,
   and may have gaps.

   Users should consult CMSV_RDATA for instructions on how to read
   heap data.
   

 BLOCK, POINTER, OFFSET

   This procedure can read data from a byte array, a file unit, or
   both.  In fact, this procedure is designed to implement "lazy"
   reading from a file, which is to say, it normally reads from a
   byte array of data.  However, if the requested data goes beyond
   the end of the byte array, more data is read from the file on
   demand.  This way the user gets the benefit of fast memory access
   for small reads, but guaranteed file access for large reads.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.


 KEYWORDS:

   UNIT - a file unit.  If a library routine reads to the end of
          BLOCK, or if BLOCK is undefined, then this file UNIT will
          be accessed for more data.  If undefined, then BLOCK must
          contain the entire file in memory.

   OFFSET - the file offset of byte zero of BLOCK.  Default: 0
            (OFFSET is used by this routine)

   BLOCK_TYPE - upon return, the numeric record type, as described
                above.

   BLOCK_NAME - upon return, a scalar string specifying the record
                type, as specified above.

   NEXT_BLOCK - upon return, file offset of the next record in the
                file.

   INITIALIZE - if set, then BLOCK and POINTER are initialized to a
                pristine state.  All data in these two variables is
                lost before reading the next record.

   FULL - if set, then the entire record will be read into BLOCK.

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Fix typo for RHEAP call, CM, 21 Apr 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_rrec.pro,v 1.11 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_rrec.pro)


CMSV_RVTYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_RVTYPE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Read variable type information from input block or file unit

 CALLING SEQUENCE:
   CMSV_RVTYPE, BLOCK, POINTER, NAME, SIZE, UNIT=UNIT, $
          TEMPLATE=TEMPLATE, SUFFIX=SUFFIX, $
          /NO_CREATE, /NO_TYPE, /HEAP, /SYSTEM, $
          STRUCTURE_NAME=STNAME, $
          NAMED_STRUCTS=STRUCTS, NAMED_CLASSES=CLASSES, $
          OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   CMSV_RVTYPE reads the type portion of an IDL SAVE variable record.
   An IDL variable is stored in two components: the type descriptor
   which describes the name, type, and dimensions of the variable;
   and the data record, which contains the raw data of the variable.
   This procedure reads the type descriptor returns it to the user.
   This procedure can also determine the name of a variable; the heap
   index number of a heap variable; and other important information.
   Once the type of the data has been determined, the data portion
   can be read using the CMSV_RDATA procedure.

   CMSV_RVTYPE should recognize and correctly return type descriptor
   information about all known IDL data types, as of this writing.
   It should be noted that CMSV_RDATA will not necessarily be capable
   of reading all of these data types, but the description of the
   data should still be readable.  Users can then use this
   information to print a summary of the file contents for example.

   The type information are normally returned in the SIZE parameter,
   which gives the IDL variable type, and the dimensions of the
   variable just as the IDL built-in function SIZE() would do.
   However, in the case of structures, there is much more information
   to convey.  To assist the user a blank template structure is
   returned in the keyword parameter TEMPLATE, which they can then
   pass on to CMSV_RDATA.

   Users should be aware of structure and class name clashes.  The
   problem arises because CMSV_RVTYPE must actually instantiate any
   named structures or classes in the file.  If these named
   structures clash with the definitions of the structures on the
   user's local computer, then an error will result.  To prevent
   this, the user can use the SUFFIX keyword.  If the SUFFIX keyword
   contains a string, then this string is appended to any structure
   names discovered in the save file, before instantiation.  Thus, as
   long as the suffix is a unique string, there will be no clashes
   with local structure definitions.  Users are advised to pick a
   different suffix for *each* save file that they open.

   CMSV_RVTYPE also provides some diagnostic information about the
   variable.  Users can pass the NAMED_STRUCTS and NAMED_CLASSES
   keywords in order to discover what named structures, classes and
   superclasses are stored in the save file (this is especially
   useful with the NO_TYPE keyword).  Since the contents of
   NAMED_STRUCTS and NAMED_CLASSES are not destroyed, but appended to
   instead, users are advised to clear these variables when opening
   each new file.
   

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 BLOCK, POINTER, OFFSET

   This procedure can read data from a byte array, a file unit, or
   both.  In fact, this procedure is designed to implement "lazy"
   reading from a file, which is to say, it normally reads from a
   byte array of data.  However, if the requested data goes beyond
   the end of the byte array, more data is read from the file on
   demand.  This way the user gets the benefit of fast memory access
   for small reads, but guaranteed file access for large reads.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.

   NAME - upon return, the identifier of the variable.  For named
          variables, NAME is a string.  For heap variables, NAME is
          an integer heap index.

   SIZE - upon return, an integers array describing the variable type
          and size, in the same format as returned by the built-in
          function SIZE.

 KEYWORDS:

   TEMPLATE - upon return, if the variable is a structure, TEMPLATE
              will contain a single blank template structure, which
              can be used in calls to CMSV_RDATA.

   NO_CREATE - if set, then do not create any template structures
               (saves execution time and structure name clashes).

   NO_TYPE - if set, do not read type information.  CMSV_RVTYPE
             returns only the variable NAME or heap index.

   HEAP - if set, then read the variable type assuming it is a heap
          variable (a HEAP_DATA record).

   SYSTEM - if set, then read the variable type assuming it is a
            system variable (a SYSTEM_VARIABLE record).

   SUFFIX - a scalar string, the suffix to be appended to any
            structure names to force them to be unique.

   STRUCTURE_NAME - upon return, if the variable is a named
                    structure, STRUCTURE_NAME will contain the name
                    of the structure as a string.

   NAMED_CLASSES /
   NAMED_STRUCTS - upon input, this keyword should contain an
                   undefined or a string array value.

                   If the variable contains any named structure/class
                   definitions, CMSV_RVTYPE will append those names
                   upon return, including any enclosed structures or
                   superclasses.

   UNIT - a file unit.  If a library routine reads to the end of
          BLOCK, or if BLOCK is undefined, then this file UNIT will
          be accessed for more data.  If undefined, then BLOCK must
          contain the entire file in memory.

   OFFSET - the file offset of byte zero of BLOCK.  Default: 0
            (OFFSET is not used by this routine at this time)

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_rvtype.pro,v 1.11 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_rvtype.pro)


CMSV_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_TEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Test the CMSVLIB library

 CALLING SEQUENCE:
   CMSV_TEST, FILENAME, USER_VALUE=UVALUE
   
 DESCRIPTION: 

   CMSV_TEST performs a standard test of the CMSVLIB library.  It
   reads and writes a save file using several different methods in an
   attempt to test the different ways that the library can be used.
   The test procedure can be used to verify that the library is
   functioning properly.

   By default, this procedure provides standard values to be written,
   but the user can provide one of them with the USER_VALUE keyword.
   If the user's data contains pointers, they must expect tests
   listed under CMSVREAD and CMSVWRITE to fail.

   By default the file is written in the current directory, but this
   can be changed with the FILENAME parameter.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.


 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 INPUTS:

   FILENAME - a scalar string, the output path.  
              Default: 'CMSVTEST.SAV' in current directory

 KEYWORDS:

   USER_VALUE - any IDL variable to be saved, in place of variable
                "C" in the test.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Resolve all routines at start, and add VMS keyword, 14 Feb 2001, CM
   Make version checks with correct precision, 19 Jul 2001, CM
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_test.pro,v 1.8 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_test.pro)


CMSV_WDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_WDATA

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Write SAVE-formatted data variable record to output block or file

 CALLING SEQUENCE:
   CMSV_WDATA, BLOCK, POINTER, DATA, UNIT=UNIT, TEMPORARY=TEMPORARY, $
               PTR_INDEX=PTR_INDEX, PTR_DATA=PTR_DATA, $
               OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   CMSV_WDATA writes the data portion of an IDL SAVE variable record.
   An IDL variable is stored in two components: the type descriptor
   which describes the name, type, and dimensions of the variable;
   and the data record, which contains the raw data of the variable.
   This procedure writes the raw data to the output.  The initial
   type descriptor portion of the record must have already been
   writtenusing the CMSV_WVTYPE procedure.

   Under normal circumstances a user will write variable or heap data
   using the CMSV_WREC procedure.

   CMSV_WDATA supports the following variable types:

     BYTE(1),INT(2),LONG(3) - integer types
     UINT(12),ULONG(13),LONG64(14),ULONG64(15) - integer types (IDL >5.2 only)
     FLOAT(4),DOUBLE(5),COMPLEX(6),DCOMPLEX(9) - float types
     STRING(7) - string type
     STRUCT(8) - structure type
     POINTER(10) - pointer type - SEE BELOW
     NOT SUPPORTED - OBJ(11) - object reference type - NOT SUPPORTED

   Arrays and structures containing any of the supported types are
   supported (including structures within structures).

   The caller must specify in the DATA parameter, the data to be
   written to output.  The variable passed as DATA must have the same
   type and dimensions as passed to CMSV_WVTYPE.

   Unlike most of the other output routines, this procedure is able
   to send its output to a file rather than to the BLOCK buffer.  If
   the UNIT keyword is specified then output is sent to that file
   UNIT, after any pending BLOCK data is first sent.  Users should
   note that after such operations, the BLOCK POINTER and OFFSET
   parameters may be modified (ie reset to new values).

   See CMSV_WREC for instructions on how to write heap data.

   [ This code assumes the record header and type descriptor have
   been written with CMSV_WREC and CMSV_WVTYPE. ]

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================


 BLOCK, POINTER, OFFSET

   This procedure writes data to a byte array or a file.  If the UNIT
   keyword is specified then file is sent to the specified unit
   number rather than to the buffer BLOCK.  However, the intent is
   for users to accumulate a significant amount of data in a BLOCK
   and then write it out with a single call to WRITEU.  Users should
   be aware that the block can be larger than the buffered data, so
   they should use something like the following:

          WRITEU, UNIT, BLOCK(0:POINTER-1)

   When library routines do indeed write buffered BLOCK data to disk,
   they will appropriately reset the BLOCK and POINTER.  Namely,
   BLOCK will be reset to empty, and POINTER will be reset to zero.
   OFFSET will be advanced the according number of bytes.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN or writing the
           block to disk.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.

   DATA - the data to be written, of any save-able data type.

 KEYWORDS:

   TEMPORARY - if set, then the input DATA are discarded after being
               written, as a memory economy provision.

   PTR_INDEX - a heap index array for the data being written, if any
               heap data records have been written.
               Default: no pointers are written

   PTR_DATA - an array of pointers, pointing to the heap values being
              written.
              Default: no pointers are written

   UNIT - a file unit.  If specified then data are directed to the
          file unit rather than to the buffer BLOCK.

   OFFSET - the file offset of byte zero of BLOCK.  
            Upon output, if the file pointer is advanced, OFFSET will
            also be changed.
            (OFFSET is not currently used by this routine)
            Default: 0

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_wdata.pro,v 1.8 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_wdata.pro)


CMSV_WRAW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_WRAW

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Write raw SAVE data to output block

 CALLING SEQUENCE:
   CMSV_WRAW, BLOCK, POINTER, DATA, UNIT=UNIT, $
              STRING=STRING, LONG=LONG, BYTE=BYTE, TYPE=TYPE, $
              OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   This procedure writes raw integer or string data to an IDL SAVE
   block in memory.  This is the lowest level writing function in the
   library, intended for developers who are investigating new and
   existing SAVE file formats.

   The data to be written is specified by the DATA parameter.  The
   data must be of type BYTE, LONG or STRING, and the type is
   determined automatically from the data itself.  [ The mnemonic
   STRING LONG and BYTE keywords are accepted for programming clarity
   but ignored. ]

   This procedure accepts but currently ignores the UNIT keyword.  It
   is the caller's responsibility to write the BLOCK data to disk
   when appropriate.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================


 BLOCK, POINTER, OFFSET

   This procedure writes data to a byte array only.  The intent is
   for users to accumulate a significant amount of data in a BLOCK
   and then write it out with a single call to WRITEU.  Users should
   be aware that the block can be larger than the buffered data, so
   they should use something like the following:

          WRITEU, UNIT, BLOCK(0:POINTER-1)

   When library routines do indeed write buffered BLOCK data to disk,
   they will appropriately reset the BLOCK and POINTER.  Namely,
   BLOCK will be reset to empty, and POINTER will be reset to zero.
   OFFSET will be advanced the according number of bytes.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be written is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN or writing the
           block to disk.

   POINTER - a long integer, a pointer to the next byte to be written
             from BLOCK.  CMSVLIB routines will automatically advance
             the pointer.

   DATA - the data to be written.  Must of type STRING, BYTE or LONG.


 KEYWORDS:

   LONG - ignored (to be used for clarity)
   BYTE - ignored (to be used for clarity)
   STRING - ignored (to be used for clarity)

   UNIT - a file unit.  Currently ignored.

   OFFSET - the file offset of byte zero of BLOCK.  
            Upon output, if the file pointer is advanced, OFFSET will
            also be changed.
            (OFFSET is not currently used by this routine)
            Default: 0

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_wraw.pro,v 1.6 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_wraw.pro)


CMSV_WREC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_WREC

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Write SAVE-formatted record header to output block or file

 CALLING SEQUENCE:
   CMSV_WDATA, BLOCK, POINTER, DATA, IDENT, UNIT=UNIT, $
               INITIALIZE=INITIALIZE, NO_DATA=NO_DATA, $
               NO_TYPE=NO_TYPE, COMPATIBILITY=COMPAT, $
               BLOCK_TYPE=BLOCK_TYPE, BLOCK_NAME=BLOCK_NAME,
               NEXT_BLOCK=NEXT_BLOCK, $
               [ ... EXTRA KEYWORDS ... ]
               OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   This procedure writes most types of IDL SAVE record, including the
   header and contents.  The header consists of four bytes at the
   beginning of each record which indentifies the type and size of
   the record.  This procedure also writes the contents of certain
   records, as noted below.

   Users can specify the block type by passing the BLOCK_TYPE or
   BLOCK_NAME keywords.  The values listed in the following table are
   supported.  CMSV_WREC writes the contents of essentially all
   record types as well.  Some records do not contain any contents at
   all (those entries marked with an [empty]) and thus require no
   further processing.

    BLOCK_TYPE      BLOCK_TYPE         WRITE RECORD CONTENTS WITH...

       0         = 'START_MARKER'      [empty]
       1         = 'COMMON_BLOCK'      [this procedure]
       2         = 'VARIABLE'          [this procedure]
       3         = 'SYSTEM_VARIABLE'   [this procedure]
       6         = 'END_MARKER'        [empty]
       10        = 'TIMESTAMP'         [this procedure]
       12        = 'COMPILED'          no published procedure
       13        = 'IDENTIFICATION'    [this procedure]
       14        = 'VERSION'           [this procedure]
       15        = 'HEAP_INDEX'        [this procedure]
       16        = 'HEAP_DATA'         [this procedure]
       17        = 'PROMOTE64'         [empty]

   For records that contain variable data, the external procedures
   CMSV_WVTYPE and/or CMSV_WDATA may be used, however it is not
   recommended, since the record header must finally be re-written by
   the user.  Users can write the entire record with this procedure.

   After issuing a POINT_LUN, or after writing the BLOCK to disk, the
   block cache in BLOCK must be reset using the /INITIALIZE keyword.

 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 SPECIFIC RECORD TYPES

   CMSV_WREC reads certain specific record types automatically based
   on data passed in the DATA parameter.  

   Records of type 'VARIABLE' (2), 'SYSTEM_VARIABLE' (3) and
   'HEAP_DATA' (16) require both the DATA and IDENT parameters.  For
   the first two record types, the IDENT parameter is the name of the
   variable, as a scalar string.  Variable names should be valid IDL
   variable names, uppercase, and have no embedded spaces.  For the
   'HEAP_DATA' record type, the IDENT parameter is the heap index
   value, as described below.  The DATA itself can be any supported
   IDL variable type (as described in CMSV_WVTYPE).

   For records that accept data in the form of a structure, as listed
   below, the listed structure tag entries are optional.  If the user
   does not provide a value, then a suitable default will be computed
   by this procedure (listed in parentheses).

   A record of type 'VERSION' (14) has the following structure:

         { FORMAT_VERSION: 0L, $   ; Format version number of file (5)
           ARCH: '', $             ; !VERSION.ARCH of creating host
           OS: '', $               ; !VERSION.OS of creating host
           RELEASE: '' }           ; !VERSION.RELEASE of creating host

   A record of type 'TIMESTAMP' (10) has the following structure:

          { SAVE_DATE: '', $  ; Date the save file was created (SYSTIME(0))
            SAVE_USER: '', $  ; User name who  created file ('UNKNOWN')
            SAVE_HOST: '' }   ; Host name that created file ('UNKNOWN')

   Save files created by IDL version 4 do not contain a timestamp
   record.  Under Unix this procedure will attempt to discover the
   user and host names automatically.

   A record of type 'IDENTIFICATION' (13) has the following
   structure:

          { AUTHOR: '', $  ; Author of SAVE file ('')
            TITLE:  '', $  ; Title of SAVE file  ('')
            IDCODE: '' }   ; Identifying code for SAVE file ('')

   It appears that this record is not used in IDL version 5 or later.

   A record of type 'COMMON_BLOCK' (1) defines a named common block
   and its variables.  A common block descriptor consists of an array
   of strings whose first element is the common block name, and whose
   remaining elements are the common block variable names.  Thus, a
   common block descriptor must have at least two elements.  No
   variable data are stored with the common block definition.

   A record of type 'HEAP_INDEX' (15) defines the heap index in a
   SAVE file.  The heap index specifies a list of which heap
   variables are stored in the current save file.  These indices are
   simply numbers which identify each heap variable (i.e.,
   "" would have an index of 2).  The heap index can use
   any numbers to identify the heap data; however it is required that
   all index entries have corresponding heap data values.

 WRITING HEAP DATA

   If your data contains heap data and/or pointers, then users must
   take special care in writing their data.  Writing heap data is
   actually more straightforward than reading it.  There are several
   steps involved which can be summarized as followed: (1) take
   inventory of HEAP data; (2) write HEAP_INDEX record; (3) write one
   HEAP_DATA record for each heap variable; and (4) write any other
   variables using the heap index.

   (1) Take inventory of heap data.  Before writing any data to the
       SAVE file, use the CMSV_PTRSUM procedure to discover all
       pointer variables in the data set, like so:

          cmsv_ptrsum, var, ptrlist

       PTRLIST contains an array of any heap variables pointed to by
       VAR (including structures or pointed-to variables).  If
       multiple variables are to be written, then the inventory must
       contain the union of all heap variables.

   (2) Write a HEAP_INDEX record.  The heap index is an array of long
       integers which identify the heap variables.  In principle it
       doesn't matter which integers are used, however there must be
       a one-to-one correspondence between the entries in the heap
       index and the heap identifiers used in the next step.  In this
       example a simple LINDGEN is used:

           index = lindgen(n_elements(ptrlist))
           cmsv_wrec, block, pointer, index, block_name='HEAP_INDEX', $
             offset=offset

   (3) Write one HEAP_DATA record for each heap variable.  Issue one
       CMSV_WREC call for each entry in PTRLIST, as follows for the
       ith heap variable:

           cmsv_wrec, block, pointer, ptrlist(i), block_name='HEAP_DATA', $
             ptr_index=index, ptr_data=ptrlist, offset=offset

       Note that the PTR_INDEX and PTR_DATA keywords are required
       because heap data may itself contain pointers.  The PTR_INDEX
       and PTR_DATA keywords enable the CMSV_WREC procedure to write
       appropriate descriptors when it encounters pointers.

   (4) Write remaining data.  For the ith variable, use:

          cmsv_wrec, block, pointer, var(i), name(i), block_name='VARIABLE',$
             ptr_index=index, ptr_data=ptrlist, offset=offset

       As above, using the PTR_INDEX and PTR_DATA keywords will allow
       the CMSV_WREC procedure to write the appropriate data.


 BLOCK, POINTER, OFFSET

   This procedure writes data to a byte array or a file.  If the UNIT
   keyword is specified then file is sent to the specified unit
   number rather than to the buffer BLOCK.  However, the intent is
   for users to accumulate a significant amount of data in a BLOCK
   and then write it out with a single call to WRITEU.  Users should
   be aware that the block can be larger than the buffered data, so
   they should use something like the following:

          WRITEU, UNIT, BLOCK(0:POINTER-1)

   When library routines do indeed write buffered BLOCK data to disk,
   they will appropriately reset the BLOCK and POINTER.  Namely,
   BLOCK will be reset to empty, and POINTER will be reset to zero.
   OFFSET will be advanced the according number of bytes.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be read is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN or writing the
           block to disk.

   POINTER - a long integer, a pointer to the next byte to be read
             from BLOCK.  CMSVLIB routines will automatically
             advance the pointer.

   DATA - the record contents to be written, as describe above.

   IDENT - for record types 'VARIABLE' (2) and 'SYSTEM_VARIABLE' (3),
           the name of the variable as a scalar string.  For record
           type 'HEAP_DATA' (16), the heap index identifier as a
           scalar long integer.

 KEYWORDS:

   BLOCK_NAME - a scalar string specifying the record type, as
                described above.  The BLOCK_TYPE keyword takes
                precedence over BLOCK_NAME.

   BLOCK_TYPE - a scalar integer specifying the record type, as
                described above.

   NEXT_BLOCK - if specified, the file offset of the next record
                location.
                Default: the offset will be computed automatically.

   INITIALIZE - if the keyword is set, then the BLOCK is emptied and
                the POINTER is reset before any new data is written.

   NO_TYPE - if set, no type descriptor or data are written for
             variable records.

   NO_DATA - if set, no data are written for variable records.


   TEMPORARY - if set, then the input DATA are discarded after being
               written, as a memory economy provision.

   PTR_INDEX - a heap index array for the data being written, if any
               heap data records have been written.
               Default: no pointers are written

   PTR_DATA - an array of pointers, pointing to the heap values being
              written.
              Default: no pointers are written

   UNIT - a file unit.  If specified then data are directed to the
          file unit rather than to the buffer BLOCK.

   OFFSET - the file offset of byte zero of BLOCK.  
            Upon output, if the file pointer is advanced, OFFSET will
            also be changed.
            (OFFSET is not currently used by this routine)
            Default: 0

   COMPATIBILITY - a string, which describes the format to be used in
          the output file.  Possible values are:

                  'IDL4' - format of IDL version 4;
                  'IDL5' - format of IDL versions 5.0-5.3;
                  'IDL6' - not supported yet, for versions 5.4-above;
                  'RIVAL1' - same as 'IDL5', plus a directory entry is
                            written to the file.
           Note that files written in IDL5 format may still be
           readable by IDL v.4.
           Default: 'IDL5'

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_wrec.pro,v 1.8 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_wrec.pro)


CMSV_WVTYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSV_WVTYPE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Write variable type information to output block

 CALLING SEQUENCE:
   CMSV_WVTYPE, BLOCK, DATA, IDENT, $
                HEAP=HEAP, SYSTEM=SYSTEM, UNIT=UNIT, $
                OFFSET=OFFSET, STATUS=STATUS, ERRMSG=ERRMSG
   
 DESCRIPTION: 

   CMSV_WVTYPE writes the type portion of an IDL SAVE variable
   record.  An IDL variable is stored in two components: the type
   descriptor which describes the name, type, and dimensions of the
   variable; and the data record, which contains the raw data of the
   variable.  This procedure writes the type descriptor based on a
   variable passed by the user.  Once the type descriptor has been
   written, the data portion can be written using the CMSV_WDATA
   procedure.

   CMSV_WVTYPE should recognize and correctly output type descriptors
   for all currently known IDL data types, except for object
   references.  Type information is inferred from the DATA parameter
   passed by the user.  

   Heap data is a special case, since the data itself are stored
   separately from the pointer in the SAVE file.  Three steps must be
   satisfied: a HEAP_INDEX record must be written; a valid HEAP_DATA
   record must be written containing a type descriptor (written with
   this procedure) and the heap data; and the named pointer itself
   must be written.


 ==================================================================
   Research Systems, Inc. has issued a separate license intended
   to resolve any potential conflict between this software and the
   IDL End User License Agreement. The text of that license
   can be found in the file LICENSE.RSI, included with this
   software library.
 ==================================================================

 BLOCK, POINTER, OFFSET

   This procedure writes data to a byte array only.  The intent is
   for users to accumulate a significant amount of data in a BLOCK
   and then write it out with a single call to WRITEU.  Users should
   be aware that the block can be larger than the buffered data, so
   they should use something like the following:

          WRITEU, UNIT, BLOCK(0:POINTER-1)

   When library routines do indeed write buffered BLOCK data to disk,
   they will appropriately reset the BLOCK and POINTER.  Namely,
   BLOCK will be reset to empty, and POINTER will be reset to zero.
   OFFSET will be advanced the according number of bytes.

   The terminology is as follows: BLOCK is a byte array which
   represents a portion of, or an entire, IDL SAVE file.  The block
   may be a cached portion of an on-disk file, or an entire in-memory
   SAVE file.  POINTER is the current file pointer within BLOCK
   (i.e., the next byte to be written is BLOCK[POINTER]).  Hence, a
   POINTER value of 0 refers to the start of the block.  OFFSET is
   the file offset of the 0th byte of BLOCK; thus "POINT_LUN,
   OFFSET+POINTER" should point to the same byte as BLOCK[POINTER].
   The following diagram shows the meanings for BLOCK, POINTER and
   OFFSET schematically:


                 0 <-  OFFSET  -> |
   FILE          |----------------|------*--------|--------->

   BLOCK                          |------*--------|
                                  0      ^ POINTER
     

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.  


 INPUTS:

   BLOCK - a byte array, a cache of the SAVE file.  Users will
           usually not access this array directly.  Users are advised
           to clear BLOCK after calling POINT_LUN or writing the
           block to disk.

   POINTER - a long integer, a pointer to the next byte to be written
             from BLOCK.  CMSVLIB routines will automatically advance
             the pointer.

   DATA - the data to be written, of any save-able data type.

   IDENT - for variables, the name of the variable as a string; for
           heap data, the heap index as an integer.

 KEYWORDS:

   HEAP - if set, the data is treated as heap data, and IDENT must be
          an integer heap index.

   SYSTEM - if set, the data is assumed to be a system variable.

   UNIT - a file unit.  Currently ignored.

   OFFSET - the file offset of byte zero of BLOCK.  
            Upon output, if the file pointer is advanced, OFFSET will
            also be changed.
            (OFFSET is not currently used by this routine)
            Default: 0

   STATUS - upon return, this keyword will contain 1 for success and
            0 for failure.

   ERRMSG - upon return with a failure, this keyword will contain the
            error condition as a string.

 EXAMPLE:


 SEE ALSO:

   CMRESTORE, SAVE, RESTORE, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000
   Documented, 24 Jan 2001
   Added notification about RSI License, 13 May 2002, CM

 $Id: cmsv_wvtype.pro,v 1.13 2002/05/13 06:41:10 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsv_wvtype.pro)


CMSYSTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CMSYSTIME

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute seconds since Jan 1, 1970 and (Modified) Julian Days

 CALLING SEQUENCE:
   TIMEVAL1 = CMSYSTIME(TIMEVAL0, ...)

 DESCRIPTION: 

   CMSYSTIME serves two functions.  It computes the current time in a
   fashion similar to the built-in IDL system function SYSTIME().  It
   also can convert between various time representations and systems,
   including a textual format.

   The current time can be obtained by invoking CMSYSTIME with the
   /NOW keyword (which is entirely equivalent to SYSTIME(1)).

   The most substantial part of CMSYSTIME, which distinguishes it
   from SYSTIME, is its ability to convert between different time
   formats.  CMSYSTIME recognizes can recognize and convert between
   time in seconds (seconds since Jan 1, 1970 [ = SEC ]) and days
   (Julian days [ = JDAY ] or "Modified" Julian days [ = MJD = JDAY -
   2400000.5 ]).  It can also recognize and convert between local and
   GM time.  

   CMSYSTIME takes maximum care to preserve the full numerical
   precision of the time values.  It converts all values to double
   precision and may return days and seconds with fractional parts.

   CMSYSTIME can also represent any time textually, not just the
   current time.  The following textual formats are supported:
        DOW MMM DD hh:mm:ss YYYY              - (Default - same as SYSTIME)
        DOW MMM DD YYYY hh:mm:ss.uuuuuu TTTTT - (/EXTENDED)
   where DOW and MMM are the abbreviated day of week and month in
   English, DD is the day of the month, YYYY is the year, hh:mm:ss is
   the time in 24 hr military time, uuuuuu are additional
   microseconds, TTTTT is the timezone offset (in +hhmm
   representation).

   CMSYSTIME accepts one parameter, the input time to be converted.
   Unlike SYSTIME, the *function* of CMSYSTIME is governed by various
   keywords, as summarized in the following table:

   Converting from                       Converting to
   ---------------                       -------------
   JDAY - /FROM_JULIAN                   JDAY - /JULIAN
   MJD  - /FROM_MJD                      MJD  - /MJD
   SEC  - (Default)                      SEC  - /SECONDS
   Current time - /NOW                   TEXT - (Default or /EXTENDED)

   Local time - /FROM_LOCAL              Local time - /LOCAL
   GM time - (Default)                   GM time - (Default)
   
   If no argument is specified, the default is to report the current
   time textually in the GM time zone.  CMSYSTIME automatically
   determines the local time zone.

 INPUTS:

   TIMEVAL0 - input time, in seconds or days, as described above.
              This value is ignored if the NOW keyword is set.  Array
              values are allowed.

 KEYWORDS:

   NOW - If set, TIMEVAL0 is ignored and the current time is used as
         input.

   FROM_JULIAN - If set, TIMEVAL0 is in Julian days.
   FROM_MJD    - If set, TIMEVAL0 is in Modified Julian days (MJD).
   FROM_LOCAL  - If set, TIMEVAL0 is in the local time zone.
                 If no FROM_ keywords are set, the input is assumed
                 to be seconds from Jan 1, 1970.

   JULIAN  - If set, the input is converted to Julian days upon output.
   MJD     - If set, the input is converted to MJD upon output.
   SECONDS - If set, the input is converted to seconds from Jan
             1, 1970 upon output.
   LOCAL   - If set, the input is converted to the local time zone.
             If no "destination" keywords are set, the output is
             converted to textual representation.

   EXTENDED - Convert to a textual representation with additional
              information, as noted above.

   TIMEZONE - Upon output, the timezone offset is returned in this
              keyword.  The offset is time difference in seconds
              between GM time and the local time, such that LOCALTIME
              = GMTIME + TIMEZONE

 RETURNS:
   The resulting converted time(s), either as a double precision
   number or a string.

 EXAMPLE:
   
   The equivalent to SYSTIME(0)
     IDL> print, systime(0) & print, cmsystime(/now, /local)
     Wed Jul  5 12:10:46 2000
     Wed Jul  5 12:10:46 2000

   The equivalent to SYSTIME(1)
     IDL> print, systime(1) & print, cmsystime(/now,/seconds)
        9.6277750e+08
        9.6277750e+08

   Comparison between local and GM time zones (I live in the Eastern
    US, daylight savings)
     IDL> print, cmsystime(/now,/extended)
     Wed Jul  5 2000 16:13:15.659000 -0400
     IDL> print, cmsystime(/now,/local,/extended)
     Wed Jul  5 2000 12:13:15.664000 -0400
    
   What day of the week was it 200 days ago?  (Note, there are 86400
    seconds in one day)
     IDL> today = cmsystime(/now,/seconds)
     IDL> print, cmsystime(today-86400L*200, /local)
     Sat Dec 18 12:17:52 1999
    

 SEE ALSO:

   SYSTIME, JULDAY, CALDAT

 MODIFICATION HISTORY:
   Written, CM, 05 Jul 2000
   Printed time zone is zero when LOCAL=0, CM, 21 Aug 2000

  $Id: cmsystime.pro,v 1.2 2001/03/25 18:10:42 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\cmsystime.pro)


CNES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cnes

 PURPOSE:
	This procedure is an example how to translate a cnes file

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   cnes


 MODIFICATION HISTORY:
 	Written by:	R. Bauer , May, 4, 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\cnes.pro)


CNES2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cnes2ncdf

 PURPOSE:
	This  procedure will translate a cnes Data File and translate it into
   a netCDF File.

 CATEGORY:
	DATAFILES/FILTER


 CALLING SEQUENCE:
	cnes2ncdf,file=file,inpath=inpath,outpath=outpath,[campaign=campaign],[/xp] ,[gps_aus=gps_aus]

 INPUTS:
   file:      the filename of the cnes file
   inpath:    the path where the cnesfile is
   outpath:   the path where the result should be stored

 OPTIONAL INPUTS:
   campaign:  the campaign name belonging to the cnes file

 KEYWORD PARAMETERS:
   xp:        will use pickfile for opening a cnes file

 OPTIONAL OUTPUTS:
   gps_aus:  the GPS data array from the cnesfile


 EXAMPLE:
   inpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/asc/'
   outpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/bin/'
   file = 'kir05110297.krn'
   campaign = 'ADEOS1997'
   cnes2ncdf,file=file,inpath=inpath,outpath=outpath,campaign=campaign

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cnes2ncdf.pro)


CNES_KIR2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cnes_kir2ncdf

 PURPOSE:
	This  procedure will translate a cnes KIR Data File and translate it into
   a netCDF File.

 CATEGORY:
	DATAFILES/FILTER


 CALLING SEQUENCE:
	cnes_kir2ncdf,file=file,inpath=inpath,outpath=outpath,[campaign=campaign],[/xp] ,[gps_aus=gps_aus]

 INPUTS:
   file:      the filename of the cnes file
   inpath:    the path where the cnesfile is
   outpath:   the path where the result should be stored

 OPTIONAL INPUTS:
   campaign:  the campaign name belonging to the cnes file

 KEYWORD PARAMETERS:
   xp:        will use pickfile for opening a cnes file

 OPTIONAL OUTPUTS:
   gps_aus:  the GPS data array from the cnesfile


 EXAMPLE:
   inpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/asc/'
   outpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/bin/'
   file = 'kir05110297.krn'
   campaign = 'ADEOS1997'
   cnes_kir2ncdf,file=file,inpath=inpath,outpath=outpath,campaign=campaign

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cnes_kir2ncdf.pro)


COLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLOR
 PURPOSE:
       Set a color in the color table by specifying color name.
 CATEGORY:
 CALLING SEQUENCE:
       color, name, [index, r, g, b]
 INPUTS:
       name = color name (like red, green, ...).           in
         Name may be modified by the words dark, pale,
         very dark, very pale.
         (Only one very is handled).  Default color=white.
       index = color table index for new color (def=last). in
       r, g, b = components of color table to modify.      in,out
         If r,g,b sent then table is not loaded.
 KEYWORD PARAMETERS:
       Keywords:
         FILE=f  color file to use instead of the default.
           Text file, each line has r g b color_name.
         /LEARN prompts for r,g,b values of an unknown color.
         /LIST lists all available colors.
         MAXNUMBER=mx  return number of colors known.
         NUMBER=n  Select color by color number (0 to MAXNUMBER-1).
           Index # 255 is set by default.  To set a different index
           a dummy color name must also be given.  It is ignored.
           Ex: color,'dum',50,number=7  sets index 50 to color 7.
           If no args are given default color and index used.
         NAME = nam  return name of selected color.
           Useful with NUMBER keyword.
         TEXT=txt  returns 0 or 255, whichever best with color.
         RED=r.  Return red value for specified color.
         GREEN=g.  Return green value for specified color.
         BLUE=b.  Return blue value for specified color.
         /EXIT exit without modifying screen color table.
 OUTPUTS:
 COMMON BLOCKS:
       color_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 26 Dec 1989
       R. Sterner, 7 Jun, 1990 --- polished for vms.
       R. Sterner, 4 Feb, 1991 ---- made system independent.
       R. Sterner, 1997 Dec 30 --- Converted colors file to text file
       and dropped need for Env. Var.
       R. Sterner, 1998 Jan 14 --- Switched to !d.table_size instead
       of !d.n_colors.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\color.pro)


COLOR24

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLOR24

 PURPOSE:

       The purpose of this function is to convert a RGB color triple
       into the equivalent 24-bit long integer. The 24-bit integer
       can be decomposed into the appropriate color by interpreting
       the lowest 8 bits as red, the middle 8 bits as green, and the
       highest 8 bits as blue.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

       Graphics, Color Specification.

 CALLING SEQUENCE:

       color = COLOR24(rgb_triple)

 INPUTS:

       RGB_TRIPLE: A three-element column or row array representing
       a color triple. Or an N-by-three element array of color triples.
       The values of the elements must be between 0 and 255.

 KEYWORD PARAMETERS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:

       To convert the color triple for the color YELLOW,
       (255, 255, 0), to the hexadecimal value '00FFFF'x
       or the decimal number 65535, type:

       color = COLOR24([255, 255, 0])

       This routine was written to be used with device-independent
       color programs like GETCOLOR.

 MODIFICATION HISTORY:

       Written by:  David Fanning, 3 February 96.
       Completely revised the algorithm to accept color arrays. 19 October 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\color24.pro)


COLORBAR[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   COLORBAR

 PURPOSE:
       The purpose of this routine is to add a color bar to the current
       graphics window.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:
       Graphics, Widgets.

 CALLING SEQUENCE:
       COLORBAR

 INPUTS:
       None.

 KEYWORD PARAMETERS:

       BOTTOM:   The lowest color index of the colors to be loaded in
                 the bar.

       CHARSIZE: The character size of the color bar annotations. Default is 1.0.

       COLOR:    The color index of the bar outline and characters. Default
                 is !P.Color..

       DIVISIONS: The number of divisions to divide the bar into. There will
                 be (divisions + 1) annotations. The default is 6.

       FONT:     Sets the font of the annotation. Hershey: -1, Hardware:0, True-Type: 1.

       FORMAT:   The format of the bar annotations. Default is '(I5)'.

       INVERTCOLORS: Setting this keyword inverts the colors in the color bar.

       MAXRANGE: The maximum data value for the bar annotation. Default is
                 NCOLORS.

       MINRANGE: The minimum data value for the bar annotation. Default is 0.

       MINOR:    The number of minor tick divisions. Default is 2.

       NCOLORS:  This is the number of colors in the color bar.

       POSITION: A four-element array of normalized coordinates in the same
                 form as the POSITION keyword on a plot. Default is
                 [0.88, 0.15, 0.95, 0.95] for a vertical bar and
                 [0.15, 0.88, 0.95, 0.95] for a horizontal bar.
;
       RANGE:    A two-element vector of the form [min, max]. Provides an
                 alternative way of setting the MINRANGE and MAXRANGE keywords.

       RIGHT:    This puts the labels on the right-hand side of a vertical
                 color bar. It applies only to vertical color bars.

       TITLE:    This is title for the color bar. The default is to have
                 no title.

       TOP:      This puts the labels on top of the bar rather than under it.
                 The keyword only applies if a horizontal color bar is rendered.

       VERTICAL: Setting this keyword give a vertical color bar. The default
                 is a horizontal color bar.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       Color bar is drawn in the current graphics window.

 RESTRICTIONS:
       The number of colors available on the display device (not the
       PostScript device) is used unless the NCOLORS keyword is used.

 EXAMPLE:
       To display a horizontal color bar above a contour plot, type:

       LOADCT, 5, NCOLORS=100
       CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $
          C_COLORS=INDGEN(25)*4, NLEVELS=25
       COLORBAR, NCOLORS=100, POSITION=[0.15, 0.85, 0.95, 0.90]

 MODIFICATION HISTORY:
       Written by: David Fanning, 10 JUNE 96.
       10/27/96: Added the ability to send output to PostScript. DWF
       11/4/96: Substantially rewritten to go to screen or PostScript
           file without having to know much about the PostScript device
           or even what the current graphics device is. DWF
       1/27/97: Added the RIGHT and TOP keywords. Also modified the
            way the TITLE keyword works. DWF
       7/15/97: Fixed a problem some machines have with plots that have
            no valid data range in them. DWF
       12/5/98: Fixed a problem in how the colorbar image is created that
            seemed to tickle a bug in some versions of IDL. DWF.
       1/12/99: Fixed a problem caused by RSI fixing a bug in IDL 5.2. Sigh... DWF.
       3/30/99: Modified a few of the defaults. DWF.
       3/30/99: Used NORMAL rather than DEVICE coords for positioning bar. DWF.
       3/30/99: Added the RANGE keyword. DWF.
       3/30/99: Added FONT keyword. DWF
       5/6/99: Many modifications to defaults. DWF.
       5/6/99: Removed PSCOLOR keyword. DWF.
       5/6/99: Improved error handling on position coordinates. DWF.
       5/6/99. Added MINOR keyword. DWF.
       5/6/99: Set Device, Decomposed=0 if necessary. DWF.
       2/9/99: Fixed a problem caused by setting BOTTOM keyword, but not NCOLORS. DWF.
       8/17/99. Fixed a problem with ambiguous MIN and MINOR keywords. DWF
       8/25/99. I think I *finally* got the BOTTOM/NCOLORS thing sorted out. :-( DWF.
       10/10/99. Modified the program so that current plot and map coordinates are
            saved and restored after the colorbar is drawn. DWF.
       3/18/00. Moved a block of code to prevent a problem with color decomposition. DWF.
       4/28/00. Made !P.Font default value for FONT keyword. DWF.
       9/26/00. Made the code more general for scalable pixel devices. DWF.
       1/16/01. Added INVERTCOLORS keyword. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\colorbar.pro)


COLORBAR[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        COLORBAR

 PURPOSE:
        Draw a colorbar (legend) with labels

 CATEGORY:
        Colors

 CALLING SEQUENCE:
        COLORBAR [,options]

 INPUTS:

 KEYWORD PARAMETERS:
        COLOR  -> the drawing color for boxes and labels 
             (default: !P.COLOR)
 
        BOTTOM -> first color index to use (default: 1)

        NCOLORS -> number of colors to use (default: 
             !D.N_Colors-bottom)

        MIN, MAX -> range of the data (default bottom and 
             bottom+ncolors-1

        LABEL -> array with label values (must be numeric).
             Normally, it is easier to generate labels with the 
             DIVISIONS options, but this allows tighter control 
             (e.g. 1,2,5,10,20 labels on logarithmic scales).
             Default (if no DIVISIONS are given): min and max

        DIVISIONS -> number of labels to put on the colorbar.
             Note that this keyword is overwritten by LABEL.
             The labels will be equally spaced and the /LOG option
             will be honored.

        FORMAT -> output format of the labels. Default is determined
             according to the range given in min and max. Label strings 
             will be trimmed, so you can safely specify f14.2 for example.

        SCIENTIFIC -> If set, will call STRSCI to put the colorbar
             labels in scientific notation format (e.g. in the form
             A x 10^B).  STRSCI will use the format string specified 
             in the FORMAT keyword.

        /LOG -> logarithmic spacing of labels (colors are *always* 
             linearily distributed)

        C_COLORS -> array of color indices for "discrete" color bars
             e.g. in filled contour plots. You must also use the 
             C_LEVELS keyword, otherwise there will most likely be
             a mismatch between your plot colors and your colorbar 
             colors. COLORBAR normally limits the number of labels
             it prints to 10. Use the SKIP keyword to force a different
             behaviour. If C_COLORS is not undefined it overrides the
             settings from NCOLORS, and BOTTOM.

        C_LEVELS -> array with label values for discrete colorbars.
             Use the LABEL keyword for continuous colors. C_LEVELS
             must have the same number of elements as C_COLORS and 
             assigns one label to each color change (LABEL distributes
             the labels evenly). Use the SKIP keyword to skip labels.
             As default, COLORBAR limits the number of labels printed 
             to 10. 
             NB: In order to be consistent with the behaviour of the 
             CONTOUR procedure, colorbar disregards the first entry of
             C_LEVELS.

        SKIP -> print only every nth discrete label. Default is computed
             so that COLORBAR will print no more than 10 labels.

        STARTLABEL -> for discrete colorbars: the first left box side to be
             labeled. Default is 1, i.e. between the first two boxes.

        /VERTICAL -> set this keyword to produce a vertical colorbar
             (default is horizontal). Note that out-of-range boxes are
             only implemented for horizontal color bars.

        POSITION -> a position value or 4-element vector. If POSITION
             contains only one element, it will be centered at the
             bottom or right side of the page and extend over 60% of
             the total plotting area.

        CHARSIZE -> character size (default !p.charsize)

        TITLE -> a title string (similar to XTITLE or YTITLE for PLOT)

        UNIT -> a unit string that will be added to the right (top) of
             the labels

        BotOutOfRange, TopOutOfRange -> a colorindex value for data
             that falls below or above the normal plot range. If given,
             an extra box will be drawn to the left or right of the color-
             bar, and the colorbar will shrink in size. A default label
             '<' ('>') will be placed below. Note that these options are
             only available for horizontal colorbars.

        BOR_Label, TOR_Label -> label values for BOTOutOfRange and 
             TopOutOfRange that replace the defaults.

 OUTPUTS:

 SUBROUTINES:

 REQUIREMENTS:
        The user should have some knowledge about colortables and the
        use of parts of a colortable.
        This program uses STRSCI for labels in scientific notation.

 NOTES:
        This routine was designed after David Fanning's colorbar
        routine and enhanced. Some of the postscript
        handling of DF was removed, positioning is a little easier but
        maybe a little less flexible; out-of-range boxes have been
        added.

 EXAMPLE:
        ; draw a colorbar with all available colors on top of index 20
        ; will be placed at the bottom of the page

        colorbar,bottom=20,min=min(data),max=max(data)

        ; draw another colorbar above the first one, use logarithmic scale

        colorbar,bottom=20,min=0.1,max=10.,labels=[0.1,0.5,1.,5.10.],/log, $
              position=0.3,unit='ppt'

        ; (simply add keyword /vertical and you'll get it flipped)

        ; colorbar with out-of-range information on right side only
        ; Here we used 20 colors for the plot, the 21st is for 
        ; out-of-range data

        colorbar,bottom=20,ncolors=20,min=0,max=100,divisions=5, $
              TopOutOfRange=40

 MODIFICATION HISTORY:
        mgs, 02 Jun 1998: VERSION 1.00
        mgs, 14 Nov 1998: - changed default format to f14.2 from f6.2
        mgs, 19 Nov 1998: - added cbdefaultformat function to better handle
                            default labeling format.
        mgs, 28 Nov 1998: - default labelling format now exponential for
                            values gt 1.e6
        mgs, 19 May 1999: - unit string placed a little further right
                            in horizontal colorbars.
        mgs, 27 May 1999: - added functionality for discrete colorbars
                            (C_COLORS, C_LEVELS, and SKIP keywords)
        bmy, 02 Jun 1999: - added /SCIENTIFIC keyword
                          - updated comments
        mgs, 14 Sep 1999: - charsize bug fix. Needed to check for 0.
        mgs, 23 Sep 1999: - now uses !P.COLOR as default color (as it was originally)
                          - BOTTOM default now 1 (because 0 is the standard beackground
                            value)
        mgs, 17 Dec 1999: - fixed zero division for SKIP=0
                          - added StartLabel keyword for discrete colorbars
        mgs, 20 Dec 1999: - disregard first entry of C_LEVELS

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\colorbar.pro)


COLORBAR__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLORBAR__DEFINE

 PURPOSE:
       The purpose of this routine is to implement a COLORBAR object
       class. The ColorBar is rendered in the direct graphics system.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Graphics.

 CALLING SEQUENCE:
       colorbar = Obj_New("COLORBAR")

 INPUTS:
       All inputs to the program are via keyword parameters.

 KEYWORD PARAMETERS:

   Background: Background color. This is the color with which the colorbar is
               erased. The default color is !P.Background.
   Bottom: Bottom color index of colors allocated to colorbar.
   Charsize: Character size of annotation. Default is 1.0.
   Color: Color of annotation and outline. Default is !P.Color.
   Font: Font to use for annotation. Default is -1, Hershey fonts.
   Format: Format of annotation. Default is "(F8.2)".
   Major: The number of major tick intervals. Default is 5.
   Minor: The number of minor tick intervals. Default is 2.
   MinusOne: Set this keyword to choose MinusOne keyword on the Congrid command
               that resizes the colorbar into the window.
   NColors: The number of colors allocated to colorbar. Default is (256 <
            !D.N_Colors).
   Neighbor: Set to indicate Nearest Neighbor sampling for Congrid. Default is
             0 (Bilinear).
   Position: The position of colorbar in normalized coordinates. Default for a
             horizontal colorbar is [0.15, 0.88, 0.85, 0.95]. Default for a
             vertical colorbar is [0.88, 0.15, 0.95, 0.85]. These defaults are
             designed for a 400 by 400 window.
   Range: The data range on colorbar. Default is [0, 255].
   TickLen: The length of tick marks. Default is -0.1
   TickV:   Locations for the tick marks in data units. This is the same as
            the [XY]TickV keyword. Default is to do what IDL would do
            normally.
   Vertical: Set this keyword if you want a vertical colorbar. Default is
             horizontal.
   XEraseBox: A five-element vector of X points (normalized) for erasing the
              colorbar plot. Normally this keyword will not have to be used.
              The program uses the plot REGION for erasing. But larger
              character sizes can result in annotation going outside the
              region enclosed by the plot. If that is the case, then use this
              keyword along with YEraseBox to specify a larger-than-normal
              erasure area. The points are sent to the POLYFILL command for
              erasing.

                 POLYFILL, xEraseBox, yEraseBox, /Normal, Color=background

   YEraseBox: A five-element vector of Y points (normalized) for erasing the
              colorbar plot.

 OBJECT METHODS:

   Clamp: This procedure method allows the color bar range to be "clamped"
          to a particular data range.

   Draw: This procedure method draws the colorbar in the display window. The
         ERASE keyword to this method will erase the current colorbar (by
         calling the ERASE method) before drawing the colorbar in the display
         window.

               colorbar->Draw

   Erase: This procedure method erases the colorbar object in the window. It
          accomplishes this by performing a POLYFILL in the background color.
          This method is primarily useful for interactive graphics display
          devices.
               colorbar->Erase

   GetProperty: This procedure method allows one to obtain the current state
                of the object via the keyword parameters listed above.

               colorbar->GetProperty, Range=currentRange, Title=currentTitle
               Print, currentRange, currentTitle

   SetProperty: This procedure method allows one to set the properties of the
                colorbar object via the keywords described above. In addition,
                a DRAW and ERASE keyword are provided so that the colorbar can
                be immediately drawn when the new property is set.

               colorbar->SetProperty, Range=[500, 15000], /Erase, /Draw

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       The display window is not erased first.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To create a colorbar, use it, then destroy it, type:

       colorbar = Obj_New("COLORBAR", Title='Colorbar Values', Range=[0,1000],$
                  Format='(I4)')
       Window
       LoadCT, 5
       colorbar->Draw
       colorbar->SetProperty, Range=[0,500], /Erase, /Draw
       Obj_Destroy, colorbar

 MODIFICATION HISTORY:
       Written by: David Fanning, Fanning Software Consulting,
                   26 November 1998.
       Added Horizontal keyword to SetProperty method and fixed problem in
       going from Vertical to Horizontal color bars. 29 Nov 1998. DWF.
       Added LoadCT method and current color table index to object.
             6 December 1998.
       Fixed a bug dealing with nearest neighbor resampling. 30 Mar 1999. DWF.
       Fixed a bug with how NCOLORS and BOTTOM keywords interacted.
             29 Aug 1999. DWF.
       10 Oct 99. Modified the program so that current plot and map coordinates
                are saved and restored after the colorbar is drawn. DWF.
       26 May 2000 Added {XY}TICKV capability to the draw method. This
                required adding TickV to the object data structure, and to the
                INIT, GetProperty and SetProperty methods.
                Changed default tick length to -0.1. DWF (and Jack Saba)
       18 Nov 2001. Added Clamp method. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\colorbar__define.pro)


COLORCHART

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    colorchart

 PURPOSE:
    produce a chart with many colors to test printers and find colors
    suitable for plotting.
    EXPERIMENTAL STATUS - NOT PERFECT

 CATEGORY:
    Colors

 MODIFICATION HISTORY:
    mgs, some time in 1999.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\colorchart.pro)


COLORIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLORIZE
 PURPOSE:
       Colorize an image.
 CATEGORY:
 CALLING SEQUENCE:
       colorize
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         IMAGE=img  Name of GIF image to colorize.
         COLORS=clr Name of GIF image with color areas to overlay.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Result is displayed on screen.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 17

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\colorize.pro)


COLORS8BIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLORS8BIT
 PURPOSE:
       Show array of 256 colors in a window.
 CATEGORY:
 CALLING SEQUENCE:
       colors8bit
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         BLACK=blk  Specify black or dark color (def=0).
         WHITE=wht  Specify white or bright color (def=1).
           These are used for the index numbers.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: useful to pick colors from the window systems
       colors in case IDL cannot control the colors.  For
       example, when using 256 colors on a workstation and
       a widget, the IDL colors will not show up while using
       the widget.  This may make it impossible to use the
       widget.  One work around is to use good window colors
       for the IDL graphics.  For example, window color 23
       may be white and 32 blue.  If XOR mode graphics is used
       then XOR 55 with 23 to get 32 (32 = 23 xor 55).  If the
       background color is bck and you want plot color clr then
       just plot (bck XOR clr), where the plot crosses the
       background it will be that color.
 MODIFICATION HISTORY:
       R. Sterner, 1998 May 12

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\colors8bit.pro)


COLORWARN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLORWARN
 PURPOSE:
       Warn if available IDL colors too few.
 CATEGORY:
 CALLING SEQUENCE:
       colorwarn
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         MINIMUM=n  Alert if below this value.
         /QUIET     Suppress information message.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 23

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\colorwarn.pro)


COLOR_BAR

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  color_bar

 PURPOSE:  draw a horizontal color bar

 USEAGE:   color_bar

 INPUT:    
   levels  
     a vector of physical values (required)

   colors  
     a vector of color values. If colors is not specified a
     continuous spectrum of colors between colors values 1 and
     !d.n_colors-2 are used.


 KEYWORD INPUT:
   pos
     position of color bar in normal or subnormal coordinates
     [xmin,ymin,xmax,ymax], if pos is not specified, CURBOX is
     called to set the color bar position interactively.

   digits
     number of significant digits used in number scale label
     digits=0 causes an integer format to be used. any positive value
     causes a floating point format.

   stride
     if set, label only those intervals which have n mod stride eq 0,
     where n is the number of intervals counting left to right.
   
   subnorm
     use subnormal coordinates to specify pos. subnormal coordinates
     vary from 0 to 1 across the range of the last plotting window.
     If not set, normalized coordinates are used.
 
   labels  a string array of labels for color values. 

           if nlabels eq nlevels   ==> center labels under tick marks
           if nlabels eq nlevels-1 ==> center labels between tick marks
           otherwise               ==> execution stops, error message issued

           where nlabels=n_elements(labels) and nlevels=n_elements(levels)

   title   overall title for color bar, appears below labels


 OUTPUT:
  none

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

    loadct,5
    !y.omargin=[10,0]
    !p.multi=[0,2,2]
    r=randata(50,50,s=4) & r=(r-3)
    levels=-9+indgen(10)
    colors=findrng(20,!d.n_colors,9)
    confill,r,/noscale,levels=levels,colors=colors
    confill,rotate(r,1),/noscale,levels=levels,colors=colors
    confill,rotate(r,2),/noscale,levels=levels,colors=colors
    confill,rotate(r,3),/noscale,levels=levels,colors=colors
    !y.omargin=0

    labels='10!a-'+strcompress(string(8-indgen(9)),/rem)
    title='ozone mass density (ug/m3)'
    color_bar,levels,colors,labels=labels,title=title

; use a continuous spectrum of colors

    !y.omargin=[10,0]
    !p.multi=[0,2,2]
    r=randata(50,50,s=4) & r=(r-3)
    levels=-9+indgen(10)
    colors=findrng(20,!d.n_colors,9)
    tvim,r & tvim,rotate(r,1) & tvim,rotate(r,2) & tvim,rotate(r,3)
    !y.omargin=0

    color_bar,indgen(10),labels=labels,title=title

 AUTHOR:   Paul Ricchiazzi                        09 Feb 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\color_bar.pro)


COLOR_FRAME

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  color_frame

 PURPOSE:  draw a color background on which to overlay plots

 USEAGE:   result=color_frame(color,pos=pos,xmargin=xmargin,ymargin=ymargin)

 INPUT:  
   color  
     the background color of the plot frame  
   

 KEYWORD INPUT:
   pos
     4 element vector specifying the lower left and upper right
     normalized coordinates of the plot frame [xll,yll,xur,yur]

   xmargin
     2 element vector specifying the left and right margins in character
     width units

   ymargin
     2 element vector specifying the lower and upper margins in character
     height units

   bg_color
     back ground color used outside of plot frame
;
 OUTPUT:
   result
     4 element vector specifying the lower left and upper right
     normalized coordinates of the plot frame [xll,yll,xur,yur]

 DISCUSSION: 
     COLOR_FRAME can be used to produce color backgrounds within plot
     frames.  Since COLOR_FRAME itself calls PLOT to obtain the
     default frame position, it is necessary to include the NOERASE
     keyword in the PLOT call that actually draws the plot. See examples.

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

  !p.multi=[0,1,2]
  loadct,5
  xx=findrng(-2.5,2.5,200)
  yy=exp(-xx^2)
  yc=cos(xx*10)
  plot,xx,yy,pos=color_frame(50),/noerase
  plot,xx,yc*yy,pos=color_frame(70),/noerase

  plot,xx,yc^2*yy,pos=color_frame(90),/noerase
  plot,xx,yc^3*yy,pos=color_frame(110),/noerase
   
;; multi-frame plot

  loadct,5
  !p.multi=[0,1,2]
  plot,xx,yy,pos=color_frame(100,ymargin=ymulti(p,np=2)),/noerase
  plot,xx,yc*yy,pos=color_frame(60,ymargin=ymulti(p)),/noerase
   
;; plot within a plot

  loadct,5
  !p.multi=0
  plot,xx,yy*yc,pos=color_frame(50,bg=10),/noerase
  plot,xx,yy,pos=color_frame(100,pos=boxpos(/cur)),/noerase

;; color in frame over a different background color

  loadct,5
  plot,xx,yy,pos=color_frame(100,bg=50),/noerase,color=255
  
 AUTHOR:   Paul Ricchiazzi                        23 Feb 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\color_frame.pro)


COLOR_KEY

[Previous Routine] [Next Routine] [List of Routines]
ROUTINE:     COLOR_KEY

PURPOSE:     draws a numbered color scale.  
             NOTE: COLOR_KEY is intended to replace PUT_COLOR_SCALE

USEAGE:     
            COLOR_KEY,pos=pos,ysize=ysize,range=range,inc=inc,$
                    charsize=charsize,barwidth=barwidth,step=step,$
                    labels=labels,title=title,colors=colors,nbotclr=nbotclr

PURPOSE:    Draws a numbered color scale

INPUT:      no required input

OPTIONAL KEYWORD INPUT:

  pos          2 element vector, x and y device coordinates of lower 
               left hand corner of color bar.  If POS is not set the
               color bar will be placed one character width to the 
               right of the lower right corner of the last defined 
               data window

  xoff         x offset of color bar from right edge of plot frame in
               units of default character with.  (default=1) xoff is
               disabled when pos is set.

  range        array which contains full range of physical values,
               The number scale limits are computed fron min(range) and
               max(range).  (default=0-255)

  inc          increment step of the number scale in physical units
               If INC is not set the number scale increment is set 
               automatically

  step         if set to one, the color table is modified with STEP_CT.
               The color scale is stepped at the number scale intervals. 

  colors       a vector of discreet colors selected from the original
               color table.  In this case the original color table is
               not modified and the number of elements of COLORS
               is used to find the number scale increments. This
               option should be used with devices that do not accept
               user specified color tables (such as the Apple Laser
               Writers).  BEWARE: when the COLORS option is used with
               TVIM's SCALE option care must be taken to ensure that
               COLOR_KEY's number scale matches the quantity values.
               Unlike the STEP option, this is not automatic (see
               example below)

  nbotclr      number of reserved colors at the bottom of the color
               table.  these colors will not appear in the color key.

  charsize     character size on number scale

  ysize        vertical size of color bar in device units. 
               if ysize is negative, the abs of ysize is interpreted
               as the normalized z coordinate of the top of the bar.

  barwidth     width of color bar (default=1)

  labels       a vector of strings used to label the color key levels
               if not set the default color key number labels are
               used.  If the number of elements in LABELS is the same
               as the number of elements in COLORS then the labels
               will appear in the middle of a given color band
               instead of at the boundary between colors.

  title        color scale title drawn to the right of the color key

  slevels      selected levels at which to mark vertical scale. If LABELS
               is also set, the number of elements in LABELS should be
               equal to either nsl, or nsl-1 where nsl is the number of
               elements in SLEVELS.  The SLEVELS input does not work when
               COLORS is also specified.

  rct          if set, reverse direction of grey scale increase.  This
               keyword can be used on black & white printers to allow
               large field values to be represented by dark colors.
               
               

KEYWORD OUTPUT

  clevels      physical values at the color key tic marks

  SIDE EFFECTS:
               if STEP is set COLOR_KEY calls STEP_CT to discreetize
               the color scale.  To return to original color table
               enter STEP_CT,/OFF

EXAMPLE:

; on devices which allow user defined color tables:

      loadct,0
      TVIM,dist(200),/scale
      COLOR_KEY,range=dist(200),inc=20,/step ; change the color scale
      COLOR_KEY,range=dist(200),inc=40,/step ; change it again

; on devices with a single hard-wired color table:

      d=dist(200)+20.
      inc=step_size(d)            ; finds good step size
      dmin=fix(min(d)/inc)*inc
      dmax=fix(max(d)/inc)*inc
      nclrs=(dmax-dmin)/inc
      colors=!p.color*indgen(nclrs)/(nclrs-1)
      TVIM,colors((d-dmin)/inc),/scale,/c_map
      color_key,range=[dmin,dmax],colors=colors


; draw one big color key which applies to all tvim images on frame
 
      !p.multi=[0,2,2]
      loadct,5
      im1=randata(128,128,s=3)
      im2=rotate(im1,5)
      im3=rotate(im1,7)
      im4=rotate(im1,2)
      range=[min(im1,max=mx),mx]
      !x.omargin=[0,20]
      tvim,im1,range=range
      tvim,im2,range=range
      tvim,im3,range=range
      tvim,im4,range=range
      color_key,range=range,xoff=10,ysize=-.97

; logarithmic scales  

      im=randata(128,128)
      im=abs(im) & im=3*(im/max(im) > .001)
      tvim,im,/rmarg ; here we assume im is the log10 of some plot quantity.

      ndec=3       ; number of decades

      slevels=[1.] ; starting value
      for i=0,ndec-1 do slevels=[slevels,(findgen(9)+2)*10.^i]
      slevels=alog10(slevels)
      labels=strarr(n_elements(slevels))
      labels(indgen(ndec+1)*9)=string(f='("10!a",i1,"!b")',indgen(ndec+1))
      color_key,range=im,slevels=slevels,labels=labels


 AUTHOR:       Paul Ricchiazzi    jan93 
               Earth Space Research Group, UCSB

 REVISIONS:
 20sep93: put in LABELS option
 21sep93: use pure white blankout color for postscript
 22sep93: put in COLORS option
 09sep96: put in SLEVELS option
 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\color_key.pro)


COLOR_PAL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:                 color_pal

 AUTHOR:                 Terry Figel, ESRG, UCSB 10-21-92

 CALLING SEQUENCE:        color_pal

 PURPOSE:                 Displays Color palette in a seperate window

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\color_pal.pro)


COLOR_QUANJ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLOR_QUANJ
 PURPOSE:
       Combines Red, Green, Blue components into a color image.
 CATEGORY:
 CALLING SEQUENCE:
       c = color_quanj(red, grn, blu, r, g, b)
 INPUTS:
       red, grn, blu = Red, green, and blue images.   in
 KEYWORD PARAMETERS:
       Keywords:
         COLORS=n  Number of colors to have in final image
           (def=number of available colors).
         /DITHER   Combined using dithering.
         /DISPLAY  Display resulting image.
         /ORDER    Display image with first line at top.
 OUTPUTS:
       r,g,b = Color table for combined color image.  out
       c = Resulting color image.                     out
 COMMON BLOCKS:
 NOTES:
       Notes: This routine uses another color combining method
         then color_quan, it writes the image to a JPEG file and
         then reads it back.  This gives better results than
         color_quan in some cases.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 24

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\color_quanj.pro)


COLOR_SCHEME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	color_scheme

 PURPOSE:
   This procedure is used to load one or more predefined dynamical color scheme (ct_*.pro')

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   color_scheme,plot,[scheme_code=scheme_code]

 INPUTS:
   plot: This is the defined plot scructure look at pl_init
         If it is not given defaults will be loaded from pl_init

 KEYWORD PARAMETERS:
   scheme_code: the integer code or "character string" of the color scheme
               1:  a dyamical color code from yellow - red - blue - green - black that's the default
               2:  a dyamical color code from blue - red - yellow
               3:  a dyamical color code from blue - green - yellow - red
               12: a dyamical color code from yellow - red - blue
               20: a dynamical gray scaled color code
               'ct_yellow_red_blue'

  EXAMPLE:
   color_scheme,plot,scheme_code=1
   or for setting up of two colorsystems:
   color_scheme,plot,scheme_code=[20,2]
   or
   color_scheme,plot,scheme_code=['ct_yellow_red_blue_green_black','ct_yellow_red_blue']



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-Oct-5
                       R.Bauer 1997-Nov-12 additional colortable
                       1998-Jul-8 multiple color tables added
               1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
               1999-Feb-28 color names changed
               1999-Dec-08 some more colortables added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\color_scheme.pro)


COLOR_WHEEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLOR_WHEEL
 PURPOSE:
       Pick a color using a color wheel.
 CATEGORY:
 CALLING SEQUENCE:
       color_wheel, clr
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /VARYWHEEL means vary wheel brightness using bar.
         XPOS=xpos, YPOS=ypos Window position.
         SIZE=sz  Size of color wheel (def=200).
 OUTPUTS:
       clr = Returned color.   out
         -1 means ignore new color.
 COMMON BLOCKS:
 NOTES:
       Notes: color is selected by clicking on a color
         wheel and brightness bar.
 MODIFICATION HISTORY:
       R. Sterner, 2000 Aug 22
       R. Sterner, 2001 Feb 15 --- Added HSV and RGB listing.

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\color_wheel.pro)


COMBINE_PATH_FILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   combine_path_file

 PURPOSE:
   This function will combine path and file, change '\' to '/' and add '/' to the path if necessaray

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   result=combine_path_file(path,file)

 INPUTS:
   path,file : scalar strings

 OUTPUTS:
    result: correct combination of path and file

 SIDE EFFECTS
   will resolve multiple // into /

 EXAMPLE:
   result=combine_path_file('d:\/temp','test.xxx')
   will return result:'d:/temp/test.xxx'

   result=combine_path_file('d:\/temp','')
   will return result:'d:/temp/'

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\combine_path_file.pro)


COMMALIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COMMALIST
 PURPOSE:
       Return a given array as a comma delimited text list.
 CATEGORY:
 CALLING SEQUENCE:
       list = commalist(array, [form])
 INPUTS:
       array = Input array of numbers.          in
       form = Optional format (like I3).        in
 KEYWORD PARAMETERS:
       Keywords:
         /NOCOMMAS  do not add commas to returned list.
         DELIMITER=del Delimiter instead of comma.
 OUTPUTS:
       list = Returned text string with list.   out
 COMMON BLOCKS:
 NOTES:
       Note: see wordarray as a near inverse.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 28
       R. Sterner, 1998 Jul 31 --- Added DELIMITER=d, also fixed for alpha.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\commalist.pro)


COMPASS

[Previous Routine] [Next Routine] [List of Routines]
ROUTINE:     compass

USEAGE       compass, lat0,lon0,alat,alon,rng,az
             compass, lat0,lon0,rng,az,alat,alon,/to_latlon

PURPOSE:     Given the geographical coordinates of an array of points
             on the on the earth's surface, compute the great-circle 
             distance and compass heading from the central point.
             Distances and azimuth angles about the central point are 
             provided in KM and Degrees.  

             If TO_LATLON is set, convert the specified range and
             azimuth values to lat, lon coordinates

INPUT:
  lat0       geographic latitude (degrees) of central point
  lon0       geographic longitude (degrees) of central point
 
INPUT/OUTPUT
  alat       geographic latitudes

  alon       geographic longitudes

  rng        great circle distances (km) from (lat0,lon0) to (alat,alon)

  az         azimuth angles (degrees), azimuth is measured clockwise
             from due north (compass heading)

KEYWORD INPUT:
 to_latlon   if set, rng, az input converted to lat, lon


EXAMPLE:

;; plot family of great circles passing though lat,lon=(0,0)

  rng=findrng(0,2*!pi*6371.2,400)
  map_set,/cyl,/cont,/grid
  for az=0,90,15 do begin &$
   compass,0,0,rng,az,alat,alon,/to_latlon & oplot,alon,alat & endfor
  

;; find the range and az of Janus Island from Palmer Station

  lat0=-64.767 & lon0=-64.067 & alat=-64.78 & alon=-64.11
  compass,lat0,lon0,alat,alon,rng,az
  compass,lat0,lon0,rng,az,nlat,nlon,/to_latlon 
  print,f='(6a13)','alat','alon','rng','az','nlat','nlon' &$
  print,alat,alon,rng,az,nlat,nlon


  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\compass.pro)


COMPILE_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	compile_plot

 PURPOSE:
	This routine writes a precompiled idl sav file


 CATEGORY:
   PRECOMPILE

 CALLING SEQUENCE:
   compile_plot


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-05
   1999-02-28 independent_path removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\compile_plot.pro)


COMPOSE_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	compose_structure

 PURPOSE:
	This is the reverse function to decompose_structure.
	For details see that procedure.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = compose_structure(pstruc [, index])

 INPUTS:
	pstruc: Array of structures as it is obtained from the procedure
		decompose_structure

 KEYWORD PARAMETERS:
	/NO_FREE: If set no PTR_FREE command will be issued to destroys the heap variables.

 OPTIONAL INPUTS:
	index: Index vector to subscribe single elements of pstruc

 OUTPUTS:
	This function returns a 'normal' structure.

 EXAMPLE:
	see decompose_structure

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09.12.1999
	04.01.2000:	Added PTR_FREE command
	05.01.2000:	Got rid of LINK tag
	12.01.2000:	Added keyword parameter /NO_FREE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\compose_structure.pro)


COMPOUND

[Previous Routine] [Next Routine] [List of Routines]
 pro compound,compound_string,density,z_array

	Type in a chemical formula and the density.  The routine
	then figures out the atomic weight in g/mole of "molecules"
	and how many of what Z atoms you have.	The
	density isn't really needed here; it's just that if
	what you type is defined in
		(your directory) compound.dat
               (a system directory; see below) compound.dat
	then you can type
		compound,'protein',density,atwt,z_array
	and get both the density and z_array set for you.

	Note that you can do "zshow,z_array" to check out the
	composition.

 CJJ Feb 93

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\compound.pro)


COMP_BITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	comp_bits

 PURPOSE:
	This function performs a bitwise AND operation on two operands.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	result = comp_bits(var, value)

 INPUTS:
	var, value: the two operands

 KEYWORD PARAMETERS:
	/BIT - operand  is treated as bit number.
		the following AND operation is performed: var AND 2^value

 OUTPUTS:
	This function either returns 0 if the bitwise AND operation returns 0 or
	1 in any other case.

 EXAMPLE:
	print, comp_bits(9, 1) --> 1
	print, comp_bits(9, 3, /BIT) --> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 08. Jun 98.
	30.04.1999:	Removed debug statement

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\comp_bits.pro)


COMP_K_OH_NO2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  comp_k_oh_no2

 PURPOSE:
   This procedure compares different literature values for the reaction constant OH+NO2

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   comp_k_oh_no2

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   comp_k_oh_no2

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\comp_k_oh_no2.pro)


CONCATENATE_NCDF_INHALT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   concatenate_ncdf_inhalt

 PURPOSE:
   This function will concatenate two structures read from a ncdf-file into one.

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=concatenate_ncdf_inhalt(master,client)

 INPUTS:
   master: master structure
   client:

 OUTPUTS:
   result: concatenated structure
   Tags 'time', 'param' and the tags flagged in 'flags' are concatenated from master and client.
   All other tags will be taken from master only.
   Tag 'valid' will be updated correctly.

 EXAMPLE:


 MODIFICATION HISTORY:
   Written by Franz Rohrer Jan 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\concatenate_ncdf_inhalt.pro)


CONCATINATE_TWO_STRUCTURE_TAGS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	concatinate_two_structure_tags

 PURPOSE:
   The result of this function is an structure where the elements of two structure tags are concatinated

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=concatinate_two_structure_tags(master,client)

 INPUTS:
  master: The master structure
  client: the client structure
  both structure have to have the same tag names defined

 OUTPUTS:
   This function returns a structure

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1),  1998-Sep-29
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\concatinate_two_structure_tags.pro)


CONCAT_STR

[Previous Routine] [Next Routine] [List of Routines]
	NAME:
		concat_str

	PURPOSE:
		This function concatenates two structures

	CATEGORY:
		PROG_TOOLS/STRUCTURES

	CALLING SEQUENCE:
		result = concat_str(master, client [,/OVERWRITE] [,/PARSE] [,ERR = err])

	INPUTS:
		master, client: Two structures

	KEYWORD PARAMETERS:
		/OVERWRITE: If set, a tag of client will overwrite a tag with the same name in master.
			The default is that all tags from master are part of the returned stucture.
		ERR: If set to a named variable the error status of the routine will be returned:
			0: no error, 1: error ocurred (see log window)
		/PARSE: If set, a tag in client will be removed if its name starts with the same
			string as the name of a master tag (e.g. master = {tag: 4}, client = {tag_name: 9.2})
			If not set (default), a tag in client will only be removed if a tag with exactly
			the same name appears in master.

	OUTPUTS:
		This function returns the structure which results from the concatenation of the two
		structures master and client

	EXAMPLE:
		master = {a: 1, b: 'ASD'}
		client = {b: 7L, c: 6.78}
		HELP, concat_str(master, client), /STR
			** Structure <1362ec4>, 3 tags, length=16, refs=1:
		   	A               INT              1
			   B               STRING    'ASD'
			   C               FLOAT           6.78000

		master={col: 3, thick: 2, ycharsize: 2}
		client={color: 5, thick: 1, charsize: 3}
		HELP, concat_str(master, client, /PARSE), /STR
			** Structure <1353bf8>, 4 tags, length=8, refs=1:
			   COL             INT              3
			   THICK           INT              2
			   YCHARSIZE       INT              2
			   CHARSIZE        INT              3

	MODIFICATION HISTORY:
		Written by:	Frank Holland, 02. May 1998.
		15.11.1998:	Header added
		17.11.1998:	Implemented new procedure to build concatenated structure
		17.02.1999:	Changed entry under PURPOSE
		28.04.1999:	Added KEYWORD parameter PARSE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\concat_str.pro)


CONCAT_STR_BUG

[Previous Routine] [Next Routine] [List of Routines]
	NAME:
		concat_str_bug

	PURPOSE:
		This file (codebank\concat_str_bug.pro) demonstrates a bug (I think!)
		     in	   ICG\IDL_SOURCE\IDL_WORK\fh_lib\concat_str.pro

 	From the documentation, I'd have expected that if
 	* the [,/OVERWRITE] keyword is NOT set  and
	* all tags of client are present in master, 
	then concat_str would gracefully return master unchanged.
 	Instead, concat_str crashes :-)  See the following:

	IDL> help ,/struc ,host
	HOST            STRUCT    = ->  Array[1]
	** Structure , 9 tags, length=68:
	   SEP             STRING   '\'
	   TYPE            STRING   'DOS'
	   ONLINE          STRING   'FALSE'
	   DATAROOT        STRING   'D:\mirror\bw1\tascom\data'
	   LOCALDATAROOT   STRING   'D:\mirror\bw1\tascom\data'
	   PLOTFILE        STRING   'D:\temp\plot.ps'
	   PLOTCMD         STRING   'C:\PROGRA~1\Ghostgum\gsview\gsview32.exe -e d'...
	   RETAIN          INT             1
	   EDITOR          STRING   ''
	IDL> help ,/struc ,concat_str(host,{editor: 'notepad'}, /overwrite)    ; Works :-)
	    STRUCT    = ->  Array[1]
	** Structure , 9 tags, length=68:
	   EDITOR          STRING   'notepad'
	   SEP             STRING   '\'
	   TYPE            STRING   'DOS'
	   ONLINE          STRING   'FALSE'
	   DATAROOT        STRING   'D:\mirror\bw1\tascom\data'
	   LOCALDATAROOT   STRING   'D:\mirror\bw1\tascom\data'
	   PLOTFILE        STRING   'D:\temp\plot.ps'
	   PLOTCMD         STRING   'C:\PROGRA~1\Ghostgum\gsview\gsview32.exe -e d'...
	   RETAIN          INT             1
	IDL> help ,/struc ,concat_str(host,{editor: 'notepad'})                ; Fails :-(
	% Conflicting or duplicate structure tag definition: EDITOR.
	% Error occurred at:  CONCAT_STR        112 D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\concat_str.pro
	%                     $MAIN$                 
	% Execution halted at:  $MAIN$                 
	
	I think the solution will be to avoid calling concat_str() under those circumstances.
	Instead, as in functions ppsdmake() and tasmake(), we can write something like:
	
	if not chkstru(NewStruc,'text'  ) then NewStruc=concat_str(NewStruc,{text:   ['','']  })
	if not chkstru(host    ,'editor') then     host=concat_str(host    ,{editor: 'notepad'})
	
	For reference, here is the documentation from concat_str.pro:
	
	------------------------------------------------------------
	PURPOSE:
		This function (concat_str) concatenates two structures

	CATEGORY:
		PROG_TOOLS/STRUCTURES

	CALLING SEQUENCE:
		result = concat_str(master, client [,/OVERWRITE] [,/PARSE] [,ERR = err])

	INPUTS:
		master, client: Two structures

	KEYWORD PARAMETERS:
		/OVERWRITE: If set, a tag of client will overwrite a tag with the same name in master.
			The default is that all tags from master are part of the returned stucture.
		ERR: If set to a named variable the error status of the routine will be returned:
			0: no error, 1: error ocurred (see log window)
		/PARSE: If set, a tag in client will be removed if its name starts with the same
			string as the name of a master tag (e.g. master = {tag: 4}, client = {tag_name: 9.2})
			If not set (default), a tag in client will only be removed if a tag with exactly
			the same name appears in master.

	OUTPUTS:
		This function returns the structure which results from the concatenation of the two
		structures master and client

	EXAMPLE:
		master = {a: 1, b: 'ASD'}
		client = {b: 7L, c: 6.78}
		HELP, concat_str(master, client), /STR
			** Structure <1362ec4>, 3 tags, length=16, refs=1:
		   	A               INT              1
			   B               STRING    'ASD'
			   C               FLOAT           6.78000

		master={col: 3, thick: 2, ycharsize: 2}
		client={color: 5, thick: 1, charsize: 3}
		HELP, concat_str(master, client, /PARSE), /STR
			** Structure <1353bf8>, 4 tags, length=8, refs=1:
			   COL             INT              3
			   THICK           INT              2
			   YCHARSIZE       INT              2
			   CHARSIZE        INT              3

	MODIFICATION HISTORY:
		Written by:	Frank Holland, 02. May 1998.
		15.11.1998:	Header added
		17.11.1998:	Implemented new procedure to build concatenated structure
		17.02.1999:	Changed entry under PURPOSE
		28.04.1999:	Added KEYWORD parameter PARSE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\concat_str_bug.pro)


CONCOORD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CONCOORD
 PURPOSE:
       Convert between two linear coordinate systems.
 CATEGORY:
 CALLING SEQUENCE:
       concoord, x1, y1, x2, y2
 INPUTS:
       x1,y1 = input coordinates.          in
 KEYWORD PARAMETERS:
       Keywords:
         /ROUND means round output to nearest integers.
           Intended for pixel coordinates.
         /TO_1  the input point(s), x1,y1, are in system 2 and are
           to be converted to system 1.  /TO_1 is the default.
         /TO_2  the input point(s), x1,y1, are in system 1 and are
           to be converted to system 2.
         /INIT  means initialize coordinate transformations.
           In this case x1,y1 are the known reference point
           coordinates in system 1, and x2,y2 are the known
           reference point coordinates in system 2.
           At least 3 non-colinear reference points are needed
           to define the coordinate transformations, more are
           ok.  So for /INIT all 4 parameters are inputs and
           arrays of at least 3 elements.
         NAME1=nm1, NAME2=nm2  Optional coordinate system names,
           def=system 1 and system 2.  Only on /INIT.
           Use /SYSTEMS to display system names at a later time.
           Very useful to make the correct calls clear.
 OUTPUTS:
       x2,y2 = output coordinates.         out
 COMMON BLOCKS:
       concoord_com
 NOTES:
       Notes: Example for pixel coordinates and lat/long:
         concoord,ix,iy,lng,lat,/init,name1='Pixels',name2='Long/lat'
           ix,iy are arrays of ref pt pixel coord, lng,lat are
           arrays of ref pt long, lat.
         concoord,lng,lat,ix,iy,/to_1,/round
           From long,lat find pixel coordinates.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Oct 2

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\concoord.pro)


CONFILL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  confill

 PURPOSE:  display a contour plot with filled contours 

 USEAGE:   confill,z,x,y,xrange=xrange,yrange=yrange,charsize=charsize,$
                   title=title,stitle=stitle,xtitle=xtitle,ytitle=ytitle,$
                   aspect=aspect,colors=colors,range=range,nlevels=nlevels,$
                   rmarg=rmarg,pcharsize=pcharsize,lcharsize=lcharsize,$
                   c_thick=c_thick,c_label=c_label,c_charsize=c_charsize,$
                   c_orientation=c_orientation,c_spacing=c_spacing,$
                   downhill=downhill,xtype=xtype,ytype=ytype,$
                   c_color=c_color,labels=labels,position=position,$
                   levels=levels,rgb_data=rgb_data,noscale=noscale

 INPUT:    
  z
    array of field values

  x
    one or two dimensional array of x axis points

  y
    one or two dimensional array of y axis points

    IF z,x, and y are all one dimensional vectors and all the same
    size, it is assumed that irregularly grided data is being
    supplied.  In this case the routine TRIANGULATE is called to get
    the Delaunay triangulation of the data.  The triangulation info
    is then passed on to CONTOUR


 KEYWORD INPUT:

  title
    plot title

  xtitle
    x axis title
 
  ytitle
    y axis title

  stitle
    color key title (drawn to the right of color scale)

  noscale 
    if set, no color key will be drawn

  rmarg 
    right margin expansion factor to provide more room for extra wide
    color scale annotation (default=1)

  xrange
    x axis range. (default = [0,x_dimension-1])

  yrange
    y axis range. (default = [0,y_dimension-1])

  range
    two element vector indicating physical range over which
    to distribute contour levels. 

  nlevels
    maximum number of contour levels.  If LEVELS is not set the
    actual number of contour levels is determined automatically by
    AUTORANGE.  NLEVELS sets the maximum allowed number of levels,
    the actual number of levels may be less.

  levels
    contour level values (vector).  The default contour levels are
    set by AUTORANGE. The automatically selected levels chosen by
    AUTORANGE can be retrieved by setting LEVELS to a named variable
    which is initially undefined or set to zero.

  labels
     a vector of strings used to label the color key levels.  If not
     set the default color key number labels are used.  If the number
     of elements in LABELS is the same as the number of elements in
     COLORS then the labels will appear in the middle of a given
     color band instead of at the boundary between colors.  If COLORS
     is not set, the number of elements in LABELS should be at least
     as large as the number of color key segments plus one.  

  colors
     an array of color indicies used to fill contours.  The number of
     color values should be one less than the number of levels. The
     default colors are chosen to be uniformally distributed over the
     full color table.  The automatically selected colors chosen by
     CONFILL are:  colors=fix((!d.n_colors-2)*(1+findgen(nclr))/nclr),
     where nclr=n_elements(levels)-1.  If COLORS is set to a negative
     number these automatically chosen colors are reversed so that dark 
     colors are used to represent high intensity areas.

     NOTE: The default color indicies generated by CONFILL never
     include color index 0 or !d.n_colors-1.  These indicies are
     reserved for the overall plot background and foreground colors.
     For best results, color index 0 and !d.n_colors-1 should
     correspond to pure black and white respectively, which is
     usually the case in the predefined color tables supplied by RSI.
     A predefined color table that doesn't follow this rule can be
     redefined using TVLCT to put black and white in these slots,
     without affecting any of the filled contours used in the CONFILL
     plot:   tvlct,0,0,0,0 & tvlct,255,255,255,!d.n_colors-1
     
  c_label 
     integer array indicating which contour lines to label.  For
     example, c_label=[0,0,0,1,0,1] indicates that the contour lines
     which correspond to levels(3) and levels(5) are to be labeled.
     The number of C_LABELs should be the same as the number of
     LEVELS. By default no contour lines are labeled.

  c_thick
     thickness of contour lines (may be a vector of values),
     Default is 1.

  c_color
     color of contour lines (may be a scalor or vector of values).
     If c_color is negative then the color of contour lines is chosen
     to maximize contrast with adjacent fill colors. The default is
     not to drawn contour lines.  This keyword must be set to get 
     contour lines.

     NOTE: The number of contour levels is determined automatically
     if LEVELS is not set.  Hence, it may not be possible to guess
     how many values of LABELS, COLORS, C_LABEL, C_THICK or C_COLOR
     should be specified. It is probably safer not to include these
     parameters unless LEVELS is also specified.
        
  c_orientation
    If the FILL keyword is set, this keyword can be set to the angle,
    in degrees counterclockwise from the horizontal, of the lines
    used to fill contours.  If neither C_ORIENTATION or C_SPACING are
    specified, the contours are solid filled.
        
  c_spacing
    If the FILL keyword is set, this keyword can be used to control
    the distance, in centimeters, between the lines used to fill the
    contours.

  xtype
    Set this keyword to specify a logarithmic X axis.
        
  ytype
    Set this keyword to specify a logarithmic Y axis.
        
  downhill
    Set this keyword to label each contour with short, perpendicular
    tick marks that point in the "downhill" direction, making the
    direction of the grade readily apparent. If this keyword is set,
    the contour following method is used in drawing the contours.

    NOTE: Due to a bug in IDL_3.6,  the concurrent use of C_LABEL and
          DOWNHILL causes an IDL session crash.  For this reason the
          DOWNHILL option is disabled on IDL_3.6.
        
  aspect
    the x over y aspect ratio of the output image. If not set, the 
    aspect ratio is adjusted to fill the available plotting area.

  position
    specifies the lower left and upper right CONFILL frame position in
    normal coordinates.  When set POSITION overides the setting of
    ASPECT.

  pcharsize
    character size of numbers along x and y axis and the title
    (default is !p.charsize if non-zero, 1 otherwise)
 
    NOTE: The character size of the x and y-axis number scale
    annotation may be independently controlled by the !x.charsize or
    !y.charsize system variables.  For example, the x and y axis
    number scale characters may be made invisible by setting these
    variables to a very small non-zero number before calling CONFILL.
    Remember to restore normal character sizes by setting !x.charsize
    and !y.charsize to 1 or zero after the call to CONFILL.

  lcharsize
    character size of color key number or labels (default is
    pcharsize if set, otherwise !p.charsize if non-zero, 1 otherwise)

  barwidth
     width of color key which appears to right of contour plot (default=1).

  rgb_nodata
    if set, regions with field values less then the minimum of LEVELS
    or RANGE will be colored with the RGB values specified in
    RGB_NODATA (a scalor or three element vector).  Color index 1 is
    used for the nodata color.  When RGB_NODATA is set don't use
    color index 1 in the COLORS input vector.  

    NOTE: RGB_NODATA has no effect unless either RANGE or LEVELS is
    set.  This is because the default contour levels are set so that
    the minimum level is less than the minimum field value.

  overplot if set, current field is super imposed over a previous
    confill plot this option only works when z,x, and y are all one
    dimensional vectors and all the same size, in which case it is
    assumed that irregularly grided data is being supplied.  In this
    case the routine TRIANGULATE is called to get the Delaunay
    triangulation of the data.  The triangulation info is then passed
    on to CONTOUR.

 DEPENDENCIES: COLOR_KEY, AUTORANGE

 SIDE EFFECTS: if RGB_NODATA is set the rgb value of color index 1
               is modified

 EXAMPLES:

 loadct,5
 n=128
 zz=randata(n,n,s=4)
 xx=findrng([-120,-100],n)
 yy=findrng([20,50],n)
 confill,zz,xx,yy,title='Plot title',xtitle='x-axis',ytitle='y-axis',$
         stitle='contour levels',c_color=-1

 confill,zz,xx,yy,title='Plot title',xtitle='x-axis',ytitle='y-axis',$
         stitle='contour levels',c_color=-1,rgb_nodata=!p.color/2

; labeled regions

 levels=-3+findgen(6)*2
 labels=[' ocean','  rain!c forrest',' sand',$
         ' old!c snow',' real!c new!c snow']
 confill,zz,xx,yy,title='Plot title',xtitle='x-axis',ytitle='y-axis',$
         stitle='surface types',labels=labels,levels=levels,barwidth=.5

; contour irregularly grided data

 loadct,5
 w8x11
 n=128
 z=randata(n,n,s=4)
 x=findgen(n)
 y=findgen(n)
 !p.multi=[0,1,2]
 confill,z,x,y,title='Regularly Grided',c_color=-1

 ii=randomu(iseed,200)*(n*n-1)         ; random sample points
 zz=z(ii)                              ; random samples
 xx=ii mod n                           ;   (zz,xx,yy are vectors)
 yy=ii / n
 confill,zz,xx,yy,title='Randomly Sampled',c_color=-1

 oplot,xx,yy,psym=4,color=1,symsize=.4 ; show locations of sample points

; overlay three irregular regions in one confill plot

 loadct,5
 w8x11
 n=128
 z=randata(n,n,s=4)
 ii=randomu(iseed,200)*(n*n-1)         ; random sample points
 zz=z(ii)                              ; random samples
 xx=ii mod n                           ;   (zz,xx,yy are vectors)
 yy=ii / n
 confill,zz,xx,yy,xrange=[0,300]
 confill,zz^2,xx+150,yy/2,/overplot
 confill,sqrt(zz>0),xx+150,70+yy/2,/over


 AUTHOR:   Paul Ricchiazzi                        24 May 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\confill.pro)


CONFRAC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CONFRAC
 VERSION:
		4.0
 PURPOSE:
		Performs continued fraction evaluation.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = CONFRAC( A, B [,X [, keywords]])
 INPUTS:
	A
		A numeric scalar, vector or a 2-D array.  A(i,*) contains the i-th
		A coefficient(s) of the continued fraction.
	B
		Same as A for the B coefficient(s).  A and B must agree in their first
		dimension, i.e. if A is an (N,M) array (including the possibility of
		M = 1) then B must be an (N,M') array, with an arbitrary M'.
 OPTIONAL INPUT PARAMETERS:
	X
		Numeric, otherwise arbitrary.  When provided, X is used together with
		A and B to determine the continued fraction coefficients.
 KEYWORD PARAMETERS:
	AFUNCTION
		Name of a function to be used (with the CALL_FUNCTION routine) to
		determine the A coefficients.  Optional.
	BFUNCTION
		Same as AFUNCTION for the B coefficients.  Optional.
	EPSILON
		Smallness parameter, determining the allowed evaluation error.
		Optional.  Default values are machine dependent, established through
		TOLER which calls MACHAR().
	/RELATIVE
		Switch.  If set, EPS represent the allowed relative evaluation error.
	ERROR
		Optional output, see below.
	STATUS
		Optional output, see below.
 OUTPUTS:
		Returns the value(s) of the continued fraction.  The result is of the
		same format as X (a scalar if X is not given).  The type of the result
		is the highest of the types of A, B, and X, but no lower than 4 (float).
 OPTIONAL OUTPUT PARAMETERS:
	ERROR
		The name of the variable to receive the estimated evaluation error.
		Given in the same format as X (scalar if X isn't provided).  If
		RELATIVE is set the error returned is relative.
	STATUS
		The name of the variable to receive evaluation status information.
		Same format as ERROR.  Possible values are:
			0 - evaluation didn't converge.
			1 - OK.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other then the restrictions on A, B, as mentioned above.
 PROCEDURE:
		CONFRAC evaluates continued fractions of the form

			res = a(0)/(b(0) + a(1)/(b(1) + a(2)/(b(2) + ......

		Using the recurrence relation from Numerical Recipies, Sec 5.2.  The
		designation of the coefficients a(i), b(i) depends on the data
		provided, as follows:

		1)  If X isn't provided then a(i) = A(i) (or A(i,0) if A is a 2-dim
			array) and same is true for b(i) (using B)
		2)  If X is provided then a(i) = Sum_j(A(i,j)*X^j) and the same for b(i)
			using B.  In other words the fraction coefficients are polynomials
			in X, using columns of A, B, as polynomial coefficients.  Note that
			if A and/or B are one dimensional arrays then only X^0 is used i.e.
			we are back to case 1.
		3)  If AFUN and/or BFUN are provided then a(i) = afun(x,A(i,*),i) and
			same for b(i) with BFUN and B.  The functions can be arbitrary but
			they must accept at least three parameters.

		CONFRAC uses CALCTYPE, CAST, DEFAULT, FPU_FIX, POLEVAL, TOLER and TYPE
		from MIDL.
 MODIFICATION HISTORY:
		Created 20-DEC-1994 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\confrac.pro)


CONGRID2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CONGRID2
 PURPOSE:
       Alternate (and limited) congrid using interpolate.
 CATEGORY:
 CALLING SEQUENCE:
       z2 = congrid2(z,mx,my)
 INPUTS:
       z = input 2-d array.                   in
       mx, my = requested output array size.  in
 KEYWORD PARAMETERS:
       Keywords:
         /INTERPOLATE means do bilinear interpolation.
           Default is nearest neighbor.
         /CENTERED means assume pixels centered.  This means
           the pixel at (0,0) is clipped to 1/4 size.
           Default is that pixel start (not center) is at index.
 OUTPUTS:
       z2 = resulting array.                  out
 COMMON BLOCKS:
 NOTES:
       Notes: tries to correct problems in congrid.  Result may
         look odd due to extrapolation.  For example, using
         /CENT and /INTERP gives results with magnified pixels
         not all the same size.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Dec 2

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\congrid2.pro)


CONGRID8C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CONGRID8C
 PURPOSE:
       Do 24 bit congrid interpolation on 8 bit color image.
 CATEGORY:
 CALLING SEQUENCE:
       out = congrid8c(in, nx, ny)
 INPUTS:
       in = input 8 bit color image.                in
       nx,ny = New output image dimensions.         in
 KEYWORD PARAMETERS:
       Keywords:
         INRED=r1   Input image red color table.
         INGREEN=g1 Input image green color table.
         INBLUE=b1  Input image blue color table.
           If these are not given the current color table is used.
         RED=r1   Output image red color table.
         GREEN=g1 Output image green color table.
         BLUE=b1  Output image blue color table.
         /INTERP, /CUBIC, and /MINUS_ONE work as for congrid.
 OUTPUTS:
       out = interpolated output image.             out
 COMMON BLOCKS:
 NOTES:
       Notes: Intended for 8 bit color images such as GIF or TIFF.
 MODIFICATION HISTORY:
       R. Sterner, 1994 May 4

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\congrid8c.pro)


CONJ_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CONJ_MM
 VERSION:
		4.0
 PURPOSE:
		Returns complex conjugate values.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = CONJ_MM (X)
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the complex conjugate of the input, if the input is complex,
		else returns the input.  The only difference from the RSI function CONJ
		is that the output of CONJ_MM is always of the same numerical type as
		the input.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calling CAST and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-2000 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\conj_mm.pro)


CONNECTED

[Previous Routine] [Next Routine] [List of Routines]
 routine:      connected

 useage:       connected,image,nstring,view=view

 purpose:      The bi-level image is searched for all pixels which are
               are part a continous set of adjacent pixels. Those pixel
               groupings which contain fewer than NSTRING "on" pixels are
               set to zero.
 input:

   image       a bi-level image array (2d)

   nstring     the number of "on" pixels required for a given cluster of
               adjacent pixels to survive.

 output:
   image       a bi-level image with islands composed of fewer than nstring
               pixels removed.

 EXAMPLE:

   r=randata(128,128,s=2) gt 7
   connected,r,3,/view

 WARNING:      this procedure can take a lot of time for large images.
               for images larger than 64 x 64 computation times goes
               something like 
                               time=c * (NX x NY)^2

               for a DecStation 5000/240, c=7.4e-8, and 
               a 256x256 image takes about 5 minutes.

  author:  Paul Ricchiazzi                            Nov93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\connected.pro)


CONSTANTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CONSTANTS
 VERSION:
		4.0
 PURPOSE:
		Creates or updates a system variable named !PCON.  !PCON is a structure
		the fields of which contain values of physical constants as follows:
		!PCON
			USYS  - Unit System.  Either 'MKS' or CGS'.
			C     -	Speed of light.
			E     -	Electron charge.
			H     -	Planck constant.
			ME    -	Electron mass.
			K     -	Boltzman constant.
			NA    -	Avogadro constant.

			ECONV -	Used internally for unit conversion.

			HBAR  -	Planck constant divided by 2*pi.
			ALPHA -	Fine structure constant.
			AMU   -	Atomic mass unit.
			SIGMA -	Stefan-Boltzman radiation constant.

		All the values are given in a double precision format.  Of course, the
		actual accuracy depends on how precisely they can be measured.
 CATEGORY:
		Utility.
 CALLING SEQUENCE:
		CONSTANTS [,/MKS or /CGS]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/MKS
		Switch.  Sets the units system to MKS.  This is also the default.
	/CGS
		Switch.  Sets the units system to CGS.  Default is MKS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		M_CONS.  Contains a single parameter, EXISTS.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Can't use both MKS and CGS at the same time.
 PROCEDURE:
		Either creates or, if EXISTS is defined, updates the system variable
		!PCONS.  Uses ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 30-MAR-1994 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\constants.pro)


CONTLEV

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    contlev

 PURPOSE:    find a good set of contour levels 

 USEAGE:     result=contlev(a)

 INPUT:      
   a         an array

 KEYWORD INPUT:
   maxlev    maximum number of levels on the plot.  Setting this keyword to,
             say, 5 does not mean you will get 5 levels.  It just means no
             more than 5 levels will be generated.

 OUTPUT:
   result    a vector of contour levels

 EXAMPLE:    contour,dist(20),levels=contlev(dist(20),maxlev=8)

  author:  Paul Ricchiazzi                            feb94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\contlev.pro)


CONTRASTZOOM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CONTRASTZOOM

 PURPOSE:

       The purpose of this program is to demonstrate how to
       zoom an image "in place" and how to window and level
       (set "contrast and brightness") an image using object
       graphics functionality. The exercise involves using
       multiple views in an object graphics scene, and being
       able to interact with different views in different ways.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       ContrastZoom, image

 REQUIRED INPUTS:

       None. The image "mr_knee.dcm" from the examples/data directory
       is used if no data is supplied in call.

 OPTIONAL INPUTS

       image: A 2D image array of any data type.

 OPTIONAL KEYWORD PARAMETERS:

       COLORTABLE: The number of a color table to use as the image palette.
       Color table 0 (grayscale) is used as a default.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       None.

 RESTRICTIONS:

       None. The Coyote Library program VCOLORBAR is included.

 EXAMPLE:

       To use this program with your 8-bit image data and a red-temperature
       color scale, type:

          IDL> ContrastZoom, image, Colortable=3

 NOTES:

       The left image is used to "zoom" into a portion of the image.
       The aspect ratio of the sub-image is always preserved. To see
       the entire image, click and release the mouse button in this
       window.

       The center image is used to adjust the contrast and brightness
       (sometimes called the "window" and "level" of the image. Click and
       drag the mouse vertically to set contrast. Click and drag the mouse
       horizontally to set brightness. To return to original values (25%
       contrast and 75% brightness), click and release in the center image.

       The color bars shows the image values of the image.

 MODIFICATION HISTORY:

       Written by David Fanning, 18 November 2001.
       Added second colorbar to show the relationship of the clamped
          colors to the overall image values. 19 November 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\contrastzoom.pro)


CONT_ERROR_19990804

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  cont_error_19990804

 PURPOSE:
   This example shows the error by contour and triangulation

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   cont_error_19990804

 EXAMPLE:
 cont_error_19990804


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Aug-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\cont_error_19990804.pro)


CONV13B_10B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	conv13b_10b

 PURPOSE:
   this procedure will remove all ^M in unix from pc created idlscripts

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   conv13b_10b,file_name

 INPUTS:
   file_name: the name of the file

 RESTRICTIONS:
 will only work on unix

 EXAMPLE:
   conv13b_10b

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),August 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\conv13b_10b.pro)


CONVERT_ICGS_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	convert_icgs_name

 PURPOSE:
	If an ICG structure and a short name (tag name) is provided this function returns
	one of the following: [short name, tag name, long name, unit].

 CATEGORY:
	ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
	result = convert_icgs_name(icgs, name)

 INPUTS:
	icgs: ICG structure
	name: short name of parameter in ICG structure (scalar or array).

 KEYWORD PARAMETERS:
	/TAG_NAME: If set name is interpreted as tag name.
	/TO_SHORT_NAME: If set conversion is to short name.
	/TO_TAG_NAME: If set conversion is to tag name.
	/TO_LONG_NAME: If set conversion is to long name ('NONE' if not defined).
	/TO_UNITS: If set conversion is to unit ('NONE' if not defined).

 OUTPUTS:
	This function returns the [short name, tag name, long name, unit] for
	parameters in an ICG structure which are characterized by their short
	or tag name.

 EXAMPLE:
	hox_data = read_ncdf('hox.nc')
	PRINT, convert_icgs_name(hox_data, 'OH', /TO_LONG_NAME)   ---> 'OH radical concentration'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 18.02.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\convert_icgs_name.pro)


CONVERT_IND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CONVERT_IND
 PURPOSE:
       Convert a text description of runs of indices to numbers.
 CATEGORY:
 CALLING SEQUENCE:
       ind = convert_ind(txt)
 INPUTS:
       txt = text string or array.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       ind = long array of indices.    out
 COMMON BLOCKS:
 NOTES:
       Notes: txt contains a list of integers.  A range may
         be indicated by the syntax b:e where b = beginning,
         and e = end of the range.  A step, s, may also be
         given: b:e:s.  An example list might be:
         txt=['2,3,4,10:20:2,25:30','34,35,38:40','50:100:10,111']
         print,convert_ind(txt) gives:
         2   3   4  10  12  14  16  18  20  25  26  27  28  29  30
         34  35  38  39  40  50  60  70  80  90 100 111
	  Inverse of LISTRUNS.PRO.
 MODIFICATION HISTORY:
       R. Sterner, 24 Jul, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\convert_ind.pro)


CONVERT_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CONVERT_INDEX

 PURPOSE:
        Converts a 1-D array index (such as is returned from 
        WHERE, UNIQ, etc) to the appropriate 1-D, 2-D, or 3-D
        array indices

 CATEGORY:
        Array Tools

 CALLING SEQUENCE:
        Result = CONVERT_INDEX( Index, Dim )

 INPUTS:
        INDEX  -> The 1-D array index to be converted to  
                  multi-dimensional indices.  INDEX is returned
                  to the calling program unchanged.
 
        DIM    -> A vector containing the dimensions of the array
                  for which multi-dimensional indices are required.

 KEYWORD PARAMETERS:
        FORTRAN -> Interpret array indices as FORTRAN indices, i.e.
                  starting from 1 instead of 0. This applies to INPUT 
                  and OUTPUT indices!

 OUTPUTS:
        Returns either a vector index or a vector of multi-dimensional 
        array indices as the value of the function. If INDEX is a 
        1-dimensional parameter, the result will have n_elements(dim)
        dimensions, if Index is a multidimensional parameter, the result
        will be a scalar.

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        Right now only works for 3-D arrays and smaller.  Will
        eventually do the general case...

 EXAMPLE:

 IDL> print,convert_index([1,1],[2,2])
           3
 IDL> print,convert_index([2,2],[2,2])
 % CONVERT_INDEX: Index[0] greater than Dim[0]
 % CONVERT_INDEX: Index[1] greater than Dim[1]
            6
 IDL> print,convert_index([2,2],[2,2],/FORTRAN)
            4       ; <<<-- shifted by 1 !

 IDL> print,convert_index(72,[72,46,20])
            0           1           0
 IDL> print,convert_index(72,[72,46,20],/FORTRAN)
           72           1           1
 
 MODIFICATION HISTORY:
        bmy, 07 Oct 1998: VERSION 1.00
        mgs, 07 Oct 1998: VERSION 1.20
               - made result etc LONG arrays
               - allow sany dimensions now
               - added reverse operation if index is multidimensional
               - added FORTRAN keyword 
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\convert_index.pro)


CONVERT_LON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CONVERT_LON

 PURPOSE:
        Convert longitudes from -180..180 to 0..360 or vice 
        versa.

 CATEGORY:
        Geography

 CALLING SEQUENCE:
        CONVERT_LON,data,names,Pacific=Pacific,Atlantic=Atlantic, $
                 minval=minval

 INPUTS:
        DATA -> A data array (lines,vars) or vector containing 
            longitude data. If DATA is a 2D array, the NAMES
            parameter must be given to identify the LONgitude variable.

        NAMES -> A string list of variable names. The longitude data
            must be labeled 'LON', unless specified with the LONNAME
            keyword. The NAMES parameter is not needed, if a data
            vector is passed.

 KEYWORD PARAMETERS:
        PACIFIC -> Convert longitudes from -180..180 to 0..360

        ATLANTIC -> Convert from 0..360 to -180..180

        LONNAME -> Name of the longitude variable if a name other
            than 'LON' is used.

 OUTPUTS:
        The longitude column in the data array will be changed.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        londat = [ -180.,-179.,-0.1,0.1,179.,180.,270.,359.]
        CONVERT_LON,londat,/Pacific
        print,londat

        CONVERT_LON,londat,/Atlantic
        print,londat

 MODIFICATION HISTORY:
        mgs, 25 Aug 1998: VERSION 1.00
        mgs, 19 May 1999: - now makes sure that longitude range does
                            not exceed -180..180 or 0..360
        mgs, 24 Jun 1999: - bug fix: choked at missing values 
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\convert_lon.pro)


CONVERT_UNIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CONVERT_UNIT

 PURPOSE:
        Convert data to a different unit. You can either 
        replace a unit by the corresponding standard SI unit or 
        replace a specific unit with another one.

 CATEGORY:
        General Science

 CALLING SEQUENCE:
        CONVERT_UNIT,DATA,UNIT,TOPARAM [,keywords]

 INPUTS:
        DATA -> A data vector, array, or a single value that shall
            be converted to a new unit. 

        UNIT -> A string variable containing the (current) unit of 
            DATA. This will be replaced by the new unit afterwards.
            If omitted, you must give the FROM_UNIT keyword to indicate
            the current unit of DATA.

        TOPARAM -> The unit to convert DATA to. This is equivalent to 
            the keyword TO_UNIT and overwrites it.

 KEYWORD PARAMETERS:
        FROM_UNIT -> An individual unit to search and replace. If not
            given, any unit will be converted to TO_UNIT, as long as
            the current unit belongs to the same physicalcategory. 

        TO_UNIT -> An individual unit to convert to. If not given, all
            unit that are converted (see FROM_UNIT) will be replaced
            by the standard SI unit of their physicalcategory.

        For the individual unit and categories see FIND_UNIT 

        RESULT -> returns 1 if conversion was successful, 0 otherwise
            This keyword is mostly for consistency witholder routines.
            It is more convenient to test !ERROR_STATE.CODE for being
            0.

        MINVAL -> minimum valid data value. Only data above this 
            value will be converted (default: -1.E30)

        QUIET -> In case of an error, an error message is displayed,
            and the !ERROR_STATUS system variable is set to reflect the
            error condition (program execution continues). Set the
            QUIET keyword to suppress the error message.

 OUTPUTS:
        DATA will be converted and unit will contain new names.

 SUBROUTINES:

 REQUIREMENTS:
        Uses FIND_UNIT

 NOTES:
        CONVERT_UNIT wil return the value and unit unchanged if
        the unit was not found in the standard list (see FIND_UNIT)
        or the physicalcategory of the target unit does not match the
        physicalcategory of the source unit. In these cases, 
        !ERROR_STATE.CODE will be set to signal an error condition.

        Should try the udunits implementation by ?????

 EXAMPLE:
        ; create some data
        data = findgen(100)
        unit = 'cm'

        ; convert all data to SI unit of same category (m)
        convert_unit,data,unit

        ; test success
        if (!ERROR_STATE.CODE ne 0) then stop

        ; convert temperature in Fahrenheit to 'deg C'
        ; (multiple calls to capture all different spellings)
        ; Data will only be changed if unit is indeed Fahrenheit
        convert_unit,data,unit,from='F',to='deg C'
        convert_unit,data,unit,from='degF',to='deg C'
        convert_unit,data,unit,from='deg F',to='deg C'

        ; (easier way) convert any temperature to 'C'
        ; This will also convert 'K' !
        ; Don't display error message
        convert_unit,data,unit,to='C',/QUIET

        ; convert 'mph' data to SI ('m/s')
        convert_unit,data,unit,from='mph'

        ; explicitely convert 'cm' to 'm'
        convert_unit,data,'cm','m'
        ; equivalent to
        convert_unit,data,from='cm',to='m'

 MODIFICATION HISTORY:
        mgs, 26 Aug 1998: VERSION 1.00
        mgs, 27 Aug 1998: 
            - added RESULT and QUIET keywords
            - improved error handling
        mgs, 23 Aug 2000: 
            - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\convert_unit.pro)


CONVOL_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		CONVOL_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates the convolution of two functions represented by arrays.
 CATEGORY:
		Mathematical, array function.
 CALLING SEQUENCE:
		Result = CONVOL_MM (FAR, GAR [, keywords])
 INPUTS:
	FAR
		Array, numeric, otherwise arbitrary.
	GAR
		Ditto.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/NOCENTER
		Switch.  Prevents centering one array over the other (corresponds to
		the CENTER = 0 setting in IDL CONVOL.  The default is CENTERED.
	/REVERSE
		Switch.  Reverses the direction, i.e instead of f(x-x')g(x') the
		integrand becomes f(x+x')g(x').
	/CLIP
		Switch.  If set, the edges of the result (which cannot be fully
		convolved) are set to zero, same as the default behavior of IDL CONVOL.
		The default behaviour of CONVOL_MM corresponds to the IDL CONVOL
		EDGE_WRAP SETTING.
	EDGE_VAL
		Accepts a value to be used for all the "beyond the edge " elements.
		if EDGE_VAL is provided, /CLIP is ignored.  EDGE_VAL and EDGE_TRUNCATE
		are mutually exclusive.
	/EDGE_TRUNCATE
		Switch.  If set, the "beyond the edge" elements are obtained by a
		propagation of the edge elements of FAR.  EDGE_TRUNCATE and EDGE_VAL
		are mutually exclusive.
	/NOROUND
		Switch.  Normally, if both input arrays are of one of the integer
		types, the result is rounded before type casting to the output type.
		Setting NOROUND prevents the rounding.
 OUTPUTS:
		Returns the result of the convolution with dimensions corresponding to
		the bigger of the two arrays.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses FFT.  Faster then the IDL CONVOL, and differs from it in few
		significant aspects, as follows:

		1) The two arrays are treated symmetrically, i.e. the result stays the
		same if they are exchanged (with the exception that when /REVERSE is
		set, it is always the second array that's reversed.
		2) The problem with IDL CONVOL, where the centered convolution is
		calculated in a reversed direction (versus standard mathematical
		practice) has been corrected.
		3) The arrays don't have to be of the same dimensionality.  If they're
		not they are imbedded in an array big enough to contained both and
		padded with zeroes (default), a constant value (if EDGE_VAL is used)
		or the edge elements of FAR (if EDGE_TRUNCATE is used).

		Calls CALCTYPE, CAST, EXTEND_ARRAY, FPU_FIX and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-NOV-1996 by Mati Meron as M_CONVOL.
		Modified 20-JAN-1997 by Mati Meron.  Streamlined (through the use of
		EXTEND_ARRAY and added keyword EDGE_TRUNCATE.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to CONVOL_MM.
		Modified 25-DEC-2000 by Mati Meron.  Added rounding for integer types
		and the keyword NOROUND.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\convol_mm.pro)


CONV_UNIX_VAX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      CONV_UNIX_VAX
 PURPOSE:
      To convert Unix IDL data types to Vax IDL data types. 
 EXPLANATION:
      CONV_UNIX_VAX assumes the Unix IDL data type is IEEE standard in either
      big-endian or little-endian format.

 CALLING SEQUENCE:
      CONV_UNIX_VAX, variable, [ SOURCE_ARCH = ]

 PARAMETERS:
      variable - The data variable to be converted.  This may be a scalar
            or an array.  Valid datatypes are integer, longword,
            floating point, and double precision. The result of the 
            conversion is passed back in the original variable.
 OPTIONAL INPUT KEYWORD:  
      SOURCE_ARCH = name (string) of source architecture
            if using this function on a VAX, otherwise
            !VERSION.ARCH is used to determine the conversion.
            **If run on a VAX, the default is to assume the source to be
            a little-endian machine with IEEE floating point
            (e.g. MIPSEL or Alpha***).
 RESTRICTIONS:
      Requires that data be from IEEE standard Unix machines
      (e.g. SUN, MIPSEL, or Alpha).
 EXAMPLE:
      Read a 100 by 100 matrix of floating point numbers from a data
      file created on a Sun.  Then convert the matrix values into
      VAX format.

      IDL> openr,1,'vax_float.dat
      IDL> data = fltarr(100,100)
      IDL> forrd,1,data
      IDL> CONV_UNIX_VAX,data,SOURCE_ARCH='sparc'

 MODIFICATION HISTORY:
      Version 1      By John Hoegy            13-Jun-88
      04-May-90 - WTT:  Created CONV_UNIX_VAX from VAX2SUN,
                         reversing floating point procedure.
       Modified  P. Keegstra             September 1994
           Implemented MIPSEL and ALPHA architecture,
           distinguishing VMS and OSF
       Modified  P. Keegstra             February 1995
           Added 386 PC based architectures
       If since V5.1 then VMS is always little endian    June 1998
       Convert to IDL V5.0   W. Landsman                 June 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\conv_unix_vax.pro)


COO_CONV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		COO_CONV
 VERSION:
		4.0
 PURPOSE:
		Transforms values between the coordinate systems supported by IDL.
		Allowed coord systems are DATA, DEVICE (only for X, Y axes) and NORMAL.
		Functionally similar to the IDL function CONVERT_COORD, COO_CONV is
		maintained for historical reasons.
 CATEGORY:
		Plotting /General Graphics.
 CALLING SEQUENCE:
		Result = COO_CONV( R, AXIS = AX [, keywords])
 INPUTS:
	R
		numeric, otherwise arbitrary, assumed to be a coordinate(s) in the
		direction specified by AXIS.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	AXIS
		Sets the transformation axis.  Accepts either a numeric value, one of
		(0, 1, 2) or a character value (only first character matters), one of
		('X', 'Y', 'Z').  Mandatory.
	FROM
		Character value (only first 3 characters matter), specifies input
		coord. system.  One of ('DATA','DEVICE','NORMAL').  Defaults to 'DATA'.
	TO
		Same as FROM.  Specifies output coord. system.
 OUTPUTS:
		'' (0 length string) in case of failure (bad keyword value), otherwise
		returns the transformed value as floating (or double if the input is
		of type double).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses calls to CAST, DEFAULT, FPU_FIX, ISNUM, STREQ, STRMATCH_MM and
		TYPE from MIDL.  Converts coordinates using values provided by relevant
		system variables.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\coo_conv.pro)


CORRELATE_ALL_COLUMNS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   correlate_all_columns

 PURPOSE:
   This function calculates the correlation coefficients (Pearson, Spearman, or Kendall)
   for a 2 dim data matrix

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = CORRELATE_ALL_COLUMNS(Value, [Text], [/SPEARMAN], [/KENDALL])

 INPUTS:
   Value:  2d data array

 OPTIONAL INPUTS:
   Text:   column header(title) for input array

 KEYWORD PARAMETERS:
   SPEARMAN:       if set Spearman rank correlation will be used (default: Pearson)
   KENDAL:         if set Kendal tau rank correlation will be used (default: Pearson)
   MISSING_VALUE:  if set to a single number these values will be excluded from calculation
   SIGNIFICANCE:   upper limit for significance to be plotted (def 1.0), see R_CORRELATE
   R_MINIMUM:      lower limit for correlation coeff. to be plotted (def 0.0)
   PLOT_ROWS, PLOT_COLS    number of rows and columns in plot
   N_MINIMUM:      minimum of data points to be considered for correaltion and plot
   SORT_BY_R       if set output array will be sorted after correlation coeff.
   SORT_BY_SIGNIF  if set output array will be sorted after significance
   REVERSE_ORDER   if set reverse order sorting, highest correlation first
   FIXED_COLUMN    if set to column number or an array of column numbers this column/these columns
                       will be correlated against all other columns
   EXCLUDE_COLUMNS if set to a cloumns number these columns will be excluded
   NO_PLOT:        suppress plotting
   PSFILE:         postscript filename for plotting (def: idl.ps)
   MESSAGE:        if set messages will be printed
   ERR:            if set to a named variable an error is indicated (OK:0, error:1)
   _EXTRA:         additional keywords can be provided for plot, init_dev, init_mplot

 OUTPUTS:
   This function returns a structure r containing the indeces to the columns r.i and r.j
   and the respective correlation coefficient r.r and a significance level r.s

 EXAMPLE:
   nr=100 & nc=3
   v = FINDGEN(nr,nc)+nr*RANDOMU(s,nr,nc)
   PRINT, correlate_all_columns(v, /MESSAGE)
       % CORRELATE_ALL_COLUMNS: no column headers given
       % CORRELATE_ALL_COLUMNS: Pearson's linear correlation
       % CORRELATE_ALL_COLUMNS: plotting COLUMN1 vs. COLUMN0 (0,1)
       % CORRELATE_ALL_COLUMNS: plotting COLUMN2 vs. COLUMN0 (0,2)
       % CORRELATE_ALL_COLUMNS: plotting COLUMN2 vs. COLUMN1 (1,2)
           {           1           0      0.59619999      0.00000000}
           {           2           0      0.57707387      0.00000000}
           {           2           1      0.48136258      0.00000000}

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-DEC-1

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\correlate_all_columns.pro)


COSANGLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		COSANGLE
 VERSION:
		4.0
 PURPOSE:
		Finds the Cosine of the angle between two vectors.
 CATEGORY:
		Geometry, General.
 CALLING SEQUENCE:
		Result = COSANGLE ( U, V)
 INPUTS:
	U, V
		Vectors, numeric, same length, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the Cosine of the angle between the two vectors.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Vectors must be non-zero.
 PROCEDURE:
		Uses the functions FPU_FIX, VINP and VNORM from MIDL.
 MODIFICATION HISTORY:
		Created 30-JUNE-1992 by Mati Meron.
		Added to MIDL 10-NOV-1997 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\cosangle.pro)


COSD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COSD

 PURPOSE:
       Return the cosine of an angle specified in degrees rather than radians.

 CALLING SEQUENCE:
       x = cosd(deg)

 INPUTS:
       angle   angle in degrees

 OPTIONAL INPUTS:

 OUTPUTS:
       Cosine of angle returned.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/07/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cosd.pro_)


COSFILT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COSFILT
 PURPOSE:
       Cosine tapered weighting array to use for FFT filtering.
 CATEGORY:
 CALLING SEQUENCE:
       W = COSFILT(DATA, F1, F2, [F3, F4])
 INPUTS:
       DATA = 1-d data array (only used to find array size).   in
       F1 = filter start of rolloff (fraction of sample freq). in
       F2 = end of rolloff (fraction of sample freq).          in
          or
       F1 = filter start of rollup (fraction of sample freq).  in
       F2 = end of rollup (fraction of sample freq).           in
       F3 = filter start of rolloff (fraction of sample freq). in
       F4 = end of rolloff (fraction of sample freq).          in
         F1 < F2 < F3 < F4 <= .5
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner., B. Gotwols  7 Apr, 1987.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cosfilt.pro)


COSSCATANG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COSSCATANG

 PURPOSE:
       Return the scattering angle of the incident and emerging rays.
       NOTE:  the scattering angle is defined as 180 degrees when
       sza = vza = 0 and phi = 180.

 CALLING SEQUENCE:
       cos_omega = cosscatang(cossza, cosvza, phi)

 INPUTS:
       cossza    cosine of solar (or incident) zenith angle 
       cosvza    cosine of viewing (or emergin or satellite) zenith angle 
       phi       relative azimuth angle; this is defined as the difference
                 between the solar azimuth angle and the viewing azimuth
                 angle; when sat, sun are in the same position in
                 the sky, phi = 0

 OPTIONAL INPUTS:

 OUTPUTS:
       The scattering angle is returned.

 EXAMPLE:
 IDL> print,acosd(cosscatang(cosd(60),cosd(60),0))
       0.00000
 IDL> print,acosd(cosscatang(cosd(60),cosd(60),180))
       120.000

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  1/04/94

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cosscatang.pro)


COSTAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COSTAP
 PURPOSE:
       Cosine taper weighting from 1 at center to 0 at ends.
 CATEGORY:
 CALLING SEQUENCE:
       w = costap(n,[f])
 INPUTS:
       n = # of pts in weighting array.               in
       f = fraction of pts in flat region (def=0).    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       w = weight with values from 0 to 1.            out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 6 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\costap.pro)


COUNT_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   count_name

 PURPOSE:
   This function increments a given name with a number. The old number is stored in an heap variable named: 'count_name_'+name

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=count_name(name,[/reset])

 INPUTS:
   name: the name which should be used as base for the counting

 KEYWORD_PARAMETERS:
  reset: if set counter is set zero

 EXAMPLE:
 PRINT,count_name('test')
 test_1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-20

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\count_name.pro)


COYOTE_FIELD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   COYOTE_FIELD

 PURPOSE:

   The purpose of this compound widget is to provide an alternative
   to the CW_FIELD widget offered in the IDL distribution. What has
   always annoyed me about CW_FIELD is that the text widgets do not
   look editable to the users on Windows platforms. This program
   corrects that deficiency and adds some features that I think
   would be helpful. For example, you can now assign an event handler
   to the compound widget.

 AUTHOR:
   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   fieldID = COYOTE_Field(parent, Title='X Size: ", Value=256, /IntegerValue)

 INPUT PARAMETERS:

   parent -- The parent widget ID of the compound widget. Required.

 INPUT KEYWORDS:

   Column -- Set this keyword to have the Label Widget above the Text Widget.
   CR_Only -- Set this keyword if you only want Carriage Return events. If
              this keyword is not set, all events are returned. No events
              are returned unless the EVENT_PRO or EVENT_FUNC keywords are used.
   DoubleValue -- Set this keyword if you want DOUBLE values returned.
   Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
   Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
   Event_Func -- Set this keyword to the name of an Event Function. If this
                 keyword is undefined and the Event_Pro keyword is undefined,
                 all compound widget events are handled internally and not
                 passed on to the parent widget.
   Event_Pro -- Set this keyword to the name of an Event Procedure. If this
                keyword is undefined and the Event_Func keyword is undefined,
                all compound widget events are handled internally and not
                passed on to the parent widget.
   FieldFont -- The font name for the text in the Text Widget.
   FloatValue -- Set this keyword for FLOAT values.
   Frame -- Set this keyword to put a frame around the compound widget.
   IntegerValue -- Set this keyword for INTEGER values.
   LabelFont -- The font name for the text in the Label Widget.
   LabelSize -- The X screen size of the Label Widget.
   LongValue -- Set this keyword for LONG values.
   Row=row -- Set this keyword to have the Label beside the Text Widget. (The default.)
   Scr_XSize -- The X screen size of the compound widget.
   Scr_YSize -- The Y screen size of the compound widget.
   StringValue -- Set this keyword for STRING values. (The default.)
   Title -- The text to go on the Label Widget.
   UValue -- A user value for any purpose.
   Value -- The "value" of the compound widget.
   XSize -- The X size of the Text Widget.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   None.

 EVENT STRUCTURE:

   All events are handled internally unless either the Event_Pro or Event_Func
   keywords are used to assign an event handler to the compound widget. By
   default all events generated by the text widget are passed to the assigned
   event handler. If you wish to receive only Carriage Return events, set the
   CR_Only keyword.

   event = { COYOTE_FIELD, $      ; The name of the event structure.
             ID: 0L, $            ; The ID of the compound widget's top-level base.
             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
             Value: Ptr_New(), $  ; A pointer to the widget value.
             Type:""              ; A string indicating the type of data in the VALUE field.
           }                      ; Values are "INT", "LONG", "FLOAT", "DOUBLE", or "STRING".

 EXAMPLE:

   An example program is provided at the end of the COYOTE_FIELD code. To run it,
   type these commands:

      IDL> .Compile COYOTE_Field
      IDL> Example

 MODIFICATION HISTORY:

   Written by: David Fanning, 17 NOV 1999.
   Added check to make float and double values finite. 18 NOV 1999. DWF.
   Fixed a bug when selecting and deleting all numerical text. 19 NOV 1999. DWF.
   Added DECIMAL and DIGITS keywords. 2 Jan 2000. DWF.
   Added the POSITIVE keyword. 12 Jan 2000. DWF.
   Fixed a few minor bugs with delete and digits. 12 Jan 2000. DWF.
   Made GET_VALUE function return pointer to data, instead of data. 12 Jan 2000. DWF.
   Fixed a small typo: "aveDecimal" to "haveDecimal". 10 March 2000. DWF.
   Fixed a small problem with the Example program. 7 Oct 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\coyote_field.pro)


CPLOT_ALL_COLUMNS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   cplot_all_columns

 PURPOSE:
   This function plots all columns of a matrix versus 1 vector

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   CPLOT_ALL_COLUMNS, X, Value, Text

 INPUTS:
   Xvalue:     vector of N elements
   Yvalue:     array of [N, M] elements

 OPTIONAL INPUTS:
   Text:   column header(title) for input array

 KEYWORD PARAMETERS:
   MISSING_VALUE:  if set to a single number these values will be excluded from calculation
   PLOT_ROWS, PLOT_COLS    number of rows and columns in plot
   PSFILE:         postscript filename for plotting (def: idl.ps)
   MESSAGE:        if set messages will beprinted
   ERR:            if set to a named variable an error is indicated (OK:0, error:1)
   _EXTRA:         additional keywords can be provided for plot, init_dev, init_mplot

 EXAMPLE:
   nr=100 & nc=3
   v = FINDGEN(nr,nc)+nr*RANDOMU(s,nr,nc)
   plot_all_columns(v[*,0], v, /MESSAGE)

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-DEC-1

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\cplot_all_columns.pro)


CPOSPRINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CPOSPRINT
 PURPOSE:
       Print a string showing character positions.
 CATEGORY:
 CALLING SEQUENCE:
       cposprint, s
 INPUTS:
       s = input string to print.  in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: prints character positions above string.
 MODIFICATION HISTORY:
       R. Sterner, 2000 May 31

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cposprint.pro)


CREATED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CREATED
 PURPOSE:
       Return file creation host, user, and time stamp or tag.
 CATEGORY:
 CALLING SEQUENCE:
       txt = created()
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         VERB=verb First word to use (def=Created).
 OUTPUTS:
       txt = returned text.        out
       Ex: Created on tesla by Sterner on Tue Jul  1 14:22:15 1997
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Jul 1

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\created.pro)


CREATE_GRIDFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    Create_GridFile

 PURPOSE:
    This procedure generates a netcdf file with grid information for
    regular grids or gaussian grids corresponding to a spectral
    truncation of T21, T30, T42, T63, T85, T106, T126, T170, T213, or
    TL319. The netcdf file contains the three variable lon, lat, and
    lat_weight. Lat_weight is the area weighting factor for latitudes
    (integral = 1).

 CATEGORY:
    Geography

 AUTHOR:
    Martin Schultz
    Max-Planck-Institute for Meteorology
    Bundesstr. 55, 20146 Hamburg, Germany
    martin.schultz@dkrz.de

 MODIFICATION HISTORY:
    mgs, 24 Aug 2000: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\create_gridfile.pro)


CREATE_HISTORY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	create_history

 PURPOSE:
	This function returns the following - history - string:
	' [  at  ]'

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	Result = create_history([text])

 OPTIONAL INPUTS:
	text: A text string (scalar) which will appear in the history string.

 OUTPUTS:
	This function returns the following - history - string:
	' [  at  ]'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 24.09.1999
	18.11.1999:	Added optional input parameter: text
	19.11.1999:	Minor change on default setting for text.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\create_history.pro)


CREATE_HREF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   create_href

 PURPOSE:
   This function creates an HTML href from a file name

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result=CREATE_HREF(Location, Name)

 INPUTS:
   Location:   filename with path
               example: 'a.txt', 'http://ich313.ich.kfa-juelich.de/test.html'

 OPTIONAL INPUTS:
   Name:       Name to appear in the browser, if not given location will be
               taken instead

 KEYWORD PARAMETERS:
   FULLNAME:   if this keyword is set the name wil not be stripped for
               directory etc.

 OUTPUTS:
   This function returns the hrefs for the input files

 EXAMPLE:
   a=['a.txt', 'b.txt']
   print, transpose(create_href(a))
       a.txt
       b.txt

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1998 July 26

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\create_href.pro)


CREATE_INFO_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CREATE_INFO_STRUCT

 PURPOSE:
   This function defines a structure for informations about files (ENZ,ZUS,NC )
   and for informations to write a html-file

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
       s= CREATE_INFO_STRUCT(n_sets,n_header, n_flags  $
         ,FILE_NAME=FILE_NAME,FILETYPE=FILETYPE, FILEDATE=FILEDATE, EXPERIMENT=experiment )

 INPUTS:
   n_sets  : number of rows of structure s.data (tags: text,nvalid,mean,median,stdev,minimum,maximum)
             output of zus_fb_info or nc_info or enz_info
   n_header: number of rows of header

 KEYWORD PARAMETERS:
   FILENAME, FILETYPE, FILEDATE, EXPERIMENT

 OUTPUTS:
   a structure for example s
       .file_infoname         : name of file
       .file_info.filetype    : 'zus' or 'enz' or 'nc'
       .file_info.filedate    : date of file
       .record_info.jstime : DBLARR(2) start-time and end-time in julian seconds
       .record_info.ntime  : STRARR(2) start-time and end-time in normal date and time
       .record_info.n_records: number of rows of time- and parameter vectors
       .record_info.n_sets : number of columns
       .pi.pi_name:
       .pi.email  :
       .pi.phone_number  :
       .pi.organisation  :
       .hsrefs.ps   :'ps'   (reference to ps-file:filename+.ps)
       .hsrefs.data :'data' (reference to
       .hsrefs.html :'html' (reference to html-file: filename+.savinfo.html)
       .data.text   :description of a data column (string-array )
       .data.nvalid :array containing the number of valid values of a column
       .data.mean   :array containing the avarage values of a data column
       .data.median :array containing the median values of a data column
       .data.stdev  :array containing the standard deviation of a column
       .data.minimum:array containing the lowest values of a data column
       .data.maximum:array containing the greatest values of a data column
       .experiment.text: containing the experiment text of the file if it exists
       .header.text :string array containing the header of the file

 EXAMPLE:
     s= CREATE_INFO_STRUCT(n_sets,n_header , FILENAME=FILENAME)

 REVISION HISTORY:
       Written         Theo Brauers, Marsy Lisken,  July 1998
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\create_info_struct.pro)


CREATE_WIDGET_BUTTON_SYMBOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	create_widget_button_symbol

 PURPOSE:
 This function translates a given symbol to it's bitmap buttom equivalent

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   create_widget_button_symbol,symbol

 INPUTS:
   symbol: The by icgsym_n defined icg symbolnumber

 OPTIONAL INPUTS:
   buttom_size=buttom_size: the size of the buttom (multiples from 8)
                            see restrictions

 OUTPUTS:
	This function returns an array as input for widget_buttom

 RESTRICTIONS:
  At the moment while an error on the aix occurs this routine is not in a state to use
  really  the buttom_size key

 EXAMPLE:
   result=create_widget_button_symbol(208)
   print,result
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0 240   7   0
   0 248  15   0
   0 252  31   0
   0 254  63   0
   0 254  63   0
   0 254  63   0
   0 254 127   0
   0 254  63   0
   0 254  63   0
   0 254  63   0
   0 254  63   0
   0 248  15   0
   0 248  15   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Apr-04
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\create_widget_button_symbol.pro)


CROSSI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CROSSI
 PURPOSE:
       Interactive cross-hair cursor on screen or plot.
 CATEGORY:
 CALLING SEQUENCE:
       crossi, [x, y, z]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Causes data coordinates to be used (default).
         /DEVICE Causes window device coordinates to be used.
         /NORMAL Causes normalized coordinates to be used.
         /ORDER  Reverse device y coordinate (0 at window top).
         /PIXEL  Show pixel value.
         COLOR=c Set color of line (ignored for /XOR).
           Use -2 for dotted line.
         LINESTYLE=s Line style.
         MAG=m   Magnification for an optional magnified window.
           Setting MAG turns window on. /MAG gives magnification 10.
         SIZE=sz Mag window approx. size in pixels (def=200).
         XFORMAT=xfn  These keywords are given names of functions
         YFORMAT=yfn  that accept the numeric value of x or y
           and return a corresponding string which is displayed
           in place of the actual value.  For example, Julian
           days could be displayed as a date with jd2date.
         XSIZE=xs, YSIZE=ys  Coordinate display widths.
         /JS  Means X axis is time in Julian seconds. Example:
           x=maken(-2e8,-1.9e8,200) & y=maken(20,30,200)
           z=bytscl(makez(200,200))
           izoom,x,y,z,/js
           crossi,/js
         /NOSTATUS   Inhibits status display widget.
         SETSTAT=st  May use the same status display widget on
           each call to crossi (stays in same position).
           On first call: the status widget structure is returned.
           Following calls: send st.  Must use with /KEEP.
           To delete status display widget after last box1 call:
             widget_control,st.top,/dest (or drop /KEEP)
         /KEEP   Do not delete status widget or mag window on exit.
         /XMODE  Means use XOR plot mode instead of tvrd mode.
         INSTRUCTIONS=t  String array with exit instructions.
           Default: Press any button to exit.
         /DIALOG Means give an exit dialog box.
         MENU=m  A string array with exit dialog box options.
           An option labeled Continue is always added. Def=Continue.
         DEFAULT=def  Set exit menu default.
         EXITCODE=x Returns exit code.  Always 0 unless a dialog
           box is requested, then is selected exit option number.
         BUTTON=b   Returned button code: 1=left, 2=middle, 4=right.
 OUTPUTS:
       x = X coordinate of line.             in, out
       y = Y coordinate of line.             in, out
       z = optionally returned pixel value.  out
         Only if /PIXEL is specified.
 COMMON BLOCKS:
       js_com
 NOTES:
       Note: data coordinates are default.
         X and Y may be set to starting position in entry.
 MODIFICATION HISTORY:
       R. Sterner, 1994 May 16
       R. Sterner, 1994 May 19 --- Added mag window.
       R. Sterner, 1995 May 12 --- Added exit menu default.
       R. Sterner, 1995 Jun 30 --- Added /ORDER.
       R. Sterner, 1995 Oct 17 --- Added /PIXEL and RGB display.
       R. Sterner, 1995 Nov 30 --- Added color=-2 option.
       R. Sterner, 1998 Jan 15 --- Dropped the use of !d.n_colors.
       R. Sterner, 1999 Oct 05 --- Upgraded for true color.
       R. Sterner, 1999 Dec 07 --- Fixed /PIXEL for 24-bit color & mag bug.
       R. Sterner, 2001 Jan 12 --- Fixed for maps.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\crossi.pro)


CROSSI2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CROSSI2
 PURPOSE:
       Interactive cross-hair cursor on screen or plot.
 CATEGORY:
 CALLING SEQUENCE:
       crossi, [x, y]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Causes data coordinates to be used (default).
         /DEVICE Causes window device coordinates to be used.
         /NORMAL Causes normalized coordinates to be used.
         /ORDER  Reverse device y coordinate (0 at window top).
         STATUS_PRO=pro  Name of optional status update procedure.
         /DETAILS for more info on using STATUS_PRO.
         COLOR=c Set color of line (ignored for /XOR).
           Use -2 for dotted line.
         LINESTYLE=s Line style.
         MAG=m   Magnification for an optional magnified window.
           Setting MAG turns window on. /MAG gives magnification 10.
         SIZE=sz Mag window approx. size in pixels (def=200).
         /XMODE  Means use XOR plot mode instead of tvrd mode.
         /DIALOG Means give an exit dialog box.
         MENU=m  A string array with exit dialog box options.
           An option labeled Continue is always added. Def=Continue.
         DEFAULT=def  Set exit menu default.
         EXITCODE=x Returns exit code.  Always 0 unless a dialog
           box is requested, then is selected exit option number.
         BUTTON=b   Returned button code: 1=left, 2=middle, 4=right.
 OUTPUTS:
       x = X coordinate of line.             in, out
       y = Y coordinate of line.             in, out
 COMMON BLOCKS:
 NOTES:
       Note: data coordinates are default.
         X and Y may be set to starting position in entry.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Oct 6.
	R. Sterner, 1998 Jan 15 --- Dropped the use of !d.n_colors.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\crossi2.pro)


CROSSI_FR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CROSSI_FR
 PURPOSE:
       Interactive cross-hair cursor on screen or plot.
 CATEGORY:
 CALLING SEQUENCE:
       crossi_fr, [x, y, z]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Causes data coordinates to be used (default).
         /DEVICE Causes window device coordinates to be used.
         /NORMAL Causes normalized coordinates to be used.
         /ORDER  Reverse device y coordinate (0 at window top).
         /PIXEL  Show pixel value.
         COLOR=c Set color of line (ignored for /XOR).
           Use -2 for dotted line.
         LINESTYLE=s Line style.
         MAG=m   Magnification for an optional magnified window.
           Setting MAG turns window on. /MAG gives magnification 10.
         SIZE=sz Mag window approx. size in pixels (def=200).
         XFORMAT=xfn  These keywords are given names of functions
         YFORMAT=yfn  that accept the numeric value of x or y
           and return a corresponding string which is displayed
           in place of the actual value.  For example, Julian
           days could be displayed as a date with jd2date.
         XSIZE=xs, YSIZE=ys  Coordinate display widths.
         /JS  Means X axis is time in Julian seconds. Example:
           x=maken(-2e8,-1.9e8,200) & y=maken(20,30,200)
           z=bytscl(makez(200,200))
           izoom,x,y,z,/js
           crossi,/js
         /NOSTATUS   Inhibits status display widget.
         SETSTAT=st  May use the same status display widget on
           each call to crossi (stays in same position).
           On first call: the status widget structure is returned.
           Following calls: send st.  Must use with /KEEP.
           To delete status display widget after last box1 call:
             widget_control,st.top,/dest (or drop /KEEP)
         /KEEP   Do not delete status widget or mag window on exit.
         /XMODE  Means use XOR plot mode instead of tvrd mode.
         INSTRUCTIONS=t  String array with exit instructions.
           Default: Press any button to exit.
         /DIALOG Means give an exit dialog box.
         MENU=m  A string array with exit dialog box options.
           An option labeled Continue is always added. Def=Continue.
         DEFAULT=def  Set exit menu default.
         EXITCODE=x Returns exit code.  Always 0 unless a dialog
           box is requested, then is selected exit option number.
         BUTTON=b   Returned button code: 1=left, 2=middle, 4=right.
 OUTPUTS:
       x = X coordinate of line.             in, out
       y = Y coordinate of line.             in, out
       z = optionally returned pixel value.  out
         Only if /PIXEL is specified.
 COMMON BLOCKS:
       js_com
 NOTES:
       Note: data coordinates are default.
         X and Y may be set to starting position in entry.
 MODIFICATION HISTORY:
       R. Sterner, 1994 May 16
       R. Sterner, 1994 May 19 --- Added mag window.
       R. Sterner, 1995 May 12 --- Added exit menu default.
       R. Sterner, 1995 Jun 30 --- Added /ORDER.
       R. Sterner, 1995 Oct 17 --- Added /PIXEL and RGB display.
       R. Sterner, 1995 Nov 30 --- Added color=-2 option.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\crossi_fr.pro)


CROSSPN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   CROSSPN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   A version of CROSSP for efficient vector cross products

 CALLING SEQUENCE:
   C = CROSSPN(A, B)

 DESCRIPTION: 

   The function CROSSPN computes the vector cross product (outer
   product).  The difference between CROSSPN and the IDL library
   function CROSSP, is that CROSSPN allows more than one cross
   product to be computed at one time (i.e., it is vectorized).

   Thus, in the expression "C = CROSSPN(A, B)" the vector cross
   product is computed as C = A x B.  Because CROSSPN is vectorized,
   any of the following combinations are valid:

       * A is a 3-vector, B is a 3-vector
            ==> C is the vector cross product C = A x B

       * A is a 3xN array, B is a 3-vector
            ==> C(*,I) = A(*,I) x B    (each A is crossed with B)

       * A is a 3-vector, B is a 3xN array
            ==> C(*,I) = A x B(*,I)  (A is crossed with each B)

       * A is a 3xN array, B is a 3xN array
            ==> C(*,I) = A(*,I) x B(*,I)   (component-by-component)

   If both A and B are arrays then they must have the same
   dimensions.

 INPUTS:

   A - a 3-vector or 3xN array.

   B - a 3-vector or 3xN array.


 RETURNS:

   The vector cross product A x B, either a 3-vector or a 3xN array
   depending on A and B.

 SEE ALSO:

   CROSSP

 MODIFICATION HISTORY:
   Written, CM, 10 Mar 2002
   Documented, CM, 22 Mar 2002

  $Id: crosspn.pro,v 1.2 2002/03/22 22:02:02 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\crosspn.pro)


CRS_EDIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CRS_EDIT
 PURPOSE:
       Edit a bitmap to use for a cursor image.
 CATEGORY:
 CALLING SEQUENCE:
       crs_edit, img, msk
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         HOT=[ix,iy] x and y offsets to cursor hot spot (def=[8,8]).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Displays current array values as a large version
         of the cursor.  Click on pixels to change state among
         black, white, and gray.  Transparent part of cursor is
         gray.  Left and middle mouse buttons change state,
         right button exits.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Nov 24

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\crs_edit.pro)


CRYSTAL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  crystal

 PURPOSE:  compute the radius of an mie-sphere with scattering
           properties equivalent to a irregular crystal shape. 

 USEAGE:   crystal,type,rsph,nsph,area,volume, $
             d=d,t=t,bb=bb,bt=bt,l1=l1,l2=l2,l3=l3,a1=a1,a2=a2,a3=a3

 INPUT:    
   type    crystal type      description            Geom input parameters
           ------------      -----------            ---------------------
               1             hollow column          L1,a1,d
               2             bullet rosette         L1,a1,t
               3             dendrite on plate      L1,a1,bb,bt
               4             capped column          L1,L2,L3,a1,a2,a3


 KEYWORD INPUT:
;

      type 1:     hollow column

   L1          column length (um)
   a1          hexagonal face width (um)
   d           cavity depth at each end of column (um)

      type 2:     bullet rosette

   L1          column length (um)
   a1          hexagonal face width (um)
   t           conical pyramid height on bullet rosettes (um)

      type 3:     dendrite on plate

   L1          disk thickness (um)
   a1          hexagonal face width (um)
   bb          base width of dendrite (um)
   bt          length of dendrite (um)

      type 4:     capped column

   L1          cap thickness (um)
   L2          column length (um)
   L3          other cap thickness (um)
   a1          cap hexagonal face width (um)
   a2          hexagonal face width of column (um)
   a3          other cap hexagonal face width (um)

   These geometric parameters are difined in Takano and Liou, 1995:
     "Radiative Transfer in Cirrus Clouds. Part III: Light
      Scattering by Irregular Ice Crystals" JAS 152, No 7, April 1995

 OUTPUT:
   rsph        radius of equivalent Mie spheres (um)

   nsph        number of equivalent Mie spheres 
               (factors into particle distribution function in mie
               calculation if a distribution of crystal sizes are
               computed, see example)

   area        area in um^2

   volume      volume in um^3


 DISCUSSION:
               According to Warren and Grenfeld, the scattering
               parameters of an irregular crystal can be approximated
               by those of the set of equivalent Mie spheres, such
               that the both the area and volume of the set of
               spheres match those of the original crystal.

               Say the density of a given crystal type is N per unit volume
               the extinction coefficient, kappa, (per unit distance) is 
               given by,  

                     kappa = N * Q * A / 4 

               where Q is the unknown extinction efficiency and the factor
               of 4 is to turn area into average cross-sectional area.
               According to W&G, kappa is approximately given by,

                     kappa = N * Q_mie(rsph) * (nsph * pi rsph^2)

                           = N * Q_mie(rsph) * A/4

               The single scattering albedo and asymmetry factor are given by,

                     omega = omega_mie(rsph)

                     g = g_mie(rsph)


 EXAMPLE:  

; Plot equivalent mie radius versus crystal length

        l1=findrng(50,200,100)
        crystal,1,rsph,nsph,l1=l1,a1=50,d=10
        plot,l1,rsph

; Determine PDF of equivalent radius mie spheres given distribution
; of crystal shapes.  Suppose dendrite width is fixed and the number
; of particles of a given length is given by a lognormal pdf with
; cutoffs at 10 and 500um:
; 
        l1=findrng(10,500,100) & sig=.3
        w=exp(-alog10(l1/50.)^2/(2.*sig^2))

        crystal,1,rsph,nsph,l1=l1,a1=10.,d=0
        wmie=w*nsph                          ; pdf of equivalent mie sphere
                                             ; radius distribution

        !p.multi=[0,1,2]
        plot,l1,w,title='dendrite length pdf',xtitle='length'
        plot,rsph,wmie,title='equivalent mie radius pdf',xtitle='radius'


 REVISIONS:

 AUTHOR:   Paul Ricchiazzi                        27 Jul 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\crystal.pro)


CR_STRUCT_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cr_struct_name

 PURPOSE:
	This function returns a unique structure name based on current
	date and time information and an additional random number.

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	structure_name = cr_struct_name()

 COMMON BLOCKS:
	STORE_SEED: A Long Array[36] which stores the state of the random number generator

 EXAMPLE:
	PRINT, cr_struct_name()
		'Mon Mar 16 20:55:13 1998      425995'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 17. Mar. 98.
	16.03.1999	Removed debug statement, Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\cr_struct_name.pro)


CSPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CSPEC
 PURPOSE:
       Compute ensemble averaged frequency spectrum of complex data.
 CATEGORY:
 CALLING SEQUENCE:
       s = cspec(z,n,sr,[freq])
 INPUTS:
       z = input signal: Z = X + iY.                   in
         If z has too few points, -1 is returned.
       n = number of points to use in each transform   in
         May be arbitrary.
       sr = sample rate in Hz                          in
         Needed to get actual units
 KEYWORD PARAMETERS:
       Keywords:
         OVERLAP=novr  number of points to overlap spectra (Def=0).
         ZEROPAD=zlen  length to zero pad out to (def=no 0 pad).
         N_ENSEMBLE=n  returned # spectra ensemble averaged.
         /NOTES lists some additional comments.
 OUTPUTS:
       freq = optionally output frequency array.       out
         If freq is requested then s is shifted for plots.
       s = spectral density in units of z**2/Hz.       out
         First value is DC, unless freq is requested.
 COMMON BLOCKS:
       cspec_com
 NOTES:
       Notes: For example, if Z=I+iQ, and I and Q are in volts,
         s will be volts**2/Hz
         Restrictions: one dimensional data only.
 MODIFICATION HISTORY:
       B. L. Gotwols Oct. 13, 1990.
       R. E. Sterner Sep. 13, 1991 --- added freq and cleaned up.
       R. E. Sterner Mar.  1, 1993 --- Tested for ntimes eq 0 sooner.
       R. Sterner, 1994 Oct 31 --- added overlap
       R. Sterner, 1994 Nov, 10 --- Added ZEROPAD keyword.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cspec.pro)


CTINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CTINT
 PURPOSE:
       Interpolate between two color table entries.
 CATEGORY:
 CALLING SEQUENCE:
       ctint, r, g, b, i1, i2, [mode]
 INPUTS:
       i1, i2 = start and end index for interpolation.  in
       mode = interpolation mode (def=1).               in
         Color interpolation mode
       0 = Copy.  Copy color i1 to i1:i2 range.
       1 = R,G,B.  Interp each color independently.
       2 = H,S,V straight.  Through less sat. hues (grays).
       3 = H,S,V curved. Through sat. in-between hues.
       4 = Reverse.  Reverse colors in i1:i2 range.
       5 = Ramp value from i1 down to 0 at i2.
 KEYWORD PARAMETERS:
 OUTPUTS:
       r,g,b = color table, red, green, blue.           in out
 COMMON BLOCKS:
 NOTES:
       Note: Modifies the color table.
 MODIFICATION HISTORY:
       R. Sterner, 6 Sep, 1990
       R. Sterner, 18 Oct, 1993 --- Added Copy and Reverse.
       R. Sterner, 21 Oct, 1993 --- Added Ramp mode.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ctint.pro)


CTOOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CTOOL
 PURPOSE:
       Modify a color table using widgets.
 CATEGORY:
 CALLING SEQUENCE:
       ctool
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 13 Oct, 1993
       R. Sterner, 1998 Jan 15 --- Dropped the use of !d.n_colors.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ctool.pro)


CTRIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CTRIM
 PURPOSE:
       Do a circular trim on an array.
 CATEGORY:
 CALLING SEQUENCE:
       b = ctrim(a)
 INPUTS:
       a = input array.           in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = output trimmed array.  out
 COMMON BLOCKS:
 NOTES:
       Note: if input array is not square then
         trimmed array is elliptical.
 MODIFICATION HISTORY:
       R. Sterner.  24 May, 1987.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 25 Jan 1990 --- converted to SUN.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ctrim.pro)


CT_BLUE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_blue

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_blue OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_blue' to load only one color table: ct_blue MODIFICATION HISTORY: Written by: x_def_colortable 1999-1-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ct_blue.pro)


CT_BLUE_GREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_blue_green

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_blue_green OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_blue_green' to load only one color table: ct_blue_green MODIFICATION HISTORY: Written by: x_def_colortable 1999-1-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_blue_green.pro)


CT_BLUE_GREEN_YELLOW_RED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_blue_green_yellow_red

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_blue_green_yellow_red OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_blue_green_yellow_red' to load only one color table: ct_blue_green_yellow_red MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_blue_green_yellow_red.pro)


CT_BLUE_RED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_blue_red

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_blue_red OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_blue_red' to load only one color table: ct_blue_red MODIFICATION HISTORY: Written by: x_def_colortable 1999-1-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_blue_red.pro)


CT_BLUE_RED_YELLOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_blue_red_yellow

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_blue_red_yellow OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_blue_red_yellow' to load only one color table: ct_blue_red_yellow MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_blue_red_yellow.pro)


CT_CYAN_GREEN_YELLOW_RED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_cyan_green_yellow_red

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_cyan_green_yellow_red OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_cyan_green_yellow_red' to load only one color table: ct_cyan_green_yellow_red MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ct_cyan_green_yellow_red.pro)


CT_GREY_191_32

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_grey_191_32

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_grey_191_32 OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_grey_191_32' to load only one color table: ct_grey_191_32 MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_grey_191_32.pro)


CT_GREY_220_70

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_grey_220_70

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_grey_220_70 OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_grey_220_70' to load only one color table: ct_grey_220_70 MODIFICATION HISTORY: Written by: x_def_colortable 1999-1-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_grey_220_70.pro)


CT_NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ct_ncdf

 PURPOSE:
 
This procedure defines a colorindices of 20 possible colors for plotxy
CATEGORY: PLOT/PLOTXY CALLING SEQUENCE: ct_ncdf,colors_ncdf OUTPUTS: colors_ncdf. : is a structure defining color names .black :0 .red :1 .blue :2 .green :3 .pink :4 .violett :5 .orange :6 .dark_red :7 .cyan :8 .yellow :9 .blue_green :10 .white :11 .light_grey :12 .medium_grey:13 gold :14 aquamarine :15 orchid :16 beige :17 EXAMPLE: ct_ncdf,colors_ncdf help,colors_ncdf,/str ** Structure <30027fbc>, 12 tags, length=24, refs=1: BLACK INT 0 RED INT 1 BLUE INT 2 GREEN INT 3 PINK INT 4 VIOLETT INT 5 ORANGE INT 6 DARK_RED INT 7 CYAN INT 8 YELLOW INT 9 BLUE_GREEN INT 10 WHITE INT 11 LIGHT_GREY INT 12 MEDIUM_GREY INT 13 MODIFICATION HISTORY: Written by Franz Rohrer Mai 1997 Modified 22. 5.97 : new colors violett and orange defined by R. Bauer 20. 8.97 : new_colors dark_red, cyan, yellow and blue_green defined by O. Bujok 10. 9.97 : new_color white defined by F. Rohrer 7. 4.98 : /silent introduced in loadct, F. Rohrer 22.03.99 : 4 new colors added, F. Rohrer 20.10.99 : function get_color_struct() added 'LOADCT,0,/silent' kommentiert

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ct_ncdf.pro)


CT_PASTEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_pastel

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_pastel OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_pastel' to load only one color table: ct_pastel MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_pastel.pro)


CT_YELLOW_RED_BLUE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_yellow_red_blue

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_yellow_red_blue OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_yellow_red_blue' to load only one color table: ct_yellow_red_blue MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ct_yellow_red_blue.pro)


CT_YELLOW_RED_BLUE_GREEN_BLACK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ct_yellow_red_blue_green_black

 PURPOSE:
 
This procedure defines a linear interpolated color table
added to the previously defined first 20 colors
CATEGORY: PLOT/PLOT2D CALLING SEQUENCE: ct_yellow_red_blue_green_black OPTIONAL INPUTS: start_color: the start index between 0 and 255 where the colorsystem should loaded max_colors: the number of colors for the new color scheme OPTIONAL OUTPUTS: colors: the defined color system (as input for x_def_colortable) PROCEDURE: This routine will be used by color_scheme. Using color_scheme it is possible to load more colortables at once. If you like to have an integer code do a request by R.Bauer@fz_juelich.de EXAMPLE: @init color_scheme,plot,scheme_code='ct_yellow_red_blue_green_black' to load only one color table: ct_yellow_red_blue_green_black MODIFICATION HISTORY: Written by: x_def_colortable 1999-2-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ct_yellow_red_blue_green_black.pro)


CUMULATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CUMULATE
 PURPOSE:
       Array with the cumulative sum of an array.  Integrate.
 CATEGORY:
 CALLING SEQUENCE:
       out = cumulate(in)
 INPUTS:
       in = input array.             in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = cumulative sum of in.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  20 June, 1985.
	R. Sterner, 26 June, 1991 --- fixed long overflow bug.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cumulate.pro)


CURBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CURBOX

 PURPOSE:
        Emulate the operation of a variable-sized box cursor (also known as
        a "marquee" selector).  CURBOX can be used to select a sub-region
        from a TVIM image (see example).   

 CATEGORY:
        Interactive graphics.

 CALLING SEQUENCE:
        CURBOX, x1,x2,y1,y2

        curbox,x1,x2,y1,y2,xwin,ywin,xrng,yrng,init=init,$
                message=message,inc=inc, index=index,label=label, $
                color=color,charsize=charsize
+

 INPUTS:
   x1,x2,y1,y2
     coordinates of box edges. If XWIN,YWIN,XRNG,YRNG are set, then
     input is in data coordinates, otherwise in normalized coordinates.

 KEYWORD PARAMETERS:

   init
     If this keyword is set, the initial position of the cursor
     is given by X1,X2,Y1,Y2

   message
     If this keyword is set, print a short message describing
     operation of the cursor.

   xwin,ywin
     two element vectors giving normalized x and y coordinates of window
     subregion, for example that given by !x.window or !y.window
   
   xrng,yrng
     two elements vectors giving data range of window subregion, for 
     example, as given by !x.crange or !y.crange.  When CURBOX is used
     with TVIM (and XRANGE and YRANGE are not used with TVIM), XRNG
     and YRNG represent the total index range of the displayed
     image. X1,X2,Y1,Y2 will then be the array subrange of the
     selected region.

   index
     if set, the XRNG,YRNG,XWIN,YWIN parameters are set to the values of
     the last data window, i.e., !x.crange,!y.crange, !x.window, and
     !y.window respectively.  Setting INDEX causes X1,X2,Y1,Y2 to be
     interpreted as index range coordinates.
     
   inc
     increment by which to change cursor box size when right or left
     mouse button is pressed.  Specified in data index coordinates (i.e.,
     array index coordinate) when XWIN,YWIN,XRNG,YRNG are set, otherwise
     in normalized coordinates.  The x and y increments may be specified
     separately by providing INC as a two element array.

   label
     a string which is used to label the selected region.  The string is
     centered within the region and is sized to ensure that it fits within
     the box.  If LABEL is set the box is not erased after CURBOX returns
     
   color
     color used to label regions

   charsize
     character size used for region labels

   fill
     color used to fill box region, only effective when LABEL is set

 OUTPUTS:
   x1,x2,y1,y2
     normalized coordinates coordinates of box edges.  Howvever, if
     xwin, ywin, xrng, and yrng are set, output is in data index
     coordinates, i.e., x1,x2,y1,y2 provide the index range of the
     boxed region of the image.

     If xwin,ywin,xrng,yrng are set, the output range is clipped to be
     within the limits of xrng and yrng.  

 COMMON BLOCKS:
        None.

 SIDE EFFECTS:
        A box is drawn in the currently active window.  It is erased
        on exit.

 RESTRICTIONS:
        Works only with window system drivers.

 PROCEDURE:
        The graphics function is set to 6 for eXclusive OR.  This
        allows the box to be drawn and erased without disturbing the
        contents of the window.

        Operation is as follows:
   
        Left mouse button:   reduce box size
        Middle mouse button: increase box size
        Right mouse button:  Exit this procedure, returning the 
                             current box parameters.

        NOTE: CURBOX is designed for applications in which the aspect
              ratio of the cursor box is fixed. However, if the
              aspect ratio must be adjusted do the following: jam the
              box against one of the window borders.  If you force
              the box against the left or right borders (while
              keeping the cursor pointer within the window) box size
              is constrained to change only in the height. Similarly
              the box can be made fatter or thiner by pushing the box
              against the top or bottom. As usual the LMB decreases
              size and the MMB increases size.



; EXAMPLE
;
;    use curbox to interactively select subregions from a TVIM image

       w8x11
       !p.multi=[0,1,2]
       f=randata(128,128,s=3)
       tvim,f,/interp
       xw=!x.window & xr=!x.crange
       yw=!y.window & yr=!y.crange
        
       x1=60 & x2=80 & y1=60 & y2=80
       !p.charsize=2
       !p.multi=[4,2,4]
       curbox,x1,x2,y1,y2,xw,yw,xr,yr,/init,inc=4,/mess,label='region 1'
       confill,f(x1:x2,y1:y2),title='region 1'
       curbox,x1,x2,y1,y2,xw,yw,xr,yr,/init,inc=4,/mess,label='region 2'
       confill,f(x1:x2,y1:y2),title='region 2'
       curbox,x1,x2,y1,y2,xw,yw,xr,yr,/init,inc=4,/mess,label='region 3'
       confill,f(x1:x2,y1:y2),title='region 3'
       curbox,x1,x2,y1,y2,xw,yw,xr,yr,/init,inc=4,/mess,label='region 4'
       confill,f(x1:x2,y1:y2),title='region 4'

;    use CURBOX to find the normalized coordinates of a window region
;    of given aspect ratio

        x1=.4 & x2=x1+.3 & y1=.4 & y2=y1+.1
        curbox,x1,x2,y1,y2,/init,/mess
        print,x1,x2,y1,y2

 author   Paul Ricchiazzi      April, 1993

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\curbox.pro)


CURSIM

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:        cursim

 USEAGE:         cursim,a,yy,xx,range=range

 PURPOSE:        Use the graphics cursor to interrogate a TVIM image for
                 pixel values and positions. 

 INPUT:    

    a            image array, same size as used in TVIM image

    yy, xx       2-D arrays of "vertical" and "horizontal" position
                 in the geographical case these would be lat and lon arrays
                 If these arrays are not supplied the x and y data
                 coordinates are used instead.

 OPTIONAL INPUT:
    point        if set, CURSIM will print the range and azimuth 
                 of the cursor from this point. (Palmer = [-64.767,-64.067] )

                 When this option is used the lat,lon coordinates must
                 be available either in the data coordinates of the plot
                 (i.e., as specified by the XRANGE and YRANGE parameter 
                 in the TVIM call) or explicitly as the YY and XX parameters
                 in CURSIM

 EXAMPLE: 
                 tvim,hanning(200,200),xrange=[-180,180],yrange=[-90,90] 
                 map_set,0,0,/cont,/grid,pos=boxpos(/get),/noerase
                 cursim,hanning(200,200),point=[35,-120]

  author:  Paul Ricchiazzi                            sep92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cursim.pro)


CURSX

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:        cursx

 USEAGE:         cursx,xx,yy,verbose=verbose

 PROCEDURE:      Use the graphics cursor to find xy point on plot.
                 xy point is written to pop-up widget. 

                 If a single argument is supplied (XX) it is interpreted
                 as an image or z value which will be evaluated when
                 the LMB is pressed. This option works with TVIM images
                 or plots drawn with CONTOUR.

                 if two arguments are supplied (XX and YY) they are
                 interpreted as the x and y values of a curve in the xy
                 plane.  The y value of the function is evaluated when
                 the LMB is pressed. This option works with plots drawn
                 with PLOT

                 Hit and drag LMB to retrieve coordinates and values
                 Hit MMB to quit and retain pop-up display
                 Hit RMB to quit and destroy pop-up

 INPUT:          
   xx            x coordinate or image array

   yy            if present this parameter indicates CURSX should be run
                 in curve follow mode (CFM). In this mode the y value at a
                 x coordiate point is indicated with a drawn symbol. The
                 symbol position follows the shape of the drawn curve as
                 the cursor is dragged across the plot.
 
 Keyword input

   psym          symbol used to mark xy point in plot follow mode.
   symsize       symbol size
   color         color of symbol
   silent        if set, pop up window will not contain operating instructions
   interpolate   if set and non-zero, interpolate between defined x and y
                 points in plot follow mode
                 

 EXAMPLE: 
  plot,dist(20)
  cursx

; display value at a point

  f=randata(100,100,s=3)
  tvim,f,xra=[100,120],yra=[30,50],xtitle='longitude',ytitle='latitude',/scale
  cursx,f

; pick values off a plot using curve follow mode

  x=findgen(200)
  y=randf(200,1.5)
  plot,x,y
  loadct,5
  thick,2
  cursx,x,y,psym=1,symsize=2,color=100
  thick,1

  author:  Paul Ricchiazzi                            sep92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\cursx.pro)


CURVE_LABEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CURVE_LABEL

 PURPOSE:

       Draw labels close to one or more (up to 30) curves that have
       been previously plotted.

 CALLING SEQUENCE:

       CURVE_LABEL,X,Y1,[Y2,Y3,Y4,Y5],LABELS=LABELS, $
                  [COLOR=COLOR,XPOSITION=XPOSITION,YOFFSET=YOFFSET]
 
 INPUTS:
       X - xaxis vector (1D array)
       Y1 - 1st y axis vector to be labelled.

 OPTIONAL INPUTS:
       Y2 - 2nd y axis vector to be labelled.
       Y3 - 3rd y axis vector to be labelled.
       ....etc....
	
 KEYWORD PARAMETERS:

       LABELS - String array of labels.  The size of the LABELS array
                must match the number of y variables passed.  This
                keyword is required.

       XPOSITION - A scalar variable specifying where along the x
                   axis the labels are to be drawn, in normal
                   coordinates.  Default = 0.25.  Unless the
                   NO_REPOSITION keyword is set, this might get
                   changed if the procedure determines that the
                   labels are too close together when drawing
                   multiple labels.

       YOFFSET - A scalar specifying the distance in Y between the
                 labels and the curves, in normal
                 coordinates. Default = 0.01

       NO_REPOSITION - Set this to inhibit moving the label positions
                       if the labels are too close together when
                       drawing multiple labels.

       COLOR - Integer array of color indices for the labels.

       _EXTRA - The idl _EXTRA keyword, for additional graphics
                keywords to the XYOUTS procedure.
       

 PROCEDURE:

       All labels are lined up at one point along the xaxis.  The
       procedure will try to find a position along the xaxis for
       which the labels are not too close to each other.  If it fails
       at this, it will just stick the labels at x=0.25 (normal).

 EXAMPLE:

       To label a plot containing three curves, try something like
       this:

       plot,x,y1,/nodata
       oplot,x,y1,color=2
       oplot,x,y2,color=3
       oplot,x,y3,color=4
       curve_label,x,y1,y2,y3,labels=['Y1','Y2','Y3'],color=[2,3,4]

 MODIFICATION HISTORY:

       David L. Windt, Bell Labs, March, 1997.
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\curve_label.pro)


CUTOFF_FIRST_CHARS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CutOff_first_chars

 PURPOSE:
	This function cuts off the first n characters from a string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	fc = CutOff_first_chars(charstr [,n] [,CUTOFF = co])

 INPUTS:
	charstr:	string of which the first n characters should be cut off.
	n: number of characters to cut off (default: 1).

 KEYWORD PARAMETERS:
	CUTOFF = co:	Named variable which will contain the truncated characters of charstr.
						This variable has to be initialised as a string before calling the routine.

 OUTPUTS:
	fc:	truncated string.

 EXAMPLE:
	a = 'Hello'
	fc = CutOff_First_Chars(a, 3, CUTOFF = co)
	PRINT, fc + '+' + co
		-> lo+Hel

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 04. Sep. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\cutoff_first_chars.pro)


CUTOFF_LAST_CHARS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CutOff_last_chars

 PURPOSE:
	This function cuts off the last n characters from a string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	fc = CutOff_last_chars(charstr [,n] [,CUTOFF = co])

 INPUTS:
	charstr:	string of which the last n characters should be cut off.
	n: number of characters to cut off (default: 1).

 KEYWORD PARAMETERS:
	CUTOFF = co:	Named variable which will contain the cut-off characters of charstr.
						This variable has to be initialised as a string before calling the routine.

 OUTPUTS:
	fc:	truncated string.

 EXAMPLE:
	a = 'Hello'
	fc = CutOff_last_chars(a, 3, CUTOFF = co)
	PRINT, fc + '+' + co
		-> He+llo

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 04. Sep. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\cutoff_last_chars.pro)


CW_BTGROUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CW_BTGROUP

 PURPOSE:
	CW_BTGROUP is a compound widget that simplifies creating
	a base of buttons. It handles the details of creating the
	proper base (standard, exclusive, or non-exclusive) and filling
	in the desired buttons. Events for the individual buttons are
	handled transparently, and a CW_BTGROUP event returned. This
	event can return any one of the following:
		- The Index of the button within the base.
		- The widget ID of the button.
		- The name of the button.
		- An arbitrary value taken from an array of User values.

 CATEGORY:
	PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
		Widget = CW_BTGROUP(Parent, Names)

 PROCEDURE:
	To get or set the value of a CW_BTGROUP, use the GET_VALUE and
	SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BTGROUP
	is:

		-----------------------------------------------
		Type		Value
		-----------------------------------------------
		normal		None
		exclusive   	Index of currently set button
		non-exclusive	Vector indicating the position
				of each button (1-set, 0-unset)
		-----------------------------------------------


 INPUTS:
       Parent:		The ID of the parent widget.
	Names:		A string array, containing one string per button,
			giving the name of each button.

 KEYWORD PARAMETERS:

	BUTTON_UVALUE:	An array of user values to be associated with
			each button and returned in the event structure.
	COLUMN:		Buttons will be arranged in the number of columns
			specified by this keyword.
	EVENT_FUNCT:	The name of an optional user-supplied event function
			for buttons. This function is called with the return
			value structure whenever a button is pressed, and
			follows the conventions for user-written event
			functions.
	EXCLUSIVE:	Buttons will be placed in an exclusive base, with
			only one button allowed to be selected at a time.
	FONT:		The name of the font to be used for the button
			titles. If this keyword is not specified, the default
			font is used.
	FRAME:		Specifies the width of the frame to be drawn around
			the base.
	IDS:		A named variable into which the button IDs will be
			stored, as a longword vector.
	LABEL_LEFT:	Creates a text label to the left of the buttons.
	LABEL_TOP:	Creates a text label above the buttons.
	MAP:		If set, the base will be mapped when the widget
			is realized (the default).
	NONEXCLUSIVE:	Buttons will be placed in an non-exclusive base.
			The buttons will be independent.
	NO_RELEASE:	If set, button release events will not be returned.
	RETURN_ID:	If set, the VALUE field of returned events will be
			the widget ID of the button.
	RETURN_INDEX:	If set, the VALUE field of returned events will be
			the zero-based index of the button within the base.
			THIS IS THE DEFAULT.
	RETURN_NAME:	If set, the VALUE field of returned events will be
			the name of the button within the base.
	ROW:		Buttons will be arranged in the number of rows
			specified by this keyword.
	SCROLL:		If set, the base will include scroll bars to allow
			viewing a large base through a smaller viewport.
	SET_VALUE:	The initial value of the buttons. This is equivalent
			to the later statement:

			WIDGET_CONTROL, widget, set_value=value

	SPACE:		The space, in pixels, to be left around the edges
			of a row or column major base. This keyword is
			ignored if EXCLUSIVE or NONEXCLUSIVE are specified.
	UVALUE:		The user value to be associated with the widget.
	XOFFSET:	The X offset of the widget relative to its parent.
	XPAD:		The horizontal space, in pixels, between children
			of a row or column major base. Ignored if EXCLUSIVE
			or NONEXCLUSIVE are specified.
	XSIZE:		The width of the base.
	X_SCROLL_SIZE:	The width of the viewport if SCROLL is specified.
	YOFFSET:	The Y offset of the widget relative to its parent.
	YPAD:		The vertical space, in pixels, between children of
			a row or column major base. Ignored if EXCLUSIVE
			or NONEXCLUSIVE are specified.
	YSIZE:		The height of the base.
	Y_SCROLL_SIZE:	The height of the viewport if SCROLL is specified.
	TRACKING_EVENTS:Return tracking events.

 OUTPUTS:
       The ID of the created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures with the following definition:

		event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 }

	The SELECT field is passed through from the button event. VALUE is
	either the INDEX, ID, NAME, or BUTTON_UVALUE of the button,
	depending on how the widget was created.

 RESTRICTIONS:
	Only buttons with textual names are handled by this widget.
	Bitmaps are not understood.

 MODIFICATION HISTORY:
	15 June 1992, AB
	7 April 1993, AB, Removed state caching.
	6 Oct. 1994, KDB, Font keyword is not applied to the label.
       10 FEB 1995, DJC  fixed bad bug in event procedure, getting
                         id of stash widget.
	11 April 1995, AB Removed Motif special cases.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_btgroup.pro)


CW_BUTTONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   cw_buttons

 PURPOSE:
  This compound widget function is used to set a group of buttons

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=cw_buttons(base,value,uvalue=uvalue,_extra=extra)

 INPUTS:
   base: the base where the widget should be placed in
   value: a structure of value and set
         .value: a vector of the text labels of the buttons
         .set        : a vector of 0 or 1 to set the buttons on


 KEYWORD PARAMETERS:
      uvalue: the users uvalue of the widget
      _extra: all keywords for widget_base
              and all keywords for buttons as buttons_ e.g. buttons_xsize

 OUTPUTS:
       This function returns widget id


 EXAMPLE:

PRO test_event,ev

   WIDGET_CONTROL,ev.id,get_uval=cmd
   WIDGET_CONTROL,ev.top,get_uvalue=b
   CASE cmd OF
      'done':WIDGET_CONTROL,ev.top,/dest
      'FF': BEGIN
         WIDGET_CONTROL,ev.id,get_value=v
         print,v.set
         idx=(WHERE(v.set EQ 1,count))[0]
         IF count GT 0 THEN BEGIN
            value={value:[strtrim(SINDGEN(idx+1),2)],set:MAKE_ARRAY(idx+1,/LONG,value=1)}
            WIDGET_CONTROL,b,set_value=value
         ENDIF
      END

      ELSE:
   ENDCASE
END
PRO test

   a=WIDGET_BASE(row=2)
   value={value:['MIN','SPEC','DEFAULT','MAX'],set:[1,0,0,0]}
   b=cw_buttons(a,value=value,uvalue='FF',row=1,button_xsize=60,frame=2,xoffset=0,yoffset=0,button_frame=1)
   value={value:['0'],set:[1]}
   b=cw_buttons(a,value=value,uvalue='EF',col=2,/nonexclusive,frame=2,xoffset=20,yoffset=0,button_frame=1)

   d=WIDGET_BUTTON(a,val='done',uval='done')
   WIDGET_CONTROL,/realize,a,set_uvalue=b
   XMANAGER,'test',a
END



 MODIFICATION HISTORY:
    Written by:     R.Bauer (ICG-1), 1999-Oct-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_buttons.pro)


CW_CURVE_LABEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CW_CURVE_LABEL

 PURPOSE:

       A compound widget used to select the position for a curve
       label; this widget is intended to be used in conjunction with
       the CURVE_LABEL procedure in this directory, in that this
       widget lets the user select a value from a slider from 0 to
       one, corresponding to the XPOSITION keyword in CURVE_LABEL.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_CURVE_LABEL(PARENT)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

 KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.

       VALUE - Initial value for the widget: a floating point between
               0 and 1, corresponding to the XPOSITION keyword in
               CURVE_LABEL.
 
       TITLE - A title for the widget. 

       FRAME - Set to draw a frame around the widget; ignored if
               PARENT is present.

       FORMAT - Format string for CW_FSLIDER (default is F5.3)

       FONT - Fonts to use for labels and buttons.

       DONE - Set this to add a Done button, in addition to the
              standard Apply button.
 
 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         A slider widget is created in which the user can select a
         position value.  By pressing the "Apply" button, an event is
         returned, allowing the calling procedure to redraw the
         curve label if desired.

         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, April 1997
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_curve_label.pro)


CW_DRAWCOLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CW_DRAWCOLOR

 PURPOSE:

       This compound widget is used to place a label or color name next
       to a color patch. Clicking on the color patch allows the user
       to select another color

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       colorpatchID = CW_DrawColor(parent)

 REQUIRED INPUTS:

       parent - The identifier of a parent base widget.

 OUTPUTS:

       colorpatchID - The widget identifier of the top-level base of this compound widget

 INPUT KEYWORDS:

   COLOR - The name of the color to be displayed. Color names come from PickColorName.
   COLUMN - Set this keyword to stack widgets in a column. Default is in a row.
   EVENT_FUNC - The name of an event handler function for this compound widget.
   EVENT_PRO -The name of an event handler procedure for this compound widget.
   INDEX - An index number where the color should be loaded. !D.Table_Size-2, by default.
   LABEL_LEFT - Set this keyword to have the label text aligned on the left of the label. Default is to center.
   LABEL_RIGHT - Set this keyword to have the label text aligned on the right of the label. Default is to center.
   LABELSIZE - This is the X size of the label widget (containing the label) in device coordinates. Default is natural size.
   LABELTEXT - This is the text on the label. Example, "Background Color", etc.
   TITLE - This is the title on the PickColorName program that allows the user to select another color.
   UVALUE - A user value for the widget.
   XSIZE - The xsize (in pixel units) of the color patch. By default, 20.
   YSIZE - The xsize (in pixel units) of the color patch. By default, 20.

 OUTPUT KEYWORDS:

   OBJECT - The object reference. Use this to call methods, etc.

 DEPENDENCIES:

       Reqires FSC_COLOR and PICKCOLORNAME from the Coyote Library:

                     http://www.dfanning.com/programs/fsc_color.pro
                     http://www.dfanning.com/programs/pickcolorname.pro

 MODIFICATION HISTORY:

       Written by David Fanning, March 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\cw_drawcolor.pro)


CW_DRAWSIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CW_DRAWSIZE

 PURPOSE:
 
       A compound widget used to change the size of an existing
       draw widget.  The widget contains fields for the X and Y
       draw size (in pixels), an Apply button, and optionally a
       Done button.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_DRAWSIZE(PARENT,DRAW_WIDGET)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

       DRAW_WIDGET - The id of the draw widget being resized.
 
 KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.
 
       FRAME - set to draw a frame around the widget; ignored if
               PARENT is present.

       ROW - set to place the two window size fields (x,y) in a row.
 
       COLUMN - set to place the two window size fields (x,y) in a column.

       FONT - fonts to use for labels and buttons.

       DONE - set this to add a Done button, in addition to the standard
              Apply button.

       NO_RETURN - The default behavior is that the user must press
                    after entering new values.  Set this
                   keyword so that an event is returned even if the
                   user just changes a value and then moves the
                   cursor outside of the text entry area.

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         A widget is created in which the user can specify the X and Y
         draw widget size in pixels.   By pressing the "Apply" button,
         the draw widget is resized, and an event is returned, allowing
         the calling procedure to repaint the window if desired.

         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       DLW, June 1997, Added NO_RETURN keyword.

       DLW, Sep 1997, Fixed bug that caused initial values of X and Y
       pixel sizes to be displayed as floating point values rather
       than integers.
       

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_drawsize.pro)


CW_FIELD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CW_FIELD

 PURPOSE:
	This widget cluster function manages a data entry field widget.
	The field consists of a label and a text widget.  CW_FIELD's can
	be string fields, integer fields or floating-point fields.  The
	default is an editable string field.

 CATEGORY:
	Widget Clusters.

 CALLING SEQUENCE:
	Result = CW_FIELD(Parent)

 INPUTS:
	Parent:	The widget ID of the widget to be the field's parent.

 KEYWORD PARAMETERS:
	TITLE:	A string containing the text to be used as the label for the
		field.  The default is "Input Field:".

	VALUE:	The initial value in the text widget.  This value is
		automatically converted to the type set by the STRING,
		INTEGER, and FLOATING keywords described below.

	UVALUE:	A user value to assign to the field cluster.  This value
		can be of any type.

	FRAME:	The width, in pixels, of a frame to be drawn around the
		entire field cluster.  The default is no frame.

RETURN_EVENTS:	Set this keyword to make cluster return an event when a
		 is pressed in a text field.  The default is
		not to return events.  Note that the value of the text field
		is always returned when the WIDGET_CONTROL, field, GET_VALUE=X
		command is used.

   ALL_EVENTS: Like RETURN_EVENTS but return an event whenever the
		contents of a text field have changed.

	COLUMN:	Set this keyword to center the label above the text field.
		The default is to position the label to the left of the text
		field.

	ROW:	Set this keyword to position the label to the left of the text
		field.  This is the default.

	XSIZE:	An explicit horizontal size (in characters) for the text input
		area.  The default is to let the window manager size the
		widget.  Using the XSIZE keyword is not recommended.

	YSIZE:	An explicit vertical size (in lines) for the text input
		area.  The default is 1.

	STRING:	Set this keyword to have the field accept only string values.
		Numbers entered in the field are converted to their string
		equivalents.  This is the default.

     FLOATING:	Set this keyword to have the field accept only floating-point
		values.  Any number or string entered is converted to its
		floating-point equivalent.

      INTEGER:	Set this keyword to have the field accept only integer values.
		Any number or string entered is converted to its integer
		equivalent (using FIX).  For example, if 12.5 is entered in
		this type of field, it is converted to 12.

	LONG:	Set this keyword to have the field accept only long integer
		values.  Any number or string entered is converted to its
		long integer equivalent (using LONG).

	FONT:	A string containing the name of the X Windows font to use
		for the TITLE of the field.

    FIELDFONT:	A string containing the name of the X Windows font to use
		for the TEXT part of the field.

	NOEDIT:	Normally, the value in the text field can be edited.  Set this
		keyword to make the field non-editable.
		
   NO_RETURN:  The default behavior is that the user must press
                after entering new values.  Set this
               keyword so that an event is returned even if the
               user just changes a value and then moves the
               cursor outside of the text entry area.

     TEXT_ID:  The widget id of the text widget.

 OUTPUTS:
	This function returns the widget ID of the newly-created cluster.

 COMMON BLOCKS:
	None.

 PROCEDURE:
	Create the widgets, set up the appropriate event handlers, and return
	the widget ID of the newly-created cluster.

 EXAMPLE:
	The code below creates a main base with a field cluster attached
	to it.  The cluster accepts string input, has the title "Name:", and
	has a frame around it:

		base = WIDGET_BASE()
		field = CW_FIELD(base, TITLE="Name:", /FRAME)
		WIDGET_CONTROL, base, /REALIZE

 MODIFICATION HISTORY:
 	Written by:	Keith R. Crosley   June 1992
			KRC, January 1993 -- Added support for LONG
					     integers.
		        AB, 7 April 1993, Removed state caching.
			JWG, August 1993, Completely rewritten to make
				use of improved TEXT widget functionality
			ACY, 25 March, 1994, fix usage of FRAME keyword
                       KDB, May 1994, Initial value =0 would result
                                      in a null text field. Fixed
                                      keyword check.
                       David L. Windt, Bell Labs, June 1997,
                       Added NO_RETURN keyword.
                       David L. Windt, Bell Labs, March 1998,
                       Added TEXT_ID keyword.
                       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_field.pro)


CW_FIELDS

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

 NAME:
   cw_fields

 PURPOSE:
  This compound widget function is used to set a group of lables and input data fields

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=cw_fields(base,value=value,uvalue=uvalue,_extra=extra)

 INPUTS:
   base: the base where the widget should be placed in


 KEYWORD PARAMETERS:

   value: a structure of description and values
         .label            : a vector of the text labels of the values
         .value            : a vector of the values, type of value musn't be string
         .description      : the label of the whole frame (if it's not defined no label is printed)


      uvalue: the users uvalue of the widget
      _extra: all keywords for widget_base
              and all keywords for widget_text or widget_label as text_ or label_ e.g. text_xsize or label_xsize

 OUTPUTS:
       This function returns widget id


 EXAMPLE:

PRO test2_event,ev

   WIDGET_CONTROL,ev.id,get_uval=cmd
   WIDGET_CONTROL,ev.top,get_uvalue=b
   CASE cmd OF
      'done':WIDGET_CONTROL,ev.top,/dest
      'FF': BEGIN
         WIDGET_CONTROL,ev.id,get_value=v
         print,v.value
         idx=(WHERE(v.value EQ 1,count))[0]
         IF count GT 0 THEN BEGIN
            value={label:['AHA','ABA'],value:[10.1,10.3]}
            WIDGET_CONTROL,b,set_value=value
         ENDIF
      END

      ELSE:
   ENDCASE
END
PRO test2

   a=WIDGET_BASE(row=2)
   value={label:['MIN','SPEC','DEFAULT','MAX'],value:[1,0,0,0]}
   b=cw_fields(a,value=value,uvalue='FF',row=1,text_xsize=10,text_editable=1,frame=2,xoffset=0,yoffset=0,button_frame=1)

   d=WIDGET_BUTTON(a,val='done',uval='done')
   WIDGET_CONTROL,/realize,a,set_uvalue=b
   XMANAGER,'test2',a
END


 MODIFICATION HISTORY:
    Written by:     R.Bauer (ICG-1), 1999-Oct-24
    2000-Feb-07 possible variable size of text fields added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_fields.pro)


CW_LIST

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

 NAME:
   cw_list

 PURPOSE:
  This compound widget function is used to set up a input list

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=cw_list(base,value=value,uvalue=uvalue,_extra=extra)

 INPUTS:
   base: the base where the widget should be placed in


 KEYWORD PARAMETERS:
 value={label:fn.name+fn.ext,list:list,text:'',button:'FILE',list_selected:-1,button_pressed:0}

   value: a structure of description and values
         .label            : a label right to the button
         .list             : a vector of strings to set as value to the list
         .list_selected    : a vector of indices to set which list values are selected

 The following tags are optional:

         .button           : a string to set as value to the button
         .button_pressed   : 1 if button is pressed 0 if not
         .description      : the label of the whole frame (if it's not defined no description is printed)


      uvalue: the users uvalue of the widget
      _extra: all keywords for widget_base
              and all keywords for widget_text or widget_label or widget_button or widget_list as text_ or label_ e.g. text_xsize or label_xsize

 OUTPUTS:
       This function returns widget id

 EXAMPLE:
  PRO test_event,ev

     WIDGET_CONTROL,ev.id,get_uval=cmd
     WIDGET_CONTROL,ev.top,get_uvalue=b
     CASE cmd OF
        'done':BEGIN
           WIDGET_CONTROL,b,get_value=v
           IF v.list_selected[0] NE -1 THEN PRINT,v.list[v.list_selected]
            WIDGET_CONTROL,ev.top,/dest
        END
       'FF':BEGIN
          WIDGET_CONTROL,ev.id,get_value=v

          IF v.button_pressed EQ 1 THEN BEGIN
             file_name=DIALOG_PICKFILE(filter='*.nc')
             fn=file_path_name_ext(file_name)
             list=f_names(file_name,/time)
             value={label:fn.name+fn.ext,list:list,text:'',button:'FILE',list_selected:-1,button_pressed:0}
             WIDGET_CONTROL,ev.id,set_value=value
          ENDIF

        END
        ELSE:
     ENDCASE
  END
  PRO test

     a=WIDGET_BASE(row=2,/frame)
     value={label:'testdatei',list:STRTRIM(SINDGEN(40),2),text:'',button:'FILE',$
            list_selected:-1,button_pressed:0,description:'TEST'}
     b=cw_list(a,value=value,uvalue='FF',frame=2, XOFFSET=9,$
               YOFFSET=15 ,SCR_XSIZE=140 ,SCR_YSIZE=200,$
               /text_all_events, text_xsize=19,/text_editable,  $
               /list_multiple,list_ysize=10,list_xsize=20,$
               label_xsize=100,$
               button_ysize=20 )
     d=WIDGET_BUTTON(a,val='done',uval='done')
     WIDGET_CONTROL,/realize,a,set_uvalue=b
     XMANAGER,'test',a
  END

 

2nd example
PRO test2_event,ev WIDGET_CONTROL,ev.id,get_uval=cmd WIDGET_CONTROL,ev.top,get_uvalue=b CASE cmd OF 'done':BEGIN WIDGET_CONTROL,b,get_value=v IF v.list_selected[0] NE -1 THEN PRINT,v.list[v.list_selected] WIDGET_CONTROL,ev.top,/dest END 'FF':BEGIN WIDGET_CONTROL,ev.id,get_value=v IF v.button_pressed EQ 1 THEN BEGIN replace_tag,v,'list_selected','list_selected',INDGEN(2) WIDGET_CONTROL,ev.id,set_value=v ENDIF END ELSE: ENDCASE END PRO test2 a=WIDGET_BASE(row=2,/frame) value={label:'[0,1]',list:STRTRIM(SINDGEN(40),2),text:'',button:'PRESELECTION',$ list_selected:-1,button_pressed:0,description:'TEST'} b=cw_list(a,value=value,uvalue='FF',frame=2, XOFFSET=9,$ YOFFSET=15 ,SCR_XSIZE=140 ,SCR_YSIZE=200,$ /text_all_events, text_xsize=19,/text_editable, $ /list_multiple,list_ysize=10,list_xsize=20,$ label_xsize=100,$ button_ysize=20 ) d=WIDGET_BUTTON(a,val='done',uval='done') WIDGET_CONTROL,/realize,a,set_uvalue=b XMANAGER,'test2',a END MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Nov-07 2000-Jan-07 : button definition changed 2000-Jan-11 : pointer removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_list.pro)


CW_PDRB

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	cw_pdrb 
 
 PURPOSE: 
	cw_pdrb is a compound widget that simplifies creating 
	pulldown menus. It has a simpler interface than the XPDMENU 
	procedure, which it is intended to replace. Events for the 
	individual buttons are handled transparently, and a cw_pdrb 
	event returned. This event can return any one of the following: 
                The Index of the button within the base. 
                The widget ID of the button. 
                The name of the button. 
		 The fully qualified name of the button. This allows 
		  different sub-menus to contain buttons with the same 
		  name in an unambiguous way. 
 
 
 CATEGORY: 
	PROG_TOOLS/WIDGETS 
 
 CALLING SEQUENCE: 
	widget = cw_pdrb(Parent, Desc) 
 
 INPUTS: 
       Parent:	The ID of the parent widget. 
	Desc:	An array of strings or structures.  Each element contains 
		a menu description with two fields, a flag field, and 
		the name of the item.  If a structure, each element 
		is defined as follows: 
			{ cw_pdrb_S, flags:0, name:'' } 
 
		The name tag gives the name of button. The flags 
		field is a two-bit bitmask that controls how the button is 
		interpreted: 
 
		    Value	   Meaning 
		    ------------------------------------------- 
		     0     This button is neither the beginning 
			   nor the end of a pulldown level. 
		     1     This button is the root of a 
                          sub-pulldown menu. The sub-buttons 
			   start with the next button. 
		     2     This button is the last button at the 
			   current pulldown level. The next button 
			   belongs to the same level as the current 
			   parent button. 
		     3     This button is the root of a sub-pulldown 
			   menu, but it is also the last entry of 
			   the current level. 
 
	If Desc is a string, each element contains the flag field 
	followed by a backslash character, followed by the menu item's 
	contents.  See the example below. 
 
	event procedures:  An event procedure may be specified for an 
                                                element and all its children, by including a third field 
	in Desc, if Desc is a string array.  Events for buttons without 
	an event procedure, are dispatched normally. 
	See the example below. 
 
 KEYWORD PARAMETERS: 
	delimeter:        The character used to separate the parts of a 
			  fully qualified name in returned events. The 
			  default is to use the '.' character. 
	font:		  The name of the font to be used for the button 
			  titles. If this keyword is not specified, the 
			  default font is used. 
	help:		  If MBAR is specified and one of the buttons on the 
			  menubar has the label "help" (case insensitive) then 
			  that button is created with the /HELP keyword to 
			  give it any special appearance it is supposed to 
			  have on a menubar. For example, Motif expects 
			  help buttons to be on the right. 
	ids:		  A named variable into which the button IDs will 
			  be stored as a longword vector. 
	mbar:		  if constructing a menu-bar pulldown, set this 
			  keyword.  In this case, the parent must be the 
			  widget id of the menu bar of a top-level base, 
			  returned by WIDGET_BASE(..., MBAR=mbar). 
	return_id:	  If present and non-zero, the VALUE field of returned 
			  events will be the widget ID of the button. 
	return_index:	  If present and non-zero, the VALUE field of returned 
			  events will be the zero-based index of the button 
			  within the base. THIS IS THE DEFAULT. 
	return_name:	  If present and non-zero, the VALUE field of returned 
			  events will be the name of the selected button. 
	return_full_name: If present and non-zero, the VALUE field of returned 
               	  	events will be the fully qualified name of the 
			  selected button. This means that the names of all 
			  the buttons from the topmost button of the pulldown 
			  menu to the selected one are concatenated with the 
			  delimiter specified by the DELIMITER keyword. For 
			  example, if the top button was named COLORS, the 
			  second level button was named BLUE, and the selected 
			  button was named LIGHT, the returned value would be 
 
			  COLORS.BLUE.LIGHT 
 
			  This allows different submenus to have buttons with 
			  the same name (e.g. COLORS.RED.LIGHT). 
	uvalue:		  The user value to be associated with the widget. 
	xoffset:	  The X offset of the widget relative to its parent. 
	yoffset:	  The Y offset of the widget relative to its parent. 
 
 OUTPUTS: 
       The ID of the top level button is returned. 
 
 SIDE EFFECTS: 
	This widget generates event structures with the following definition: 
 
		event = { ID:0L, TOP:0L, HANDLER:0L, VALUE:0 } 
 
	VALUE is either the INDEX, ID, NAME, or FULL_NAME of the button, 
	depending on how the widget was created. 
 
 RESTRICTIONS: 
	Only buttons with textual names are handled by this widget. 
	Bitmaps are not understood. 
 
 EXAMPLE: 
	The following is the description of a menu bar with two buttons, 
	"Colors" and "Quit". Colors is a pulldown containing the colors 
	"Red", "Green", Blue", "Cyan", and "Magenta". Blue is a sub-pulldown 
	containing "Light", "Medium", "Dark", "Navy", and "Royal": 
 
		; Make sure cw_pdrb_S is defined 
		junk = { cw_pdrb_S, flags:0, name:'' } 
 
		; The description 
		desc = [ { cw_pdrb_S, 1, 'Colors' }, $ 
			     { cw_pdrb_S, 0, 'Red' }, $ 
			     { cw_pdrb_S, 0, 'Green' }, $ 
			     { cw_pdrb_S, 1, 'Blue' }, $ 
			         { cw_pdrb_S, 0, 'Light' }, $ 
			         { cw_pdrb_S, 0, 'Medium' }, $ 
			         { cw_pdrb_S, 0, 'Dark' }, $ 
			         { cw_pdrb_S, 0, 'Navy' }, $ 
			         { cw_pdrb_S, 2, 'Royal' }, $ 
			       { cw_pdrb_S, 0, 'Cyan' }, $ 
			       { cw_pdrb_S, 2, 'Magenta' }, $ 
			 { cw_pdrb_S, 2, 'Quit' } ] 
 
	The same menu may be defined as a string by equating the Desc parameter 
	to the following string array: 
 
	desc =[ '1\Colors' , $ 
		'0\Red' , $ 
		'0\Green' , $ 
		'1\Blue\BLUE_EVENT_PROC' , $ 
		'0\Light' , $ 
		'0\Medium' , $ 
		'0\Dark' , $ 
		'0\Navy' , $ 
		'2\Royal' , $ 
		'0\Cyan' , $ 
		'2\Magenta\MAGENTA_EVENT_PROC' , $ 
		'2\Quit'  ] 
 
 
	The following small program can be used with the above description 
	to create the specified menu: 
 
 
		base = widget_base() 
		menu = cw_pdrb(base, desc, /RETURN_FULL_NAME) 
		WIDGET_CONTROL, /REALIZE, base 
		repeat begin 
		  ev = WIDGET_EVENT(base) 
		  print, ev.value 
		end until ev.value eq 'Quit' 
		WIDGET_CONTROL, /DESTROY, base 
		end 
 
	Note that independent event procedures were specified for 
	the multiple Blue buttons (blue_event_proc), and the Magenta button 
	(magenta_event_proc). 
 
 MODIFICATION HISTORY: 
	18 June 1992, AB 
	16 Jan 1995, DMS, Added MBAR keyword, event procedures, 
			and menu descriptor strings. 
	2 July 1995, AB, Added HELP keyword. 
   21 Mar 1998, learned now that's an opposite problem will occur 
                if variables named same as functions 
                in the past functions would not be found if they have same names as variables 
                now variables won't be found if they have same names as functions whithout using [] 
 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_pdrb.pro)


CW_PDTMENU

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CW_PDTMENU

 PURPOSE:
	CW_PDTMENU is a compound widget that simplifies creating
	pulldown menus. It has a simpler interface than the XPDTMENU
	procedure, which it is intended to replace. Events for the
	individual buttons are handled transparently, and a CW_PDTMENU
	event returned. This event can return any one of the following:
               - The Index of the button within the base.
               - The widget ID of the button.
               - The name of the button.
		- The fully qualified name of the button. This allows
		  different sub-menus to contain buttons with the same
		  name in an unambiguous way.


 CATEGORY:
	PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
	widget = CW_PDTMENU(Parent, Desc)

 INPUTS:
       Parent:	The ID of the parent widget.
	Desc:	An array of strings or structures.  Each element contains
		a menu description with two fields, a flag field, and
		the name of the item.  If a structure, each element
		is defined as follows:
			{ CW_PDTMENU_S, flags:0, name:'' }

		The name tag gives the name of button. The flags
		field is a two-bit bitmask that controls how the button is
		interpreted:

		    Value	   Meaning
		    -------------------------------------------
		     0     This button is neither the beginning
			   nor the end of a pulldown level.
		     1     This button is the root of a
                          sub-pulldown menu. The sub-buttons
			   start with the next button.
		     2     This button is the last button at the
			   current pulldown level. The next button
			   belongs to the same level as the current
			   parent button.
		     3     This button is the root of a sub-pulldown
			   menu, but it is also the last entry of
			   the current level.

	If Desc is a string, each element contains the flag field
	followed by a backslash character, followed by the menu item's
	contents.  See the example below.

	EVENT PROCEDURES:  An event procedure may be specified for an
	element and all its children, by including a third field
	in Desc, if Desc is a string array.  Events for buttons without
	an event procedure, are dispatched normally.
	See the example below.

 KEYWORD PARAMETERS:
	DELIMITER:        The character used to separate the parts of a
			  fully qualified name in returned events. The
			  default is to use the '.' character.
	FONT:		  The name of the font to be used for the button
			  titles. If this keyword is not specified, the
			  default font is used.
	HELP:		  If MBAR is specified and one of the buttons on the
			  menubar has the label "help" (case insensitive) then
			  that button is created with the /HELP keyword to
			  give it any special appearance it is supposed to
			  have on a menubar. For example, Motif expects
			  help buttons to be on the right.
	IDS:		  A named variable into which the button IDs will
			  be stored as a longword vector.
	MBAR:		  if constructing a menu-bar pulldown, set this
			  keyword.  In this case, the parent must be the 
			  widget id of the menu bar of a top-level base,
			  returned by WIDGET_BASE(..., MBAR=mbar).
	RETURN_ID:	  If present and non-zero, the VALUE field of returned
			  events will be the widget ID of the button.
	RETURN_INDEX:	  If present and non-zero, the VALUE field of returned
			  events will be the zero-based index of the button
			  within the base. THIS IS THE DEFAULT.
	RETURN_NAME:	  If present and non-zero, the VALUE field of returned
			  events will be the name of the selected button.
	RETURN_FULL_NAME: If present and non-zero, the VALUE field of returned
               	  events will be the fully qualified name of the
			  selected button. This means that the names of all
			  the buttons from the topmost button of the pulldown
			  menu to the selected one are concatenated with the
			  delimiter specified by the DELIMITER keyword. For
			  example, if the top button was named COLORS, the
			  second level button was named BLUE, and the selected
			  button was named LIGHT, the returned value would be

			  COLORS.BLUE.LIGHT

			  This allows different submenus to have buttons with
			  the same name (e.g. COLORS.RED.LIGHT).
	UVALUE:		  The user value to be associated with the widget.
	XOFFSET:	  The X offset of the widget relative to its parent.
	YOFFSET:	  The Y offset of the widget relative to its parent.
	TRACKING_EVENTS:  Enable widget tracking events.

 OUTPUTS:
       The ID of the top level button is returned.

 SIDE EFFECTS:
	This widget generates event structures with the following definition:

		event = { ID:0L, TOP:0L, HANDLER:0L, VALUE:0 }

	VALUE is either the INDEX, ID, NAME, or FULL_NAME of the button,
	depending on how the widget was created.

 RESTRICTIONS:
	Only buttons with textual names are handled by this widget.
	Bitmaps are not understood.

 EXAMPLE:
	The following is the description of a menu bar with two buttons,
	"Colors" and "Quit". Colors is a pulldown containing the colors
	"Red", "Green", Blue", "Cyan", and "Magenta". Blue is a sub-pulldown
	containing "Light", "Medium", "Dark", "Navy", and "Royal":

		; Make sure CW_PDTMENU_S is defined
		junk = { CW_PDTMENU_S, flags:0, name:'' }

		; The description
		desc = [ { CW_PDTMENU_S, 1, 'Colors' }, $
			     { CW_PDTMENU_S, 0, 'Red' }, $
			     { CW_PDTMENU_S, 0, 'Green' }, $
			     { CW_PDTMENU_S, 1, 'Blue' }, $
			         { CW_PDTMENU_S, 0, 'Light' }, $
			         { CW_PDTMENU_S, 0, 'Medium' }, $
			         { CW_PDTMENU_S, 0, 'Dark' }, $
			         { CW_PDTMENU_S, 0, 'Navy' }, $
			         { CW_PDTMENU_S, 2, 'Royal' }, $
			       { CW_PDTMENU_S, 0, 'Cyan' }, $
			       { CW_PDTMENU_S, 2, 'Magenta' }, $
			 { CW_PDTMENU_S, 2, 'Quit' } ]

	The same menu may be defined as a string by equating the Desc parameter
	to the following string array:
	
	desc =[ '1\Colors' , $
		'0\Red' , $
		'0\Green' , $
		'1\Blue\BLUE_EVENT_PROC' , $
		'0\Light' , $
		'0\Medium' , $
		'0\Dark' , $
		'0\Navy' , $
		'2\Royal' , $
		'0\Cyan' , $
		'2\Magenta\MAGENTA_EVENT_PROC' , $
		'2\Quit'  ]


	The following small program can be used with the above description
	to create the specified menu:


		base = widget_base()
		menu = cw_pdtmenu(base, desc, /RETURN_FULL_NAME)
		WIDGET_CONTROL, /REALIZE, base
		repeat begin
		  ev = WIDGET_EVENT(base)
		  print, ev.value
		end until ev.value eq 'Quit'
		WIDGET_CONTROL, /DESTROY, base
		end

	Note that independent event procedures were specified for
	the multiple Blue buttons (blue_event_proc), and the Magenta button 
	(magenta_event_proc).

 MODIFICATION HISTORY:
	18 June 1992, AB
	16 Jan 1995, DMS, Added MBAR keyword, event procedures,
			and menu descriptor strings.
	2 July 1995, AB, Added HELP keyword.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_pdtmenu.pro)


CW_PLOTAXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CW_PLOTAXES

 PURPOSE:
 
       A compound widget used to change the type, range and style
       (bit 0) values of one or more plot axis structure variable.  A
       CW_PLOTAXIS (single axis) widget is created for each element
       of the LABELS input parameter. The widget also includes an
       Apply button, and (optionally) a Done button.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTAXES(PARENT,LABELS)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

       LABELS - A string array of labels to be drawn to the left (or
                top) of each of the CW_PLOTAXIS widgets.

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.
 
       FRAME - Set to draw a frame around the widget.

       VALUE - An (n,4) array of initial values, where
               n = n_elements(LABELS), and each row has
               the form VALUE(i,*)=[type,min,max,style]

       FONT - Font keyword for labels etc.

       ROW - Set to create a row of column-oriented CW_PLOTAXIS widgets.

       COLUMN - Set to create a column of row-oriented CW_PLOTAXIS
                widgets. (default)
 
       DONE - Set this to add a Done button, in addition to the standard
              Apply button.

       AXIS_IDS - An array of widget id's for the individual
                  CW_PLOTAXIS widgets.

       X_SCROLL_SIZE, Y_SCROLL_SIZE - if these values are non-zero,
                                      then the base widget which
                                      holds the CW_PLOTAXIS widgets
                                      will include scroll bars.

       NO_RETURN - The default behavior is that the user must press
                    after entering new values.  Set this
                   keyword so that new values are accepted even if
                   the user just changes a value and then moves the
                   cursor outside of the text entry area.

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         The idea is that this cw would be used in a widget intended
         to allow the user to interactively adjust the settings for a
         plot.  For instance, you might have a menu item such as Plot
         Options->Scaling, which would create a popup widget
         containing a CW_PLOTAXES subwidget for the X and Y plot
         variables.  When the user makes changes to the Type, Range,
         and Style values, and then presses the Apply button, the
         popup widget event handler would re-draw the plot
         accordingly.

         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

         Example:
 
         axes=CW_PLOTAXES(BASE,['X','Y'],/DONE, $
                      VALUE=TRANSPOSE([[FLTARR(4)],[FLTARR(4)]]))

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       DLW, June 1997, Added NO_RETURN keyword.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plotaxes.pro)


CW_RBFSLIDER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cw_rbfslider

 PURPOSE:
	The standard slider provided by the WIDGET_SLIDER() function is
	integer only. This compound widget provides a floating point
	slider.

 CATEGORY:
	PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
	widget = CW_RBFSLIDER(Parent)

 INPUTS:
       Parent:		The ID of the parent widget.

 KEYWORD PARAMETERS:
	DRAG:		Set this keyword to zero if events should only
			be generated when the mouse is released. If it is
			non-zero, events will be generated continuously
			when the slider is adjusted. Note: On slow systems,
			/DRAG performance can be inadequate. The default
			is DRAG=0.
       EDIT:		Set this keyword to make the slider label be
			editable. The default is EDIT=0.
	FORMAT:		Provides the format in which the slider value is
			displayed. This should be a format as accepted by
			the STRING procedure. The default is FORMAT='(G13.6)'
	FRAME:		Set this keyword to have a frame drawn around the
			widget. The default is FRAME=0.
	MAXIMUM:	The maximum value of the slider. The default is
			MAXIMUM=100.
	MINIMUM:	The minimum value of the slider. The default is
			MINIMUM=0.
	SCROLL		Sets the SCROLL keyword to the WIDGET_SLIDER underlying
			this compound widget. Unlike WIDGET_SLIDER, the
			value given to SCROLL is taken in the floating units
			established by MAXIMUM and MINIMUM, and not in pixels.
	SUPPRESS_VALUE:	If true, the current slider value is not displayed.
			The default is SUPPRESS_VALUE=0.
	TITLE:		The title of slider. (The default is no title.)
	UVALUE:		The user value for the widget.
	VALUE:		The initial value of the slider
	VERTICAL:	If set, the slider will be oriented vertically.
			The default is horizontal.
	XSIZE:		For horizontal sliders, sets the length.
	YSIZE:		For vertical sliders, sets the height.
   XOFFSET:    The offset in x direction, if it's used then xsize=xsize-yoffset ;new March 98
   YOFFSET:    The offset in y direction, if it's used then ysize=ysize-yoffset ;new March 98

 OUTPUTS:
       The ID of the created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures containing a field
	named value when its selection thumb is moved. This is a
	floating point value.

 PROCEDURE:
	WIDGET_CONTROL, id, SET_VALUE=value can be used to change the
		current value displayed by the widget.

	WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current
		value displayed by the widget.

 MODIFICATION HISTORY:
	April 2, 1992, SMR and AB
		Based on the RGB code from XPALETTE.PRO, but extended to
		support color systems other than RGB.
	5 January 1993, Mark Rivers, Brookhaven National Labs
		Added EDIT keyword.
       7 April 1993, AB, Removed state caching.
	28 July 1993, ACY, set_value: check labelid before setting text.
	3 October 1995, AB, Added SCROLL keyword.
   30 March 1998 RB added xoffset and yoffset

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\cw_rbfslider.pro)


CYPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CYPH
 PURPOSE:
       Construct a cycle/phase array from time series data.
 CATEGORY:
 CALLING SEQUENCE:
       cyph, data, time
 INPUTS:
       data = time series data.             in
       time = time tag of each data point.  in
 KEYWORD PARAMETERS:
       Keywords:
         CPOUT=z  Returned reformatted data image.
         TOUT=t   Returned time for bottom line image.
         OFFSET=frac  Given starting offset into data as fraction
           of time slice size (def=0).
         SLICE=dx  Given slice size in samples (may be fractional).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: See also xcyph, a widget based interactive version.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Mar 2.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\cyph.pro)


D2DMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       D2DMS
 PURPOSE:
       Function to convert from degrees to deg, min, sec.
 CATEGORY:
 CALLING SEQUENCE:
       s = d2dms( deg)
 INPUTS:
       deg = input in degrees.             in
 KEYWORD PARAMETERS:
       Keywords:
         DIGITS=n  Force degrees to have n digits.
 OUTPUTS:
       s = output string.                  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Jan 17

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\d2dms.pro)


DATATYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATATYPE
 PURPOSE:
       Datatype of variable as a string (3 char or spelled out).
 CATEGORY:
 CALLING SEQUENCE:
       typ = datatype(var, [flag])
 INPUTS:
       var = variable to examine.         in
       flag = output format flag (def=0). in
 KEYWORD PARAMETERS:
       Keywords:
         NUMERIC=num returns a code indicating numeric type:
           0=non-numeric, 1=integer, 2=float, 3=complex.
         INTEGER_BITS=bits returns number of bits if integer:
           0=Not Integer, 8=Byte, 16=Int, 32=Long, 64=Long 64.
         /DESCRIPTOR returns a descriptor for the given variable.
           If the variable is a scalar the value is returned as
           a string.  If it is an array a description is return
           just like the HELP command gives.  Ex:
           datatype(fltarr(2,3,5),/desc) gives
             FLTARR(2,3,5)  (flag always defaults to 3 for /DESC).
 OUTPUTS:
       typ = datatype string or number.   out
          flag=0    flag=1      flag=2    flag=3
          UND       Undefined   0         UND
          BYT       Byte        1         BYT
          INT       Integer     2         INT
          LON       Long        3         LON
          FLO       Float       4         FLT
          DOU       Double      5         DBL
          COM       Complex     6         COMPLEX
          STR       String      7         STR
          STC       Structure   8         STC
          DCO       DComplex    9         DCOMPLEX
          PTR       Pointer    10         PTR
          OBJ       Object     11         OBJ
          UIN       U_Integer  12         UINT
          ULO       U_Long     13         ULON
          LLO       Long_64    14         LON64
          ULL       U_Long_64  15         ULON64
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 24 Oct, 1985.
       RES 29 June, 1988 --- added spelled out TYPE.
       R. Sterner, 13 Dec 1990 --- Added strings and structures.
       R. Sterner, 19 Jun, 1991 --- Added format 3.
       R. Sterner, 18 Mar, 1993 --- Added /DESCRIPTOR.
       R. Sterner, 1995 Jul 24 --- Added DCOMPLEX for data type 9.
       R. Sterner, 1999 Jun  4 --- Added types 10 on, also numeric and bits.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\datatype.pro)


DATA_BLOCK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATA_BLOCK
 PURPOSE:
       Read the block of data following data_block call.
 CATEGORY:
 CALLING SEQUENCE:
       data_block, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /CHECK  means just list data block lines without
           interpreting them.
         ERROR=err  Error flag: 0=ok, 1=error.
 OUTPUTS:
       out = returned array of data.   out
 COMMON BLOCKS:
 NOTES:
       Notes: Block of data must directly follow call to data_block.
       Examples:
         data_block, x
         ; 11,23,26.5, 34.7 42 EOD
       
              data_block, t
       ;        1, 2, 3      ; Line 1.
       ;       11,22,33      ; Line 2.
       ;       eod
        
        <> Values may be separated by commas, spaces, and/or tabs.
        <> The string EOD indicates the End Of Data and may be at
             the end of a line or on a separate line (but only once).
        <> Multiple data lines are allowed.
        <> Data always comes back as a floating 1-d array.
        <> Data lines must be commented out so IDL will ignore them.
        <> Anything following a second comment char is ignored.
       
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 23
       R. Sterner, 2000 Aug 01 --- Fixed chnage in returned calling line #.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\data_block.pro)


DATA_SEPARATOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   data_separator

 PURPOSE:
   This function searches possible separators between data entries
   in a string.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=DATA_SEPARATOR(string)

 INPUTS:
   string:  a string containing data seperated by
   ';' ',' tab or space

 OUTPUTS:
   This function returns the separator. If different separators or no
   separator is present, the string '0' is returned

 EXAMPLE:
   string = '12345, 234, 123'
   r=data_separator(string)
   print, r
   the output should be: ,

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-Sep-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\data_separator.pro)


DATA_SUBSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	data_subset

 PURPOSE:
   This function makes a subset of data from the structure INHALT
   depending on a time range

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=data_subset(structure,time_range)

 INPUTS:
   structure:      The structure INHALT
   time_range:  An Array of start and end time

 OUTPUTS:
   The Result is a new Structure type INHALT whith the subset of called
   time_range

 EXAMPLE:
   Result=data_subset(INHALT,time_range)
   result=data_subset(inhalt,[dtime2js('1997-03-01 00:00:00 000'),$"
                              dtime2js('1997-03-05 00:00:00 000')])"


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Date. August 14 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\data_subset.pro)


DATE2DN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATE2DN
 PURPOSE:
       Find day of year number from date.
 CATEGORY:
 CALLING SEQUENCE:
       dn = date2dn(date)
 INPUTS:
       date = date string (like 6 Jul, 1995).    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       dn = day number in year (like 187).        out
 COMMON BLOCKS:
 NOTES:
       Notes: The format of the date is flexible except that the
         month must be month name.
         Dashes, commas, periods, or slashes are allowed.
         Some examples: 23 sep, 1985     sep 23 1985   1985 Sep 23
         23/SEP/85   23-SEP-1985   85-SEP-23   23 September, 1985.
         Doesn't check if month day is valid. Doesn't
         change year number (like 86 does not change to 1986).
         Dates may have only 2 numeric values, year and day. If
         both year & day values are < 31 then day is assumed first.
         systime() can be handled: dn=date2dn(systime()).
         Day number is returned as a string.
         For invalid dates dn is set to a null string.
         Times are allowed.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Jul 6

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\date2dn.pro)


DATE2DOY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATE2DOY
 PURPOSE:
       Date to Day of Year conversion.
 CATEGORY:
 CALLING SEQUENCE:
       date2doy
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FIRST=date1  Starting date for list of dates.
         LAST=date2   Ending date for list of dates.
           Date must be entered using month name, 3 letters
           or more.  Year, month, and day may be any order
           but must be separated by spaces, commas, tabs,slashes,
           or dashes (like 1998-Nov-25, NOT 1998nov25).
         FILE=file  Optional output file (else screen).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1998 Nov 25

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\date2doy.pro)


DATE2JD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATE2JD
 PURPOSE:
       Convert a date string to Julian Day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd = date2jd(date)
 INPUTS:
       date = date string.                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       jd = Returned Julian Day number.   out
 COMMON BLOCKS:
 NOTES:
       Note: date must contain month as a name of 3 or more leeters.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 15
       R. Sterner, 1999 Aug 4 --- Improved 2 digit year case.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\date2jd.pro)


DATE2YMD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DATE2YMD
 PURPOSE:
       Date text string to the numbers year, month, day.
 CATEGORY:
 CALLING SEQUENCE:
       date2ymd,date,y,m,d
 INPUTS:
       date = date string.		in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = year number.		out
       m = month number.		out
       d = day number.		out
 COMMON BLOCKS:
 NOTES:
       Notes: The format of the date is flexible except that the
         month must be month name.
         Dashes, commas, periods, or slashes are allowed.
         Some examples: 23 sep, 1985     sep 23 1985   1985 Sep 23
         23/SEP/85   23-SEP-1985   85-SEP-23   23 September, 1985.
         Doesn't check if month day is valid. Doesn't
         change year number (like 86 does not change to 1986).
         Dates may have only 2 numeric values, year and day. If
         both year & day values are < 31 then day is assumed first.
         systime() can be handled: date2ymd,systime(),y,m,d
         For invalid dates y, m and d are all set to -1.
 MODIFICATION HISTORY:
       Written by R. Sterner, 29 Oct, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       25-Nov-1986 --- changed to REPCHR.
       RES 18 Sep, 1989 --- converted to SUN.
       R. Sterner, 1994 Mar 29 --- Modified to handle arrays.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\date2ymd.pro)


DATE_STRING

[Previous Routine] [Next Routine] [List of Routines]
 purpose:  return date string given year and day of year
 useage:   result=date_string(year,day)

 EXAMPLE:  print,date_string(1991,283)
             October 10, 1991

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\date_string.pro)


DAVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    daverage

 USEAGE:     daverage,lat,sza,yy

 PURPOSE:
             finds the daylight hour average of yy at each latitude
             point.  Average values are for spring or fall equinox

 INPUT:
   lat       array of latitude points
   sza       solar zenith angle array
   yy        function of solar zenith angle

 OUTPUT:
   result    average of yy over 12 hours (daylight)
 
 EXAMPLE:

   lat=indgen(10)*10
   sza=acos((indgen(11))*.1)/!dtor
   yy=90-sza
   !p.multi=[0,1,2]
   plot,sza,yy
   plot,lat,daverage(lat,sza,yy)



 procedure:  At the spring or fall equinox the solar zenith angle at
             a given latitude is given by,

               cos(sza)=cos(lat)*cos(phi) 

             where phi is the phase angle of the earth's rotation
             [= 2 pi*(time-12)/24)]

             thus for each value of lat we have

                     yave=integral(phi,yv)/!pi
             where,
                     yv=interpol(yy,mu,cos(lat*!dtor)*cos(phi*!dtor))
                     mu=cos(sza*!dtor)


 AUTHOR:   Paul Ricchiazzi                        24 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\daverage.pro)


DAYAVE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    dayave

 PURPOSE:    convert quantities which depend on sza to daily averages for 
             given values of day_of_year and latitude

 USEAGE:     result=dayave(doy,lat,sza,xx)

 INPUT:      
   doy       the day of year (vector)

   lat       latitude (vector)

   sza       a vector of solar zenith angles (degrees) monitonic increasing

   xx        a vector of a quantity which varies with SZA. If
             max(sza) lt 90 then it is assumed that xx=0 when
             (cos(sza) le 0).  If this is not the case, then data
             values for the full SZA angle range [-90,90] must be
             supplied.
             

 KEYWORD INPUT
   dt        averaging interval in hours (default=0.25 hours)

   zenith    zenith angles at each time, doy and lat (24/dt,nday,nlat)
             (returned by first call of DAYAVE, see below)
             if zero or absent, DAYAVE recomputes the zenith angle at 
             each point in the (DOY # LAT) input grid.  This can be
             fairly time consuming when there are lots of grid points.
             By supplying a zero filled named variable to DAYAVE you
             can retrieve the ZENITH grid for the next call to DAYAVE.

   night     if set, the interpolated value of xx is not set to zero 
             when sza is greater than 90.  This should be used for 
             physical quantities which maintain non-zero values even
             after sunset


 OUTPUT:
   result   the integral of xx(t) dt for the given days and latitudes


 EXAMPLE:
      !p.multi=[0,1,2]
      doy=findgen(365/30+1)*30
      lat=findgen(90/10+1)*10
      sza=findgen(90/10)*10
      xx=cos(sza*!dtor)
      zenith=0.                         ; zero filled named variable to 
                                        ; retrieve zenith angle grid 
      
      yy=dayave(doy,lat,sza,xx,zenith=zenith)
      tvim,yy,xrange=doy,yrange=lat,xtitle='day of year',ytitle='latitude',$
           title='daily integral of sup(cos(sza),0)',/scale,/interp

      xx2=xx^2
      yy2=dayave(doy,lat,sza,xx2,zenith=zenith)
      tvim,yy2,xrange=doy,yrange=lat,xtitle='day of year',ytitle='latitude',$
           title='daily average of sup(cos(sza)!a2!n,0)',/scale,/interp
  
  author:  Paul Ricchiazzi                            aug94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\dayave.pro)


DAYGLOBE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DAYGLOBE
 PURPOSE:
       Show the area of daylight/night on a globe.
 CATEGORY:
 CALLING SEQUENCE:
       dayglobe, lat0, lng0, ang0
 INPUTS:
       lat0 = Latitude at center of globe.        in
       lng0 = Longitude at center of globe.       in
       ang0 = Rotation angle of image (deg CCW).  in
 KEYWORD PARAMETERS:
       Keywords:
         TIME=time  Time string (def=current).
         ZONE=hrs  Hours ahead of GMT (def=0).  Ex: zone=-4 for EDT.
         /DEEPER  means use deeper colors.
         /QUANTIZED  means 10 degree banded day colors.
         /BLACK   means use black background (else white).
         /COUNTRIES means plot countries.
         POINT='lng lat'  Point to mark.
         COLOR=clr Color of point as R G B like '0 255 0').
         /GRID  display a grid.
         CGRID=gclr  Color for Grid as R G B like '0 255 0').
         CHARSIZE=csz  Relative character size (def=1).
         /STEREO  means use Stereographic projection instead of
            Orthographic.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Oct 14
       R. Sterner, 2000 Sep 19 --- Added quantized day colors.

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dayglobe.pro)


DAY_AVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   day_average

 PURPOSE:
   This function calculates a small statistical survey for each day of a given data set of a given array

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = DAY_AVERAGE(time, array)

 INPUTS:
   time:  julian seconds
   array: data field

 OPTIONAL INPUTS:

 Keyword PARAMETERS:
   MISSING:    missing value to be ignored
   FORMAT:     format for numbers

 OUTPUTS:
   String array containing the statistics

 EXAMPLE:
   printtab, day_average(DINDGEN(144)*3600., DINDGEN(144))

 REVISION HISTORY:
       Written         Theo Brauers, Apr 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\day_average.pro)


DBD_DIRTREE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    dbd_dirtree

 PURPOSE:
  this procedure write a html directory structure and creates the depending dir2html.html files.

 CATEGORY:
   DATAFILES/DBD

 CALLING SEQUENCE:
   dbd_dirtree,path,_extra=e

 INPUTS:
  path: the path to make the html tree

 KEYWORD PARAMETERS:
  _extra: to submit keywords to get_dir_tree or/and dir2htmlfile

 PROCEDURE:
  The tree html information file is stored one path segment before the submitted path.
  At the moment it is not possible to create a tree of the root path.

 EXAMPLE:
   dbd_dirtree,'C:\temp',level=5

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1),  2000-May-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dbd_dirtree.pro)


DCOLORS

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

 USEAGE          dcolors
                 dcolors,r=r,g=g,b=b,pickc=pickc,squeeze=squeeze,view=view

 INPUT:          none

 Keyword input:  

   pickc         if set, call pickc to adjust discreet colors

   squeeze       if set,  original color table is resampled to fit
                 in remaining color table index space.

   view          if set, draw palette of discreet colors to separate window

   r,g,b         red, green and blue values of discreet color table.
                 default colors:

                  r =  [0, 255,   0, 150, 255, 194, 125,   0, 255,  19,   0]
                  g =  [0,   0, 255, 150, 248, 196, 255, 175,  10, 215,   0]
                  b =  [0,   0,   0, 255,   6, 196, 185,   0, 246, 224, 255]

 OUTPUT:         none
 
 PURPOSE:        loads custom colors in lower part of current color
                 scale.  If SQUEEZE is set pre-existing color scale 
                 is squeezed to fit between color index n_elements(r)
                 and !d.n_colors.
 
  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\dcolors.pro)


DDEABM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DDEABM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Integrate Ordinary Differential Equation with Adams-Bashford-Moulton

 MAJOR TOPICS:
   Numerical Analysis.

 CALLING SEQUENCE:
   DDEABM, FUNCT, T0, F0, TOUT, [ PRIVATE, FUNCTARGS=, STATE= , ]
     [ /INIT, /INTERMEDIATE, TSTOP=, EPSREL=, EPSABS=, ]
     [ TGRID=, YGRID=, YPGRID=, NGRID=, NFEV=, ]
     [ STATUS=, ERRMSG= ]

 DESCRIPTION:

  DDEABM performs integration of a system of one or more ordinary
  differential equations using a Predictor-Corrector technique.  An
  adaptive Adams-Bashford-Moulton method of variable order between
  one and twelve, adaptive stepsize, and error control, is used to
  integrate equations of the form:

     DF_DT = FUNCT(T, F)

  T is the independent variable, F is the (possibly vector) function
  value at T, and DF_DT is the derivative of F with respect to T,
  evaluated at T.  FUNCT is a user function which returns the
  derivative of one or more equations.  

  DDEABM is based on the public domain procedure DDEABM.F written by
  L. F. Shampine and M. K. Gordon, and available in the DEPAC package
  of solvers within SLATEC library.

  DDEABM is used primarily to solve non-stiff and mildly stiff
  ordinary differential equations, where evaluation of the user
  function is expensive, or high precision is demanded (close to the
  machine precision).  A Runge-Kutta technique may be more
  appropriate if lower precision is acceptable.  For stiff problems
  neither Adams-Bashford-Moulton nor Runge-Kutta techniques are
  appropriate.  DDEABM has code which detects the stiffness of the
  problem and reports it.

  The user can operate DDEABM in three different modes:

    * the user requests one output at a time (the default), and
      maintains the integrator state using the STATE keyword;

    * the user requests a grid of times (by passing an array to
      TOUT), and optionally maintains the integrator state for
      subsequent integrations using the STATE keyword;

    * the user requests output at the natural adaptive stepsizes
      using the /INTERMEDIATE keyword.

  When the user requests explicit output points using TOUT, it is
  likely that the output will be interpolated between two natural
  stepsize points.

  If the user requests a grid of outputs, and the integration fails
  before reaching the requested endpoint, then control returns
  immediately to the user with the appropriate STATUS code.

  The initial conditions are given by F0, when T = T0.  The number of
  equations is determined by the number of elements in F0.
  Integration stops when the independent variable T reaches the final
  value of TOUT.  If the user wants to continue the integration, it
  can be restarted with a new call to DDEABM, and a new value of
  TOUT.

 USER FUNCTION

  The user function FUNCT must be of the following form:

  FUNCTION FUNCT, T, F, PRIVATE, ...
     ; ... compute derivatives ...
     RETURN, DF_DT
  END

  The function must accept at least two, but optionally three,
  parameters.  The first, 'T', is the scalar independent variable
  where the derivatives are to be evaluated.  The second, 'F', is the
  vector of function values.  The function must return an array of
  same size as 'F'.  The third positional parameter, 'PRIVATE', is a
  purely optional PRIVATE parameter.  FUNCT may accept more
  positional parameters, but DDEABM will not use them.  Any number of
  keyword parameters can be passed using the FUNCTARGS keyword.

  The user function FUNCT must not modify either the independent
  variable 'T' or the function values 'F'.

 RESTARTING THE INTEGRATOR

  When restarting the integrator, the STATE keyword can be used to
  save some computation time.  Upon return from DDEABM the STATE
  keyword will contain a structure which describes the state of the
  integrator at the output point.  The user need merely pass this
  variable back into the next call to continue integration.  The
  value of T, and the function value F, must not be adjusted between
  calls to DDEABM.

  If T or F0 are to be adjusted, then the integrator must be
  restarted afresh *without* the previous state.  This can be
  achieved either by reseting STATE to undefined, or by setting the
  /INIT keyword to DDEABM.

 ERROR CONTROL

  Local error control is governed by two keywords, EPSABS and EPSREL.
  The former governs the absolute error, while the latter governs the
  relative or fractional error.  The error test at each iteration is:

     ABS(ERROR)   LE   EPSREL*ABS(F) + EPSABS
  
  A scalar value indicates the same constraint should be applied to
  every equation; a vector array indicates constraints should be
  applied individually to each component.

  Setting EPSABS=0.D0 results in a pure relative error test on that
  component. Setting EPSREL=0. results in a pure absolute error test
  on that component.  A mixed test with non-zero EPSREL and EPSABS
  corresponds roughly to a relative error test when the solution
  component is much bigger than EPSABS and to an absolute error test
  when the solution component is smaller than the threshold EPSABS.
  
  Proper selection of the absolute error control parameters EPSABS
  requires you to have some idea of the scale of the solution
  components.  To acquire this information may mean that you will
  have to solve the problem more than once. In the absence of scale
  information, you should ask for some relative accuracy in all the
  components (by setting EPSREL values non-zero) and perhaps impose
  extremely small absolute error tolerances to protect against the
  danger of a solution component becoming zero.
  
  The code will not attempt to compute a solution at an accuracy
  unreasonable for the machine being used.  It will advise you if you
  ask for too much accuracy and inform you as to the maximum accuracy
  it believes possible.

 HARD LIMIT ON T

  If for some reason there is a hard limit on the independent
  variable T, then the user should specify TSTOP.  For efficiency
  DDEABM may try to integrate *beyond* the requested point of
  termination, TOUT, and then interpolate backwards to obtain the
  function value at the requested point.  If this is not possible
  because the function because the equation changes, or if there is a
  discontinuity, then users should specify a value for TSTOP; the
  integrator will not go past this point.


 INPUTS:

  FUNCT - by default, a scalar string containing the name of an IDL
          function to be integrated.  See above for the formal
          definition of FUNCT.  (No default).

  T0 - scalar number, upon input the starting value of the
       independent variable T.  Upon output, the final value of T.

  Y - vector.  Upon input the starting values of the function for T =
      T0.  Upon output, the final (vector) value of the function.

  TOUT - must be at least a scalar, but optionally a vector,
         specifies the desired points of output.

         If TOUT is a scalar and INTERMEDIATE is not set, then DDEABM
         integrates up to TOUT.  A scalar value of the function at
         TOUT is returned in F.

         If TOUT is a scalar and /INTERMEDIATE is set, then DDEABM
         computes a grid of function values at the optimal step
         points of the solution.  The grid of values is returned in
         TGRID, YGRID, and YPGRID.  The final function value,
         evaluated at the last point in TOUT, is returned in F.

         If TOUT is a vector, then DDEABM computes a grid of function
         values at the requested points.  The grid of values is
         returned in TGRID, YGRID and YPGRID.  The final function
         value, evaluated at the last point in TOUT, is returned in
         F.

         It is possible for TOUT to be less than T0, i.e., to
         integrate backwards.

  PRIVATE - any optional variable to be passed on to the function to
            be integrated.  For functions, PRIVATE is passed as the
            second positional parameter.  DDEABM does not examine or
            alter PRIVATE.

 KEYWORD PARAMETERS:

   EPSABS - a scalar number, the absolute error tolerance requested
            in the integral computation.  If less than or equal to
            zero, then the value is ignored.
            Default: 0

   EPSREL - a scalar number, the relative (i.e., fractional) error
            tolerance in the integral computation.  If less than or
            equal to zero, then the value is ignored.
            Default: 1e-4 for float, 1d-6 for double

   ERRMSG - upon return, a descriptive error message.

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by FUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.  By default, no extra parameters
               are passed to the user-supplied function.

   INIT - if set, indicates that the integrator is to be restarted
          afresh.

   INTERMEDIATE - if set, indicates that the integrator is to compute
                  at the natural step points.

   NFEV - upon output, the scalar number of function evaluations.

   NGRID - if /INTERMEDIATE is set, the number of points to compute
           before returning.
           Default: 1

   STATE - upon input and return, the integrator state.  Users should
           not modify this structure.  If the integrator is to be
           restarted afresh, then the /INIT keyword should be set, in
           order to clear out the old state information.

   STATUS - upon output, the integer status of the integration.

           1 - A step was successfully taken in the
               intermediate-output mode.  The code has not yet
               reached TOUT.
 
           2 - The integration to TOUT was successfully completed
               (T=TOUT) by stepping exactly to TOUT.
 
           3 - The integration to TOUT was successfully completed
               (T=TOUT) by stepping past TOUT.  Y(*) is obtained by
               interpolation.
 
                       *** Task Interrupted ***
                 Reported by negative values of STATUS
 
           -1 - A large amount of work has been expended.  (500 steps
                attempted)
 
           -2 - The error tolerances are too stringent.
 
           -3 - The local error test cannot be satisfied because you
                specified a zero component in EPSABS and the
                corresponding computed solution component is zero.
                Thus, a pure relative error test is impossible for
                this component.
 
           -4 - The problem appears to be stiff.
 
                       *** Task Terminated ***
                 Reported by the value of STATUS=-33
 
           -33 - The code has encountered trouble from which it
                 cannot recover.  A error message is printed
                 explaining the trouble and control is returned to
                 the calling program. For example, this occurs when
                 invalid input is detected.

   TGRID - upon output, the grid of values of T for which the
           integration is provided.

   TSTOP - a scalar, specifies a hard limit for T, beyond which the
           integration must not proceed.
           Default:  none, i.e., integration is allowed to
                    "overshoot"

   YGRID - upon output, the grid of function values for which the
           integration is provided.

   YPGRID - upon ouptut, the grid of function derivative values at
            the points where the integration is provided.

 EXAMPLES:


 REFERENCES:

   SAND79-2374 , DEPAC - Design of a User Oriented Package of ODE
                         Solvers.

   "Solving Ordinary Differential Equations with ODE, STEP, and INTRP",
       by L. F. Shampine and M. K. Gordon, SLA-73-1060.

    SLATEC Common Mathematical Library, Version 4.1, July 1993
    a comprehensive software library containing over
    1400 general purpose mathematical and statistical routines
    written in Fortran 77.  (http://www.netlib.org/slatec/)


 MODIFICATION HISTORY:
    Fix bug in TSTOP keyword, 09 May 2002, CM


  $Id: ddeabm.pro,v 1.13 2002/05/09 23:04:47 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\ddeabm.pro)


DEBUG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       debug

 PURPOSE:
       debugging of IDL routines

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       DEBUG, version_string, file=filename

 INPUTS:
       version_string:   string containing info
       about the version an author of a routine

 OPTIONAL INPUTS:
       filename: output file for debug info
       (only on the first call of debug during an IDL session)

 OUTPUTS:

 SIDE EFFECTS:
       if called first time it creates the sysvar !debug with 2 tags:
       !debug.flag and !debug.file
       on next calls it controlls the output of the version
       string to screen and/or file:
       !debug.flag = 00000(0x00) : no output
                   = 00001(0x01) : screen
                   = 00010(0x02) : + systime
                   = 00100(0x04) : + calling routine
                   = 01000(0x08) : + file
       any combination possible

 EXAMPLE:
       debug, file='test.txt'
       !debug.flag=4
       ........
       debug, '1.11 T.B. 1997-JAN-1'

 REVISION HISTORY:
       Written         Franz Rohrer, June 1997
       Corrected
       Revised         Theo Brauers, Sep 1997
                       Theo Brauers, Oct 1997
                       !debug is struct

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\debug.pro)


DECOMPOSE_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	decompose_structure

 PURPOSE:
	This function decomposes a structure into its single elements.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = decompose_structure(struc)

 INPUTS:
	struc: Any structure

 OPTIONAL INPUTS:
	pointer: This argument is for internal use only.

 OUTPUTS:
	This function returns a decomposed structure with the following tags:
		   NUM             LONG      --> running number
		   TN              STRING    --> tag name
		   VAL             POINTER   --> pointer to tag value
		   ROOT            STRING    --> root of tag

 EXAMPLE:
	s = {a: 0, b: {b1: FINDGEN(10), b2: 'LOP'}}
	p = decompose_structure(s)
	HELP, p
		P               STRUCT    = ->  Array[4]

	HELP, p, /STR
		** Structure <1350828>, 6 tags, length=32, refs=1:
		   LEV             LONG                 0					--> level of tag
		   TN              STRING    'A'								--> tag name
		   VAL             POINTER   				--> pointer to tag value
		   ROOT            STRING    ''								--> root of tag

	PRINT, p.lev   -->   0 0 1 1
	PRINT, p.tn    -->   A B B1 B2
	HELP, *p[0].val   -->     INT       =        0
	HELP, *p[1].val   -->     STRUCT    = ->  Array[1]
	HELP, *p[2].val   -->     FLOAT     = Array[10]
	HELP, *p[3].val   -->     STRING    = 'LOP'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09.12.1999
	04.01.2000:	Header was edited
	05.01.2000:	Removed tags NUM and LINK
	12.01.2000:	A named structure is returned

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\decompose_structure.pro)


DEFAULT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DEFAULT
 VERSION:
		4.0
 PURPOSE:
		Provides an automatic default value for nondefined parameters.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = DEFAULT( X, Y [, keywords])
 INPUTS:
	X, Y
		Arbitrary, at least one needs to be defined.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/STRICT
		Switch.  If set, X is considered defined only if it is of the same type
		as Y.
	/DTYPE
		Switch.  If set, the result will be typecast into the type of Y.
		Explicit settings for LOW and/or HIGH (see below) override DTYPE.
	LOW
		Numeric value representing a valid numeric type. If given, the result
		is of type >= LOW.
	HIGH
		Numeric value representing a valid numeric type. If given, the result
		is of type <= HIGH.
 OUTPUTS:
		X if it is defined, otherwise Y.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		All type casting is bypassed if the result is not of numeric type.
 PROCEDURE:
		Uses the functions CAST, ISNUM and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-NOV-1993 by Mati Meron.  The keyword TYPE has been replaced
		by STRICT.  Added keywords DTYPE, LOW and HIGH.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\default.pro)


DEFAULT_CACHE_PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   default_cache_path

 PURPOSE:
   The result of this function is the platform independent path for the cache files

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
  result=default_cache_path([/alternative_path])

 KEYWORD PARAMETERS:
   alternative_path: to use the alternative cache path. It is defined as if is_write_access to /private/tmp or $HOME for WS or TEMP for PC

 OUTPUTS
   result: a string with the pathname

 MODIFICATION HISTORY:
       R. Bauer, 1998-Jun-09
       1998-Jul-02 /scratch/cache now idl_source/idl_cache
   2000-Apr-06 environment variables are handled as strupcase and strlowcase


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\default_cache_path.pro)


DEFAULT_RANGE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        DEFAULT_RANGE  (function)

 PURPOSE:
        Make sure a RANGE argument or keyword is a valid 
        vector with at least two elements. Can also be used
        to limit RANGE to two elements. The argument may be a string
        containing one or more numeric values delimited by almost
        any character combination (including '..' and '-'). A '-'
        will be treated as seperator if it is preceeded by a  
        digit or not followed by a digit.
        The resulting range will be sorted and spans the minimum and
        maximum of the "data" given in the argument.

 CATEGORY:
        General programming

 CALLING SEQUENCE:
        range = DEFAULT_RANGE( ARG, DEFAULT [,/LIMIT2] )

 INPUTS:
        ARG     -> The range argument or keyword as passed into 
                   a procedure or function. This can be an undefined
                   variable or a variable with 1 or more elements.
                   If ARG contains 1 element, it will be repeated 
                   to range from and to the same number.

        DEFAULT -> A 2-element vector containing the default range 
                   if ARG is undefined. This argument is mandatory
                   although it is not used if ARG contains at least 
                   1 element.

 KEYWORD PARAMETERS:
        /LIMIT2 -> Limit the resulting RANGE vector to 2 elements.
                   Default is to return *at least* 2 elements.

        RANGE   -> Limit the RANGE vector to minimum and maximum value
                   given by this keyword.

        /NOSORT -> Do not sort the output. This can be useful for
                   longitude vectors spanning the Pacific ;-)

 OUTPUTS:
        A two (or more) element vector that can be used in statements
        like WHERE(x ge RANGE[0] AND x lt RANGE[1]).

 SUBROUTINES:
        none.

 REQUIREMENTS:
        none.

 NOTES:
        This function is meant for argument checking in procedures
        or functions, hence it will generally not be called from the
        command line.

 EXAMPLE:
        ; Suppose a procedure has a keyword parameter named LATRANGE.
        ; Before we use LATRANGE in any form, we should test it:
        LATRANGE = DEFAULT_RANGE(LATRANGE,[-90.,90.])
        ; This ensures that we have at least 2 elements in LATRANGE
        ; and it defaults LATRANGE to the whole globe if nothing was 
        ; passed in the LATRANGE keyword.

 MODIFICATION HISTORY:
        mgs, 29 Sep 1998: VERSION 1.00
        mgs, 17 Nov 1998: - added string handling
                          - added RANGE and NOSORT keywords
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\default_range.pro)


DEFP2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	defp2d

 PURPOSE:
   This procedure is used to replace tag arrays in the defined plot structure

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   defp2d,struct,name,attvalue

 INPUTS:
	struct:   The structure which should be modified
	name:     The tagname which should be replaced
   attvalue: The new values which should be added to the structure

 OUTPUTS:
   struct: The modified structure

 EXAMPLE:
   defp2d,plot,'levels',indgen(10)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\defp2d.pro)


DEFSUBCELL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DEFSUBCELL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Returns a default subcell suitable for plotting in.

 CALLING SEQUENCE:
   sub = defsubcell( [default] )

 DESCRIPTION: 

   DEFSUBCELL returns a "nice" subcell, useful for plotting in.  It
   gives 8% margins on the left and bottom, and 5% margins on the
   right and top.

   A set of user-defined default values can be passed in.  Any that
   are negative are replaced by this function's.

 INPUTS:

   DEFAULT - a "default" subcell.  Any elements that are negative are
             replaced by DEFSUBCELL's notion of the proper margins.
             This feature is used, for example, by SUBCELLARRAY to
             make subcells that have special margins on certain sides
             and default ones on other sides.

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   NONE

 RETURNS:
   The new subcell.

 PROCEDURE:

 EXAMPLE:

 SEE ALSO:

   DEFSUBCELL, SUBCELLARRAY

 EXTERNAL SUBROUTINES:

 MODIFICATION HISTORY:
   Written, CM, 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\defsubcell.pro)


DEFTYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  deftype

 PURPOSE:
   This function is able to translate a variable to the same type of another variable

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result=deftype(data_with_type,value_without_type,[/value],[/type],[/char])

 INPUTS:
   data_with_type: A variable e.g. 10.5
   value_without_type: A variable e.g. 4

 KEYWORD PARAMETERS:
   value:  if the key value is used the result is
           value_without_type with the same type as data_with_type
   type:   if the key type is used result is the integer code of type of data_with_type
   char:   same as type diffeternt is thats the result is the name of the type

 OUTPUTS:
  see KEYWORD PARAMETERS:


 EXAMPLE:
   Result=deftype(10.5,4)
   Result is 4.00000

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), Jan. 2 1997
   1997-Nov-01 nicer programcode
   1998-Mar-04 limittest for integer included
   1998-Mar-04 default is now new_value
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\deftype.pro)


DEF_COLORSYSTEM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  def_colorsystem

 PURPOSE:
  This procedure defines the colors for the colorsystem

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   def_colorsystem,[colors=colors],[start_color=start_color],[max_colors=max_colors]

 KEYWORD PARAMETERS:
   colors=colors:           the RGB color code which describe the colors
                            default comes from ct_fr2
   start_color=start_color: the beginning index of the colorsystem
                            default is 20
   max_colors=max_colors:   the number of indices belonging to the colorsystem
                            default is def_n_colors()-1

 EXAMPLE:
   def_colorsystem,start=100,max_colors=50
   erase
   cbar

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-09
               1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_colorsystem.pro)


DEF_COLOR_SYSV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       def_color_sysv

 PURPOSE:
       This procedure defines the new system variable with color indices

 CATEGORY:
       PLOT

 CALLING SEQUENCE:
       def_color_sysv

 KEYWORD PARAMETERS:
       NAME: Name of new system variable (STRING) - default: !F

 OUTPUTS:
       the new system variable which is of type structure with the tags
         .black      :0
         .red        :1
         .blue       :2
         .geen       :3
         .pink       :4
         .violett    :5
         .orange     :6
         .dark_red   :7
         .cyan       :8
         .yellow     :9
         .blue_green :10
         .white      :11

 EXAMPLE:
       def_color_sysv
       HELP, !F, /STR
       ** Structure <88963dcc>, 12 tags, length=24, refs=2:
          BLACK           INT              0
          RED             INT              1
          BLUE            INT              2
          GREEN           INT              3
          PINK            INT              4
          VIOLETT         INT              5
          ORANGE          INT              6
          DARK_RED        INT              7
          CYAN            INT              8
          YELLOW          INT              9
          BLUE_GREEN      INT             10
          WHITE           INT             11

 SIDE EFFECTS:
       A new system variable is defined

 REVISION HISTORY:
     Definition of colors written by Franz Rohrer
     Wrapper written by Frank Holland, 28. Jan. 1998
       History:
           04.11.98:   Changed color structure from anonymous into a named structure

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\def_color_sysv.pro)


DEF_INHALT_DEF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  def_inhalt_def

 PURPOSE:
  This procedure write the definition procedure inhalt_def.pro for the structure inhalt

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   def_inhalt_def

 OUTPUTS:
   This procedure write the idl Source inhalt_def.pro

 OPTIONAL OUTPUTS:
    inhalt_def: could used for debugging

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_inhalt_def.pro)


DEF_MPLOTSTR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       def_mplotstr

 PURPOSE:
       This function defines a structure with default settings for plot keywords

 CATEGORY:
		PLOT/MPLOT

 CALLING SEQUENCE:
		mplot_str = def_mplotstr()

 OUTPUTS:
     This function returns a structure with the tags
         .screen
         .ps
         .printer
		each of which is a structure with tags which define values for different plot keywords

 EXAMPLE:
     ms = def_mplotstr()
		HELP, ms, /STR
		** Structure <13554f8>, 3 tags, length=84, refs=1:
		   SCREEN          STRUCT    -> SCREEN Array[1]
		   PS              STRUCT    -> PS Array[1]
		   PRINTER         STRUCT    -> PRINTER Array[1]

 REVISION HISTORY:
		Written by Frank Holland, 05.11.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\def_mplotstr.pro)


DEF_NCDF_DIMENSIONS_FOR_PARAMETERS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    def_ncdf_dimensions_for_parameters

 PURPOSE:
   write_ncdf
   This procedure sets the diension ids for the parameters and the flags

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   def_ncdf_dimensions_for_parameters,dimensions

 INPUTS:
   file_id:      the id of the netcdf File
   dimensions:   A Structure holding parameter and flag informations
   n_parameters: n_elements of parameter tags

   e.g.:
   DIMENSIONS    STRUCT
                 TIME:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [-1]
                             TYPE            LONG                 5

                  N2O:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [-1]
                             TYPE            LONG                 4
                             FLAG            STRUCT
                                             STDEV           STRUCT
                                                             NAME            STRING    ['time']
                                                             SIZE            LONG      [100]
                                                             P_ID            LONG                -1
                                                             D_IDS           LONG      [-1]
                                                             TYPE            LONG                 5

                  TAG_NAME:   STRING    ['TIME', 'N2O']
                  SHORT_NAME: STRING    ['time', 'N2O']
                  FLAG:       STRUCT
                              N2O             STRUCT
                                              SHORT_NAME      STRING    'N2O@STDEV'
                                              TAG_NAME        STRING    'STDEV'

 OUTPUTS:
   input structure is output structure
   dimensions for flags: dimensions.(i).flag.(ii).d_ids is altered to dimensions.(i).d_ids
   DIMENSIONS    STRUCT
                 TIME:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [-1]
                             TYPE            LONG                 5

                  N2O:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [-1]
                             TYPE            LONG                 4
                             FLAG            STRUCT
                                             STDEV           STRUCT
                                                             NAME            STRING    ['time']
                                                             SIZE            LONG      [100]
                                                             P_ID            LONG                -1
                                                             D_IDS           LONG      [-1]
                                                             TYPE            LONG                 5

                  TAG_NAME:   STRING    ['TIME', 'N2O']
                  SHORT_NAME: STRING    ['time', 'N2O']
                  FLAG:       STRUCT
                              N2O             STRUCT
                                              SHORT_NAME      STRING    'N2O@STDEV'
                                              TAG_NAME        STRING    'STDEV'



 EXAMPLE:
   def_ncdf_dimensions_for_parameters,dimensions

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-02
 name wird spaeter geändert
  2000-Feb-09  added MESSAGE,'Problem with dimensions of parameter: '+dimensions.short_name[i],/info

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_ncdf_dimensions_for_parameters.pro)


DEF_NCDF_VARIABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    def_ncdf_variable

 PURPOSE:
   This routine defines all netCDF parameters and flags described in the dimensions structure.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   def_ncdf_variable,file_id,dimensions

 INPUTS:
   file_id: the ncdf_open file_id of a netCDF File
   dimensions: a structure holding informations about type size and name of a parameter
   e.g.:
   DIMENSIONS    STRUCT
                 TIME:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [0]
                             TYPE            LONG                 5

                  N2O:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                -1
                             D_IDS           LONG      [0]
                             TYPE            LONG                 4
                             FLAG            STRUCT
                                             STDEV           STRUCT
                                                             NAME            STRING    ['time']
                                                             SIZE            LONG      [100]
                                                             P_ID            LONG                -1
                                                             D_IDS           LONG      [0]
                                                             TYPE            LONG                 5

                  TAG_NAME:   STRING    ['TIME', 'N2O']
                  SHORT_NAME: STRING    ['time', 'N2O']
                  FLAG:       STRUCT
                              N2O             STRUCT
                                              SHORT_NAME      STRING    'N2O@STDEV'
                                              TAG_NAME        STRING    'STDEV'



 OUTPUTS:
   dimensions: a structure holding informations about type size and name of a parameter
      the tag P_id is altered by the real parameter ID of the netCDF File

   e.g.
   DIMENSIONS    STRUCT
                 TIME:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                0
                             D_IDS           LONG      [0]
                             TYPE            LONG                 5

                  N2O:       STRUCT
                             NAME            STRING    ['time']
                             SIZE            LONG      [100]
                             P_ID            LONG                1
                             D_IDS           LONG      [0]
                             TYPE            LONG                 4
                             FLAG            STRUCT
                                             STDEV           STRUCT
                                                             NAME            STRING    ['time']
                                                             SIZE            LONG      [100]
                                                             P_ID            LONG               2
                                                             D_IDS           LONG      [0]
                                                             TYPE            LONG                 5

                  TAG_NAME:   STRING    ['TIME', 'N2O']
                  SHORT_NAME: STRING    ['time', 'N2O']
                  FLAG:       STRUCT
                              N2O             STRUCT
                                              SHORT_NAME      STRING    'N2O@STDEV'
                                              TAG_NAME        STRING    'STDEV'


 EXAMPLE:
 
TIME N2O TAG_NAME SHORT_NAME
str[1]str[1]TIMEtime
N2ON2O


TIME
NAME SIZE P_ID D_IDS TYPE
time100-105


N2O
NAME SIZE P_ID D_IDS TYPE
time100-104

def_ncdf_variable,file_id,dimensions
TIME N2O TAG_NAME SHORT_NAME
str[1]str[1]TIMEtime
N2ON2O


TIME
NAME SIZE P_ID D_IDS TYPE
time100005


N2O
NAME SIZE P_ID D_IDS TYPE
time100104

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Mar-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_ncdf_variable.pro)


DEF_N_COLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  def_n_colors

 PURPOSE:
  This function returns 256 if !d.n_colors is gt 256 else !d.n_colors

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result=def_n_colors()

 EXAMPLE:
   print,def_n_colors()
   256

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), 1999, Feb. 05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_n_colors.pro)


DEF_PLOTSTR_SYSV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       def_plotstr_sysv

 PURPOSE:
       This procedure defines the new system variable with default settings for plot keywords

 CATEGORY:
		PLOT/MPLOT

 CALLING SEQUENCE:
       def_plotstr_sysv

 KEYWORD PARAMETERS:
		NAME: Name of new system variable (STRING) - default: !FH_PLOTSTR

 OUTPUTS:
       a new system variable which is of type structure with the tags
         .screen
         .printer
		each of which has subtags which define values for different plot keywords

 EXAMPLE:
       def_plotstr_sysv
		HELP, !FH_PLOTSTR, /STR
		** Structure <88963dcc>, 12 tags, length=24, refs=2:
 SIDE EFFECTS:
		A new system variable is defined

 REVISION HISTORY:
		Written by Frank Holland, 12.06.98
		History:
			04.11.98:	Changed plot structure from anonymous into a named structure

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\def_plotstr_sysv.pro)


DEF_PLXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	def_plxy

 PURPOSE:
       This procedure defines the internal communication structure for plotxy-like procedures

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
       def_plxy,pl_xy

 OUTPUTS:
    pl_xy.                       : The predefined structure whith the following tags:
         .i_xn:        0
         .i_yn:        0
         .n_xn:        1
         .n_yn:        1
         .charsize:    0.
         .title_charsize :0.
         .c_charsize:  0.
         .framethick:  0.
         .thick:       0.
         .factor:      0.
         .xticklen:    0.
         .yticklen:    0.
         .zticklen:    0.

 EXAMPLE:
       def_plxy, pl_xy

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer September 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\def_plxy.pro)


DEF_SIZES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       def_sizes

 PURPOSE:
      definition of charsize and thick for plotxy-type procedures

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       def_sizes,plot,pl_xy

 INPUTS:
       plot  : structure with plot-options (see pl_init.pro for details)

 OUTPUTS:
       pl_xy : structure with parameters for plotxy as defined by def_plxy

 EXAMPLE:
   def_sizes,plot,pl_xy

 MODIFICATION HISTORY:
       Written         Franz Rohrer, September 1997
       Corrected
         9.10.1997 added that ticklength would not be reduced if it's set to make gridlines
        29.10.1997 "IF strupcase(!version.os) EQ 'AIX' THEN corr = 0.75"
        11.01.1998 plot.charsize_norm_factor zur Normierung der Textbreite eingeführt, wird in plotinit berechnet
        03.06.00 : plot.spalten+plot.zeilen nach plot.columns+plot.rows umbenannt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\def_sizes.pro)


DEF_VALID_FOR_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    def_valid_for_param

 PURPOSE:
   This function returns the valid information arrays for the ICG data_structure

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=def_valid_for_param(param,quality, [valid_min=valid_min], [valid_max=valid_max], [fill_value=fill_value_intern], [missing_value=missing_value_intern], [struct_name=struct_name])

 INPUTS:
  param:   the data of a parameter
  quality: the quality flag vector describing quality of param

 KEYWORD PARAMETERS:
   valid_min:     if also valid_max is set the valid data range is from valid_min to valid_max
   valid_max:     if also valid_min is set the valid data range is from valid_min to valid_max
                  if no data fits in this range a message is given and valid from 0:*
   fill_value:    if set indicator value for setting fill valuess
   missing_value: if set indicator value for setting missing values
   struct_name:  name of the resulting structure by count_name(struct_name)

 PROCEDURE:
  if valid eq -1 then plot_min and plot_max = !values.f_nan

 EXAMPLE:
  fill_value=-999.9
  missing_value=-999.8
  param=findgen(10)
  param[1:2]=fill_value
  param[6:9]=missing_value
  result=def_valid_for_param(param,fill_value=fill_value, missing_value=missing_value)
  help,result,/str
  ** Structure <1357cf8>, 5 tags, length=48, refs=1:
      PLOT_MIN        FLOAT          0.000000
      PLOT_MAX        FLOAT           5.00000
      VALID           LONG      Array[4]
      FILLED          LONG      Array[2]
      MISSED          LONG      Array[4]

 
PLOT_MIN PLOT_MAX VALID FILLED MISSED
0.0000005.00000016
327
48
59

with QUALITY: fill_value=-999.9 missing_value=-999.8 param=findgen(10) quality=lonarr(10) quality[3:4]=32 param[1:2]=fill_value param[6:9]=missing_value result=def_valid_for_param(param,quality, fill_value=fill_value, missing_value=missing_value) help,result,/str ** Structure <136cc18>, 5 tags, length=40, refs=1: PLOT_MIN FLOAT 0.000000 PLOT_MAX FLOAT 5.00000 VALID LONG Array[2] FILLED LONG Array[2] MISSED LONG Array[4]
PLOT_MIN PLOT_MAX VALID FILLED MISSED
0.0000005.00000016
527
8
9

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Mar-02 1999-05-11 all where function by double 1999-06-15 if all data are missing values now valid is -1 1999-06-24 because of an unknow WS aix idl error line 196 is changed now first valid is created in the structure and afterwards other variables the error happens in the routine where def_valid_for_param was called from the syntax was: INVALID DESCRIPTOR 1999-09-28 bug removed if nothing is valid then valid is now -1 2000-01-12 bug removed for a = {q: {param: 2., quality: 0, fill_value: -12345.}}. Element [0] is valid 2000-04-11 bug removed if fill_value or missing_value and param is of type string

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_valid_for_param.pro)


DEF_VALID_TAGNAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   def_valid_tagname

 PURPOSE:
   This function translates short_names to tag_names

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=def_valid_tagname(short_name,[consideration=consideration])

 INPUTS:
   short_name: the short name of a parameter

 KEYWORD PARAMETERS::
   consideration: beware of duplicate definitions

 EXAMPLE:
  print,def_valid_tag_name('test 1')
  TEST_1
  print,def_valid_tagname('test 1',consideration='test_1')
  TEST_1A

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\def_valid_tagname.pro)


DEGLITCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DEGLITCH
 VERSION:
		4.0
 PURPOSE:
		Replaces exceptional array elements by the average of their neighbors.
 CATEGORY:
		Array Function.
 CALLING SEQUENCE:
		Result = DEGLITCH( ARR, THRESH [, keywords])
 INPUTS:
	ARR
		Array, numeric, otherwise arbitrary.
	THRESH
		Threshold value for element replacement.  Must be > 1.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/DOWN
		Switch.  If set the correction is downward, i.e. elements which are too
		big (in absolute value) are replaced.  This is the default.
	/UP
		Switch.  If set the correction is upward, i.e. elements which are too
		small (in absolute value) are replaced.
	COUNT
		Optional output, see below.
 OUTPUTS:
		Returns the corrected array, i.e. an array of the same format as ARR,
		in which all the exceptional element have been replaced by the average
		of their neighbors.
 OPTIONAL OUTPUT PARAMETERS:
	COUNT
		The name of the variable to receive the number of exceptional elements.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Compares the absolute values of the original array and the one obtained
		by neighborhood averaging.  Locates exceptions and replaces them by
		neighborhood average.  Uses FPU_FIX, NEIGHBORS and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 30-MARCH-1994 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\deglitch.pro)


DEGRADE

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

 PURPOSE:      degrade image resolution by a factor of two

 USEAGE:       result=degrade(array)
 
 INPUT:   
   array       an image array of dimension NX x NY, where both nx
               ny are divisible by 2. If nx or ny are not divisible by
               2 a subimage is extracted that leaves off the last row 
               or column and is divisible by 2 in both directions.

 KEYWORD INPUT:

   min         if set the returned value for each superpixel is the min
               of each of the four subpixels

   max         if set the returned value for each superpixel is the max
               of each of the four subpixels

 output:
   result      image array of dimension NX/2 x NY/2 composed of 2 x 2 
               superpixel averages of u (except if MIN or MAX keyword is
               set, see above)

 AUTHOR:       Paul Ricchiazzi                        26 May 95
               Institute for Computational Earth System Science
               University of California, Santa Barbara 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\degrade.pro)


DELCHR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DELCHR
 PURPOSE:
       Delete all occurrences of a character from a text string.
 CATEGORY:
 CALLING SEQUENCE:
       new = delchr(old, char)
 INPUTS:
       old = original text string.     in
       char = character to delete.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       new = resulting string.         out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  5 Jul, 1988.
       Johns Hopkins Applied Physics Lab.
       RES 11 Sep, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\delchr.pro)


DELETE_FROM_PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   delete_from_path

 PURPOSE:
   This function deletes entries from the !path setting of IDL

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   DELETE_FROM_PATH, str

 INPUTS:
   Str:  Input string, name of path entry to be deleted

 EXAMPLE:
   PRINT, !path
   DELETE_FORM_PATH, 'examples'
   PRINT, !path

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-JAN

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\delete_from_path.pro)


DELETE_TAG

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

 USERLEVEL:
   TOPLEVEL

 NAME:
    delete_tag

 PURPOSE:
   This functions deletes a tag in a structure, even within substructures.

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result = delete_tag(struct, tagname, [sub_structure = sub_structure])

 INPUTS:
   struct: the structure in which to delete the tag
   tagname: the name of the tag to be deleted (scalar or array),
            wildcards '*' are possible (see examples).

 KEYWORD PARAMETERS:
   sub_structure: to define a sub structure within struct where to delete the tag
   /ALL: If set all tags which agree to tagname will be deleted starting from the
         main level or the level 'sub_structure' downwards.

 OUTPUTS:
   This function returns a structure with some tags deleted.

 EXAMPLE:
   d = {A: 1, B: {B1: 0, B2: 1}, C: {B1: 0, B2: 1}}

   result = delete_tag(d, 'B')
   help, result, /str
   ** Structure <1342678>, 2 tags, length=8, refs=1:
   A               INT              1
   C               STRUCT    ->  Array[1]

   result = delete_tag(d, ['B*'], SUB = 'C')
   help, result, /str
   ** Structure <13694a8>, 2 tags, length=6, refs=1:
   A               INT              1
   B               STRUCT    ->  Array[1]

   result = delete_tag(d, '*B1', SUB = ['B', 'C'])
   help, result.b, /str
   ** Structure <1331be8>, 1 tags, length=2, refs=1:
   B2              INT              1

   result = delete_tag(d, ['B1', 'B2'], /ALL)
   help, result, /str
   ** Structure <170fac8>, 1 tags, length=2, refs=1:
   A               INT              1

   help,(delete_tag(d,'b1',sub_structure='B')).b,/str
   B2              INT              1

   help,(delete_tag(d,'b1',sub_structure='B')).c,/str
   ** Structure <1333618>, 2 tags, length=4, refs=1:
   B1              INT              0
   B2              INT              1

   help,(delete_tag(d,'*',sub_structure='B')),/str
   ** Structure <133b2d8>, 2 tags, length=6, refs=1:
   A               INT              1
   C               STRUCT    ->  Array[1]

   help,(delete_tag(d,'*',sub_structure='B',/sort)),/str
   ** Structure , 2 tags, length=6, refs=1:
   A               INT              1
   C               STRUCT    ->  Array[1]

   help,(delete_tag(d,sub_structure=['B','A'])),/str
   ** Structure <132fe78>, 2 tags, length=6, refs=1:
   A               INT              1
   C               STRUCT    ->  Array[1]

   help,(delete_tag(d,sub_structure=['B','C'])),/str
   ** Structure <1333288>, 1 tags, length=2, refs=1:
   A               INT              1

   help,(delete_tag(d,['B1','B2'],sub_structure=['B','C'])),/str
   ** Structure <46a9498>, 1 tags, length=2, refs=1:
   A               INT              1

   d = {ABRA: {B1: 0, B2: 1}, ABRA2B: {B1: 0, B2: 1}, ABRA3B: {B1: 0, B2: 1}}

   result=delete_tag(d,'abra')
   help,result,/str
   ** Structure <1365a48>, 2 tags, length=8, refs=1:
   ABRA2B          STRUCT    ->  Array[1]
   ABRA3B          STRUCT    ->  Array[1]

   result=delete_tag(d,'abra*')
   help,result,/str
   RESULT          INT       =       -1

   result=delete_tag(d,'abra?B')
   help,result,/str

   ** Structure <1364358>, 1 tags, length=4, refs=1:
   ABRA            STRUCT    ->  Array[1]

   d = {ABRA: {B1: 0, B2: {A:1}}, ABRA2B: {B1: 0, B2: {A:1}}, ABRA3B: {B1: 0, B2: {A:1}}}
   result=delete_tag(d,'A',sub_structure='abra.b2')
   help,result.abra,/str
   ** Structure <1365c68>, 1 tags, length=2, refs=2:
   B1              INT              0



 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05
       14.03.2000: Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\delete_tag.pro)


DELETE_TAG_FH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	delete_tag_fh

 PURPOSE:
	This function can be used to delete tags within a substructure of a given structure

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	result = delete_tag(struct, tag_name)

 INPUTS:
	struct: Input structure.
	tag_name: Name of tag or array of tag names to be deleted from struct (STRING).

 KEYWORD PARAMETERS:
	SUB_STR = sub_str: Name of the substructure under which the tags are deletetd.

 OUTPUTS:
	This function returns a structure were the tags 'tag_name' have been removed.

 EXAMPLE:
	s0 = {H2O: {param: 4, units: 'mbar'}, O3: {param: 17, units: 'ppb'}}

	s1 = delete_tag(s0, 'H2O')
	HELP, s1, /STR
		** Structure , 1 tags, length=12, refs=1:
   		O3              STRUCT    ->  Array[1]
	HELP, s1.o3, /STR
		** Structure , 2 tags, length=12, refs=2:
		   PARAM           INT             17
		   UNITS           STRING    'ppb'

	s1 = delete_tag(s0, 'units')
	HELP, s1, /STR
		** Structure , 2 tags, length=4, refs=1:
		   H2O             STRUCT    ->  Array[1]
		   O3              STRUCT    ->  Array[1]
	HELP, s1.o3, /STR
		** Structure , 1 tags, length=2, refs=2:
		   PARAM           INT             17

	s1 = delete_tag(s0, 'units', SUB_STR = 'O3')
	HELP, s1.o3, /STR
		** Structure , 1 tags, length=2, refs=2:
		   PARAM           INT             17
	HELP, s1.h2o, /STR
		** Structure , 2 tags, length=12, refs=2:
		   PARAM           INT              4
		   UNITS           STRING    'mbar'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05.01.2000
	13.03.2000:	Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\delete_tag_fh.pro)


DELLOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       dellog

 PURPOSE:
  dummy procedure for the one defined by VMS idl

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   dellog,a

 MODIFICATION HISTORY:
 R.Bauer 1998-Jul-24

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dellog.pro)


DEL_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   del_file

 PURPOSE:
   This procedure deletes a file or files

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   del_file,file

 INPUTS:
   file: the file(s) which should be deleted

 EXAMPLE:
   del_file,'test.dat'

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Jun-07
   1998-12-16 message added if file does not exist
   1999-09-13 get_ownership added
   2000-2-17 keyword verbose added T.B.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\del_file.pro)


DEL_TAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	del_tag

 PURPOSE:
	This function deletes a tag from a given structure.
	It also handels an array of tags.

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	x = del_tag(str, tag)

 INPUTS:
	str: variable name of structure
	tag: name of tag or array of tag names to be deleted (STRING)

 KEYWORD PARAMETERS:
	RETURN_ON_LAST_TAG_DELETED: Defines a variable which will be returned if the only tag
								in str is deleted.
	NAME: New name for a named structure (must not exist already)

 EXAMPLE:
	as = {Bsp1, a:0, b:'asd'}
	bs = del_tag(as, 'b', NAME = 'Bsp3')
	HELP, bs, /STR :
		** Structure BSP3, 1 tags, length=2:
		   A               INT              0

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 28. Jan. 98.
	29.09.98:	Debug statement deleted.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\del_tag.pro)


DEL_TAG2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	del_tag2

 PURPOSE:
	This function deletes a tag from a given structure.
	It also handels an array of tags and/or 1-dim array of structures.

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	x = del_tag2(str, tag)

 INPUTS:
	str: variable name of structure
	tag: name of tag or array of tag names to be deleted (STRING)

 KEYWORD PARAMETERS:
	RETURN_ON_LAST_TAG_DELETED: Defines a variable which will be returned if the only tag
								in str is deleted.
	NAME: New name for a named structure (must not exist already)

 OPTIONAL OUTPUTS:
	status: Status information 	=0: every thing worked fine;
								=1: something went wrong (see messages on screen)

 EXAMPLE:
	as = {Bsp1, a:0, b:'asd'}
	bs = del_tag2(as, 'b', NAME = 'Bsp3')
	HELP, bs, /STR :
		** Structure BSP3, 1 tags, length=2:
		   A               INT              0

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 11. Apr. 98.
	This program is based on the procedure del_tag.pro but provides additional features
	15.11.98:	call to debug deleted

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\del_tag2.pro)


DEMO_XYOUTS_AUTO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    demo_xyouts_auto

 PURPOSE:
   This routine shows the capabilities of xyouts_auto

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   demo_xyouts_auto

 MODIFICATION HISTORY:
	Written by: Frank Holland, 29.10.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\demo_xyouts_auto.pro)


DENS2D

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE     dens2d,x,y,g,nbins=nbins,xrange=xrange,yrange=yrange,$
               title=title,xtitle=xtitle,ytitle=ytitle,psym=psym,$
               grid=grid,tvim=tvim,scale=scale,contur=contur


 PURPOSE     Compute and/or display the density function of a 2-d scatter
             of points with coordinate x and y

 INPUTS:
     x       array of values
     y       array of values (same size as x)

 OUTPUTS:    
  g          2-d histogram array of size nbins(0) x nbins(1)

 OPTIONAL INPUTS (keyword parameters):
  nbins      1 or 2 element vector, number of bins in x and y direction
             default is (20,20)
  xrange     2 element vector, binning range in x direction
  yrange     2 element vector, binning range in y direction
  charsize   character size
  title      plot title
  xtitle     x axis label
  ytitle     y axis label
  psym       symbol used for scatter plot, if negative don't plot points
  grid       if set, show binning grid 
  contur     if set, draw in density contours (default)
  confill    if set, use CONFILL is used to draw contours
  tvim       if set, use TVIM to display the point density function
             if tvim is set to 1 image is smoothed
             if tvim is set to 2 image is not smoothed 
  scale      if set, draw in a color scale      
                 0=> no color scale
                 1=> regular color scale (default)
                 2=> stepped color scale

 EXAMPLE
     x=randomn(is,2000)
     y=4*randomn(is,2000) + x^3
     dens2d,x,y,g,/tvim,/grid

     dens2d,x,y,/tvim,/contur

     dens2d,x,y,psym=-1,/contur

 AUTHOR:     Paul Ricchiazzi,  Earth Space Research Group, sep92

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\dens2d.pro)


DEPENDENCES_OF_FAMILY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	dependences_of_family

 PURPOSE:
	This function returns a structure of keys depending on !version.os_family

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=dependences_of_family( )

 OUTPUTS:
  This function returns a structure:
    slash:               The platform depended slash or back slash
    path_separator:      The platform depended : od ;
    two_path_backwards:  The platform depended '../../'  od ...

 EXAMPLE:
   result=dependences_of_family()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dependences_of_family.pro)


DEPENDENCY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DEPENDENCY
 VERSION:
		4.2
 PURPOSE:
		Locating routines dependent on a given routine.
 CATEGORY:
		Programming utility.
 CALLING SEQUENCE:
		Result = DEPENDENCY( RNAME [, keywords])
 INPUTS:
	RNAME
		Character value resolving to a routine name (no extension).
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/GLOBAL
		Switch.  If set, the search is global, default is search in current
		directory.
	DIRPATH
		Directory path, for internal use only (recursive calls).
	NFOUND
		Optional output, see below.
 OUTPUTS:
		Returns a list of addresses for all the routines which are calling
		RNAME.  If none are found, returns null string.
 OPTIONAL OUTPUT PARAMETERS:
	NFOUND
		Returns the number of files satisfying the search criterion.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls itself recursively.  Also calls DEFAULT, SDEP,
		STREQ, STRPARSE_MM and STRVALID_MM, from MIDL.
 MODIFICATION HISTORY:
		Created 10-AUG-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\dependency.pro)


DES_INH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	des_inh

 PURPOSE:
	The include of des_inh will transform the tagnames of the structure inhalt
	to variables.

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
   @des_inh

 OUTPUTS:
	all in Structure INHALT defined tagnames as variables


 EXAMPLE:
   ncdf_gr,file='test.nc',name='sin2',inhalr=inhalt
	@des_inh

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1996
               R.Bauer Feb.,  26, 1997 areal in type umbenannt
               R.Bauer March, 17, 1997 valid_last_index eingefuegt
               R.Bauer March, 19, 1997 param_stdev, param_accuracy,param_detection_limit,param_high_err,param_low_err

               R.Bauer / F.Rohrer  June, 6, 1997 downgrade to idl 3.6.1
 1998-Jun-30 strmid removed
               R.Bauer 1998-11-16 alt_inhalt_def instead of inhalt_def

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\des_inh.pro)


DETAB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DETAB
 PURPOSE:
       Replace tab characters by spaces.
 CATEGORY:
 CALLING SEQUENCE:
       out = detab(in)
 INPUTS:
       in = input text string.              in
 KEYWORD PARAMETERS:
       Keywords:
         TAB=tb  number of spaces per tab (def=8).
 OUTPUTS:
       out = processed output text string.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 3

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\detab.pro)


DIAGOARR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DIAGOARR
 VERSION
		4.0
 PURPOSE:
		Creates a diagonal square matrix with the elements of a given vector on
		the diagonal.
 CATEGORY:
		Array Manipulation.
 CALLING SEQUENCE:
		Result = DIAGOARR(VEC)
 INPUTS:
	VEC
		Vector.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Return a square N*N (N is the vector's dimension) matrix, with the
		elements of VEC on the diagonal and zeroes elsewhere.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 20-MAY-1993 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\diagoarr.pro)


DIAGOVEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DIAGOVEC
 VERSION:
		4.0
 PURPOSE:
		Extracts the diagonal of a square matrix as a vector.
 CATEGORY:
		Array Manipulation.
 CALLING SEQUENCE:
		Result = DIAGOVEC(ARR)
 INPUTS:
	ARR
		Array, 2-dimensional, square (a scalar is considered a 1*1 matrix).
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		If ARR is a square matrix, returns the diagonal as a vector, else
		generates an error message.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.
 MODIFICATION HISTORY:
		Created 20-DEC-1991 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.
		Modified 25-NOV-2001 by Mati Meron.  Added scalar handling capability.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\diagovec.pro)


DIALOG_CHANGEDIR

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   dialog_changedir

 PURPOSE:
   This function provides a widget directory change

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   new = DIALOG_CHANGEDIR( [OLDDIR=old] [, /VERBOSE])

 KEYWORD PARAMETERS:
   VERBOSE:    print messages
   OLDDIR:     if set to named variable the previous dir is returned

 OUTPUTS:
   This function returns the selected directory

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\dialog_changedir.pro)


DIALOG_PSSETUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Dialog_PSSetup

 PURPOSE:
	This function displays a widget to interactively choose the setting for the ps device.
	(Wrapper around the ps_form routine by Craig B. Markwardt)

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	Result = Dialog_PSSetup(ps_config [,LOCALDEFAULT = local_config] [,CANCEL = canceled] [,/QUIET] )

 OPTIONAL INPUTS:
	ps_config:	structure with a default configuration for the PS device.
					For information about this structure run the routine and set
					ps_config to a named variable.

 KEYWORD PARAMETERS:
	LOCALDEFAULT = local_config: structure with a 2nd default configuration ('local') for the PS device.
	CANCEL = canceled	: 				Set to 1 if dialog was closed with CANCEL button.
	/QUIET:								Don't show the widget; rather return the default ps configuration
	PSFILE = psfile:					Name of the ps file.

 OUTPUTS:
	ps_config:	structure with the configuration of the PS device. This structure
					can be passed into the DEVICE procedure via the _EXTRA keyword.

 EXAMPLE:
		create = Dialog_PSSetup(ps_config, CANCEL = canceled)
		IF NOT canceled THEN HELP, ps_config, /STR

 MODIFICATION HISTORY:
	This routine is a wrapper around the ps_form routine by Craig B. Markwardt and David Fanning
 	Written by:	Frank Holland, 13.11.98
	17.11.98:	QUIET keyword enabled (bug in PS_FORM was fixed by CM)
					Keyword handling improved
	17.02.99:	Changed the header

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\dialog_pssetup.pro)


DIF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		DIF
 VERSION:
		4.1
 PURPOSE:
		Calculates finite differences for 1D vectors.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = DIF( VEC [, ORD] [, keywords])
 INPUTS:
	VEC
		1-D numeric array (a scalar may be used and ti is treated as a vector
		with length of 1.
 OPTIONAL INPUT PARAMETERS:
	ORD
		The order of the difference.  Default value is 1.
 KEYWORD PARAMETERS:
	/BACKWARD
		Switch.  If set, backward difference is performed, i.e.
		Result[n] = VEC[n] - VEC[n-1].  This is also the default.
	/FORWARD
		Switch.  If set, forward difference is performed, i.e.
		Result[n] = VEC[n+1] - VEC[n].
	/CENTERED
		Switch.  If set, centered difference is performed, i.e.
		Result[n] = (VEC[n+1] - VEC[n-1])/2.

		Note:  Only one of BACKWARD, FORWARD and CENTERED may be set at any
		given call.

	/EDGE_EXTEND
		Switch.  If set, the "beyond the edge" elements which are needed for
		the differences are set equal to the appropriate edge elements.  The
		default operation is to set them to 0.
	/CLIP
		Switch.  If set, the elements (within ORD from either edge) for which
		there is not enough information to determine the result, are set to 0.
 OUTPUTS:
		Returns the difference vector for VEC, of a type determined by the
		keywords.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		As mentioned above, Only one of BACKWARD/FORWARD/CENTERED may be used.
 PROCEDURE:
		Straightforward.  Calls DEFAULT, ISNUM and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 15-APR-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\dif.pro)


DIGITIZE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    digitize

 PURPOSE:    digitize hardcopy graphical information.

 USEAGE:     digitize,x,y

 INPUT:      none

 KEYWORD INPUT:
   xr        x axis range of hardcopy plot, prompted for if not supplied
   yr        y axis range of hardcopy plot, prompted for if not supplied

 OUTPUT:
   x         vector of x coordinate values
   y         vector of y coordinate values


 PROCEDURE:  1.  make a photo copy of the graph  on tranparency film.

             2.  IDL> DIGITIZE,x,y,xr=xr,yr=yr
                 where xr and yr are the x and y axis range. 

             3.  align the hard copy graph onto the axis drawn by DIGITIZE
                 and use scotch tape to stick the film onto your screen

             4.  click with LMB on the axis end points (will prompt)

             5.  trace over the plot with cursor, LMB adds points, MMB
                 erases points and RMB exits the program

             NOTE: Because the outer glass surface of the screen is not
                   on the same plane as the displayed image their is a 
                   slight parallax effect between the tranparency and the
                   DIGITIZE grid.  The parallax error is minimized by
                   keeping your line of sight normal to the screen.
  
 EXAMPLE:    
             digitize,x,y        ; try it
             plot,x,y

 REVISIONS:

  author:  Paul Ricchiazzi                            sep93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\digitize.pro)


DIG_LES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       dig_les

 PURPOSE:
       reads ascii-files with 3 columns of data (as made by digitise.exe)

 CATEGORY:
       DATAFILES/FILE

 CALLING SEQUENCE:
       dig_les,file,x,y,z

 INPUTS:
       file: name of ascii inputfile

 OUTPUTS:
       x,y,z : data vectors

 KEYWORD PARAMETERS:
       skip: skip lines 1 to value(skip)

 EXAMPLE:
       dig_les,'test.txt',x,y,z,skip=1

 REVISION HISTORY:
       Written         Franz Rohrer, May 1997
       Corrected       FR 12.08.1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\dig_les.pro)


DIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DIR

 PURPOSE:
       Simple procedure that can be executed within an interactive session of IDL to print
       the filesystem contents of the current working directory to the output log.

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       dir

 INPUT PARAMETERS:
       None.

 KEYWORD PARAMETERS:
       None.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 MODIFICATION HISTORY:
       Written by: AEB, 4/03.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\dir.pro)


DIR2HTMLFILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   dir2htmlfile

 PURPOSE:
   writes the informations about a directory to a html file

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result=DIR2HTMLFILE(Dirname)

 INPUTS:
   dirname : directory name or string array of dir-names to be searched for

 KEYWORD PARAMETERS:
   HTMLFILE: a name for the html file ( default: 'dir2html.html' )

 OUTPUTS:
   This function returns the names of the htmlfiles with path.

 EXAMPLE:
     x = dir2htmlfile( ['/home3/ich388','/home3/ich388/IDL'] $
    , CAPTION='test', HTMLFILE='a.html', INFO='info' $
    , /FIXED, /SMALL, ALIGN=0.5 )

 MODIFICATION HISTORY:
   Written by:       Theo Brauers, Marsy Lisken  july 1998
                     R.Bauer bug with no write access removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\dir2htmlfile.pro)


DIR2HTMLTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   dir2htmltable

 PURPOSE:
   writes the informations about the current directory to a html table

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = DIR2HTMLTABLE( )

 OPTIONAL INPUTS:
   Search:     Search pattern for findfile, if not given *.* is assumed

 KEYWORD PARAMETERS:
   EXCLUDE:   string array of file search patterns to be excluded
                   (in lowercase characters)
   INCLUDE:   string array of file search patterns to be included
                   (only these files will be considered for search)
   HTMLFILE:  a name for the html file ( default: 'dir2html.html' )
                   (written later in dir2htmlfile)
   REVERSE:   if keyword set the order of files will be reversed
   MIXEDCASE: if keyword set no forcing to lower case is done
   LAST_EXTENSION: if keyword set only last extendion is separated

 OUTPUTS:
   This routines returns the html code for a directory table

 EXAMPLE:
   x = dir2htmltable('a*.*', EXCLUDE='*.bak', /FIXED, /SMALL)

 MODIFICATION HISTORY:
   Written by:         Theo Brauers / Marsy Lisken  july 1998
   modified by         Franz Rohrer, Sep98, reverse keyword included
   Revised:            Theo Brauers Sep 1998
 2000-05-23 : last_extension added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\dir2htmltable.pro)


DIRMEM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DIRMEM
 PURPOSE:
       Update a directory list for easy access.
 CATEGORY:
 CALLING SEQUENCE:
       out_list = dirmem( entry)
 INPUTS:
       entry = potential new list entry.                 in
         Directory followed by an optional alias:
         /users/images/lunar/gif  Moon GIFS
 KEYWORD PARAMETERS:
       Keywords:
         READ=rf  Initialization text file: one directory/alias
           pair per line.  Comments allowed (start with * or ;).
           Over-rides any given list.
         WRITE=wf File to save updated list in.
         LIST=lst Text array with dir/alias pairs.  In/out.
         /ALIAS  Means use aliases for out_list (display list).
           Default is use directories.  ALIAS=2 means use both.
        MAX_ENTRIES=m  Max size of list.  Def=size of init file
          or 5 if that is not available.
 OUTPUTS:
       out_list = Display list.                          out
         Directories, aliases, or both.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 14

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dirmem.pro)


DIRTREE2HTMLFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   dirtree2htmlfile

 PURPOSE:
   This procedure writes a directory tree to a html tree

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
  dirtree2htmlfile,file_name,path,[level=level]

 INPUTS:
   file_name: the name of the file to write to
   path: the start directory for get_dir_tree

 KEYWORD PARAMETERS:
  _extra: to add keywords to get_dir_tree


 EXAMPLE:
  dirtree2htmlfile,'S:\links\daten\experiments\stream1998.html','S:\links\daten\experiments\stream1998',level=10


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-MAR-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dirtree2htmlfile.pro)


DIRTREEARRAY2HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   dirtreearray2html

 PURPOSE:
   makes the html-table of a directory tree

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   array=DIRTREEARRAY2HTML(dirarray,nfiles)

 INPUTS:
     dirpath  : path specification of directory
     dirarray : array of directory names output of GET_DIR_TREE (without path)
     nfiles   : integer array with number of files for each directory output of GET_NFILES

 KEYWORD PARAMETERS:
     DIR2HTMLFILE: name of the html-file, which contains the table of informations
                   about the directories (default=dir2html.html)
     _EXTRA      : BORDER=border (default), CAPTION=dirpath (default) see array2htmltable for details

 OUTPUTS:
   This function returns a string array which contains the html-table: array(cx,lev+1)
                          cx :number of directories (output of GET_DIR_TREE)
                          lev:number of directory levels

 EXAMPLE:
       dirpath='/home3/ich388/IDL'
       dirarray=get_dir_tree(dirpath,LEVEL=-1,count=cdx)
       dirarrayplus=dirpath+dirarray
       nfiles  =get_nfiles(dirarrayplus)
       array   =DIRARRAY2HTML(dirpath,dirarray,nfiles)

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\dirtreearray2html.pro)


DISKCENTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DISKCENTER
 PURPOSE:
       Find center and radius of a disk in an image.
 CATEGORY:
 CALLING SEQUENCE:
       diskcenter, img, xc, yc, rd
 INPUTS:
       img = input image containing the disk.   in
 KEYWORD PARAMETERS:
       Keywords:
         /GRID plots fit to disk.
 OUTPUTS:
       xc, yc = array indices of disk center.   out
       rd = estimated radius of disk in pixels. out
 COMMON BLOCKS:
 NOTES:
       Note: Image is assumed 0 outside disk, non-zero inside.
         Also center of array must be inside the disk.
 MODIFICATION HISTORY:
       R. Sterner, 21 Feb, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\diskcenter.pro)


DISPLAY_HELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	display_help

 PURPOSE:
   This procedure displays parts of the template on screen

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   display_help, file_name

 INPUTS:
   file_name: The name of an IDL Source File

 OUTPUTS:
   This procedure displays on the screen a short description of a routine

 EXAMPLE:
   display_help,'ncdf_gr.pro'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 23 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\display_help.pro)


DISTRIBUTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        DISTRIBUTE

 PURPOSE:
        collect all the routine names and file names that are
        used in a given program.

 CATEGORY:
        Administrative Tools

 CALLING SEQUENCE:
        DISTRIBUTE,ROUTINENAME

 INPUTS:
        ROUTINENAME --> The name of the routine to be searched.

 KEYWORD PARAMETERS:
        OUTFILE --> name of an output file where the output will be saved.

 OUTPUTS:
        A list of filenames with full pathnames and a list of routinenames
        together with the filenames where they can be found.
        Sorry, for local files, no pathname is provided.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        Unfortunately there is no way to figure out which routines
        really belong to a given routinenname, so DISTRIBUTE will always
        return too many routinenames and filenames, including itself
        and FILE_EXIST, as well as a couple of IDL standard library
        routines (The latter can be left out with the keyword NO_IDL).
        In order to get the closest results, run DISTRIBUTE only at the
        start of an IDL session.

        With routine_info /source, there should now be a way to
        overcome the previously mentioned handicap!!

 EXAMPLE:
        get all routines that belong to ITERATE.PRO:

            DISTRIBUTE,'iterate'

        A subsequent call with routinename 'create_master' will return
        both, the routines for create_master and the routines for iterate.

 MODIFICATION HISTORY:
        mgs, 16 Nov 1997: VERSION 1.00
        mgs, 20 Nov 1997: - added OUTFILE and NO_IDL keywords
        mgs, 23 Aug 2000: - changed copyright to open source
                          - reverted to IDL routine resolve_all
                            instead of own modification resolve_every.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\distribute.pro)


DIST_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DIST_SCALE
 PURPOSE:
       Display a distance scale on an image.
 CATEGORY:
 CALLING SEQUENCE:
       dist_scale, x0, y0
 INPUTS:
       x0, y0 = pixel coordinates of the center of scale.  in
 KEYWORD PARAMETERS:
       Keywords:
         SCALE=sc    Number of units per pixels (like 12.5 m).
         LENGTH=len  length of scale in units given in SCALE.
         HEIGHT=ht   height of scale in units given in SCALE.
         TITLE=txt   Scale title text (like 10 km).
         SIZE=sz     Text size (def=1).
         COLOR=clr   Color of scale (def=!p.color).
         BACKGROUND=bclr   Background color (def=!p.background).
         THICK=thk   Scale thickness.
 OUTPUTS:
 COMMON BLOCKS:
       dist_scale_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 26 Jul, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dist_scale.pro)


DIST_SCALE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DIST_SCALE2
 PURPOSE:
       Display a distance scale on an image.
 CATEGORY:
 CALLING SEQUENCE:
       dist_scale, x0, y0
 INPUTS:
       x0, y0 = pixel coordinates of the center of scale.  in
 KEYWORD PARAMETERS:
       Keywords:
         SCALE=sc    Number of units per pixels (like 12.5 m).
         LENGTH=len  length of scale in units given in SCALE.
         HEIGHT=ht   height of scale in units given in SCALE.
         TITLE=txt   Scale title text (like 10 km).
         SIZE=sz     Text size (def=1).
         COLOR=clr   Color of scale (def=!p.color).
         BACKGROUND=bclr   Background color (def=!p.background).
         THICK=thk   Text thickness.
         BORDER=brd  Border thickness.
 OUTPUTS:
 COMMON BLOCKS:
       dist_scale_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Mar 7

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dist_scale2.pro)


DIURNAL_STATISTICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		diurnal_statistics

 PURPOSE:
		This function returns statistics on time-averaged data sets.

 CATEGORY:
		TIME

 CALLING SEQUENCE:
		result = diurnal_statistics(time, data)

 INPUTS:
		time: Vector of time data in Js.
		data: Data vector.

 KEYWORD PARAMETERS:
		TIME_STEP = ts: averaging time window in seconds (default: 86400D0).
		FIRST_DAY = fd: dd.mm.yy - Date of first day to be considered
			(default: first day in data set).
		LAST_DAY = ld: dd.mm.yy - Date of last day to be considered
			(default: last day in data set).
		MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
		/MAKE_PLOT: If set the result of the time-averaging process is plotted.
		_EXTRA = e: Any valid plot_2c keyword parameters can be passed into the
			plot_2c procedure.

 OUTPUTS:
		This function returns a structure of arrays where the
		array dimension n is equal to the number of time bins in the density function.
		For each bin the start time and the statistical parameters mean, stdev, sterr,
		n, and median are returned (tag names: time, mean, stdev, sterr, n, median). The
		time step is returned as well (tag name: time_step).
		If a quantity is not defined (e.g. stdev for only one point in the bin),
		the value !VALUES.F_NAN is returned.

 EXAMPLE:
		a = DINDGEN(100)
		t = a * 3600.D
		result = diurnal_statistics(t, a, /MAKE_PLOT)

		--> a time axis plot should appear

		HELP, result, /STR

		** Structure <1859af0>, 9 tags, length=192, refs=1:
		   TIME            DOUBLE    Array[5]
		   MEAN            FLOAT     Array[5]
		   STDEV           FLOAT     Array[5]
		   STERR           FLOAT     Array[5]
		   N               LONG      Array[5]
		   MEDIAN          FLOAT     Array[5]
		   MIN             FLOAT     Array[5]
		   MAX             FLOAT     Array[5]
		   TIME_STEP       DOUBLE           86400.000

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.06.1999
	14.06.1999:	Added keyword parameter MISSING_VALUE = miss_value.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\diurnal_statistics.pro)


DL_VMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	dl_vms

 PURPOSE:
	Dummy procedure for preventing idl to search by resolve_all for rsi vms code 

 CATEGORY:
	CASE_TOOLS

 CALLING SEQUENCE:
	DL_VMS		;For prompting.
	DL_VMS, Name	;Extract documentation for procedure Name using
				the current !PATH.

 INPUTS:
	Name:   A string containing the name of the procedure.

 KEYWORDS:
	FILE:   If this keyword is set, the output is sent to the file
		"userlib.doc", in the current directory.

	PRINT:  If set, this keyword sends the  output of DL_VMS to lpr.

	PATH:   An optional directory/library search path.  This keyword uses
		the same format and semantics as !PATH.  If omitted, !PATH is
		used.
 OUTPUTS:
	Documentation is output to terminal or printer.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Output is produced on terminal or printer.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	Written, DMS, Sept, 1982.
	Added library param, Jul 1987.
	Unix version, Feb, 1988.
	Revised for VMS Version 2, 15 December 1989
	Modified by Jim Pendleton, GRO/OSSE NU, July 30, 1992 to handle
		!PATH's gt 255 characters.
	AB, 21 September 1992, renamed from DOC_LIB_VMS to DL_VMS to
		avoid DOS filename limitations.
	ACY, 25 January 1993, file should be written with stream mode
 1998-07-30 R.Bauer, all lines between PRO and END removed because of preventing idl in non vms
              to search for special vms functions  

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dl_vms.pro)


DMS2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DMS2D
 PURPOSE:
       Convert from Degrees, MInutes, and seconds to degrees.
 CATEGORY:
 CALLING SEQUENCE:
       d = dms2d(s)
 INPUTS:
       s = input text string with deg, min, sec.    in
         Ex: "3d 08m 30s" or "3 8 30".
 KEYWORD PARAMETERS:
 OUTPUTS:
       d = returned angle in degrees.               out
 COMMON BLOCKS:
 NOTES:
       Notes: scalar value only.  Units symbols ignored,
         first item assumed deg, 2nd minutes, 3rd seconds.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Feb 3

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dms2d.pro)


DMS_FORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DMS_FORM
 PURPOSE:
       Convert degrees to a deg, min, sec vector font string.
 CATEGORY:
 CALLING SEQUENCE:
       dms = dms_form(deg)
 INPUTS:
       deg = degrees and decimal fraction.    in
 KEYWORD PARAMETERS:
       Keywords:
         /NOSEC     Means suppress seconds.
         DEGREES=n  Force n digits in degrees, fill with 0s.
         FONT=fnt   Specify font string (def=!17).
 OUTPUTS:
       dms = string to be printed by xyouts   out
         using vector font.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 22 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dms_form.pro)


DMYHMS2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   dmyhms2js

 PURPOSE:
   convert date (d.m.y) and time (h:m:s) to JulianSeconds,
   works with string array input

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result= DMYHMS2JS(date_time)

 INPUTS:
   date_time:   string ('d.m.y h:m:s')

 KEYWORD PARAMETERS:
   NO_SEC: if this keyword is set the sec of the string
           are ignored, works with 'd.m.y h:m'
   NOW:    returns actual time instead

 OUTPUTS:
   julian sec: double

 RESTRICTIONS:
   1.1.70 ... 31.12.69 = 1.1.1970 ... 31.12.2069
   only seperators matter, spaces and zeros ignored
   the string array must contain all entries: 'd.m.y h:m:s'

 EXAMPLE:
   dt=['1.1.95 10:11:03', '1.1.96 1:11:36', '1.1.05 1:11:3']
   jsec=dmyhms2js(dt)

   dt=['1.1.95 10:11', '1.1.96 1:11', '1.1.05 1:11']
   jsec=dmyhms2js(dt, /no_sec)

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1997
   Modified    T.B. bug with array and no_sec removed
               T.B. bug with year  < 1969 removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\dmyhms2js.pro)


DOC

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    doc

 PURPOSE:    find and display help for a named procedure

 USEAGE:     doc,'name'

 INPUT: 
   name      name of idl .pro file.  Asterisk characters, "*", in NAME
             specify wild card matches to 1 or more arbitrary characters.


 PROCEDURE:  DOC searches through the files /local/idl/help/*.help 
             trying to find matches for the file specification, NAME.  

             if there are no matches a brief failure message is displayed
                  and control returns to the terminal

             if 1 match is found, help for the specified procedure is 
                  displayed and control returns to the terminal

             if 2 or more matches are found a menu is generated 
                  from which selections can be made.  Control returns to 
                  the terminal when the DONE button of the MENUW widget
                  is pressed.


 EXAMPLE:
             doc,'legend'            ; exact match found in ESRG_LOCAL
             
             doc,'tv*'               ; many matches found, browse through
                                     ; choices.  Notice that all procedure
                                     ; libraries are searched


  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\doc.pro)


DOCKEY

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    dockey

 PURPOSE:    display help documententation of file headers which
             contain matches for specified keywords

 USEAGE:     dockey,'name',keyword=keyword,all=all,minmatch=minmatch

 INPUT: 
   keywords  keyword string. Keywords withing the KEYWORDS must be
             separated by blanks. 

 KEYWORD_INPUT

   minmatch  the minimum number of keyword hits required for a procedure
             to be listed in the hit-list menu. 

 PROCEDURE:  DOCKEY searches through the helpfiles in subdirectory
             /local/idl/help, trying to find matches for the keywords.
             If more than one file match is found a menu of procedure
             names is displayed from which the desired procedure
             can be selected.  The parenthisized number next to each
             procedure name is the number of keyword matches, which
             can vary between one to the total number of keywords in
             KEYWORDS. 

             MAN_PROC is used to display the text

 EXAMPLE:
             dockey,'simpson rule integration';  pick group 'numerical'
            
             dockey,'polar orthographic'      ;  pick group 'esrg'

             dockey,'color key image',m=2     ;  pick group 'color'

; 


  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\dockey.pro)


DOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DOT
 PURPOSE:
       Used by SUN_SHADE for dot prod. of surf. normal & sun vect.
 CATEGORY:
 CALLING SEQUENCE:
       r = dot(s,[azi,alt])
 INPUTS:
       s = Surface array to be shaded.                    in
       azi = Light azimuth (deg, def = 135).              in
       alt = Light altitude (deg, def = 60).              in
 KEYWORD PARAMETERS:
 OUTPUTS:
       r = dot products: surface normals and sun vector.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 8 Mar, 1989.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       Slightly modified version of routine by J. Culbertson.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dot.pro)


DO_LINK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	do_link

 PURPOSE:
   This procedure did the links of "good" files to the defined flightday directories
   of the icg-1 datalibrary.
   The link name ist always the lowercase experiment name +'.nc'

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   do_link,[/month]

 KEYWORD PARAMETERS:
  month: to link the data to month instead of flightday directories

 RESTRICTIONS:
 will at the moment only work whith icg1's data-base

 EXAMPLE:
   do_link,'stream1997'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),August 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\do_link.pro)


DO_PAGE_TITLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	do_page_title

 PURPOSE:
   This procedure is used to write a centered title on a plot page

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   do_page_title,plot,text,[charsize=charsize],[color=color]

 INPUTS:
   plot: The by pl_init defined plot structure
   text: The text you want to show on the page

 OPTIONAL INPUTS:
   charsize: The charsize ot the text (default is 1)
   color:    The color of the text    (default is black)


 EXAMPLE:
   do_page_title,plot,'TEST'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct. 1997
   1999-10-14 alignment added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\do_page_title.pro)


DO_PL2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       do_pl2d

 PURPOSE:
       This procedure is an example routine for the use of the procedures
       do_pl2d_define and do_pl2d_plot.
       You can use it (with all keywords specified) or you can copy it and modify it in
       the form which you want.
       After the do_pl2d_define-call there is a comment, which substructures you can now use.

 CATEGORY:
       PLOT/PLOT2D

 CALLING SEQUENCE:
       do_pl2d,spec

 INPUTS:
       spec : the netCDF-variable which you want to plot.
       some control keywords

 OUTPUTS:
       A contour plot with the variable, specified in plotstr.values.z, plotted against the x- and y-values.

 EXAMPLE:
       do_pl2d,'PV',f_name =file_search('box_970227_nh.nc',/use_path),dir='./'
       Result: a plot of the species PV on a map-background with cylindrical projection
       

MODIFICATION HISTORY: Written by: Juergen Ankenbrand , 11.5.98

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\do_pl2d.pro)


DO_PL2D_DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       do_pl2d_define 
 
 PURPOSE: 
       This procedure defines some substructures of the ICG - plot-structure. 
       It reads the variables, which the user wants, from a netCDF-file and  
       creates them as components of the plotstructure. 
       Some control attributes of the netCDF-file become components, too.  
 
 CATEGORY: 
       PLOT/PLOT2D 
 
 CALLING SEQUENCE: 
 
       do_pl2d_define,plot 
 
 INPUTS: 
       plot: Plotstructure of the ICG plot-environment, which has to have 
             a new subcomponent 'names', which must contain the components  
             'file'       : the netcdf-filename 
             'paramnames' : a stringarray, which contains the names of the  
                            variables of the netCDF-file, which should be read 
                            from the file 
             'spec'       : the name of the variable, which is later used as  
                            z variable 
             'con'        : if 1, then the spec-values are multiplicated with the 
                            values of netCDF-variable 'TND' 
 
 OUTPUTS: 
       plot: The input Plotstructure has some new components:   
             'control' with the components: 
                      'missing_value': the missing_value-attribute of the netCDF-file 
                      'nparts'       : the number of trajectories 
                      'time'         : the time dimension 
                      'unit'         : a string, where you can set later e.g. 'ppm' 
                      'dim'          : a component where you can set the dimension for a later defp2d - 
                                       call; default value 21 
                      'maxval'       : a component for a defp2d - call, too 
                      'minval'       : a component for a defp2d - call, too 
                      'map'          : a string, where you can later chose a map projection 
 
             'paramvalues' with the components: 
                      'spec'         : the values of the z-variable, which has been  
                                       declared in plot.names.spec,eventually multiplied 
                                       with TND 
                      the names declared in plot.names.paramvalues: the values of these 
                                       netCDF-variables 
                        
 SIDE EFFECTS: 
       The input-plot-structure has some new subcomponents. 
 
 
 EXAMPLE: 
 
@init  
            ;initialize Reimar Bauer's plotstructure 
 
   paramnames = ['LONG','LAT','LEVEL','time','TND']   
            ;a stringarray with the names of the variables ,which are to read 
    
   my_struct1 = create_struct('file','test.nc','paramnames',paramnames,'spec','PV','con',0) 
            ;create a new structure 
 
   plot=create_struct(plot,'names',my_struct1) 
            ;and it becomes a substructure of the plot-structure 
 
   do_pl2d_define,plot 
           ; now you have account of e.g. plot.paramvalues.spec, plot.paramvalues.LONG 
 
 MODIFICATION HISTORY: 
       Written by:     Juergen Ankenbrand, 5.5.1998. 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\do_pl2d_define.pro)


DO_PL2D_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       do_pl2d_plot 
 
 PURPOSE: 
       This procedure calls the 'plot2d' procedure of Reimar Bauer. 
       Before, it searchs for x- and y-ranges of the axes-variables. 
       If you want, you can lay a map in the background. 
       If you have irregular values, which are in a regular gather, 
       these values can be transformed to a regular gather. 
 
 CATEGORY: 
       PLOT/PLOT2D 
 
 CALLING SEQUENCE: 
       do_pl2d_plot,plotstr 
 
 INPUTS: 
       plotstr: Plotstructure of the ICG plot-environment, which has to have 
                a new subcomponent 'names', which must contain the components: 
                'values': a new subcomponent with the components: 
                          'x': an array with the x-values (mostly longitude) 
                          'y': an array with the y-values (mostly latitude) 
                          'z': an array with the z-values, the variable, 
                               which will be plotted 
                'control' with the components(if ther has been a do_pl2d_define - call this 
                                              component already exists): 
                          'missing_value': the missing_value-attribute of the netCDF-file 
                          'nparts'       : the number of trajectories 
                          'time'         : the time dimension 
                          'unit'         : a string, where you can set later e.g. 'ppm' 
                          'dim'          : a component where you can set the dimension for a later defp2d - 
                                           call; default value 21 
                          'maxval'       : a component for a defp2d - call, too 
                          'minval'       : a component for a defp2d - call, too 
                          'map'          : a string, where you can later chose a map projection 
                          'regular'      : default 0 ; must be set later to not 0 if there are pseudoregular values 
                          'm','n'        : the sizes of the pseudoregular transformation 
 
 OUTPUTS: 
       A contour plot with the variable, specified in plotstr.values.z, plotted against the x- and y-values. 
       If plotstr.control.map is set to 1, a cylindrical map is plotted in the background, if plotstr.control.map 
       is 2 a polarstereographical map is plotted, else no map is plotted. 
 
 EXAMPLE: 
       (for the first 5 lines see the 'do_pl2D_define' - description,too) 
@init 
        paramnames = ['LONG','LAT','LEVEL','time','TND'] 
        my_struct1 = create_struct('file','test.nc','paramnames',paramnames,'spec','PV','con',0) 
        plot=create_struct(plot,'names',my_struct1) 
        do_pl2d_define,plot 
 
        my_struct4 = create_struct('Z',plot.paramvalues.spec,'X',plot.paramvalues.long,'Y',plot.paramvalues.lat,
                                   'contour'contour) 
                    ;Longitude is defined as x-axes, Latitude as y-axes and PV will be plotted. 
 
        plot = create_struct(plot,'values',my_struct4) 
                    ;values becomes a subcomponent of the 'plot' -structure 
 
        do_pl2d_plot,plot 
                    ;PV is plotted in a contour plot against longitude and latitude 
 
 MODIFICATION HISTORY: 
       Written by:  Juergen Ankenbrand , 11.5.98, 
       14.6.98: P. Konopka, new switch plot.values.contour:
        plot.values.contour=1: contour plots
        plot.values.contour=0: Air parcels are plotted as small filled circles

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\do_pl2d_plot.pro)


DO_PLXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	do_plxy

 PURPOSE:
   Using the plotxy environment possible types of plots are
   1X-1Y, 2X-1Y, 1X-2Y, 2X-2Y
   For more information look at the example do_plxy_instructions.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   do_plxy, instruction_file

 INPUTS:
   instruction_file: an idl Script which holds the instruction how to make a plot

 OUTPUTS:
   belonging on the instruction file on screen or file

 EXAMPLE:
   do_plxy,'do_plxy_instructions'

   PRO do_plxy_instructions,pict,init

       ct_ncdf,color
       seiten =1
       zeilen =2
       spalten =2
       plot_width=15.60
       plot_height=10.85
       plot_width=20.
       landscape=1
       psflag = 0
       psfile = 'idl'
       init = {$
               spalten:spalten,$
               zeilen:zeilen,$
               plot_width:plot_width,$
               plot_height:plot_height,$
               psflag:psflag,$
               psfile:psfile,$
               landscape:landscape,$
               page_title:''$
               }
       pict = replicate({use:'plotxy',$
                         file:'',$
                         title:'',$
                         x:strarr(2),$
                         y:strarr(2),$
                         psym:[(0),(108)],$
                         color:[color.red,color.green],$
                         symsize:[1.,1.],$
                         linestyle:[0,0],$
                         thick:[1.,1.],$
                         timeformat:['!h$:m$:s$@!d$.nn$.Y$','!h$:m$:s$@!d$.nn$.Y$'],$
                         x_array_index:intarr(2),$
                         y_array_index:intarr(2)},$
                         zeilen*spalten*seiten)


        pict[0].file='S:/links/idl_source/idl_work/rb_lib/examples/do_plxy.nc'
        pict[0].x = ['time','time']
        pict[0].y = ['LAT','LAT']
        pict[0].x_array_index = [0,0]
        pict[0].y_array_index = [0,1]

        pict.file='S:/links/idl_source/idl_work/rb_lib/examples/do_plxy.nc'

        pict[1].x = ['time','']
        pict[1].y = ['LAT','LON']
        pict[1].x_array_index = [0,0]
        pict[1].y_array_index = [1,1]

        pict[2].file='S:/links/idl_source/idl_work/rb_lib/examples/do_plxy.nc'
        pict[2].x = ['time','']
        pict[2].y = ['LAT','']
        pict[2].x_array_index = [0,0]
        pict[2].y_array_index = [2,2]

        pict[3].file='S:/links/idl_source/idl_work/rb_lib/examples/do_plxy.nc'
        pict[3].x = ['time','time']
        pict[3].y = ['LAT','']
        pict[3].x_array_index = [0,0]
        pict[3].y_array_index = [0,1]

 END
 

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 13-Oct-1997 15.10 Part 1X 1Y corrected 22.10 ytitle corrected 1998-Jan-15 plot.xgap sey to 8640000.d 1998-Mar-03 the case of 1X and 1Y axis is corrected in case of plot.x_array_index and y_array_index 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\do_plxy.pro)


DO_PLXY_INSTRUCTIONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	do_plxy_instructions

 PURPOSE:
   This is an instructions file for do_plxy

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   do_plxy_instructions,pict,init

 OUTPUTS:
   pict: an array of structures holding the informations for the plot
   init: a structure holding the informations to initialize a plot

 EXAMPLE:
   do_plxy,'do_plxy_instructions'
  gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 13-Oct-1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\do_plxy_instructions.pro)


DRAW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DRAW
 PURPOSE:
       Graphics draw from last point to given point.
 CATEGORY:
 CALLING SEQUENCE:
       draw, x, y
 INPUTS:
       x,y = scalar coordinates of point to draw to.   in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c color of line from last point.
 OUTPUTS:
 COMMON BLOCKS:
       move_com
 NOTES:
       Note: see move.
 MODIFICATION HISTORY:
       R. Sterner, 22 Jan, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\draw.pro)


DRAWCOLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DRAWCOLORS

 FILENAME:

   drawcolors__define.pro

 PURPOSE:

   The purpose of this object program is provide a flexible way
   to handle and select drawing colors. The program combines
   features of two previous programs: GetColor and PickColor,
   as well as adding features of its own. Sixteen original
   colors are supplied, but users can create any color they
   wish using the tools provided.

   By default, these 16 colors are defined: Black, Magenta, Cyan, Yellow,
   Green, Red, Blue, Navy, Aqua, Pink, Orchid, Sky, Beige, Charcoal, Gray, White.

 AUTHOR:
   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   2642 Bradbury Court
   Fort Collins, CO 80521 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   colors = Obj_New('DRAWCOLORS')

 OPTIONAL INPUT PARAMETERS:

      IDL> colors = Obj_New('DRAWCOLORS', red, green, blue, names)

   RED -- A 16-element byte vector of red values for the drawing colors.

   GREEN -- A 16-element byte vector of green values for the drawing colors.

   BLUE -- A 16-element byte vector of blue values for the drawing colors.

   NAMES -- A 16-element string vector of names for the drawing colors.

   By default, these colors are defined: Black, Magenta, Cyan, Yellow,
   Green, Red, Blue, Navy, Aqua, Pink, Orchid, Sky, Beige, Charcoal, Gray, White.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   If you are going to use the XCOLORS method, you will need
   the XColors program from the Coyote library:

     http://www.dfanning.com/programs/xcolors.pro

   The program is set up to handle 16 drawing colors. You may
   modify the program to have a different number, but you will
   have to modify the code in two places: (1) in the drawcolors__define
   module and (2) in the INIT method.

 FUNCTION METHODS:

   COLOR24 ***************************************************************************

      Purpose:

       Turns a color triple into the equivalent 24-bit color integer value that
       can be decomposed into the color.

      Definition:

          FUNCTION DrawColors::Color24, theColor

     Parameters:

        theColor -- A 3-element vector, representing a color triple.

     Example:

        yellow = colors->GetColor("yellow")
        yellow24 = colors->Color24(yellow)


   GETCOLOR ***************************************************************************

      Purpose:

       Returns the color triple, color index number, or the
       24-bit integer representation, of the asked for color. In
       normal operation, the colors are: Black, Magenta, Cyan, Yellow,
       Green, Red, Blue, Navy, Aqua, Pink, Orchid, Sky, Beige, Charcoal,
       Gray, and White.

      Definition:

          FUNCTION DrawColors::GetColor, theColor, startIndex, INDEXNUMBER=indexnumber, $
             TRUECOLOR=truecolor, AutoDetermine=autodetermine

     Parameters:

        theColor -- A string representing the "name" of the color. If the name
              can't be resolved or found, the first color is returned.

        startIndex -- If present, and INDEXNUMBER is set, the colors are loaded at
              this index number. Otherwise, the self.startIndex is used.

     Keywords:

        AUTODETERMINE -- If this keyword is set. the state of DECOMPOSITION is
             determined (IDL 5.2 and higher) and either the INDEXNUMBER or
             TRUECOLOR keyword is set appropriately. If the decomposition state
             cannot be determined, the INDEXNUMBER keyword is set.

        INDEXNUMBER -- If this keyword is set the colors are loaded and the
             index number of the color is returned.

        TRUECOLOR -- If this keyword is set, the color triple is converted into
             a 24-bit integer before being returned. This keyword is ignored
             if the INDEXNUMBER keyword is set.

     Examples:

        drawColor = colors->GetColor("yellow")
        drawColor = colors->GetColor("blue", /Indexnumber)
        drawColor = colors->GetColor("sky", /Truecolor)


   GETCOLORS **************************************************************************

      Purpose:

       Returns the color triples, the color index numbers of, or the
       24-bit integer representations of, all the colors.

      Definition:

          FUNCTION DrawColors::GetColors, startindex, INDEXNUMBER=indexnumber, $
             TRUECOLOR=truecolor, Structure=structure

      Parameters:

        startIndex -- If present, and INDEXNUMBER is set, the colors are loaded at
              this index number. If absent, startIndex = self.startIndex.

     Keywords:

        INDEXNUMBER -- If this keyword is set the colors are loaded and the
             index numbers of all the colors are returned.

        STRUCTURE -- If this keyword is set, the return value is a structure,
             where each field of the structure is a color name and the value
             of each field is either a color triple, an index number, or a
             24-bit color value, depending upon the state of other keywords.

        TRUECOLOR -- If this keyword is set, the color triples are converted to
             24-bit integers before being returned. This keyword is ignored
             if the INDEXNUMBER keyword is set.

     Examples:

        drawColors = colors->GetColors()  ; drawColors is a 16-by-3 byte array.
        drawColors = colors->GetColors(/IndexNumber) ; drawColors is a 16-element array of color indices.
        drawColors = colors->GetColors(/TrueColor) ; drawColors is a 16-element array of 24-bit integers.
        drawColors = colors->GetColors(/IndexNumber, /Structure) ; drawColors is a structure of index numbers.
        Plot, data, Color=drawColors.yellow, Background=drawColors.charcoal


   SELECT  **************************************************************************

      Purpose:

       Puts up a blocking or modal widget dialog, allowing the user to select
       from one of the 16 predefined colors available, or to mix their own color.
       The user-defined color triple is returned as a result of the function.

      Definition:

          FUNCTION DrawColors::Select, Color=currentColor, StartIndex=startIndex, $
             Title=title, Group_Leader=groupLeader, Cancel=cancelled, TrueColor=truecolor

     Keywords:

        CANCEL -- An output keyword that will return a value of 1 if the CANCEL
             button is selected or if program operation is interrupted in any way.

        COLOR -- The index number in the color table, where the current color
             will be mixed. In other words, this color index will change when
             the program is on the display. It will be restored to its previous
             or entry color when the program exits.

        GROUP_LEADER -- The group leader for the program. This keyword *must*
             be set if calling this method from within a widget program if you
             expect MODAL program operation.

        NAME -- If this keyword is set, the return value of the function is
             the "name" of the color.

        STARTINDEX -- This is the starting index in the color table where the
             16 predetermined colors will be loaded. The original colors will
             be restored when the program exits. By default, this is set to
             !D.Table-Size - (NCOLORS + 1).

        TITLE -- The title of the program. By default: "Pick a Color"

        TRUECOLOR -- If this keyword is set, the return value of the function
            is a 24-bit eqivalent integer rather than the color triple.

     Examples:

        newColor = colors->Select()  ; A blocking widget.
        newColor = color->Select(Group_Leader=event.top, Cancel=cancelled)
        IF NOT cancelled THEN TVLCT, newColor, info.dataColor



 PROCEDURE METHODS:

   GETPROPERTY ***********************************************************************

    Purpose:

       Allows the user to obtain the current properties of the object.

    Definition:

       PRO DrawColors::GetProperty, NAMES=names, RED=red, GREEN=green, BLUE=blue, $
           STARTINDEX=startindex, NCOLORS=ncolors

     Keywords:

        NAMES -- Returns the current names of the colors as a string array.

        RED -- Returns the current red values of the colors.

        GREEN -- Returns the current green values of the colors.

        BLUE -- Returns the current blue values of the colors.

        STARTINDEX -- Returns the current starting index in the color table.

        NCOLORS -- Returns the number of colors.

     Example:

        colors->GetProperty, Names=colorNames
        Print, colorNames


   LOADCOLORS ************************************************************************

      Purpose:

         Loads the predefined colors at a starting index.

      Definition:

         PRO DrawColors::LoadColors, startindex

     Parameters:

        STARTINDEX -- The starting color index in the color table. If not provided,
            is set to !D.Table_Size - (self.ncolors + 1).

     Example:

        colors->LoadColors, 16


   ORIGINALCOLORS *********************************************************************

      Purpose:

         Reloads the original 16 colors and their names

      Definition:

         PRO DrawColors::OriginalColors

     Parameters:

        None

     Example:

        colors->OriginalColors


   REFRESH ***************************************************************************

      Purpose:

         Refreshes the modal GUI with the current drawing colors.

      Definition:

         PRO DrawColors::Refresh

     Parameters:

        None

     Example:

        colors->Refresh


   SETPROPERTY ***********************************************************************

    Purpose:

       Allows the user to set the current properties of the object.

    Definition:

       PRO DrawColors::SetProperty, NAMES=names, RED=red, GREEN=green, BLUE=blue, $
           STARTINDEX=startindex, NCOLORS=ncolors

     Keywords:

        NAMES -- The current names of the colors as a string array.

        RED -- The current red values of the colors.

        GREEN -- The current green values of the colors.

        BLUE -- The current blue values of the colors.

        STARTINDEX -- The current starting index in the color table.

        NCOLORS -- The number of colors.

     Example:

        colorNames = 'Color ' + StrTrim(SIndGen(16),2)
        colors->SetProperty, Names=colorNames


   XCOLORS ***************************************************************************

      Purpose:

         Allows the user to select 16 new colors for the program by
         using the XCOLORS program. The XColors program must be
         somewhere in your !PATH.

      Definition:

         PRO DrawColors::XColors

     Parameters:

        None

     Example:

        colors->XColors

 TUTORIAL:

   Here is a short tutorial in how this object can be used. Note
   that this doesn't exhaust all the possibilities.

  1. Create the object.

     IDL> colors = Obj_New("DrawColors")

  2. Find out what colors it knows about.

     IDL> colors->GetProperty, Names=colorNames
     IDL> Print, colorNames

  3. Ask for a color by name and load it at a color
     index. Draw a plot in that color.

     IDL> yellow = colors->GetColor("yellow")
     IDL> TVLCT, yellow, 200
     IDL> Device, Decomposed=0
     IDL> Plot, Findgen(11), Color=200

  4. Do the same thing, but in DECOMPOSED color.

     IDL> Device, Decomposed=1
     IDL> green = colors->GetColor("green", /TrueColor)
     IDL> Plot, Findgen(11), Color=green

  5. Find the color index number of the sky blue color.

     IDL> Device, Decomposed=0
     IDL> skyIndex = colors->GetColor("sky", /IndexNumber)
     IDL> Plot, Findgen(11), Color=skyIndex

  6. Load all 16 drawing colors at color index 32.

     IDL> colors->LoadColors, 32
     IDL> CIndex ; If them, if you have CINDEX from my library.

  7. Get a structure of colors, with each field set to
     the appropriate index number of its associated color.

     IDL> Device, Decomposed=0
     IDL> col = colors->GetColors(/IndexNumber, /Structure)
     IDL> Plot, Findgen(11), Color=col.yellow, Background=col.charcoal

  8. Allow the user to select a color from a GUI, then
     load it and use it.

     IDL> Device, Decomposed=0
     IDL> theColor = colors->Select(Cancel=cancelled)
     IDL> IF NOT cancelled THEN TVLCT, theColor, 10
     IDL> Plot, Findgen(11), Color=10

  9. Allow the user to choose 16 new drawing colors.
     (Requires my XCOLORS program.)

     IDL> colors->XColors
     IDL> theseColors = colors->Select()

 10. Let the object decide according to the device decomposition
     state whether to return an index number or 24-bit value
     for the color.

     IDL> Plot, Findgen(11), Color=colors->GetColor('beige', /Autodetermine)

 11. Call the GUI from within a widget program and load the
     new color.

     newcolor = info.colors->Select(Group_Leader=event.top, $
        Cancel=cancelled)
     IF NOT cancelled THEN TVLCT, newcolor, info.drawColor

 12. Destroy the object.

     IDL> Obj_Destroy, colors


 MODIFICATION HISTORY:

   Written by: David Fanning, 9 NOV 1999.
   Added AUTODETERMINE keyword to the GetColor method. 10 NOV 1999. DWF.
   Added NAME keyword to SELECT method. 18 MAR 2000. DWF.
   Fixed a small bug in choosing the current color. 20 April 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\drawcolors__define.pro)


DRAWPOLY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DRAWPOLY
 PURPOSE:
       Draw a polygon using mouse.
 CATEGORY:
 CALLING SEQUENCE:
       drawpoly, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /CURVE draw a curve instead of a polygon.
         /DEVICE use device coordinates (def).
         /DATA use data coordinates.
         /NORMAL use normalized coordinates.
         /NOPLOT erase on exit (def=plot).
         COLOR=c outline or curve color (def=!p.color).
         THICK=t outline or curve thickness (def=0).
         LINESTYLE=s outline or curve line style (def=0).
         FILL=f polygon fill color (def= -1 = no fill).
 OUTPUTS:
       x,y = polygon vertices.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 Oct, 1990
       R. Sterner, 23 Oct, 1990 --- added some keywords.
       R. Sterner, 26 Feb, 1991 --- renamed from draw_polygon.pro
       R. Sterner, 1994 Mar 17 --- Default color=!p.color.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\drawpoly.pro)


DRAW_AXIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  draw_axis

 PURPOSE:
  This procedure draws the axes over an oplot. Normally this routines is used by plotxy, plot2d etc.
  if they are called after set_frame procedure

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
    draw_axis,PLOT,pl_xy,time=time,xrange=xrange,yrange=yrange,xstyle=xstyle

 INPUTS:
       plot:   The plot structure defined by pl_init
       pl_xy:  the siues structure
       time:   if set timeaxis is drawn
       xrange: submitted at the moment xrange to draw
       yrange: submitted at the moment yrange to draw
       xstyle: submitted at the moment xstyle to use

 PROCEDURE:
  This procedure is under construction



 MODIFICATION HISTORY:
  Written by: R.Bauer (ICG-1) 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\draw_axis.pro)


DROP_COMMENTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DROP_COMMENTS
 PURPOSE:
       Drop comment and null lines from a text array.
 CATEGORY:
 CALLING SEQUENCE:
       out = drop_comments(in)
 INPUTS:
       in = input text array.          in
 KEYWORD PARAMETERS:
       Keywords:
         IGNORE=ig  Text string of allowed comment characters.
           Default is ';*', so lines starting with the characters'
           * or ; in column 1 are considered comments and dropped.
         /NOTRIM  means don't do a strtrim on text array.
           By default any line with white space but no text is
           considered a null line and dropped.  If /NOTRIM is
           specified only true null lines are dropped.
         /TRAILING  means drop any trailing comments on each line.
           Be careful of the default comment characters for this.
         ERROR=err  Error flag: 0=OK, 1=All lines dropped.
         /QUIET  Means suppress error messages.
         INDEX=indx  Indices in original input of retained lines.
 OUTPUTS:
       out = processed text array.     out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 May, 1993
       R. Sterner, 1995 Jun 26 --- added keyword INDEX=indx.
       R. Sterner, 1995 Oct 27 --- added keyword /TRAILING.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\drop_comments.pro)


DTIME2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	dtime2js

 PURPOSE:
	This function translates the year ,month, day, hour, minute, second, millisecond to Julian Seconds or a
   string like 'YYYY-MM-DD HH:MM:SS mSc'

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result = dtime2js(y,m,d,s,hh,mm,ss,mi) or  Result = dtime2js('1997-06-13 13:31:13 313')

 INPUTS:
	y:  four digits for the year
       if y is a string the script goes in the char mode
	m:  the month
   d:  the day
   hh: the hours
   mm: the minutes
   ss: the seconds
   mi: the milliseconds

 OPTIONAL INPUTS:
	datstr:[obsolete] A string with the day time information
           Format is: 'YYYY-MM-DD hh:mm:ss mi'
           needed in the past to submit a string


 KEYWORD PARAMETERS:
	char: [obsolete] switch for the function to convert a string defined day time information
         was used in the past to switch between integer and string input


 OUTPUTS:
	This function returns the Julian Seconds of a day time Information


 EXAMPLE:
   Result = dtime2js(1997,6,13,13,31,13,313)
   Result=  -80476126.687D

   Result=dtime2js('1997-06-13 13:31:13 313')
   Result=  -80476126.687D


 MODIFICATION HISTORY:
 	Written by:	R.Bauer,  Sep., 18, 1996
               R.Bauer,  Jan.,  7, 1997 /char option added
               R.Bauer,  Aug., 14  1997 /Sep 2 easier handling of strings
               R.Bauer,  Mar.,  8  1998 internal variable y changed to yy


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\dtime2js.pro)


DT_TM_BRK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_BRK
 PURPOSE:
       Break a date and time string into separate date and time.
 CATEGORY:
 CALLING SEQUENCE:
       dt_tm_brk, txt, date, time
 INPUTS:
       txt = Input date and time string.               in
         May be an array.
 KEYWORD PARAMETERS:
 OUTPUTS:
       date = returned date string, null if no date.   out
       time = returned time string, null if no time.   out
 COMMON BLOCKS:
 NOTES:
       Note: works for systime: dt_tm_brk, systime(), dt, tm
         The word NOW (case insensitive) is replaced
         by the current sysem time.
 MODIFICATION HISTORY:
       R. Sterner. 21 Nov, 1988.
       RES 18 Sep, 1989 --- converted to SUN.
       R. Sterner, 26 Feb, 1991 --- renamed from brk_date_time.pro
       R. Sterner, 26 Feb, 1991 --- renamed from brk_dt_tm.pro
       R. Sterner, 1994 Mar 29 --- Allowed arrays.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_brk.pro)


DT_TM_CHK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_CHK
 PURPOSE:
       Check date & time string that both parts exist & are valid.
 CATEGORY:
 CALLING SEQUENCE:
       status = dt_tm_chk(txt)
 INPUTS:
       txt = Input data and time string.             in
 KEYWORD PARAMETERS:
 OUTPUTS:
       status = 1 if ok (true), 0 if error (false).  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 13 Apr, 1989.
       R. Sterner, 26 Feb, 1991 --- renamed from chk_date_time.pro
       R. Sterner, 27 Feb, 1991 --- renamed from chk_dt_tm.pro

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_chk.pro)


DT_TM_DIF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_DIF
 PURPOSE:
       Find time interval in seconds between two date/time strings.
 CATEGORY:
 CALLING SEQUENCE:
       sec = dt_tm_dif(t1, t2)
 INPUTS:
       t1, t2 = date and time strings.        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       sec = Time in seconds from t1 to t2.   out
 COMMON BLOCKS:
 NOTES:
       Note: date and time strings are strings like 21-Jan-1989 14:43:03
       The format of the date and time strings is flexable, see date2ymd.
 MODIFICATION HISTORY:
       R. Sterner. 12 Apr, 1989.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 26 Feb, 1991 --- Renamed from interval_sec.pro
       R. Sterner, 27 Feb, 1991 --- Renamed from interv_sec.pro

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_dif.pro)


DT_TM_FROMCR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_FROMCR
 PURPOSE:
       Convert from Carrington Rotation Number to Date/Time.
 CATEGORY:
 CALLING SEQUENCE:
       dt_tm = dt_tm_fromcr(cr)
 INPUTS:
       cr = Carrington Rotation Number.   in
 KEYWORD PARAMETERS:
       Keywords:
         /JS means return Julian Seconds, not date/time string.
 OUTPUTS:
       dt_tm = date/time string.          out
 COMMON BLOCKS:
 NOTES:
       Notes: Time is Ephemeris Time which is almost UT.
         Ref: Astronomical Algorithms, Jean Meeus.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jun 21

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_fromcr.pro)


DT_TM_FROMJS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_FROMJS
 PURPOSE:
       Convert "Julian Seconds" to a date/time string.
 CATEGORY:
 CALLING SEQUENCE:
       dt = dt_tm_fromjs(js)
 INPUTS:
       js = "Julian Seconds".      in
 KEYWORD PARAMETERS:
       Keywords: 
         FORMAT=fmt format for dt (see dt_tm_mak).
           Def = "Y$ n$ d$ h$:m$:s$ w$"
         /FRACTION displays fraction of second in default format.
         DECIMAL=dp  Number of decimal places to use for fraction of
           second (def=3) for f$ in format.  f4 will include dec pt.
         DENOMINATOR=den If given then fraction is listed as nnn/ddd
           ddd is given by den.  Over-rides DECIMAL keyword.  Ex:
           DENOM=1000 might give 087/1000 for f$ in format.
         DDECIMAL=ddp  Number of decimal places to use in day
           of year (if doy$ included in format, def=none).
         YEAR=yy returns extracted year.
         MONTH=mm returns extracted month.
         DAY=dd returns extracted day.
         SECOND=ss returns extracted seconds after midnight.
         JD=jd  returns extracted Julian Day of date.
         NUMBERS=st Returned structure with numeric values.
 OUTPUTS:
       dt = date/time string.      out
 COMMON BLOCKS:
 NOTES:
       Notes: Julian seconds (not an official unit) serve the
         same purpose as Julian Days, interval computations.
         The zero point is 0:00 1 Jan 2000, so js < 0 before then.
         Julian Seconds are double precision and have a precision
         better than 1 millisecond over a span of +/- 1000 years.
       
       See also dt_tm_tojs, ymds2js, js2ymds, jscheck.
 MODIFICATION HISTORY:
       R. Sterner, 3 Sep, 1992
       R. Sterner, 18 Aug, 1993 --- Added JD keyword.
       R. Sterner, 2 Dec, 1993 --- Changed default format.
       R. Sterner, 1998 Apr 15 --- Returned NUMBERS structure.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_fromjs.pro)


DT_TM_FULL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_FULL
 PURPOSE:
       Add missing parts of date to get a full date/time string.
 CATEGORY:
 CALLING SEQUENCE:
       out = dt_tm_full(in,miss)
 INPUTS:
       in = input date/time string.                     in
          May have missing date info: '12:34' 'May 7 7:00'
       miss = Desired year, month, day in that order.   in
          Like '1996 May 12'.  Default=current date.
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  0 if ok, 1 if result is not a valid date/time.
 OUTPUTS:
       out = Full date/time string.                     out
          Like '1996 May 12 12:34' or '1996 May 7 7:00'
 COMMON BLOCKS:
 NOTES:
       Notes: for scalar value only.  Does only limited error
         checking.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Jul 10

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_full.pro)


DT_TM_INC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_INC
 PURPOSE:
       Increment a date/time by a given number of seconds.
 CATEGORY:
 CALLING SEQUENCE:
       dt_tm_inc, t, s
 INPUTS:
       s = Time in seconds to add.      in
 KEYWORD PARAMETERS:
       Keywords:
         FORMAT = format string.  Allows output date to be customized.
         The default format string is 'y$ n$ d$ h$:m$:s$'
            The following substitutions take place in the format string:
         Y$ = 4 digit year.
         y$ = 2 digit year.
         N$ = full month name.
         n$ = 3 letter month name.
         d$ = day of month number.
         W$ = full weekday name.
         w$ = 3 letter week day name.
         h$ = hour.
         m$ = minute.
         s$ = second.
         @  = Carriage Return.
         !  = Line feed.
         Some examples: 'h$:m$:s$' -> 09:12:04,
         'd$ n$ Y$' -> 12 Jan 1991, 'd$D h$h' -> 3D 2h, ...
 OUTPUTS:
       t = date and time string.        in, out
         date/time strings are strings like 21-Jan-1989 14:43:03
         The format of the date and time strings is flexible, see date2ymd.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Apr, 1989.
       RES 25 Oct, 1991 --- renamed and rewrote from incsec_datetime.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_inc.pro)


DT_TM_MAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_MAK
 PURPOSE:
       Set up a time and date string from reference JD and offset.
 CATEGORY:
 CALLING SEQUENCE:
       s = dt_tm_mak(jd0, [sec])
 INPUTS:
       jd0 = Julian Date of a reference date (0:00 hr).  in
       sec = Seconds since JD0 at 0:00.                  in
 KEYWORD PARAMETERS:
       Keywords:
         NUMBERS=st Structure with numeric values, useful at times.
         FORMAT = format string.  Allows output date to be customized.
         The default format string is 'Y$ n$ d$ h$:m$:s$ w$'
            The following substitutions take place in the format string:
         Y$ = 4 digit year.
         y$ = 2 digit year.
         N$ = full month name.
         n$ = 3 letter month name.
         0n$= month as a 2 digit number: Jan=1, Feb=2, Dec=12.
         d$ = day of month number.
         0d$= 2 digit day of month number.
         doy$= 3 digit day of year (see DDECIMAL below).
         W$ = full weekday name.
         w$ = 3 letter week day name.
         0w$ = week day number: Sun=1, Mon=2, ... Sat=7.
         h$ = hour.
         m$ = minute.
         s$ = second.
         f$ = fraction of second (see DECIMAL, DENOMINATOR below).
         I$ = time interval in days to 2 decimal places.
         i$ = time interval in days as an integer.
           I$ and i$ apply to sec in dt_tm_mak only.
         H$ = time interval in integer hours.
         sam$ = Time in seconds after midnight (DECIMAL works here).
         @  = Carriage Return.
         !  = Line feed.
        DECIMAL=dp  Number of decimal places to use for fraction of
          second (def=3) for f$ in format.  f$ will include dec pt.
          Also applies to fraction shown in sam$.
        DENOMINATOR=den If given then fraction is listed as nnn/ddd
          ddd is given by den.  Over-rides DECIMAL keyword.  Ex:
          DENOM=1000 might give 087/1000 for f$ in format.
        DDECIMAL=ddp Num of dec places in Day of Year (def=none).
 OUTPUTS:
       s = resulting string.                             out
 COMMON BLOCKS:
 NOTES:
       Notes: Some examples: 'h$:m$:s$' -> 09:12:04,
         'd$ n$ Y$' -> 12 Jan 1991, 'd$D h$h' -> 3D 2h, ...
 MODIFICATION HISTORY:
       R. Sterner.  17 Nov, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES  20 Apr, 1989 --- 2 digit year.
       R. Sterner, 26 Feb, 1991 --- Renamed from time_date_str.pro
       R. Sterner, 27 Feb, 1991 --- Renamed from tm_dt_str.pro
       R. Sterner, 28 Feb, 1991 --- changed format.
       R. Sterner, 17 Jun, 1992 --- fixed a bug for large sec.
       R. Sterner, 27 Sep, 1993 --- Modified to handle arrays.
       R. Sterner,  2 Dec, 1993 --- Slightly modified def format.
       R. Sterner, 1994 Jun 15 --- Added fraction of second.
       R. Sterner, 1995 Mar  8 --- Added i$ format.
       R. Sterner, 1995 Jul  6 --- Added 0d$ format.
       R. Sterner, 1997 Feb  3 --- Added new keywords 0n$ and doy$ to
       give month as 2 digit number and day of year.
       Matthew Savoie, Systems Technology Associates --- 1997 Feb 5
       fixed a bug by adding floor to: days = long(floor(idays)).
       R. Sterner, 1997 Dec 18 --- Added DDECIMAL=ddec for number of
       decimal places in Day of Year.
       R. Sterner, 1998 Apr 14 --- added sam$ format.
       R. Sterner, 1998 Apr 15 --- Added returned numeric structure.
       R. Sterner, 1998 May 21 --- Fixed a bug found by Dave Watts and
       Damian Murphy that caused a lost second sometimes.
       R. Sterner, 1998 Jul 15 --- A bug was fixed by Tami Kovalick,
       Raytheon STX, 2 digit years failed beyond 1999.
       R. Sterner, 1998 Aug 10 --- Fixed a bug in the way structures are
       indexed for single values.
       R. Sterner, 2000 Jan 03 --- Fixed a problem that came up when year
       ended in 0.  Might even be a touch faster.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_mak.pro)


DT_TM_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_RANGE
 PURPOSE:
       Extract date/time range from string with two date/times.
 CATEGORY:
 CALLING SEQUENCE:
       dt_tm_range, in,js1,js2
 INPUTS:
       in = input string with 2 date/time strings.         in
         Must both have same form (at least same length).
 KEYWORD PARAMETERS:
       Keywords:
         MISSING=def  Defaults for missing date values:
           Must be string with year, month, day in that order.
           Ex: miss='1996 May 12'
           Default for MISSING is current day.
           ERROR=err  Error flag: 0=ok.
 OUTPUTS:
       js1, js2 = returned times as Julian Seconds.        out
 COMMON BLOCKS:
 NOTES:
       Notes: Tries to split input string into 2 equal parts.
         Missing year, month, or day may be added from default.
         If second time is before first then 1 day is added.
         This allows time ranges with only times, default
         applies to first day.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Nov 4

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_range.pro)


DT_TM_TOCR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_TOCR
 PURPOSE:
       Convert from Date/Time to Carrington Rotation Number.
 CATEGORY:
 CALLING SEQUENCE:
       cr = dt_tm_tocr(dt_tm)
 INPUTS:
       dt_tm = date/time string (or JS).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       cr = Carrington Rotation Number.   out
 COMMON BLOCKS:
 NOTES:
       Notes: Time is Ephemeris Time which is almost UT.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jun 21

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_tocr.pro)


DT_TM_TOJS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DT_TM_TOJS
 PURPOSE:
       Convert a date/time string to "Julian Seconds".
 CATEGORY:
 CALLING SEQUENCE:
       js = dt_tm_tojs( dt)
 INPUTS:
       dt = date/time string (may be array).   in
            (see date2ymd for format)
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  Error flag: 0=ok, else error.
         /QUIET means inhibit error message.
 OUTPUTS:
       js = "Julian Seconds".                  out
 COMMON BLOCKS:
 NOTES:
       Notes: Julian seconds (not an official unit) serve the
         same purpose as Julian Days, interval computations.
         The zero point is 0:00 1 Jan 2000, so js < 0 before then.
         Julian Seconds are double precision and have a precision
         better than 1 millisecond over a span of +/- 1000 years.
       
         2 digit years (like 17 or 92) are changed to the closest
         corresponding 4 digit year.
       
       See also dt_tm_fromjs, ymds2js, js2ymds, jscheck.
 MODIFICATION HISTORY:
       R. Sterner, 23 Jul, 1992
       R. Sterner, 1994 Mar 29 --- Modified to handle arrays.
       R. Sterner, 1999 aug 04 --- Improved 2 digit year case.
       R. Sterner, 2000 aug 17 --- Added /QUIET

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\dt_tm_tojs.pro)


DUMP2FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Dump2File

 PURPOSE:
	This procedure writes a variable into an ascii file

 CATEGORY:
	DATAFILES

 CALLING SEQUENCE:
	Dump2File, var, file, [/APPEND], [FORMAT = fmt]

 INPUTS:
	var:	variable which should be written to an ascii file
	file:	name of ascii file

 KEYWORD PARAMETERS:
	/APPEND: If set var will be appended to file
	FORMAT = fmt: Format string for formatted output of var

 EXAMPLE:
	a = findgen(10)
	Dump2File, TRANSPOSE(a), 'test.txt', FORMAT = '(5X, F4.1)'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 03. Sep. 1998
	21.01.99:	debug statement removed
					'Data were dumped into file ' message removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\dump2file.pro)


DXBREAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXBREAK

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Sets an IDL breakpoint

 CALLING SEQUENCE:
   DXBREAK, LINE                        ; current procedure (OR)"
   DXBREAK, 'PROCNAME', LINE            ; named procedure (OR)"
   DXBREAK, 'path/procname.pro', LINE   ; procedure path (OR)"
   DXBREAK, PROCNAME, LINE              ; without quotes"

 DESCRIPTION: 

   DXBREAK is a convenience routine for setting IDL breakpoints.

   The benefits over the built-in IDL procedure BREAKPOINT are:
     * fewer characters to type;
     * full pathname not required, just a procedure name; and
     * for breakpoints within the current procedure, the file name 
       is not needed.

   To clear breakpoints, use either DXCLEAR or BREAKPOINT, /CLEAR.

 INPUTS:

   LINE - the line number where the breakpoint is to be set.  This
          value is required.

   PROCNAME - the procedure name in which the breakpoint is to be
              set.  Note that IDL requires that a procedure be
              compiled on disk -- console-compiled or .RUN files
              cannot have breakpoints set.

              The name is one of:
                * the procedure or function name;
                * the full path to the procedure or function; OR
                * an unquoted procedure or function name.

              DXBREAK will search your path to find the correct
              procedure.  The first file found will be used.


 KEYWORDS:

   ONCE - if set, then the breakpoint will only occur once.  The same
          as the ONCE keyword to BREAKPOINT.

   IS_FUNCTION - if set, and there is an ambiguity between whether
                 PROCNAME is a procedure or a function, then DXBREAK
                 will assume that it is a function.

 EXAMPLE:

   dxbreak, 'myfunc', 50

   Set breakpoint in MYFUNC at line 50.

 SEE ALSO:

   BREAKPOINT, DXCLEAR

 MODIFICATION HISTORY:
   Written, 15 Apr 2000
   Addition of NOCATCH keyword for internal testing, 21 Sep 2000, CM
   Made mostly compatible with IDL v4, 21 Sep 2000, CM
   Added AFTER keyword, 13 Dec 2000, CM
   Removed AFTER, use _EXTRA instead, 08 Apr 2001, CM

  $Id: dxbreak.pro,v 1.4 2001/04/08 16:59:55 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxbreak.pro)


DXCLEAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXCLEAR

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Clears an IDL breakpoint

 CALLING SEQUENCE:
   DXCLEAR, INDEX

 DESCRIPTION: 

   DXBREAK is a convenience routine for clearing IDL breakpoints.
   Its primary benefits are that it is symmetric with DXBREAK, and it
   requires fewer characters to type.

 INPUTS:

   INDEX - the breakpoint number, as listed by HELP, /BREAKPOINT.


 EXAMPLE:

   dxclear, 0

   Clear breakpoint number 0

 SEE ALSO:

   BREAKPOINT, DXBREAK

 MODIFICATION HISTORY:
   Written, 15 Apr 2000


  $Id: dxclear.pro,v 1.2 2001/02/09 04:57:15 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxclear.pro)


DXCOMMON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXCOMMON

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Defines DEBUG_LEVEL common block (INTERNAL)

 DESCRIPTION: 

   This code fragment defines the DEBUG_LEVEL common block.  This
   common is internal to the debugging procedures.

  $Id: dxcommon.pro,v 1.2 2001/02/09 04:57:15 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxcommon.pro)


DXDOWN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXDOWN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Move the debugging focus deeper down the IDL call stack

 CALLING SEQUENCE:
   DXDOWN [ , NLEVELS ]

 DESCRIPTION: 

   DXDOWN moves the debugging "focus" deeper down the IDL call stack.
   By using this procedure and DXUP, one can navigate up and down an
   existing call stack, and examine and set variables at various
   levels.

   While IDL always keeps the command line at the deepest call level
   (i.e., where the breakpoint occurred), DXDOWN and its related
   debugging procedures maintain a separate notion of which part of
   the call stack they are examining -- the debugging "focus."

   DXDOWN moves the debugging focus deeper by at least one level, but
   never beyond the deepest level.

 INPUTS:

   NLEVELS - option number of levels to move.  Default (and minimum)
             value is 1.

 EXAMPLE:

   dxdown

   Move the debugging focus down one level.

 SEE ALSO:

   DXUP, DXDOWN, DXGET, DXSET

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxdown.pro,v 1.2 2001/02/09 04:57:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxdown.pro)


DXFINISH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXFINISH

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Sets an IDL breakpoint to stop upon return of the current procedure

 CALLING SEQUENCE:
   DXFINISH [ , NLEVELS ]

 DESCRIPTION: 

   DXFINISH is a convenience routine for setting IDL breakpoints.

   DXFINISH sets a breakpoint so that when the current procedure
   finishes, execution will stop.  Often when debugging one wants to
   let the current procedure complete but stop at the next level.
   DXFINISH does exactly that.

   DXFINISH examines the state of the current IDL call stack,
   determines at what point the current procedure will return, and
   sets a breakpoint there.  Note that the procedure in which the
   breakpoint is set must be compiled and on disk.

   By default the breakpoint is set with the ONCE keyword.

 INPUTS:

   NLEVELS - Number of call levels up to set breakpoint.  Default is
             1.

 KEYWORDS:

   ONCE - if set, then the breakpoint will only occur once.  Default
          value is SET, so ONCE=0 must be passed explicitly to
          disable this function.

 EXAMPLE:

   dxfinish

   Set breakpoint in calling procedure.

 SEE ALSO:

   BREAKPOINT, DXBREAK, DXCLEAR

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxfinish.pro,v 1.2 2001/02/09 04:57:16 craigm Exp $
  

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxfinish.pro)


DXGET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXGET

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Gets IDL variable from a different IDL call level

 CALLING SEQUENCE:
   RESULT = DXGET('NAME')  ; quoted variable name (OR)
   RESULT = DXGET(NAME)    ; unquoted variable name

 DESCRIPTION: 

   DXGET retrieves a variable value from any point in the IDL call
   stack.  The DXGET and DXSET routines allow any variable at any
   level to be examined and changed.

   The call level to be examined is determined by the current
   debugging "focus."  By default this is the deepest level in the
   call stack -- where the breakpoint occurred.  However, this level
   can be changed by using the DXUP and DXDOWN procedures.

   If the variable doesn't exist, then an error message is reported.

 INPUTS:

   NAME - the name of the variable, either quoted or unquoted.

 KEYWORDS:

   LEVEL - the call level to be examined, if not the current
           debugging focus.

 EXAMPLE:

   value = dxget('a')

   Retrieve the value of the variable A from the debugged call level.

 SEE ALSO:

   DXGET, DXSET, DXUP, DXDOWN

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxget.pro,v 1.2 2001/02/09 04:57:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxget.pro)


DXHELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXHELP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Perform HELP equivalent at any point in IDL call stack

 CALLING SEQUENCE:
   DXHELP, X0, X1, ..., [ LEVEL=LEVEL ]

 DESCRIPTION: 

   DXHELP performs the equivalent of HELP for the variables at any
   level in the IDL call stack.

   The call level to be examined is determined by the current
   debugging "focus."  By default this is the deepest level in the
   call stack -- where the breakpoint occurred.  However, this level
   can be changed by using the DXUP and DXDOWN procedures.

   If the ALL keyword is set, then all variables are examined.

 INPUTS:

   Xi - variables to be examined, either quoted or unquoted.
        Non-string expressions are diagnosed, but of course refer to
        the deepest call level.  If the ALL keyword is set then the
        Xi parameters are ignored.

 KEYWORDS:

   LEVEL - the call level to be examined, if not the current
           debugging focus.

   ALL - if set, then all variables at the current focus level are
         examined.


 EXAMPLE:

   dxhelp

   Print all variables at current debugging focus level

 SEE ALSO:

   DXUP, DXDOWN, DXHELP, DXPRINT

 MODIFICATION HISTORY:
   Written, 15 Apr 2000
   Added ALL keyword; changed N_PARAMS() EQ 0 behavior, CM 17 Apr
     2000
   DXHELP_VALUE now prints correct string and byte values, CM 23 Apr
     2000
   Add support for printing structures with FULL_STRUCT, CM 08 Feb
     2001
   Added forward_function for DXHELPFORM, CM 08 Apr 2001
   Print more info about POINTER type, CM 30 Apr 2001
   

   $Id: dxhelp.pro,v 1.5 2001/04/30 15:26:53 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxhelp.pro)


DXLRESET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXLRESET

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Reset the current debugging focus level (INTERNAL)

 CALLING SEQUENCE:
   DXLRESET

 DESCRIPTION: 

   DXLRESET resets the current debugging focus level, if it has
   changed.  This routine is internal to the debugging procedures.

 SEE ALSO:

   DXUP, DXDOWN, DXGET, DXSET

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxlreset.pro,v 1.2 2001/02/09 04:57:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxlreset.pro)


DXPLEVEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXPLEVEL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Print the current call stack (INTERNAL)

 CALLING SEQUENCE:
   DXPLEVEL

 DESCRIPTION: 

   DXLRESET prints the current call stack, and highlights the
   debugging focus level.This routine is internal to the debugging
   procedures.

 SEE ALSO:

   DXUP, DXDOWN, DXGET, DXSET

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxplevel.pro,v 1.2 2001/02/09 04:57:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxplevel.pro)


DXPRINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXPRINT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Perform HELP equivalent at any point in IDL call stack

 CALLING SEQUENCE:
   DXPRINT, X0, X1, ... [, LEVEL=LEVEL, FORMAT=FORMAT ]

 DESCRIPTION: 

   DXPRINT prints the values of variables from any level in the IDL
   call stack.

   The call level to be examined is determined by the current
   debugging "focus."  By default this is the deepest level in the
   call stack -- where the breakpoint occurred.  However, this level
   can be changed by using the DXUP and DXDOWN procedures.

 INPUTS:

   Xi - variables to be printed, unquoted.  Non-string expressions
        are printed, but of course refer to the deepest call level.

 KEYWORDS:

   LEVEL - the call level to be examined, if not the current
           debugging focus.

   FORMAT - format string to be applied to data values.


 EXAMPLE:

   dxprint, a, b

   Print A and B from the current debugging focus level

 SEE ALSO:

   DXUP, DXDOWN, DXHELP, DXPRINT

 MODIFICATION HISTORY:
   Written, 15 Apr 2000
   Corrected FORMAT statement, 30 Jun 2001

  $Id: dxprint.pro,v 1.3 2001/06/30 19:56:04 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxprint.pro)


DXPTRACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXPTRACE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Parse the current call stack (INTERNAL)

 CALLING SEQUENCE:
   RESULT = DXPTRACE(STRING)

 DESCRIPTION: 

   DXPTRACE is a function which parses the call stack, as returned by
   HELP, /CALL.  It is internal to the debugging routines.

 SEE ALSO:

   DXUP, DXDOWN, DXGET, DXSET

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxptrace.pro,v 1.2 2001/02/09 04:57:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxptrace.pro)


DXSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXSET

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Sets IDL variable in a different IDL call level

 CALLING SEQUENCE:
   DXSET, 'NAME', VALUE    ; quoted variable name (OR)
   DXSET,  NAME,  VALUE    ; unquoted variable name

 DESCRIPTION: 

   DXSET sets a variable value at any point in the IDL call stack.
   The DXGET and DXSET routines allow any variable at any level to be
   examined and changed.

   The call level to be examined is determined by the current
   debugging "focus."  By default this is the deepest level in the
   call stack -- where the breakpoint occurred.  However, this level
   can be changed by using the DXUP and DXDOWN procedures.

   If the variable doesn't exist, then an error message is reported,
   and the variable is not set.

 INPUTS:

   NAME - the name of the variable, either quoted or unquoted.

   VALUE - the new value of the variable.

 KEYWORDS:

   LEVEL - the call level to be examined, if not the current
           debugging focus.

 EXAMPLE:

   dxset, 'a', 5

   Set the value of the variable A to 5 in the currently debugged
   call level.

 SEE ALSO:

   DXGET, DXSET, DXUP, DXDOWN

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxset.pro,v 1.2 2001/02/09 04:57:18 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxset.pro)


DXUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   DXUP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Move the debugging focus higher up the IDL call stack

 CALLING SEQUENCE:
   DXUP [ , NLEVELS ]

 DESCRIPTION: 

   DXUP moves the debugging "focus" higher up the IDL call stack.  By
   using this procedure and DXDOWN, one can navigate up and down an
   existing call stack, and examine and set variables at various
   levels.

   While IDL always keeps the command line at the deepest call level
   (i.e., where the breakpoint occurred), DXUP and its related
   debugging procedures maintain a separate notion of which part of
   the call stack they are examining -- the debugging "focus."

   DXUP moves the debugging focus higher by at least one level, but
   never beyond the "root" $MAIN$ level.

 INPUTS:

   NLEVELS - option number of levels to move.  Default (and minimum)
             value is 1.

 EXAMPLE:

   dxup

   Move the debugging focus up one level.

 SEE ALSO:

   DXUP, DXDOWN, DXGET, DXSET

 MODIFICATION HISTORY:
   Written, 15 Apr 2000

  $Id: dxup.pro,v 1.2 2001/02/09 04:57:18 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\dxup.pro)


DYDX

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    dydx

 PURPOSE:    compute numerical derivative accurate to second order. 
             In most cases this should be more accurate than the 
             IDL userlib procedure DERIV.

 USEAGE:     dydx(x,y)

 INPUT:
    x        vector of independent variable (monitonic)
    y        vector of dependent variable

 KEYWORD INPUT:
   lin_end   if set, use a one sided linear approximation for end points

 OUTPUT:     numerical derivative dy/dx

 EXAMPLE:    
     !p.multi=[0,1,2]
     x=[0.,1.,3.,8.,10.,13.,17.,19.,22.,25.]
     y=x*(25-x) & yp=25-2*x & labels=['analytic','dydx','deriv']
     plot,x,y,title='quadratic [dydx(x,y) is exact in this case]'
     plot,x,yp & oplot,x,dydx(x,y),psym=2 & oplot,x,deriv(x,y),psym=4
     legend,labels,li=[0,0,0],psym=[0,2,4],pos=[0.5,0.7,0.75,0.98]

     x=[0.0,0.5,1.5,2.,3.,3.6,4.0,5.,6.,6.3]
     y=sin(x) & yp=cos(x) 
     plot,x,y,title='sin(x)'
     plot,x,yp & oplot,x,dydx(x,y),psym=2 & oplot,x,deriv(x,y),psym=4
     legend,labels,li=[0,0,0],psym=[0,2,4],pos=[0.25,0.7,0.50,0.98]

     x=[-2.,-1.,-.7,-.3,-.1,0.,.1,.3,.7,1.,2]
     y=exp(-x^2) & yp=-2*x*y
     plot,x,y,title='gausian'
     plot,x,yp & oplot,x,dydx(x,y),psym=2 & oplot,x,deriv(x,y),psym=4
     legend,labels,li=[0,0,0],psym=[0,2,4],pos=[0.5,0.7,0.75,0.98]
             

 REVISIONS:

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\dydx.pro)


EARTHDIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EARTHDIST

 PURPOSE:
       Calculate the great circle distance (in km) based on lats and lons.  

 CALLING SEQUENCE:
       dist = earthdist(lat1,lon1,lat2,lon2)

 INPUTS:
      lat1        latitude of first point
      lon1        longitude of first point
      lat2        latitude of second point
      lon2        longitude of second point

 KEYWORD INPUTS:

 OPTIONAL INPUTS:

 OUTPUTS:
       Distance along great circle returned.

 OPTIONAL OUTPUTS:

 EXAMPLE:
  
      print,earthdist(0,0,0,1)
      111.189

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  4/05/94

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\earthdist.pro)


EARTHRAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EARTHRAD
 PURPOSE:
       Return earth radius in specified units.
 CATEGORY:
 CALLING SEQUENCE:
       r = earthrad(units)
 INPUTS:
       units = Units for earth radius (def='radians').   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       r = returned earth radius in requested units.     out
 COMMON BLOCKS:
 NOTES:
       Notes: Available units (use 2 letters min):
         'radians' Radians (default).
         'degrees' Degrees.
         'nmiles'  Nautical miles.
         'miles'   Statute miles.
         'kms'     Kilometers.
         'meters'  Meters.
         'yards'   Yards.
         'feet'    Feet.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 03

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\earthrad.pro)


EASY_GET_AIX_SETTING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   easy_get_aix_setting

 PURPOSE:
   This procedure will type the contents of the file 'aix_setting.txt' into the log-window.

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   easy_get_aix_setting

 OUTPUTS:
   result: correct combination of path and file

 EXAMPLE:
   easy_get_aix_setting

 MODIFICATION HISTORY:
   Written by Franz Rohrer Jan 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\easy_get_aix_setting.pro)


EASY_PLOT_COMPLEX_EXAMPLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    easy_plot_complex_example

 PURPOSE:
   This is a complex example to show the capabilities of easy_plot

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   easy_plot_complex_example

 MODIFICATION HISTORY:
   Written by: Frank Holland, 15. Nov. 98.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\easy_plot_complex_example.pro)


EASY_PLOT_SIMPLE_EXAMPLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    easy_plot_simple_example

 PURPOSE:
   This is a simple example to show the capabilities of easy_plot

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   easy_plot_simple_example

 MODIFICATION HISTORY:
   Written by: Frank Holland, 15. Nov. 98.
		17.02.99:	Added a 2nd example

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\easy_plot_simple_example.pro)


EI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EI

 PURPOSE:
       Set the system variable to allow for large pasting of data using
       X.  Only necessary for the alphas.  This has the side effect of 
       not allowing use of the editing (arrow) keys.  This procedure
       toggles this ability on and off.  NOTE:  This is probably a bug
       in IDL and therefore the need for this procedure will disappear in
       the near future.

 CALLING SEQUENCE:
       ei

 INPUTS:

 OPTIONAL INPUTS:

 OUTPUTS:

 EXAMPLE:
     ei
     ... paste in large amts of data ...
     ei

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  1/04/94

 MODIFICATION HISTORY:

     Added change of prompt  Jeff Hicke   05/20/94

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ei.pro)


ELECTRON_MFP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ELECTRON_MFP

 PURPOSE:
 
	This function returns the elastic mean-free-path for electrons
	of energy E, in a material having density N, and atomic number Z.

 CALLING SEQUENCE:
 
	Result = ELECTRON_MFP(Z,A,RHO,E)

 INPUTS:
	
	Z = Atomic number
	
	A = Atomic weight (g/mole)
	
	RHO = Density (g/cm3)
	
	E = electron energy in keV

 OUTPUTS:
 
	This function returns the elastic mean-free-path, in angstroms.

 EXAMPLE:

       The elastic mean-free-path of tungsten (Z=74, Rho=19.35) at an
       electron energy of 100 keV = ELECTRON_MFP(74,183.85,19.35,100.)

 MODIFICATION HISTORY:
 
	Written by D. L. Windt, Bell Labs, June 1994
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\electron_mfp.pro)


ELLFIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ELLFIT
 PURPOSE:
       Fit an ellipse to a 2-d probability distribution.
 CATEGORY:
 CALLING SEQUENCE:
       ellfit, pd, xm, ym, ang, ecc, a, b
 INPUTS:
       pd = 2-d probability distribution.                  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       xm, ym = Mean X and Y coordinates (array indices).  out
       ang = angle of major axis (deg).                    out
       ecc = eccentricity of fitted ellipse.               out
       a, b = semimajor, semiminor axis of fitted ellipse. out
 COMMON BLOCKS:
 NOTES:
       Notes: An ellipse is fit by matching its moment of inertia
         to the given array.  A threshold image should be
         normalized to 1 before doing the fit, otherwise the
         ellipse will not be the correct size.
         See also genellipse.
         Here is a simple example:
           loadct,13
           d = rebin(shift(dist(200),100,100),200,400)
           z = rot(d,30) lt 50
           tvscl,z
           ellfit,z,xm,ym,ang,ecc,a,b
           genellipse,xm,ym,ang,a,b,x,y
           plots,x,y,/dev,color=!d.n_colors/2
 MODIFICATION HISTORY:
       R. Sterner.  10 June, 1986.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ellfit.pro)


ELLIPSE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ELLIPSE
 PURPOSE:
       Plot specified ellipse on the current plot device.
 CATEGORY:
 CALLING SEQUENCE:
       ellipse, a, b, tilt, a1, a2, [x0, y0]
 INPUTS:
       a = semi-major axis of ellipse (data units).                 in
       b = semi-minor axis of ellipse (data units).                 in
	[tilt] = angle of major axis (deg CCW from X axis, def=0).   in
       [a1] = Start angle of arc (deg CCW from major axis, def=0).  in
       [a2] = End angle of arc (deg CCW from major axis, def=360).  in
       [x0, y0] = optional arc center (def=0,0).                    in
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means use device coordinates .
         /DATA means use data coordinates (default).
         /NORM means use normalized coordinates.
         COLOR=c  plot color (scalar or array).
         LINESTYLE=l  linestyle (scalar or array).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: all parameters may be scalars or arrays.
 MODIFICATION HISTORY:
	D P Steele, ISR, 27 Oct. 1994: modified from ARCS.PRO by R. Sterner.
	Department of Physics and Astronomy
	The University of Calgary

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ellipse.pro)


ELLIPSE[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ELLIPSE
 VERSION:
		4.0
 PURPOSE:
		Draws an ellipse, around CENTER, with radii given by RADII, optionally
		rotating it by angle ROT.  The drawing is done in the currently
		defined plot area.  Alternatively, a *SHAPE* representation (see
		SHAPE_VER for definition) of the ellipse may be returned through the
		SHAPEOUT keyword.  DATA coordinate system is assumed unless specified
		otherwise by one of the keywords /DEVICE or /NORMAL.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		ELLIPSE, CENTER = CENT, RADII = RD, [, optional keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	CENTER
		2 dimensional vector, ellipse center location, format [x,y], mandatory.
	RADII
		2 dimensional vector, contains the x and y radii (in order), mandatory.
	ARC
		Optional.  Allows to draw an elliptical arc.  Accepts a vector of
		length 2 containing the start and end angles for the arc.  If only one
		value is provided, the arc is drown from angle 0 to this value if it is
		positive, or from this value to 0 if it is negative.  The angles are
		assumed to be in radians unless DEGREES is set.
	/DEGREES
		Switch.  Specifies that the rotation (and arc) angles are given in
		degrees.
	ROTATE
		Optional.  Angle of rotation in the mathematical positive direction.
		Assumed in radians, unless DEGREES is set.
	ROTATION_CENTER
		Optional.  Accepts a two element vector specifying the center of
		rotation.  Ignored if ROTATE is not given.  Defaults to center of shape.
	/FILL
		Switch.  Causes the ellipse to be filled with a solid pattern.
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.  See comment in RESTRICTIONS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable,on return the variable
		contains the *SHAPE* representation of the ellipse.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		If the DATA coordinate system is used and the plot area is defined with
		nonlinear (logarithmic) axes, the shape won't look like an ellipse.
		ELLIPSE calls either PLOTS or (when /FILL is used) POLYFILL.  Since
		some graphics keywords work only with PLOTS, or only with POLYFILL,
		some care must be exercised.
 PROCEDURE:
		Uses calls to DEFAULT, ONE_OF, SHAPE_COCON and SHAPE_TRANS from MIDL.
		Generates a (2,N) array containing a sufficient number of ellipse
		points to yield a smooth curve.  N is variable, depending both on the
		ellipse size and on the pixel size of the current output device.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-DEC-1991 by Mati Meron.  Added size and device dependence
		of the number of plot points.
		Modified 15-OCT-1992 by Mati Meron.  Added rotation.
		Modified 15-DEC-1993 by Mati Meron.  Now ELLIPSE takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Modified 1-MAY-1995 by Mati Meron.  Added capability to draw an
		elliptical arc.
		Modified 25-JUL-1999 by Mati Meron.  Added keyword SHAPEOUT.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\ellipse.pro)


EMBED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EMBED
 PURPOSE:
       Embed an array in a larger array.
 CATEGORY:
 CALLING SEQUENCE:
       b = embed(a,w)
 INPUTS:
       a = input array (2-d).                      in
       w = number of elements to add around edge.  in
 KEYWORD PARAMETERS:
       Keywords:
         VALUE=v.  Value for added border (def=0).
 OUTPUTS:
       b = resulting larger array with a centered. out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 13 Dec, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\embed.pro)


EMBEDSTR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  embedstr

 PURPOSE:
   This function attachs one stringarray to another stringarray reducing posibble n-dimensional fields to a vector

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	Result=embedstr(string1=string1,string2=string2)

 INPUTS:
   String1: first string array
   String2: second string array

 OUTPUTS:
   The function returns a stringarray where stringarray 1 is concatenaded
   to stringarray 2


 EXAMPLE:
   test1=sindgen(2,2)
   test2=sindgen(3)
   Result=embedstr(string1=test1,string2=test2)
   print,result
           0            1            2            3            0            1            2


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Jan. 3 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\embedstr.pro)


EMENSCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  emensch

 PURPOSE:
  This function can be used by 'axis' to define axis-labels in a better readable format

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
       emensch,axis,index,t

 INPUTS:
      axis  : for future use
      index : for future use
      t     : the value which should be formatted


 EXAMPLE:
       axis,xaxis=1,/xtype,xrange=[1e-4,10],xstyle=1,/save,xtickformat='emensch'

 MODIFICATION HISTORY:
  Written by: Franz Rohrer April 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\emensch.pro)


ENDIAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ENDIAN
 PURPOSE:
       Function indicating which endian the current machine uses.
 CATEGORY:
 CALLING SEQUENCE:
       f = endian()
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /LIST means list result to screen.
         /TEXT means return /LIST text.
 OUTPUTS:
       f = 0 if little, 1 if big.     out
 COMMON BLOCKS:
 NOTES:
       Note: this is the order the bytes are for multibyte
         numeric values.  Use the IDL procedure BYTEORDER
        to switch endian (use /LSWAP for 4 byte integers,
        /L64SWAP for 8 byte integers).
 MODIFICATION HISTORY:
       R. Sterner, 1999 Dec 13
       R. Sterner, 2000 Apr 11 --- Added /TEXT

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\endian.pro)


ENDPS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ENDPS

 PURPOSE:
         close postscript file, reopen display

 CALLING SEQUENCE:
       ENDPS

 INPUTS:

 KEYWORD INPUTS:
        notime     don't timestamp

 OPTIONAL INPUTS:

 OUTPUTS:

 OPTIONAL OUTPUTS:

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  9/22/92

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\endps.pro)


END_MPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   end_mplot

 PURPOSE:
   Restores default values of
   !P.MULTI, !X.OMARGIN, !Y.OMARGIN, !X.MARGIN, !Y.MARGIN
   which were changed in init_mplot

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   end_mplot [, save_sysvar]

 OPTIONAL INPUTS:
   save_sysvar: structure with the following tags (from init_mplot):
      pm:  !P.MULTI
      xom: !X.OMARGIN
      yom: !Y.OMARGIN
      xm:  !X.MARGIN
      ym:  !Y.MARGIN

      The system variables will be restored to these data.

 REVISION HISTORY:
       Written Theo Brauers, Frank Holland, June 1997
       02.02.2000: Added input parameter save_sysvar (FH)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\end_mplot.pro)


ENTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ENTER
 PURPOSE:
       Prompted entries allowing defaults. Help, IDL/DCL commands.
 CATEGORY:
 CALLING SEQUENCE:
       value = enter(type, prompt, default, [exit_flag, help_text])
 INPUTS:
       type = Data type to return.                     in
          Allowed types are:
          'STRING' = string
          'BYTE' = byte
          'INTEGER' = integer
          'LONG' = long integer
          'FLOAT' = float
          'DOUBLE' = double float
       prompt = prompt string.                         in
          Any occurence of $DEF in the prompt string
          is replaced by the default value, so the
          prompt message may display the default.
       default = default value.                        in
       help_text = text to display for ? command.      in
          String or string array for multiple lines.
          $DEF in the help string is replaced by
          the def. value.
 KEYWORD PARAMETERS:
 OUTPUTS:
       exit_flag = exit status flag.                   out
          Valid values are:
           0 = normal exit.
           1 = quit on return.
          -1 = backup to last entry.
          11 = invalid data type.
          12 = def. val. cannot convert to desired
               data type.
       value = returned value of desired type.         out
 COMMON BLOCKS:
 NOTES:
       Notes: The following commands are allowed as ENTER entries:
         Value requested.
         Null entry. Gives default value
           (for calling error may return error flag).
         Expressions. Processes given IDL expression.
         Q. Returns quit value (1) in exit flag.
         B. Returns backup value (-1) in exit flag.
         IDL statment. Executes given IDL statement.
         $ statement. Executes given shell statement.
 MODIFICATION HISTORY:
       R. Sterner.  17 Oct, 1986.
       RES 9 OCT, 1989 --- CONVERTED TO SUN.
       RES 13 Nov, 1989 --- put $DEF in prompt and help_text.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\enter.pro)


ENVELOPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ENVELOPE
 PURPOSE:
       Return the min/max envelope of a time series.
 CATEGORY:
 CALLING SEQUENCE:
       envelope, y, w, mn, mx, ind
 INPUTS:
       y = time series signal.                 in
       w = window width in samples.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       mn = array of mins in each window.      out
       mx = array of maxes in each window.     out
       ind = array of window midpoint indices. out
 COMMON BLOCKS:
 NOTES:
       Notes: data type of mn and mx are the same as
         input array y.
         To overplot envelope do:
           oplot,ind,mn & oplot,ind,mx
         To polyfill the envelope do:
           polyfill, [ind,reverse(ind)],[mn,reverse(mx)]
 MODIFICATION HISTORY:
       R. Sterner, 19 Sep, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\envelope.pro)


ENZ2HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   enz2html

 PURPOSE:
   write a html file with info of about an enzfile, produce
   overview plots of the datasets.

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   ENZ2HTML, file_name, html_name, ps_name

 INPUTS:
   file_name: the name of the enz data File

 OUTPUTS:
   ps_name: the name of the ps graph
   html_name: the name of the htmlfile

 MODIFICATION HISTORY:
   Written by: T.Brauers

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\enz2html.pro)


ENZTIME2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   enztime2js

 PURPOSE:
   converts time info in ENZ/ZEICHN file to julsec

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   Result = ENZTIME2JS(dvalue, ix, ref)

 INPUTS:
   dvalue:   array of values (output of IRZN)
   ix:       number of records (output of IRZN)
   ref:      reference date

 OUTPUTS:
   array with julian seconds

 EXAMPLE:
   IRZN, 'TEST.ZEICHN', dvalue, ix, iy, fb, text, header, err
   ref = text[0]
   js  = ENZTIME2JS(dvalue, ix, ref)

 REVISION HISTORY:
   Written         Theo Brauers, June 1997
   Corrected
   Revised     T.B. Sep 1997
   Revised     T.B. Oct 1997, renamed to enztime2js
   Modified    T.B. Feb 1999, new keywords Reference and nomessage
                              different interpretation reference date

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\enztime2js.pro)


ENZ_GET_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   enz_get_param

 PURPOSE:
   to read one parameter from a enz/zus-file and return the result as a ncdf-like structure

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   enz_get_param,file=file,name=name,inhalt=inhalt[,zus=zus][,fill_value=fill_value][,nocache=nocache]

 INPUTS:
   file   : file name
   name   : parameter name

 KEYWORD PARAMETERS:
    zus        : 0: enz-file (default)   1: zus-file
    fill_value : fill_value for irzn
    nocache    : to suppress caching of enz/zus-file

 OUTPUTS:
   inhalt : ncdf-like structure

 COMMENT:
   Has to be improved to handle other ncdf-tags as defined in ncdf-header

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by:     Franz Rohrer  Aug 1998
   Modified   7.10.98  FR nocache included

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\enz_get_param.pro)


ENZ_HEADER2NCDF_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	enz_header2ncdf_structure

 PURPOSE:
	This procedure converts the header of an enz file into ncdf structures

 CATEGORY:
	DATAFILES/FILTER

 CALLING SEQUENCE:
	enz_header2ncdf_structure, header, global_struc, time_struc, param_struc

 INPUTS:
	header: header of enz file as returned by cache_enz

 KEYWORD PARAMETERS:
	/NO_TIME_FLAG: If set time_struc will be returned without flag: 'INTERVAL_T'
	/VERBOSE: Informational messages will be issued by this program

 OUTPUTS:
	global_struc: structure with global attributes of the dataset as
		defined for the ICG structure. Also includes experiment specific information.
	time_struc: structure with time attributes of the dataset as
		defined for the ICG structure.
	param_struc: structure with parameter attributes of the dataset as
		defined for the ICG structure.

 RESTRICTIONS:
	The translation of the enz header into ncdf structures requires the
	following structure of the enz header:

	------------------------snip-------------------------------------------
	...							; any information (not considered)
	X_HEADER=NETCDF_GLOBAL
	...							; any entry (KEYWORD=VALUE) in this section
	...							; is translated into global_struc
	...							; if KEYWORD is identified as a valid global keyword.
	X_HEADER=NETCDF_EXPERIMENT
	...							; any entry (EXP_NAME: KEYWORD=VALUE) in this section
	...							; is translated into exp_struc which will be returned
	...							; as tag of global_struc.
	X_HEADER=NETCDF_TIME
	...							; any entry (KEYWORD=VALUE) in this section
	...							; is translated into time_struc
	...							; if KEYWORD is identified as a valid time keyword.
	X_HEADER=NETCDF_PARAMETER
	...							; any entry (KEYWORD=VALUE) in this section
	...							; is translated into param_struc
	...							; if KEYWORD is identified as a valid parameter keyword.
	X_HEADER=ENZ
	...							; any information (not considered)
	------------------------snip-------------------------------------------

 EXAMPLE:
	see ex_enz_header2ncdf_structure

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 24.06.1999
	25.06.1999: Kommentar eingefügt
	09.08.1999:	New keyword parameter NO_TIME_FLAG
	10.08.1999:	New keyword parameter VERBOSE
	25.10.1999: Bug removed if pstruc was not defined
	18.11.1999:	Bug removed if enz file was written by write_enz [() entries in header]
	10.03.2000:	Added X_HEADER = NETCDF_EXPERIMENT section for experiment specific information
	27.03.2000:	Extract allowed tag names from nc_def_... routines (code not activated yet)
	28.03.2000:	Added alias time tags

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\enz_header2ncdf_structure.pro)


ENZ_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ENZ_INFO

 PURPOSE:
       returns a structure with info about
       a ZEICHN file (KFA ICG3 data format)

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       file_info=ENZ_INFO(dvalue,ix,iy,fb,text,header,filename)

 INPUTS:
       the output of the irzn

 KEYWORD PARAMETERS:
   Keywords:
      fill_value: do not process data equal fill_value

 OPTIONAL INPUTS:

 OUTPUTS:
    a structure of info about a ncdf-file see create_info_struct for details
      .file_info.name           : name of file
      .file_info.filetype       : 'zus'
      .file_info.filedate       : date of file
      .record_info.jstime[0] : start-time in julian seconds (double)
      .record_info.jstime[1] : end-time in julian seconds   (double)
      .record_info.ntime[0]  : start-time in normal date and time (string)
      .record_info.ntime[1]  : end-time in normal date and time   (string)
      .record_info.n_records :number of rows
      .record_info.n_sets    :number of columns
      .pi.pi_name   :
      .pi.email     :
      .pi.phone_number :
      .pi.organisation :
      .hrefs.ps   : 'ps'  (reference to ps-file: filename+.ps )
      .hrefs.data : 'data'
      .hrefs.html : 'html' (reference to html-file: filename + .savinfo.html )
      .data.text   :string-array : description of a data columnstring-array
      .data.nvalid :array containing the number of valid values of a column
      .data.mean   :array containing the avarage values of a data column
      .data.median :array containing the median values of a data column
      .data.stdev  :array containing the standard deviation of a column
      .data.minimum:array containing the lowest values of a data column
      .data.maximum:array containing the greatest values of a data column
      .header.text :string array containing the header of the file (like output of IRZN)
      .experiment.text  :containing the text of structure experiment

 EXAMPLE:
       IRZN, filename, dvalue, ix, iy, fb, text, header, err
       file_info=ENZ_INFO(dvalue,ix,iy,fb,text,header,filename)

 REVISION HISTORY:
       Written         Marsy Lisken, June 1998
       Corrected                  10.7. 1998
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\enz_info.pro)


ENZ_NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     ENZ_NCDF

 PURPOSE:
     This Procedure generates the structure INHALT for an ENZ-file
     and writes it to a ncdf-file

 CATEGORY:
     DATAFILES/ZCHN

 CALLING SEQUENCE:
     enz_ncdf,fname,new_fname,fillvalue=xl,err,errmess=errmess,options

 INPUTS:
     fname:     the name of the ENZ-file (string-var)
     new_fname: the name of the ncdf-file (string-var)
                optional, default: new_fname=fname.nc
     options:   optional

 KEYWORD PARAMETERS:
     fillvalue: the numeric value for '====' input
                default: -12345
     errmess:   returns a error message
     nowrite:   no netcdf file will be written

 OUTPUTS:
     err:       flag indicating error  err=1 : no parameter
                                       err=2 : filesize <0      (output of IRZN)
                                       err=3 : no header found        (  "     )
                                       err=4 : number of columns=0    (  "     )
                                       err=5 : overwriting label      (  "     )
 OPTIONAL OUTPUTS:
 inhalt: the defined structure inhalt

 SIDE EFFECTS:
     uses the procedures IRZN, RPL_STR, HEADKEYS, ZCHN_KEYS
                         TENZ2JS,JS2INST
                         JD2YMD (Ray Sterner Lib)
                         @gen_inh2, NCDF_W, NCDF_CH

 EXAMPLE:
     ENZ_NCDF,'t.enz','test.nc',err

     result=f_history('test.nc') ---> (history contains the whole header)

 MODIFICATION HISTORY:
     Written       Theo Brauers, June 1997
     Completed     Marsy Lisken, January 1998
     Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\enz_ncdf.pro)


EOPDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   EOPDATA

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Read and interpolate tabulated earth orientation parameters

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   EOPDATA, JDUTC, PMX, PMY, UT1_UTC, DPSI, DEPS, $
        /RESET, FILENAME=, ANGUNITS=, TBASE=

 DESCRIPTION:

  The procedure EOPDATA reads, interpolates and returns Earth
  orientation parameters used for precision earth-base astronomy
  applications.

  ** NOTE: The user is responsible for downloading and maintaining an
  up-to-date file of earth orientation parameters from the
  International Earth Rotation Service.  See below. **

  This interface is somewhat provisional.  See OPEN QUESTIONS below.

  The values returned are described below.  These descriptions are
  taken from the Explanatory Supplement to IERS Bulletins A and B.

    * PMX and PMY, the coordinates of the Celestial Ephemeris Pole
      (CEP) relative to the earth-fixed International Reference Pole
      (IRP).  The x-axis is in the direction of the IERS Reference
      Meridian (IRM), the y-axis is in the direction 90 degrees West
      longitude.  The time series of PMX and PMY is referred to as
      "polar motion."

      These are the coordinates of the earth rotation pole, as seen
      in an *earth-fixed* coordinate system.  A station whose
      coordinates are given in earth-fixed coordinates referred to
      the ITRS can be transformed to the earth-fixed coordinates
      referred to the true rotation pole of date using the following
      matrix transformation:
            
             R_TRUE = RX(PMY) ## RY(PMX) ## R_ITRS

      where the matrices RX and RY are defined below.

    * UT1, the the rotation angle about the pole. It is related to
      the Greenwich mean sidereal time (GMST) by a conventional
      relationship (Aoki et al., 1982).  It gives access to the
      direction of the International Reference Meridian IRM in the
      ICRS, reckoned around the CEP axis. It is expressed as the
      difference UT1-UTC.  Thus, the value of UT1 is computed as:

          UT1 = UT1_UTC + UTC

      where UTC is the UTC time, expressed in seconds.

    * DPSI and DEPS are the offsets in longitude and obliquity of the
      celestial pole with respect to its direction defined using the
      conventional IAU precession/nutation theory.  An a priori
      correction model is available in the IERS Conventions (1996),
      (McCarthy, 1996).  The expressions to compute the nutation
      angles are:

          DEPS_TRUE = DEPS_1980 + DEPS    ;; Nutation in obliquity
          DPSI_TRUE = DPSI_1980 + DPSI    ;; Nutation in longitude

      where DPSI_1980 and DEPS_1980 are the nutation values
      determined from the IAU 1980 Nutation Theory; and DPSI_TRUE and
      DEPS_TRUE are the nutations to be used as arguments to further
      precession and nutation computations.

  For requested times which are between tabular values, a linear
  interpolation is performed.  This is not exactly the correct
  procedure, and can result in errors of +/- 0.1 mas in the earth
  polar motion and 1 usec in UT1 (see McCarthy & Gambis 1997).


 DATA FILES and MAINTENANCE

   The user is responsible for downloading and maintaining the earth
   orientation parameters file as supplied by the IERS.  The format
   of the files is the "Final" EOP data ASCII format.  They can be
   downloaded here:

      ftp://maia.usno.navy.mil/ser7/finals.all   ;; from May 1976-present
      ftp://maia.usno.navy.mil/ser7/finals.data  ;; from Jan 1992-present
   
   The user must place this file in a known location, and in *at
   least the first call*, this filename must be passed using the
   FILENAME keyword.

   EOPDATA will load the data once on the first call, and keep a
   cached copy for subsequent calls.  On a daily basis the file will
   be reloaded in case the quantities have been updated from the
   server.  A reload of data can be forced using the RESET keyword.

 ROTATION MATRICES

   The rotation matrices RX(T) and RY(T) mentioned above in relation
   to polar motion are:

      RX(T) =EQ= [[1,0,0], [0,cos(T),sin(T)], [0,-sin(T),cos(T)]]
      RY(T) =EQ= [[cos(T),0,-sin(T)], [0,1,0], [sin(T),0,cos(T)]]
      RZ(T) =EQ= [[cos(T),sin(T),0], [-sin(T),cos(T),0], [0,0,1]]

   and are meant to be applied to a vector R as, RX(T) ## R.


 OPEN QUESTIONS

   How will the transition to a new IERS EOP series be accomplished?
   Using a keyword?

   Should there be a quality flag?  The EOP file contains a
   "predicted" flag, and also there are rows which contain no value
   at all.  These should probably be flagged somehow.


 INPUTS:

   JDUTC - a vector or scalar, the UTC time for which earth
           orientation parameters are requested, expressed in Julian
           Days.  The value of the keyword TBASE is added to this
           quantity to arrive at the actual Julian date.

 OUTPUTS:

   PMX, PMY - the earth-fixed angular coordinates of the celestial
              ephemeris pole, measured in ANGUNITS units.

   UT1_UTC - the value of UT1 - UTC, expressed in seconds.

   DPSI, DEPS - the corrections to the IAU 1980 theory of Nutation,
                for nutation in longitude and obliquity, expressed in
                ANGUNITS units.

 KEYWORD PARAMETERS:

   FILENAME - scalar string, on the first call, the name of the file
              from which earth orientation parameters will be read.
              Default value: (none)

   TBASE - a fixed epoch time (Julian days) to be added to each value
           of JDUTC.  Since subtraction of large numbers occurs with
           TBASE first, the greatest precision is achieved when TBASE
           is expressed as a nearby julian epoch, JDUTC is expressed
           as a small offset from the fixed epoch.
           Default: 0

   ANGUNITS - scalar string, output units of angular parameters.
              Possible values are 'ARCSEC' or 'RADIAN'.
              Default value: 'RADIAN'

   RESET - if set, forces EOP file to be re-read.


 EXAMPLE:


 SEE ALSO:

   HPRNUTANG, TAI_UTC (Markwardt Library)
   PRECESS, PREMAT, JPRECESS, BPRECESS (IDL Astronomy Library)


 REFERENCES:

   Aoki, S., Guinot, B., Kaplan, G.H., Kinoshita, H., McCarthy, D.D.,
     Seidelmann, P.K., 1982: Astron. Astrophys., 105, 359-361.

   McCarthy, D. D. (ed.) 1996: IERS Conventions, IERS T.N. 21.
     http://maia.usno.navy.mil/conventions.html

   McCarthy, D. \& Gambis, D. 1997, "Interpolating the IERS Earth
     Orientation Data," IERS Gazette No. 13, 
     http://maia.usno.navy.mil/iers-gaz13
     Instructions for high precision EOP data interpolation, not done
     in this procedure.

   Ray, J. & Gambis, D. 2001, "Explanatory Supplement to IERS
     Bulletins A and B,"
     http://hpiers.obspm.fr/iers/bul/bulb/explanatory.html

     Explains meanings of earth orientation parameters used and
     returned by this procedure.

   Definition of Final EOP data format
     ftp://maia.usno.navy.mil/ser7/readme.finals

 MODIFICATION HISTORY:
   Written, 30 Jan 2002, CM
   Documented, 14 Feb 2002, CM
   Add default message, 01 Mar 2002, CM
   More robust handling of input file, 10 Mar 2002, CM

  $Id: eopdata.pro,v 1.4 2002/03/17 18:46:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\eopdata.pro)


EPSINIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPSINIT
 PURPOSE:
       Redirect plots and images to Encapsulated Postscript File.
 CATEGORY:
 CALLING SEQUENCE:
       epsinit, outfile
 INPUTS:
       outfile = EPS file name (def=idl.eps).          in
 KEYWORD PARAMETERS:
       Keywords:
         XSIZE=xsz  Plot size in X (def=6).
         YSIZE=xsz  Plot size in Y (def=6).
         /CM    Means size units are cm (else inches).
         /COLOR means do color PostScript (def is B&W).
         /VECTOR to use vector fonts instead of postscript fonts.
         /QUIET turns off epsinit messages.
 OUTPUTS:
 COMMON BLOCKS:
       eps_com,xsv,ysv,psv,dsv,ou
 NOTES:
       Notes: 8 bit gray scale or color is set.  Times Roman
         font is used.  To over-ride just use a call to device
         after epsinit to set desired values.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Aug 2

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\epsinit.pro)


EPSTERM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPSTERM
 PURPOSE:
       Terminate Encapsulated Postscript plotting.
 CATEGORY:
 CALLING SEQUENCE:
       epsterm
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET turns off epsterm messages.
 OUTPUTS:
 COMMON BLOCKS:
       eps_com,xsv,ysv,psv,dsv
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Aug 2

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\epsterm.pro)


EPS_GET_BOUNDINGBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   eps_get_boundingbox

 PURPOSE:
   This function returns the boundingbox of an eps file

 CATEGORY:
   PROG_TOOLS/EPS

 CALLING SEQUENCE:
  result=eps_get_boundingbox(eps_txt)

 INPUTS:
   eps_txt: This is the text of a eps file


 EXAMPLE:
  result=eps_get_boundingbox(get_file('idl.eps'))

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), 1999-Oct-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\eps_get_boundingbox.pro)


EPS_SET_BOUNDINGBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   eps_set_boundingbox

 PURPOSE:
   This Routine exchanges the boundingbox variable of an eps file

 CATEGORY:
   PROG_TOOLS/EPS

 CALLING SEQUENCE:
  eps_set_boundingbox,eps_txt,boundingbox

 INPUTS:
   eps_txt: This is the text of a eps file
   boundingbox: the boundingbox to set

 OUTPUTS:
   This routine replaces the boundingbox

 EXAMPLE:
   txt=eps_set_boundingbox(get_file('idl.eps'),[20, 100, 551, 525])

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), 1999-Sep-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\eps_set_boundingbox.pro)


EQV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EQV
 PURPOSE:
       Interactive equation viewer and curve fitter.
 CATEGORY:
 CALLING SEQUENCE:
       eqv
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FILE=filename  Name of equation file to view.
         LIST=list  List of equation file names.  If LIST is
           given then FILE is ignored.
         XS=x, YS=y  Optional arrays of scatterplot points.
           Useful for interactive curve fitting.
         PSYM=p  Scatter plot symbol (def=2 (*)).
         SNAPSHOT=file  name of snapshot file (def=snapshot.eqv).
         TITLE=tt  plot title (over-rides value from eqv file).
         XTITLE=tx  X axis title (over-rides value from eqv file).
         YTITLE=ty  Y axis title (over-rides value from eqv file).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 26 Oct, 1993
	R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\eqv.pro)


EQV2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EQV2
 PURPOSE:
       Interactively plot a function on current plot.
 CATEGORY:
 CALLING SEQUENCE:
       eqv2, file
 INPUTS:
       file = equation file.   in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=clr  Plot color (def=!p.color).
         TOP=top    Returns widget ID of top level base.
           Use widget_control to retrieve or store info structure.
         OK=wid  Given ID of widget to notify when OK button pressed.
           If not given no OK button is displayed.
         WID_OK=wid  Widget ID of the OK button.
           Can use to set /input_focus.
         GROUP_LEADER=grp  Set group leader.
 OUTPUTS:
 COMMON BLOCKS:
       eqv2_help_com
       eqv2_help_com
 NOTES:
       Note: The QUIT button allows burning in the final curve and lists its
         values.  The LIST button lists the current curve parameters.
       
       Equation file format: This file defines the equation, the x range
       and range of each adjustable parameter. The file is a text file with
       certain tags. Null and comment lines (* in first column) are allowed.
       The tags are shown by an example:
          eq: y = a + b*x + c*x^2
          title:  Parabola
          xrange:  -10 10
          n_points:  100
          par:  a -50 50 0
          par:  b -50 50 0
          par:  c -10 10 1
       
       The parameter tags are followed by 4 items:  Parameter name (as in the
       equation), min value, max value, initial value.  An optional 5th item
       may be the word int to force an integer value (for flags or harmonics).
 MODIFICATION HISTORY:
       R. Sterner, 1998 Feb 24
       R. Sterner, 1998 Apr  1 --- Added /NO_BLOCK to xmanager.
       R. Sterner, 1998 May 12 --- Added plot color.  Also added TOP=top.
       R. Sterner, 1998 May 13 --- Added OK button to signal other program.
       Also GROUP_LEADER.
       R. Sterner, 1998 May 14 --- Added LOCK=lck and UNLOCK=ulck to
       eqv2_set_val and eqv2_get_val.  Locks parameters.
       R. Sterner, 1998 Oct 27 --- Fixed bug added by the plot color addition.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\eqv2.pro)


EQV3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EQV3
 PURPOSE:
       Execute IDL code using interactively varied parameters.
 CATEGORY:
 CALLING SEQUENCE:
       eqv3, file
 INPUTS:
       file = equation file.   in
         Instead of file name the contents of the file may be
         given in a text array (same format).
 KEYWORD PARAMETERS:
       Keywords:
         P1=var1, P2=var2, ... P5=var5  Up to 5 variables.
           may be passed into the program using these keywords.
           May reference p1, p2, ... in the IDL code to execute.
         /WAIT means wait until the routine is exited instead
            returning right after startup.
         PARVALS=pv Structure with parameter names and values.
            Must be used with /WAIT or pv will be undefined.
         EXITCODE=excd 0=normal, 1=cancel.  Must use with /WAIT.
         RES=res  Returned widget ID of an unused top level
            base that will on exit from EQV3 contain a structure
            with parameter names and final values.
              widget_control,res,get_uval=s,/dest
              s.name and s.val are arrays of names and values.
         TOP=top    Returns widget ID of top level base.
           Use widget_control to retrieve or store info structure.
         OK=wid  ID of widget to notify when OK button pressed.
           If not given no OK button is displayed.
           Useful to allow a higher level widget routine to call
           EQV3.  The OK button then sends an event to the higher
           level widget which can then destroy the eqv3 widget.
         WID_OK=wid  Returned widget ID of the OK button.
           Can use to set /input_focus.
         GROUP_LEADER=grp  Set group leader.
         XOFFSET=xoff, YOFFSET=yoff Widget position.
       
 OUTPUTS:
 COMMON BLOCKS:
       eqv3_var_com
       eqv3_var_com
       eqv3_help_com
       eqv3_var_com
       eqv3_help_com
 NOTES:
       Notes:  Use the Help button for more details.
       Equation file format: This text file defines the IDL code,
       and range of each adjustable parameter.
       Null and comment lines (* in first column) are allowed.
       The tags are shown by an example:
          title: Parabola
          eqv: x=maken(-10,10,100) & plot,a + b*x + c*x^2
          par:  a -50 50 0
          par:  b -50 50 0
          par:  c -10 10 1
       
       The parameter tags are followed by 4 items:  Parameter name (as in the
       equation), min value, max value, initial value.  An optional 5th item
       may be the word int to force an integer value (for flags or harmonics).
 MODIFICATION HISTORY:
       R. Sterner, 2000 May 11 --- From EQV2.
       R. Sterner, 2000 Aug 21 --- Added XOFFSET, YOFFSET.

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\eqv3.pro)


ERFINT_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ERFINT_MM
 VERSION:
		4.3
 PURPOSE:
		Calculates a definite integral of the error function.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = ERFINT_MM (Y [,X])
 INPUTS:
	Y
		Numeric, otherwise arbitrary.  Upper integration limit.
 OPTIONAL INPUT PARAMETERS:
	X
		Numeric, otherwise arbitrary.  Lower integration limit.  Defaults to 0.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns an integral of the error function between X and Y.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		If both X and Y are arrays, they need to have same number of elements.
		Scalar-scalar and scalar-array combinations are permitted.
 PROCEDURE:
		Straightforward.  Uses CALCTYPE, CAST, DEFAULT and ERRORF_MM from MIDL.
 MODIFICATION HISTORY:
		Created 10-MAY-2002 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\erfint_mm.pro)


ERRBARS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ERRBARS
 VEERSION:
		4.0
 PURPOSE:
		Overplots error bars over an existing plot.  More general than the
		library routines ERRPLOT and PLOTERR, since it allows to independently
		vary both X and Y errors, and allows for nonsymmetric error bars.
 CATEGORY:
		Plotting.
 CALLING SEQUENCE:
		ERRBARS, [X,] Y [, XERR = XER, YERR = YER]
 INPUTS:
	X, Y
		Vectors containing the data points' coordinates.  If only one is given
		it is taken to be Y, same as in the PLOT command.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	XERR
		Either a vector or a (2,N) array where N is the number of the data
		points.  Contains the X-errors.  If given as a 2 dimensional array, the
		entries XERR(0,i) and XERR(1,i) are taken as the errors of X(i) in the
		negative and positive directions, respectively.  If given as a vector,
		the entry XERR(i) serves as both the negative and positive error of
		X(i) and therefore symmetric error bars are drawn.  If not provided,
		the default is no X-errors.
	YERR
		Same as above, for the Y-errors.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.  See comment in RESTRICTIONS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The keywords passed through _EXTRA are transferred to the PLOTS
		routine.  No keyword verification is performed by ERRBARS.
 PROCEDURE:
		Straightforward.  Uses DEFAULT from MIDL.
 MODIFICATION HISTORY:
		Created 10-DEC-1991 by Mati Meron.
		Modified 15-DEC-1993 by Mati Meron.  Now ERRBARS takes advantage of the
		keyword inheritance property and accepts most of IDL plotting keywords.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\errbars.pro)


ERRORF_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ERRORF_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates the error function.  Replacement for the IDL ERRORF function
		which accepts only real input.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = ERRORF_MM (X [, /COMPLEMENTARY)]
 INPUTS:
	X
		Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/COMPLEMENTARY
		Switch.  If set, 1 - ERRORF(X) is returned.
 OUTPUTS:
		Returns the error function of X or, if /COMPLEMENTARY is set,
		1 - error_function.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		For very large (in absolute value) complex values of x, with
			pi/4 < |abs(phase(x))| < 3*pi/4
		the results may be meaningless.  A warning will be issued in this case.
 PROCEDURE:
		Uses CAST IGAMMA_MM and IMAGINARY_MM from MIDL.
 MODIFICATION HISTORY:
		Created 20-MAR-1996 by Mati Meron as M_ERRORF.
		Renamed 25-SEP-1999 by Mati Meron, to ERRORF_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\errorf_mm.pro)


ERROR_MESSAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ERROR_MESSAGE

 PURPOSE:

    The purpose of this function  is to have a device-independent
    error messaging function. The error message is reported
    to the user by using DIALOG_MESSAGE if widgets are
    supported and MESSAGE otherwise.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

    Utility.

 CALLING SEQUENCE:

    ok = Error_Message(the_Error_Message)

 INPUTS:

    the_Error_Message: This is a string argument containing the error
       message you want reported. If undefined, this variable is set
       to the string in the !Error_State.Msg system variable.

 KEYWORDS:

    NONAME: If this keyword is set the name of the calling routine
       is not printed along with the message.

    TRACEBACK: Setting this keyword results in an error traceback
       being printed to standard output with the PRINT command.

    In addition, any keyword appropriate for the MESSAGE or DIALOG_MESSAGE
    routines can also be used.

 OUTPUTS:

    Currently the only output from the function is the string "OK".

 RESTRICTIONS:

    The "Warning" Dialog_Message dialog is used by default. Use keywords
    /ERROR or /INFORMATION to select other dialog behaviors.

 EXAMPLE:

    To handle an undefined variable error:

    IF N_Elements(variable) EQ 0 THEN $
       ok = Error_Message('Variable is undefined', /Traceback)

 MODIFICATION HISTORY:

    Written by: David Fanning, 27 April 1999.
    Added the calling routine's name in the message and NoName keyword. 31 Jan 2000. DWF.
    Added _Extra keyword. 10 February 2000. DWF.
    Forgot to add _Extra everywhere. Fixed for MAIN errors. 8 AUG 2000. DWF.
    Adding call routine's name to Traceback Report. 8 AUG 2000. DWF.
    Switched default value for Dialog_Message to "Error" from "Warning". 7 OCT 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\error_message.pro)


ERROR_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   error_plot

 PURPOSE:
   Over-plot data points with accompanying X or Y error bars.
   For use instead of PLOTERR or OPLOT or oploterr when the plotting system has already been
   defined.

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
   error_plot,  x,  y, [x_err=x_err], [y_err=yerr], [s_hatlength=s_hatlength] ,
        [s_thick=s_thick] , [s_linestyle=s_linestyle], [s_color =s_color ],  [/s_hat],[/s_background],[s_nskip]
 INPUTS:
   plot : the by pl_init defined structure
   X:  array of abcissae, any datatype except string
   Y:  array of Y values, any datatype except string

 OPTIONAL INPUTS:
   X_ERR : vector of error bar values (along X)
   Y_ERR : vector of error bar values (along Y)
   For both: if only an element is submitted a vector with make_array will be builded
   s_hatlength:  the lengt of the hat
   s_thick:      the tickness of the error bar lines
   s_linestyle:  the linestyle of the error bar lines
   s_color:      the color of the error bar lines

 KEYWORD PARAMETERS:
  s_hat: 1 the error bar has an hat else 0 no hat
  s_background: 1 error bar at background  else 0 foreground
  s_nskip: 1 no skip ; 0 skip

 PROCEDURE:
   A plot of X versus Y with error bars drawn from Y - YERR to Y + YERR
   and optionally from X - XERR to X + XERR is written to the output device

   if sx or sy is a two dimensional array they have to be defined as min, max error
   in this case it could be an asymmetrical error plotted.

 WARNING:
   This an enhanced version of a procedure that already exists in the
   standard IDL V4.0 distribution. Any call to the standard IDL version
   should also work with this version, but the reverse is not true.


 MODIFICATION HISTORY:
   Adapted from the most recent version of PLOTERR.  M. R. Greason,
       Hughes STX, 11 August 1992.
       Removed spurious keywords for IDL V3.0.0  W. Landsman Jan. 1993
   Added ability to plot a single point W. Landsman   July 1993
   Added COLOR keyword option to error bars W. Landsman   November 1993
   Remove CHANNEL call for V4.0 compatibility W. Landsman June 1995
   Add ERRCOLOR, use _EXTRA keyword,           W. Landsman, July 1995
   Remove spurious call to PLOT_KEYWORDS     W. Landsman, August 1995
   OPLOT more than 32767 error bars          W. Landsman, Feb 1996
   Added NSKIP keyword                       W. Landsman, Dec 1996
   ==============================================================================
   1998-Apr-04 R.Bauer
   Adapted from olpoterr submitted by the astro lib
   All is done by _extra
   No symbol will be plotted only the error bars
   An important difference is that's you are able to submit x, y data and x_err or (and) y_err

   03.03.2000: (FH) Removed cause of the following IDL error message:
               % Program caused arithmetic error: Floating illegal operand
               % Detected at  ERROR_PLOT        121 S:\links\idl_source\idl_work\rb_lib\error_plot.pro
   05.04.2000: (FH) Set s_hat to 1 if not provided in structure pkey

 EXAMPLE:

 result=set_range([1,2,3,4],[10,20,30,40],xrange=[0,4],yrange=[0,40],sx=transpose([[0.9,1.8,2.9,3.5],[1.1,2.01,3.1,4.2]]))
 plot,result.x,result.y,psym=4
 error_plot,result.x,result.y,x_err=result.sx,s_color=5

 x=[1,2,3,4] & y=[10,20,30,40] &sx=[0.1,0.12,0.1,0.1] & sy=[1.1,2.12,1.1,1.1]
 plot,result.x,result.y,psym=4
 error_plot,x,y,x_err=sx,y_err=sy,s_color=5
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\error_plot.pro)


ETC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ETC
 PURPOSE:
       Return estimated time to completion in seconds.
 CATEGORY:
 CALLING SEQUENCE:
       stc = etc( fr )
 INPUTS:
       fr = fraction of work done.             in
 KEYWORD PARAMETERS:
       Keywords:
        DELTA=d  interval in seconds for rate estimation (def=10).
          DELTA must be given on each call.
        /STATUS means display job status (at [10,12]).
        STATUS=[x,y] display at column x, line y (from 1 at top).
 OUTPUTS:
       stc = estimated seconds to completion.  out
 COMMON BLOCKS:
       etc_com
 NOTES:
       Notes: Call with fr=0 to initialize.
 MODIFICATION HISTORY:
       R. Sterner, 25 Mar, 1993
       R. Sterner, 1995 Jan 19 --- Added STATUS=[x,y]
       R. Sterner, 1995 Feb  9 --- Upgraded intermediate estimates.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\etc.pro)


EUDORA2LDIF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 eudora2ldif

 PURPOSE:
 This routine translates eudoras nndbase.txt to the common ldif format (readable by netscape)

 CATEGORY:
	DATAFILES/FILTER

 CALLING SEQUENCE:
   eudora2ldif,file_name

 INPUTS:
   file_name: the name of the nickname file

 OUTPUTS:
   This routine writes out an ldif file for read in whith netscape

 RESTRICTIONS:
 The nndbase.txt should look like this example
 Many emaladdresses for one name aren't allowed in this version
 
 >emailaddress
 
 >emailaddress

 EXAMPLE:
  eudora2ldif,'nndbase.txt'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-Dec-22


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\eudora2ldif.pro)


EVENT_LOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EVENT_LOG
 PURPOSE:
       Enter an event into the latest event log file.
 CATEGORY:
 CALLING SEQUENCE:
       event_log, txt
 INPUTS:
       txt = Short text string to enter into event log.   in
 KEYWORD PARAMETERS:
       Keywords:
         /TWOLINE  Use two lines: time and txt (def=one line).
         /ADD means add given text to entry for last time tag.
            Any number of additional lines may be added.
         /SCREEN means also display given text on terminal screen.
         /LIST means display current event log.
         /FILE means display log file name.
         /NEW  means start a new event log.
         SETFILE=file  Optionally specified event file name.
         DIRECTORY=dir  Event log directory (def=current).
         /DIFFERENCE gives time difference between last two entries.
         /LOG Enter the time difference in log file (with /DIFF).
         TAG=tag  Look for the first occurance of TAG in the last
           line of the log file.  Return the matching word in VALUE.
         VALUE=val First word in last log file line containing TAG.
           Example: if last log line is:
              DK processing complete: dk_191_1.res
           and TAG='dk_' then VALUE returns 'dk_191_1.res'
           TAG could also have been '.res' with same results.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: To have an event entered into the latest event
         log just call with the desired event text.  If an event
         log file does not exist one will be created.
         To start a new event file just use the keyword /NEW.
         The event file names are always of the form:
           yymmmdd_hhmm.event_log like 95May15_1242.event_log
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 15
       R. Sterner, 1995 Jul 10 --- Added /DIFFERENCE keyword.
       R. Sterner, 1995 Aug  7 --- Added SETFILE keyword.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\event_log.pro)


EVL2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   evl2js

 PURPOSE:
   converts time info in evl files of MFC to jul sec

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   Result = EVL2JS(Struc)

 INPUTS:
   Struc: a struct array of (nrec elememts) having the
	following tags:
			date, start, stop

 OUTPUTS:
   This function returns array [nrec,2] with julian
	seconds for the center time and time intervals
	between start and stop

 EXAMPLE:
   r={date: '12.1.97', start:'12:00:00', stop:'12:05:01', y:12. }
   js  = EVL2JS(r)
 	print, js
      -93614250.
       301.00000

 REVISION HISTORY:
   Written         Theo Brauers, June 1997
   Corrected
   Revised     T.B. Sep 1997
   Revised     T.B. Jan 1998,

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\evl2js.pro)


EX1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ex1

 PURPOSE:
 
Example: four plots
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: ex1 EXAMPLE: ex1 gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\ex1.pro)


EXCH_PARAMETER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  exch_parameter

 PURPOSE:
   This function exchanges in str the members of old_param by new_param

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   Result=exch_parameter(str,old_param,new_param,list=list)

 INPUTS:
   str       : array of strings
   old_param : list of parameters to be exchanged by actual parameters
   new_param : list of actual parameters

 OPTIONAL INPUTS:
   list: list of characters to recognize the separation of syntax elements in str

 OUTPUTS:
   string array with exchanged parameters

 EXAMPLE:
   str_new=exch_parameter(['T=295.','P=1013','F=T/P'],['T','P'],['s<0,*>','s<1,*>'])
   print,transpose(str_new)
   results in:
      s<0,*>=295.
      s<1,*>=1013
      F=s<0,*>/s<1,*>

 MODIFICATION HISTORY:
   Written by: Franz Rohrer 1998-Jan-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\exch_parameter.pro)


EXCH_STRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  exch_string

 PURPOSE:
   This function exchanges in str each occurence of old_str by new_str.
   The lenght of odl_str and new_str does not to be equal.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=exch_string(str,old_str,new_str)

 INPUTS:
   str     : string(array)
   old_str : substring to be exchanged by new_str
   new_str : new substring

 OUTPUTS:
   string(array) with substrings old_str exchanged by new_str

 EXAMPLE:
   str2=exch_string('abcdefghijkdefopq','def','newdim')
   print,str2
   'abcnewdimghijknewdimopq'

 MODIFICATION HISTORY:
   Written by: Franz Rohrer 1998-Jan-15
   Modified 6.4.1999 FR str2=[temporary(str)] <--> str2=[str]

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\exch_string.pro)


EXIF_READER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXIF_READER
 PURPOSE:
       Read values from an Exif file (digital camera file).
 CATEGORY:
 CALLING SEQUENCE:
       exif_reader, file, values
 INPUTS:
       file = Name of digital camera image file.   in
 KEYWORD PARAMETERS:
       Keywords:
         /LIST means list values.
         DESCRIPTION=desc Returned text array of descriptive text.
         /TAGS means list in hex all tag values found.
 OUTPUTS:
       values = Returned structure with values.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2000 Dec 19

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\exif_reader.pro)


EXPERIMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   experiment

 PURPOSE:
   This procedure reads or writes the experiment specific global Attributes

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   experiment,file=file,experiment=experiment,[/write_exp],[/read_exp]

 INPUTS:
   file=file: the filename
   experiment=experiment: the structure experiment

 KEYWORD PARAMETERS:
   write_exp: to write the structure experiment to the file
   read_exp:  to read the Attributes of the experiment from the file
              into the structure experiment

 EXAMPLE:
   experiment, file='test.nc',experiment=experiment,/read_exp

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Feb. 16 1997
       1998-10-15 arr2string implemented
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\experiment.pro)


EXPINT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:       expint

 PURPOSE:       compute the exponential integral of x.
                the exponential integral of index n is given by
 
                    integral( exp(-tx)/x^n dx)  

                range of integration is 1 to infinity

 USEAGE:        result=expint(ind,x)

 INPUT:
   ind          order of exponential integral, for example use ind=1
                to get first exponential integral, E1(x)
   x            argument to exponential integral ( 0 < x < infinity)
 OUTPUT:
   result       exponential integral

 SOURCE:        Approximation formula from Abromowitz and Stegun (p 231)

  author:  Paul Ricchiazzi                            9DEC92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\expint.pro)


EXPLORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXPLORE
 PURPOSE:
       Image stats in a 16 x 16 box movable with the mouse.
 CATEGORY:
 CALLING SEQUENCE:
       explore, a, x, y
 INPUTS:
       a = array which is displayed on screen.   in.
 KEYWORD PARAMETERS:
 OUTPUTS:
       x, y = Cursor coordinates.                in, out.
 COMMON BLOCKS:
 NOTES:
       Notes: Assumes array is loaded with element (0,0) at the
         lower left corner of the window, and !ORDER = 0
         Lists array indices of cursor box center,
         array value at cursor box center,
         and cursor box min, max, and mean, SD, skew, kurt.
         Any button exits.
 MODIFICATION HISTORY:
       R. Sterner 25 July, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\explore.pro)


EXPORTDG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    exportdg

 PURPOSE:
	 Provide an interface for sending direct graphics to
	 printer or postscript

 CALLING SEQUENCE:
	 exportdg

 INPUTS:
	 None

 KEYWORD PARAMETERS:
	 None

 OUTPUTS:
    None
	 Optionally creates a file of source commands (dgcommands.txt)
	 in the working directory

 NOTES:
	 If more recalled commands are desired, change the number of recall
 	 lines specified in File->Preferences

 MODIFICATION HISTORY:
    June 2001, DDL: Written
	 July 2002: Eliminated need for auxiliary bitmap by hardcoding image info

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\EXPORTDG.PRO)


EXPORT_HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  export_html

 PURPOSE:
   This routine exports data to html file

 CATEGORY:
   PROG_TOOLS/MACROS

 CALLING SEQUENCE:
   export_html,[file],data,[name=name]

 INPUTS:
   data: the data to save as html

 OPTIONAL INPUTS:
  file: the filename of the html file default is combine_path_file(GETENV('TEMP'),'idl_export.html')

 KEYWORD PARAMETERS:
  name: if set name is used as caption

 KEYWORD PARAMETERS:
 _extra: to submit keywords to html_* and OPENW, e.g. /append
  except: sub,border,title,caption,no_hrule,HORIZONTAL_1D

 PROCEDURE:
  use as macro: export_html,%s,name=%_'%s%_'

 EXAMPLE:
   A=1
   export_html,a

   ct_ncdf,d
   export_html,d,/append

   a=read_ncdf(file_search('ghost.nc',/use_path))
   export_html,a,/append

   export_html,1212,/append

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 2000-April-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\export_html.pro)


EXRANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXRANGE
 PURPOSE:
       Return a range array with range expanded by given fraction.
 CATEGORY:
 CALLING SEQUENCE:
       b = exrange(a, f)
 INPUTS:
       a = array.                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = [mn-, mx+]            out
       where mn- = min(a) - f*d
             mx+ = max(a) + f*d
             d = max(a) - min(a)
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 7 Sep, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\exrange.pro)


EXTEND_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		EXTEND_ARRAY
 VERSION:
		4.0
 PURPOSE:
		Extends an array to a larger size, filling the blanks according to
		keyword specifications.
 CATEGORY:
		Array function.
 CALLING SEQUENCE:
		Result = EXTEND_ARRAY( ARR, [, OFF] [,keywords]])
 INPUTS:
	ARR
		Array, arbitrary.
	OFF
		Vector containing the offset of ARR into the result array.  Defaults
		to zero(s).  If the number of entries is smaller then the dimension
		(either of ARR or of the result) missing entries are replaced with 0,
		from left.  Thus if the result has dimensions of (4,5,6) but offset
		is given as [2,2], an offset of [0,2,2] is used.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	NEWSIZE
		A vector, containing the parameters of the result array, in the format
		of the output of the IDL SIZE function.  If not given, the size used is
		the minimal size capable of containing the original array with the
		specified offset.
	VALUE
		A scalar value used to fill the blanks in the result array.  Defaults
		to 0.  Warning:  VALUE and EDGE_EXTEND cannot be specified at the same
		time
	/EDGE_EXTEND
		Switch.  If set, the blanks in the result array are filled with the
		adjoining edge values of ARR.  Warning:  EDGE_EXTEND and VALUE cannot
		be specified at the same time
 OUTPUTS:
		Returns an array of size specified either by NEWSIZE or combination of
		the original size and offset.  The original arry is imbedded in the
		result, and the blanks are filled according to the keywords VALUE or
		EDGE_EXTEND.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The new size, as provided by NEWSIZE, must be large enough to contain
		the original array with the offset.
 PROCEDURE:
		Straightforward.  Calls DEFAULT and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 20-JAN-1997 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\extend_array.pro)


EXTRACT_COMMENTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        EXTRACT_COMMENTS

 PURPOSE:
        split a string returned from READDATA.PRO into 
        items of a string array.

 CATEGORY:
        Data Handling

 CALLING SEQUENCE:
        result=EXTRACT_COMMENTS(comments,index,delim=' ')

 INPUTS:
        COMMENTS --> string array of comment lines returned from
            readdata.pro

        INDEX --> line number of comments to be analyzed

 KEYWORD PARAMETERS:
        DELIM --> delimiter character between items. Default: 1 blank.

 OUTPUTS:
        A string array containing the single "words" of 1 comment line.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        units=EXTRACT_COMMENTS(comments,2,delim=' ')

 MODIFICATION HISTORY:
        mgs, 10 Nov 1997: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\extract_comments.pro)


EXTRACT_EXTRA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   extract_extra

 PURPOSE:
   This function extracts from a given structure keywords to a new extra structure

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=extract_extra(extra,text)

 INPUTS:
   extra: an extra structure
          the problem with _extra is that's almost keywords for same actions are named same.
          e.g. if you like to use xsize by widgets and you like to set them different by a label or a text
               this is not possible.
          In my cw_ widget I am using therefore an additional name for the belonging widget function.
          If I am using buttons then the xsize keyword is button_xsize and for label label_xsize.

   text: this is a string to search for, the wildcard '*' is usefull e.g. 'button_*'
   index:

 OUTPUTS:
  The new _Extra structure belonging to text

 EXAMPLE:
  result=extract_extra(extra,'button_*')

 MODIFICATION HISTORY:
  Written by:     R.Bauer (ICG-1), 1999-Nov-07
  2000-Apr-18: added index to get_tagname:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\extract_extra.pro)


EXTRACT_FILENAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        EXTRACT_FILENAME

 PURPOSE:
        extract the file filename from a full qualified filename

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        filename=EXTRACT_FILENAME(FULLANME [,keywords])

 INPUTS:
        FULLNAME --> a fully qualified filename containing path information.

 KEYWORD PARAMETERS:
        FILEPATH --> a named variable that returns the path of the
           file. This can be used if both, the filename and the name
           of the file will be used. Otherwise it is recommended to
           use EXTRACT_PATH instead.

 OUTPUTS:
        A string containing the filename to be analyzed.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        See also EXTRACT_PATH

 EXAMPLE:
        print,extract_filename('~mgs/IDL/tools/extract_filename.pro')

             will print  'extract_filename.pro'

        print,extract_filename('example.dat',filepath=filepath)

             will print  'example.dat', and filepath will contain ''


 MODIFICATION HISTORY:
        mgs, 18 Nov 1997: VERSION 1.00
        mgs, 21 Jan 1999: - added extra check for use of '/' path specifiers
              in Windows OS;

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\extract_filename.pro)


EXTRACT_PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        EXTRACT_PATH

 PURPOSE:
        extract the file path from a full qualified filename

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        path=EXTRACT_PATH(FULLANME [,keywords])

 INPUTS:
        FULLNAME --> a fully qualified filename. If this input is
           already a path it must end with the delimiter '/' (Unix)
           or '\' (Windows).

 KEYWORD PARAMETERS:
        FILENAME --> a named variable that returns the name of the
           file. This can be used if both, the path and the name
           of the file will be used. Otherwise it is recommended to
           use EXTRACT_FILENAME instead.

 OUTPUTS:
        A string containing the path to the file given.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        See also EXTRACT_FILENAME

 EXAMPLE:
        print,extract_path('~mgs/IDL/tools/extract_path.pro')

             will print  '~mgs/IDL/tools/'

        print,extract_path('example.dat',filename=filename)

             will print  '', and filename will contain 'example.dat'


 MODIFICATION HISTORY:
        mgs, 18 Nov 1997: VERSION 1.00
        mgs, 21 Jan 1999: - added extra check for use of '/' path specifiers
              in Windows OS

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\extract_path.pro)


EXTREMA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		EXTREMA
 VERSION:
		4.1
 PURPOSE:
		Finding all local minima and maxima in a vector.
 CATEGORY:
		Mathematical Function (array).
 CALLING SEQUENCE:
		Result = EXTREMA( X [, keywords])
 INPUTS:
	X
		Numerical vector, at least three elements.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/MIN_ONLY
		Switch.  If set, EXTREMA finds only local minima.
	/MAX_ONLY
		Switch.  If set, EXTREMA finds only local maxima.
	THRESHOLD
		A nonnegative value.  If provided, entries which differ by less then
		THRESHOLD are considered equal.  Default value is 0.
	/CEILING
		Switch.  Determines how results for extended extrema (few consecutive
		elements with the same value) are returned.  See explanation in OUTPUTS.
	SIGNATURE
		Optional output, see below.
	NUMBER
		Optional output, see below.
 OUTPUTS:
		Returns the indices of the elements corresponding to local maxima
		and/or minima.  If no extrema are found returns -1.  In case of
		extended extrema returns midpoint index.  For example, if
		X = [3,7,7,7,4,2,2,5] then EXTREMA(X) = [2,5].  Note that for the
		second extremum the result was rounded downwards since (5 + 6)/2 = 5 in
		integer division.  This can be changed using the keyword CEILING which
		forces upward rounding, i.e. EXTREMA(X, /CEILING) = [2,6] for X above.
 OPTIONAL OUTPUT PARAMETERS:
	SIGNATURE
		The name of the variable to receive the signature of the extrema, i.e.
		+1 for each maximum and -1 for each minimum.
	NUMBER
		The name of the variable to receive the number of extrema found.  Note
		that if MIN_ONLY or MAX_ONLY is set, only the minima or maxima,
		respectively, are counted.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls ARREQ, DEFAULT and ONE_OF from MIDL.
 MODIFICATION HISTORY:
		Created 15-FEB-1995 by Mati Meron.
		Modified 15-APR-1995 by Mati Meron.  Added keyword THRESHOLD.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.
		Corrected and streamlined 10-MAY-2000, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\extrema.pro)


EXTREMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXTREMES
 PURPOSE:
       Find all the local extremes of a 1-d array.
 CATEGORY:
 CALLING SEQUENCE:
       ind = extremes(y, flag)
 INPUTS:
       y = 1-d array to search.                      in
       flag = min/max flag: -1 for min, 1 for max.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       ind = indices of local extremes (-1 if none). out
 COMMON BLOCKS:
 NOTES:
       Notes: if the curve has flat topped regions local
        maxes are returned at both the start and end of
        the regions.  Similarly for flat bottomed regions
        local mins are returned at both the start and end of
        the regions.
 MODIFICATION HISTORY:
       R. Sterner, 22 Sep, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\extremes.pro)


EXTREMES_2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXTREMES_2D
 PURPOSE:
       Find local extremes in a 2-d array.
 CATEGORY:
 CALLING SEQUENCE:
       ind = extremes_2d(z, flag)
 INPUTS:
       z = 2-d array to search.                          in
       flag = min/max flag: -1 for min, 1 for max.       in
 KEYWORD PARAMETERS:
       Keywords:
         /EDGES   Means examine image edges (default ignores edges).
         VALUE=v  Returned values at each extreme.
 OUTPUTS:
       ind = 1-d indices of local extremes (-1 if none). out
 COMMON BLOCKS:
 NOTES:
       Notes: Mimima are sorted in ascending order of value.
              Maxima are sorted in descending order of value.
         2-d indices may be found from: one2two,ind,z,ix,iy.
         Noisy images should be smoothed first.
 MODIFICATION HISTORY:
       R. Sterner, 23 Dec, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\extremes_2d.pro)


EXT_MDNC2ASC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  ext_mdnc2asc

 PURPOSE:
  This procedure translates netCDF Model data or other to an ascii Format

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   ext_mdnc2asc,file_name

 INPUTS:
 The name of the netCDF File

 OUTPUTS:
 A file whith the additional extension .dat will be created

 MODIFICATION HISTORY:
       Written by:     R. Bauer , 1997-Dec-10
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ext_mdnc2asc.pro)


EXZ2ENZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   exz2enz

 PURPOSE:
   convert exz files to enz files

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   EXZ2ENZ, infile, outfile

 INPUTS:
   infile: inputfilename
   outfile: outputfilename

 KEYWORD PARAMETERS
   REFDATE     string dd.mm.yy hh:mm:ss with reference date


 REVISION HISTORY:
   Written  Theo Brauers, NOV 1997
   Corrected
   Revised T.B.
           iwzn for iwzn3

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\exz2enz.pro)


EX_ENZ_HEADER2NCDF_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_enz_header2ncdf_structure

 PURPOSE:
   This routine shows the capabilities of enz_header2ncdf_structure

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_enz_header2ncdf_structure

 MODIFICATION HISTORY:
   Written by: Frank Holland, 24. June 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_enz_header2ncdf_structure.pro)


EX_ICGS_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_icgs_filter

 PURPOSE:
   This routine shows the capabilities of icgs_filter

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_icgs_filter

 MODIFICATION HISTORY:
	Written by: Frank Holland, 12.11.1999
	15.11.1999: Added keyword parameter /TAG_NAME

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_icgs_filter.pro)


EX_INIT_MPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_init_mplot

 PURPOSE:
   This routine shows the capabilities of init_mplot and xyoutp

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_init_mplot

 MODIFICATION HISTORY:
   Written by: Frank Holland, 26. Feb. 99.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\examples\ex_init_mplot.pro)


EX_MPLOT_CORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_mplot_core

 PURPOSE:
   This routine shows the capabilities of mplot

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_mplot_core

 MODIFICATION HISTORY:
	Written by: Frank Holland, 21. June 1999
	29.07.1999:	Added keyword parameter SHARE_YAXIS to call to mplot

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_mplot_core.pro)


EX_OPLOT_2Y

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_oplot_2y

 PURPOSE:
   This routine shows the capabilities of plot_2c and oplot_2y

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_oplot_2y

 MODIFICATION HISTORY:
   Written by: Frank Holland, 8. Jan. 98.
	29.01.98 - Handling of colors was changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_oplot_2y.pro)


EX_PLOT_2C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_plot_2c

 PURPOSE:
   This routine shows the capabilities of plot_2c

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_plot_2c

 MODIFICATION HISTORY:
   Written by: Frank Holland, 02. May. 98.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_plot_2c.pro)


EX_PLOT_2C_TIMESERIES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_plot_2c_timeseries

 PURPOSE:
   This routine shows how to plot a time series with plot_2c

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_plot_2c_timeseries

 MODIFICATION HISTORY:
   Written by: Frank Holland, 19. Apr. 1999.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_plot_2c_timeseries.pro)


EX_VEKLOGIK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ex_veklogik

 PURPOSE:
   This routine shows the capabilities of veklogik.pro

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   ex_veklogik

 MODIFICATION HISTORY:
   Written by: Frank Holland, 8. Jan. 98.
   08.02.2000: Debug removed, formatted output.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\ex_veklogik.pro)


EYE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  eye

 PURPOSE:  draw an eye symbol to show observer position and look direction

 USEAGE:   eye,x0,y0,angle=angle,size=size,color=color,icolor=icolor,$
               data=data,device=device

 INPUT:    
  x0,y0    coordinates of eye symbol position (normal coordinates by default)

 KEYWORD INPUT:
  angle    angle of symbol wrt due right alignment
  size     symbol size
  color    color index used to draw eye outline
  icolor   color index used to draw iris
  data     if set, x0,y0 in data coordinates
  device   if set, x0,y0 in device coordinates

 EXAMPLE:  
   

  plot,[0,1],/nodata
  arrow,0,1,.5,.5,/data
  eye,.55,.45,/data,size=3,angle=135

; here is a interactive method to place the eye symbol

  !err=0 & angle=0 & x=.5 & y=.5
  tvcrs,.5,.5,/norm & while !err ne 4 do begin &$
   !err=0 &$
   eye,x,y,angle=angle,size=5,color=0 &$
   cursor,x,y,/norm,/nowait  &$
   if !err eq 1 then angle=angle-5 &$
   if !err eq 2 then angle=angle+5 &$
   eye,x,y,angle=angle,size=5 &$
   wait,.05 &$
 endwhile
 cmdstr=string(f='("eye,",2(g10.3,","),"angle=",g10.3)',x,y,angle)
 print,strcompress(cmdstr,/remove_all)

 AUTHOR:   Paul Ricchiazzi                        10 Dec 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\eye.pro)


E_H2O

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        E_H2O  

 PURPOSE:
        calculate water vapour pressure for a given temperature

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        p = E_H2O( TEMPERATURE [,/WATER,/ICE,minval=minval] )

 INPUTS:
        TEMPERATURE --> dew or frostpoint reading in K. If you supply
              the dry air temperature (or static air temperature),
              you will get a value for the water vapor saturation 
              pressure.

 KEYWORD PARAMETERS:
        /WATER --> interprete temperature as dewpoint (default)

        /ICE --> interpret temperature as frostpoint

        MINVAL -> minimum valid data value (default -1.0E30)

 OUTPUTS:
        the water vapour pressure in mbar

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        The algorithm has been taken from the NASA GTE project data
        description.

 EXAMPLE:
        ; Calculate water vapor pressure for a dewpoint reading
        ; of 266 K
        ph2o = E_H2O(266.)

        ; Compute relative humidity 
        ; (divide ph2o by saturation pressure of DRY temperature)
        rh = ph2o/e_h2o(283.)

        print,ph2o,rh
        ; prints 

 MODIFICATION HISTORY:
        mgs, 23 Feb 1997: VERSION 1.00
        mgs, 03 Aug 1997: split e_h2o and rh, renamed, added template
        mgs, 23 May 1998: changed default behaviour to set reference
               temperature to given TD value
        mgs, 29 Aug 1998: VERSION 2.00
          - much simpler and more logical interface
          - no automatic detection of dew- or frostpoint any longer
          - can now accomodate arrays

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\e_h2o.pro)


F2FI16

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       F2FI16
 PURPOSE:
       Convert feet to feet, inches, and fractions to 1/16 inch.
 CATEGORY:
 CALLING SEQUENCE:
       s = f2fi16(f)
 INPUTS:
       f = distance in feet.            in
 KEYWORD PARAMETERS:
       Keywords:
         MIN_INCHES=d convert values < d to mm.
         MAX_MILES=D convert values > D to miles.
 OUTPUTS:
       s = distance as a text string.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 4 Oct, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 13 Sep, 1989 --- converted to SUN.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\f2fi16.pro)


FACS2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 facs2ncdf


 PURPOSE:
 translates whith a given input file facsimile files to netCDF


 CATEGORY:
 DATAFILES/FILTER


 CALLING SEQUENCE:
 facs2ncdf,instruction_file,[data_path=data_path],[out_path=out_path],[new_file=new_file]


 INPUTS:
 instructionfile: this is the name of the idl script whith the instructions for the translations of the facsimile files

 OPTIONAL INPUTS:
 data_path:  The path where the data is
 out_path:   The path where the netCDF File should be stored
 new_file:   The file name of the netCDF File
 all above optional inputs will overwrite the settings from the instructionfile

 EXAMPLE:
   facs2ncdf,'instruct'
   data will be translated to netCDF File Format

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Aug. 21 1996
                       R.Bauer Aug 22 added optional inputs (data_path,out_path,new_file)
                       R.Bauer Oct 15 resolve_routine,inst_file added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\facs2ncdf.pro)


FACTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FACTOR
 PURPOSE:
       Find prime factors of a given number.
 CATEGORY:
 CALLING SEQUENCE:
       factor, x, p, n
 INPUTS:
       x = Number to factor (>1).       in
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET  means do not print factors.
         /DEBUG  Means list steps as they happen.
         /TRY    Go beyond 20000 primes.
 OUTPUTS:
       p = Array of prime numbers.      out
       n = Count of each element of p.  out
 COMMON BLOCKS:
 NOTES:
       Note: see also prime, numfactors, print_fact.
 MODIFICATION HISTORY:
       R. Sterner.  4 Oct, 1988.
       RES 25 Oct, 1990 --- converted to IDL V2.
       R. Sterner, 1999 Jun 30 --- Improved (faster, bigger).
       R. Sterner, 1999 Jul  7 --- Bigger values (used unsigned).
       R. Sterner, 1999 Jul  9 --- Tried to make backward compatable.
       R. Sterner, 2000 Jan 06 --- Fixed to ignore non-positive numbers.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\factor.pro)


FFT_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FFT_FILTER
 PURPOSE:
       Do FFT filtering of time series data.
 CATEGORY:
 CALLING SEQUENCE:
       FILTER_DATA = FFT_FILTER(DATA, FILTER_WEIGHTS)
 INPUTS:
       data = input data array.              in
       filter_weights = weighting array.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       fitler_data = filtered output.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       B. L. Gotwols.  7 Apr, 1987.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fft_filter.pro)


FIGLET

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  figlet

 PURPOSE:  write a figure letter

 USEAGE:   figlet,x,y,charsize=charsize,font=font

 INPUT:    
   x       subnormal coordinates of letter (default = .04)
   y       subnormal coordinates of letter (default = 1.-.6*ychsz)
           where 
                               charsize*!d.y_ch_size
              ychsz=  --------------------------------------
                      !d.y_vsize*(!y.window(1)-!y.window(0))

 KEYWORD INPUT:
 charsize  character size (size is halved if more than 2 plots are
           ganged in either horizontal or vertical)

  font     vector drawn font (default = 17)
     

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  
   !p.multi=[0,2,3] 
   plot,indgen(9) & figlet
   plot,indgen(9) & figlet
   plot,indgen(9) & figlet
   plot,indgen(9) & figlet
   plot,indgen(9) & figlet,-.05
   plot,indgen(9) & figlet,-.05
   

 AUTHOR:   Paul Ricchiazzi                        13 Oct 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\figlet.pro)


FIGNUM

[Previous Routine] [Next Routine] [List of Routines]
 routine:        fignum

 useage:         fignum,fig=fig,charsize=charsize,font=font

 input:          none

 keyword input:  
   fig
     if FIG is set to an integer greater than zero figure numbering 
     is enabled and the initial figure number is set to FIG.  If FIG
     is set to zero figure numbering is disabled.  If FIG is set to a
     string scalar then that string will be appended to "Figure" and
     written to as usual.  For example fignum,fig="4a" writes "Figure 4a".

 output:         none

 PURPOSE:
     automatical increment a figure number index and draw the number
     on a sequence of plots.
     

 COMMON BLOCKS: fignum_blk
                       
 EXAMPLE:        

 plot,dist(20)
 fignum,fig=1,font='!3',charsize=2
 for i=1,4 do begin & plot,dist(20) & fignum & pause & end

  author:  Paul Ricchiazzi                            22sep92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fignum.pro)


FILEBREAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FILEBREAK
 PURPOSE:
       Breaks file name(s) into components.
 CATEGORY:
 CALLING SEQUENCE:
       filebreak, input
 INPUTS:
       input = input file name (may be an array).  in
 KEYWORD PARAMETERS:
       Keywords:
         DIRECTORY=d  returned directory name.
         FILE=f  returned complete file name (without directory).
         NVFILE=fnv  returned complete file name without version.
         NAME=n  returned file name without ext or vers.
         EXTENSION=e  returned file extension.
         VERSION=v  returned file version number.
         OS=os  Input operating system family name if not the
           one for the current IDL session.  Values may be:
           vms = Vax VMS, windows = PC windows, macos = Macs, anything else is unix.
         The following diagram show relations between components:
       
        . . . A A A / N N N N N N . E E E E ; V V V
       
       |             |           | |       | |     |
       |    DIR      |   NAME    | |  EXT  | | VER |
       +-------------+-----------+ +-------+ +-----+
       |             |                     |       |
       |             |        NVFILE       |       |
       |             +---------------------+       |
       |             |                             |
       |             |              FILE           |
       |             +-----------------------------+
       |                                           |
       |                  INPUT                    |
       +-------------------------------------------+
       
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: The argument to this routine has the form:
         dir+file where dir is operating system dependent
         but something like d0:[aaa.bbb] for vms, or
         /aaa.bbb/ for unix, or d:\aaa.bbb\ for Wndows.
         The file will be of the form: name.ext;vers.
         Only VMS has version numbers.
         Requested values that do not occur are returned as
         null strings
 MODIFICATION HISTORY:
       Ray Sterner,  16 APR, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES, Added DIR 29 May, 1985.
       R. Sterner, made op. sys. independent --- 11 Sep, 1991.
       R. Sterner, 1997 Sep 25 --- Switched to !version.os_family.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\filebreak.pro)


FILELES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	fileles

 PURPOSE:
	This routine is used by plotxy to read a sequence of netCDF-Files

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
      fileles,fileliste,xn,yn,xw,yw,xtitle_file,ytitle_file,x_units,y_units,flag,plot

 INPUTS:
       fileliste: liste of file_names
       xn:        x Parameter name
       yn:        y Parameter name

 KEYWORD PARAMETERS:
       icg_struct: if is set to the icg_struct instead of fileliste, xn and yn is used as short_names to find the data in the icg_struct

 OPTIONAL INPUTS:
       i_xn: position from current index of x
       i_yn: position from current index of y

 OUTPUTS:
       xw:          x values
       yw:          y values
       xtitle_file: xtitle for x axis (param_long_name +[param_units])
       ytitle_file: ytitle for y axis (param_long_name +[param_units])
       flag:        indicates whith 1 all is ok  gt 1
       x_units:     unit of x value
       y_units:     unit of y value

 EXAMPLE:
       fileles,fileliste,xn,yn,xw,yw,xtitle_file,ytitle_file,x_units,y_units,flag,plot

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer August 1997
                       7. 5.1997 ncdf_g replaced by ncdf_gr
                       9.10.1997 ncdf_r replaced by cache
                       8. 1.1998 outputs x_units and y_units added
                       20.10.1998 find_tag replaced by is_tag
                       1999-05-97 icg_struct added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\fileles.pro)


FILELINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  fileline

 PURPOSE:
   This function returns the number of lines of an ascii file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=fileline(filename,[bytarr=bytarr])

 INPUTS:
  filename: the name of an ascii file

  KEYWORD PARAMETERS:
  bytarr: optional output

 EXAMPLE:
   Result=fileline('test.asc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), Oct. 1996
   R.Bauer 1998-11-10 added opt output bytarr
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\fileline.pro)


FILENAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FILENAME
 PURPOSE:
       File names with system independent symbolic directories.
 CATEGORY:
 CALLING SEQUENCE:
       f = filename(symdir, name)
 INPUTS:
       symdir = symbolic directory name.   in
       name = file name.                   in
 KEYWORD PARAMETERS:
       Keywords:
         /NOSYM means directory given is not a symbolic name.
         OPSYS=os specifiy operating system to over-ride
           actual.  Use VMS, WINDOWS, or MACOS.  UNIX is default.
         DELIM=c delimiter character between directory and
           file name.  This is returned.
 OUTPUTS:
       f = file name including directory.  out
 COMMON BLOCKS:
 NOTES:
       Notes: symdir is a logical name for VMS and
         an environmental variable for UNIX and WINDOWS.  Ex:
         DEFINE IDL_IDLUSR d0:[publib.idl]  for VMS
         set IDL_IDLUSR=c:\IDL\LIB\IDLUSR   for WINDOWS.
         setenv IDL_IDLUSR /usr/pub/idl     for UNIX.
         Then in IDL: f=filename('IDL_IDLUSR','tmp.tmp')
         will be the name of the file tmp.tmp in IDL_IDLUSR.
 MODIFICATION HISTORY:
       R. Sterner,  4 Feb, 1991
       R. Sterner, 27 Mar, 1991 --- added /NOSYM
       R. Sterner, 21 May, 1991 --- If not a listed opsys assume unix.
       R. Sterner,  4 Jun, 1991 --- added DOS.
       R. Sterner,  2 Jul, 1991 --- added DELIM.
       R. Sterner, 17 Jan, 1992 --- added OPSYS= and avoided double //
       R. Sterner, 1994 Feb 7 --- Added MacOS.
       R. Sterner, 1994 Feb 14 --- Changed DOS to windows.
       R. Sterner, 1998 Jan 16 --- Changed from !version.os to os_family.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\filename.pro)


FILESIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  filesize

 PURPOSE:
   The result of this function is the bytelength of an ascii file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=filesize(filename)

 INPUTS:
   filename: the name of an ascii file

 OUTPUTS:
	This function returns the number of bytes of an ascii file

 EXAMPLE:
   Result=filesize('test.asc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), Oct. 1996
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\filesize.pro)


FILES_AT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      files_at

 PURPOSE:
   This function returns all newer files from a given startpath and a given date

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=files_at(start_path,js_time)

 INPUTS:
   js_time        the start date, e.g. dtime2js('1998-06-17 00:00:00 000')

 OUTPUTS:
    This function returns files including the whole path of files eq js_time
    The result will be '' if there is no agreement


 EXAMPLE:
       result=files_at('./',dtime2js('1998-06-17 00:00:00 000'))

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Jun-18
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\files_at.pro)


FILES_BEFORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      files_before

 PURPOSE:
   This function returns all older files from a given startpath and a given date

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=files_before(start_path,js_time

 INPUTS:
   js_time        the start date, e.g. dtime2js('1998-06-17 00:00:00 000')

 OUTPUTS:
    This function returns files including the whole path of files older equal then date
    The result will be '' if there is no agreement


 EXAMPLE:
       result=files_before('./',dtime2js('1998-06-17 00:00:00 000'))

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Jun-18
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\files_before.pro)


FILES_SINCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      files_since

 PURPOSE:
   This function returns all newer files from a given startpath and a given date

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=files_since(start_path,js_time)

 INPUTS:
   js_time        the start date, e.g. dtime2js('1998-06-17 00:00:00 000')

 OUTPUTS:
    This function returns files including the whole path of files newer then date
    The result will be '' if there is no agreement


 EXAMPLE:
       result=files_since('./',dtime2js('1998-06-17 00:00:00 000'))

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Jun-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\files_since.pro)


FILE_ACCESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   file_access

 PURPOSE:
   This function return the acces status of a file

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   Result=FILE_ACCESS(Filename)

 INPUTS:
   Filename:  a string or string array containing filenames to be processed

 KEYWORD PARAMETERS:
   DIR_ACCESS: if set to a named variable the status of the directory is returned

 OUTPUTS:
   stat= bit#      meaning
           0       file exist
           1       write ok
           2       read ok

 RESTRICTIONS:
   This routine works under Win32 only.

 PROCEDURE:
   This routine uses the c4idl.dll which was provided by Frank Holland

 EXAMPLE:
   print, file_access('c:\temp\no_exist', dir_access=d) ,d
   IDL returns:  0    7
   ( the file does not exist, but you have read an write
       access in the existing dirrectory c:\temp )

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-APR-8

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\file_access.pro)


FILE_EXIST[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        FILE_EXIST

 PURPOSE:
        FILE_EXIST checks to see whether a specified file
        can be found on disk, or if it does not exist.

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        RESULT = FILE_EXIST(FILE [,OPTIONS])

 INPUTS:
        FILE (str) --> the name of the file to be checked

 KEYWORD PARAMETERS:
        PATH       -> a path string (e.g. the IDL system variable !PATH)
            or a list (string array) of directory names to be
            searched for FILE. Under Unix, a trailing '/' is attached
            to each entry, under Windows, a trailing '\'. VMS and MacOS
            are not supported.

        FULL_PATH  -> returns the path of FILE if found
            This is not a true systemwide path but rather a combination
            of a PATH element (which may be relative) and FILE.

        DIRNAMES   -> 
            This keyword is now replaced by PATH, and should not be
            used any more.

 OUTPUTS:
        FILE_EXIST returns a 1 if the file is found or 0 otherwise
        FULL_PATH contains the file path so it can be used to open the file.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        The PATH entries are expanded prior to use, so it is possible to
        specify e.g. '~mgs/bla.pro'
        FILE_EXIST will always return the first file it finds that 
        matches your specification. 

 EXAMPLE: 
        (1)
        if (FILE_EXIST('file_exist.pro')) then print,'Found it!'

        (2)
        dirs = [ '../', '~/DATA/' ]
        ok = file_exist('test.dat',path=dirs,full=path)
        if (ok) then openr,u1,path
        ...
        
 MODIFICATION HISTORY:
        mgs, 26 Sep 1997: VERSION 1.00
        mgs, 28 Sep 1997: 
              - added expand_path() in order to digest ~-pathnames
              - initializes FULL_PATH with a zero string
        mgs, 06 Nov 1997:
              - replaced DIRNAMES by PATH and added string seperation
                if PATH is a path string with multiple entries
        mgs, 05 Feb 1998:
              - bug fix: use expand_path also if only filename is given

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\file_exist.pro)


FILE_EXIST[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   file_exist

 PURPOSE:
   The result of this function is 1 if a file exist and 0 if not

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=file_exist(file_name,[valid=valid])

 INPUTS:
   file_name: The name of the File or an array of file_names

 KEYWORD PARAMETERS:
   valid: if arg_present the valid indices are returned in valid

 OUTPUTS:
   This function returns 1 if the file exist and 0 if not

 EXAMPLE:
   result=file_exist('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  1998-May-18
   1999-June-29: searching of multiple files now possible

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\file_exist.pro)


FILE_GET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		FILE_GET
 VERSION:
		4.3
 PURPOSE:
		Finding and/or checking for the existance of files.
 CATEGORY:
		Utility
 CALLING SEQUENCE:
		Result = FILE_GET( [FNAME] [,keywords)
 INPUTS:
	FNAME
		Character variable or constant, translating to a file name.  If not
		provided, DIALOG_PICKFILE is called to find the file.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	PATH
		Character variable or constant, translating to a full or partial path.
	FILTER
		Character variable or constant, translating to a file-type filter.
	/PICK
		Switch.  If FNAME is provided but the file is not found, having PICK
		set causes FILE_GET to switch to the alternative (no FNAME) mode of an
		interactive search using DIALOG_PICKFILE.
	/RESET
		Switch.  Resets the PATH and FILTER saved from previous calls to their
		original, blank values.
	STATUS
		Optional output, see below.
 OUTPUTS:
		Returns the full file name.
 OPTIONAL OUTPUT PARAMETERS:
	STATUS
		Returns an operation success code, 1 if a file is found, 0 otherwise.
 COMMON BLOCKS:
		Block FILEINFO.  Includes the file path and filter used in the
		previous call (if there was a previous call).  These will be reused
		unless overridden by explicit values provided through PATH and FILTER.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		If FNAME is provided, FILE_GET attempts to locate it (using the path if
		needed) else it cals on DIALOG_PICKFILE for interactive selection.  If
		needed (when PICK is set) FILE_GET calls itself recursively.
		Uses ARREQ, DEFAULT and TYPE from MIDL and SDEP from imports.
 MODIFICATION HISTORY:
		Created 15-APR-2001 by Mati Meron.
		Modifed 30-SEP-2001 by Mati Meron.  Added keywords PICK and RESET.
		Modified 1-APR-2002 by Mati Meron.  Modified defaults.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\file_get.pro)


FILE_INFO

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   file_info

 PURPOSE:
   this function gives information about files in a directory
   for unix and for windows

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   info=FILE_INFO(PATH=path,SEARCH=search)

 INPUTS:

 KEYWORD PARAMETERS:
    PATH     : directory name to be searched for (default: the current directory)
    SEARCH   : string array of file search patterns (default:'-la '+'.' )
    DLL_NAME : path where c4idl.dll will be found
              (default:'S:\links\idl_source\idl_work\fh_lib\c4idl.dll'

 OUTPUTS:
   info: structure with information about the files
      tags:
        name   : string
        length : long integer size of file in bytes
        date   : last modification time of the file
        time   : hours: minutes: seconds
        jstime : time in julian seconds
        dir    : 1 if it is a directory, 0 otherwise
        write  : 1 if you have the permission to write, 0 otherwise
   on windows info.write is always = 0
        link   : 1 if a link exists, 0 otherwise
        path   : full path
        source : path + filename, or if a link exists link + filename


 EXAMPLE:
    info=file_info(path='/home3/ich388/IDL/auftrag2/')
 or
   ? info=file_info(path='\RSI\IDL51\auftrag2\',dllname='c:\RSI\IDL51\auftrag2\c4idl.dll')

 MODIFICATION HISTORY:
   Written by  : Marsy Lisken  august 1998
   modified by : Franz Rohrer, 16.1.1999 : returns -1 if no file is found
                               22.2.1999 : output changed to named structure
                               11.1.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\file_info.pro)


FILE_PATH_NAME_EXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   file_path_name_ext

 PURPOSE:
   This function returns path, name, and extension of a file in a structure
   (handles arrays as well)

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = FILE_PATH_NAME_EXT(string)

 INPUTS:
   string:  filename with path

 KEYWORD PARAMETERS:
   OUT_WINDOWS:    if set '\' instead of '/' are used on output

 OUTPUTS:
   Result: structure with name, path, and ext tags

 EXAMPLE:
   file='d:\alpha\beta\filen.ext
   f=file_path_name_ext(file)
   print, f.path, f.name, f.ext

 REVISION HISTORY:
   Written         Theo Brauers, Nov 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\file_path_name_ext.pro)


FILE_SEARCH

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   file_search

 PURPOSE:
   This function searches a file in the current directory or in a list of directories
   This function does return the first file which was found to match the search
   criterion. Use the wild cards '*' or /LIST keyword to return a full list.

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   Result=FILE_SEARCH(Name)

 INPUTS:
   Name:   name of a file or wildcards

 KEYWORD PARAMETERS:
   DIRECTORIES:    string (array) containing a list of directories to be searched
   NO_CURRENT:     if set the current directory is not searched !
   ENV_VAR:        name of a environment variable containing a path
   USE_PATH:       if this keyword is set the path of IDL is used for search
   SEARCH_TREE:    if this keyword is set the search is expanded to all subdirs of the
                   given directories, equivalent to a preceeding '+' in the directory name
   FILE_COUNT:     if set to named variable the number of file hits is returned
   DIR_COUNT:      if set to a named variable the number searched directories is returned
   DIR_FOUND:      if set to a named variable a string array of searched dirs is returned
   RETURN_MESSAGE: if set to a named variable the message is returned

 OUTPUTS:
   Result: string or string array contining the full path of the file

 EXAMPLE:

 REVISION HISTORY:
   Written         Theo Brauers, Jan 1999
   Modified        Theo Brauers, Feb 1999 wildcards, lists, counts
   Modified        T.B. 1999 Apr skip the ..\ and .\ entries with list
   Modified        T.B. 1999 Apr display the name of file if not found
   Modified        T.B. 1999 Apr search highest dir level
   Modified        T.B. 1999 Jul new keyword return_message returns the message text
   Corrected

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\file_search.pro)


FILE_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FILE_TEST
 PURPOSE:
       Test if file readable &, optionally, has specified contents.
 CATEGORY:
 CALLING SEQUENCE:
       flag = file_test(file)
 INPUTS:
       file = name of file to check.         in
 KEYWORD PARAMETERS:
       Keywords:
         CONTENTS=txt  contents of file (text file).  Must
           match what's in file or file_test returns 0.
 OUTPUTS:
       flag = test result, 1=true, 0=false.  out
 COMMON BLOCKS:
 NOTES:
       Notes: Useful for testing status type files.  Example:
         if file_test('last.tmp',contents='number 3') then begin
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 26

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\file_test.pro)


FILE_TIME_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   file_time_info

 PURPOSE:
   this function gives information about the time of files
   only for unix platform

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   time_info=FILE_TIME_INFO(files)

 INPUTS:
    files: string array of filenames

 KEYWORD PARAMETERS:

 OUTPUTS:
   time_info: stringarray(nfiles,3), containing: date, time, jstime for each file

 EXAMPLE:
    time_info=file_time_info(['tree.html','tree2html.pro'])
    print,transpose(time_info)

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998
   1999-Dec-14:  unix splitted into aix and linux
   2000-May-25:  linux call changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\file_time_info.pro)


FILE_UID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   file_uid

 PURPOSE:
   This function returns the u_id of a file

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=file_uid(file)

 INPUTS:
 file: the file name of a file

 RESTRICTIONS:
  only for unix


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\c_sources\file_uid.pro)


FILE_VERSION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	file_version

 PURPOSE:
	Given a file name this function returns a string composed of the file name and
	the modification date of the file

 CATEGORY:
	DATAFILES

 CALLING SEQUENCE:
	Result = file_version([file_name])

 OPTIONAL INPUTS:
	file_name: Name of a file (including directory). May be a scalar or array.
		If not provided the procedure 'whocalledme' is used to access the file name
		of the calling routine.

 KEYWORD PARAMETERS:
	/NO_DIR: If set the file name is returned without directory

 OUTPUTS:
	This function returns a string composed of the file name and
	the modification date of the file

 EXAMPLE:
	file_name = 'S:\links\idl_source\idl_work\fh_lib\a_and_b.pro'

	PRINT, file_version(file_name)
	--> S:\links\idl_source\idl_work\fh_lib\a_and_b.pro (Vers. from 25.02.2000 17:08:42)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 10.03.2000
	22.03.2000:	Added keyword parameter NO_DIR
					Made file_name an optional inoput

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\file_version.pro)


FILLJUMPS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FILLJUMPS
 PURPOSE:
       Find indices needed to fill in value jumps in an array.
 CATEGORY:
 CALLING SEQUENCE:
       filljumps, v, t, in
 INPUTS:
       v = array to examine.                       in
       t = max allowed value jump.                 in
 KEYWORD PARAMETERS:
 OUTPUTS:
       in = indices needed to keep max jumps < t.  out
 COMMON BLOCKS:
 NOTES:
       Notes: Use the IDL interpolate function to create
         the new array or arrays needed.  For example:
         filljump, y, t, in       ; Avoid large jumps in y.
         y2 = interpolate(y,in)   ; New y array.
         x2 = interpolate(x,in)   ; Corresponding x array.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Jul 18

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\filljumps.pro)


FILLVEC

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  fillvec

 PURPOSE:  

 USEAGE:   fillvec,vec,tol

 INPUT:    
   vec     vector with some bad points
   tol     index array of good points

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        11 Sep 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fillvec.pro)


FILL_ARR

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          fill_arr
 
 USEAGE:           fill_arr,a,ii
                   fill_arr,a,ii,niter=niter,omega=omega,tol=tol,po=po

 PURPOSE:          fill in undefined regions of a 2-d array by interpolation

 INPUT:
       a           array with some undefined points
       ii          index array of good image points, 
                   E.G., ii=where(aa ne 999)
 KEYWORD INPUT
       tol         maximum tolerance to achieve before stopping iteration
                   (default=0.001)
       niter       number of smoothing iterations (default=100)
       po          if set print diagnostic print out every PO iterations

 OUTPUT:
       a           image array with initially undefined points replaced
                   with values that vary smoothly in all dimensions
                   Initially defined points are unchanged.

 PROCEDURE:        repeat this sequence

                   
                   asave=a(ii)
                   a=smooth(a,3)
                   a(ii)=asave                   

 AUTHOR            Paul Ricchiazzi               29oct92
                   Earth Space Research Group    UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fill_arr.pro)


FILL_CONT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FILL_CONT
 PURPOSE:
       Returns a byte array with filled contours.
 CATEGORY:
 CALLING SEQUENCE:
       img = fill_cont(z)
 INPUTS:
       z = 2-d array to contour.    in
 KEYWORD PARAMETERS:
       Keywords:
         LEVELS=lv  Array of contour levels.  Default
           is 8 contours from array min to max.  First value
           in LEVELS should be the minimum of the first contour
           range, and the last should be the maximum of the
           last contour range.  For example, for 3 contour
           ranges from 23 to 130 LEVEL should be:
           23.0000      58.6667      94.3333      130.00
         N_LEVELS=n Number of evenly spaced levels to contour
           from array min to max.  Only if LEVELS not given.
         COLORS=clr Array of contour colors.  Default
           is enough colors to handle LEVELS
           spaced from 0 to !d.table_size-1.  Number of colors
           is 1 less than the number in LEVELS.
 OUTPUTS:
       img = output image.          out
         Same size as input array.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 22 Jan, 1993
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fill_cont.pro)


FILL_IMAGE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          fill_image
 
 USEAGE:           fill_image,a,ii

 PURPOSE:          fill in undefined regions of a 2-d array by interpolation

 INPUT:
       a           image array with some undefined points
       ii          index array of bad image points, 
                   E.G., ii=where(aa eq 999)

 keyword input
   extrapolate     if set extrapolation is used to fill in bad values outside
                   of region covered by convex hull of good points.
 OUTPUT:
       a           image array with initially undefined points replaced
                   with values that vary smoothly in both the horizontal and 
                   vertical directions.  Initially defined points are
                   unchanged.

 PROCEDURE:        Use TRIANGULATE and TRIGRID to establish a linear
                   interpolation function which is used to fill in
                   the undefined regions.  The points used to
                   generate the triangulation are immediately
                   adjacent to the undefined regions. "Good data" regions
                   are unchanged.  Execution time is increased if a
                   large fraction of the image is undefined.

 EXAMPLE:

   a=fltarr(16,16)
   x=[4,11,4,11]
   y=[4,4,11,11]
   a(x,y)=[1,2,4,3.]
   fill_image,a,where(a eq 0.),/extra
   tvim,a,/scale
   print,a(x,y)

; create a test pattern, splatter on some "no data"
; and fix it back up with FILL_IMAGE
; compare original data with fixed up data

   w8x11
   !p.multi=[0,2,2]
   loadct,5
   a=randata(256,256,s=3) & a=a-min(a) & aa=a
   tvim,a>0,/scale,title='Original Data',clev=clev
   contour,a>0,/overplot,levels=clev
   a(where(smooth(randomu(iseed,256,256),21) gt .51))=-999.; bad values
   tvim,a>0,/scale,title='Missing Data'
   fill_image,a,where(a eq -999)
   tvim,a>0,/scale,title='Restored data'
   contour,a>0,/overplot,levels=clev
   confill,aa-a,levels=[-1,-.1,-.01,.01,.1,1],title='Difference',/asp,c_thic=0

   
   

 AUTHOR            Paul Ricchiazzi                          29oct92
                   Institute for Computational Earth System Science
                   University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fill_image.pro)


FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	filter

 PURPOSE:
	This function returns the indices of elements in a data vector
	which are equal to the elements in a parameter vector

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	index = filter(data_vector, parameter_vector [,N_INDEX = n_ind] [,EXCLUDE = excl])

 INPUTS:
	data_vector:		the vector which will be searched for the elements defined in parameter_vector
	parameter_vector:	scalar or vector whose elements will be located in data_vector

 KEYWORD PARAMETERS:
	N_INDEX = n_ind:	(output, long). On return n_ind is set to the number of elements in
		index. If index = -1 then n_ind = 0.
	/EXCLUDE: exclude elements of param_vector from index

 OUTPUTS:
	Index vector. If no elements are found -1 is returned.

 EXAMPLE:
	a = FINDGEN(7)
	PRINT, filter(a, [2,4])					--> 2    4
	PRINT, filter(a, [2,4], /EXCL)		--> 0    1    3    5    6

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05. Aug. 98.
	25.03.1999:	Keyword parameter added: N_INDEX = n_ind
					Changed call to VekLogik against call to IndexLogic

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\filter.pro)


FINDEX

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  findex

 PURPOSE:  Compute "floating point index" into a table for use with
           INTERPOLATE.

 USEAGE:   result = findex(u,v)

 INPUT:    
   u       a monitically increasing or decreasing 1-D grid
   v       a scalor, or array of values

 OUTPUT:
   result  Floating point index. Integer part of RESULT(i) gives
           the index into to U such that V(i) is between
           U(RESULT(i)) and U(RESULT(i)+1).  The fractional part
           is the weighting factor

                          V(i)-U(RESULT(i))
                          ---------------------
                     U(RESULT(i)+1)-U(RESULT(i))


 DISCUSSION: 
           This routine is used to expedite one dimensional
           interpolation on irregular 1-d grids.  Using this routine
           with INTERPOLATE is much faster then IDL's INTERPOL
           procedure because it uses a binary instead of linear
           search algorithm.  The speedup is even more dramatic when
           the same independent variable (V) and grid (U) are used
           for several dependent variable interpolations.

  
 EXAMPLE:  

; In this example I found the FINDEX + INTERPOLATE combination
; to be about 1000 times faster then INTERPOL.

  x=randomu(iseed,10000) & x=x(sort(x)) & y=x^2-x
  xx=randomu(iseed,1000)
  t=systime(1) & y1=interpolate(y,findex(x,xx)) & t1=systime(1)-t
  t=systime(1) & y2=interpol(y,x,xx) & t2=systime(1)-t
  !p.multi=[0,1,2]
  plot,xx,y1,title=string('findex  cpu time=',t1),psym=3
  plot,xx,y2,title=string('interpol  cpu time=',t2),psym=3
  

 AUTHOR:   Paul Ricchiazzi                        21 Feb 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\findex.pro)


FINDFILE2[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FINDFILE2
 PURPOSE:
       Find files and sort them.
 CATEGORY:
 CALLING SEQUENCE:
       f = findfile2(pat)
 INPUTS:
       pat = filename or wildcard pattern.   in
 KEYWORD PARAMETERS:
       Keywords:
         /SORT means sort file names numerically.
         COUNT=c  Returned number of files found.
 OUTPUTS:
       f = sorted array of found file names. out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Mar, 1990
       R. Sterner, 1996 Sep 17 --- Added COUNT=c keyword.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\findfile2.pro)


FINDFILE2[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   findfile2

 PURPOSE:
   The findfile2 function returns a string array containing the names of all files matching File_Specification.
   This routine solves a problem by findfile for unix.

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=findfile2(File_Specification,[count=count])

 INPUTS:
  File_Specification: A scalar string used to find files. The string can contain any valid command-interpreter wildcard characters

 KEYWORD PARAMETERS:
  count:   A named variable into which the number of files found is placed. If no files are found, a value of 0 is returned.

 EXAMPLE:
  result=findfile2('/usr/local/icg/icg/idl_source/idl_cache/*.sav')

 RESTRICTIONS:

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-31
 2000-Jan-01 text_filter added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\findfile2.pro)


FINDFILE3[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FINDFILE3
 PURPOSE:
       Find files and sort them.
 CATEGORY:
 CALLING SEQUENCE:
       f = findfile3(pat)
 INPUTS:
       pat = filename or wildcard pattern.   in
             See notes below.
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=e error flag: 0=ok, 1=pattern error,
           2=no files found.
         /QUIET means do not display no files found message.
 OUTPUTS:
       f = sorted array of found file names. out
 COMMON BLOCKS:
 NOTES:
       Notes: The normal wildcard character that matches
         anything is *.  Using this character implies that
         no sort will be done.  Using $ in place of * means
         sort on that field.  Using # in place of * means
         first convert that field to a number, then sort on it.
         The wild card characters $ and # may not both be used
         together, but * may be used with either, but may not
         be adjacent. Must use the correct case (upper for VMS)
         The wildcard processing ability is limited.
 MODIFICATION HISTORY:
       R. Sterner, 8 Jul, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\findfile3.pro)


FINDFILE3[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   findfile3

 PURPOSE:
   The findfile3 function returns a string array containing the names of all files in all subdirectories matching File_Specification.
   This routine solves a problem by findfile for unix.

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=findfile3(File_Specification,[count=count])

 INPUTS:
  File_Specification: A scalar string used to find files. The string can contain any valid command-interpreter wildcard characters

 KEYWORD PARAMETERS:
  count:   A named variable into which the number of files found is placed. If no files are found, a value of 0 is returned.

 EXAMPLE:
  result=findfile3('/usr/local/icg/icg/idl_source/idl_cache/*.sav')

 RESTRICTIONS:

 MODIFICATION HISTORY:
       Written by:     F. Rohrer (ICG-3), 2000-March-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\findfile3.pro)


FINDFILESX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   findfilesx

 PURPOSE:
   This function searches files in a sub dir tree

 CATEGORY:
   OBSOLETE

 CALLING SEQUENCE:
   Result=FINDFILESX(path, search)

 INPUTS:
   path:   directory path to be searched
           if + is the first char all sub dirs are searched
   search: mask for files ('*.ps' : all ps files), can be array

 KEYWORD PARAMETERS:
   LEVEL:      this input set the number of directory levels
               to be searched (def=1)
               (-1 all levels)
   FILE_COUNT: if set to a named variable the number
               files is returned
   DIR_COUNT:  if set to a named variable the number
               dirs is returned
   DIR_FOUND:  if set to a named variable a string array
               of dirs is returned

 OUTPUTS:
   Result: string array of files with full path

 EXAMPLE:
   xx=findfilesx('+d:\', '*.enz', file_count=cx, dir_count=dc)
   print, files:',cx,'dirs:', dc
   IF cx GT 0 THEN print, transpose(xx)

 REVISION HISTORY:
   Written         Theo Brauers, Nov 1997
   Corrected

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\findfilesx.pro)


FINDRNG

[Previous Routine] [Next Routine] [List of Routines]
 useage:      findrng,x1,x2,x3
 purpose:     generates x3 floating point numbers 
                 spanning range x1 to x2 

 KEYWORD
   dx     if set ignor x3 and compute number of elements with 1+(x2-x1)/dx
           where dx is the increment
 
  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\findrng.pro)


FIND_DEFINED_WORDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   find_defined_words

 PURPOSE:
   This function returns all words found in a string or string array

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=find_defined_words(text,word,[/no_string])

 INPUTS:
   text:     a text string or array
   word:     the word or array for searching for

 KEYWORDS:
   no_string: if strings inside od "" or '' are not welcome

 RESTRICTIONS:
   momentanly uppercase are the same as lowercase
   letters as word gives no result

 OUTPUTS:
   This function returns all the words which are in the text
   It returns a NULL-String if there is no "fitting"

 EXAMPLE:
   Result=find_defined_words('this is a test','is')
   Result='is'
   Result=find_defined_words('this is a test','isq')
   Result=''

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), April 19 1998
   1998-June-28 a bit faster changed extremes by where
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\find_defined_words.pro)


FIND_FORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   find_form

 PURPOSE:
   This function finds the format specification for an array
   of numbers

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   result = find_form(numbers,flag=flag)

 INPUTS:
   numbers:  an array of numbers (one-dimensional)
   flag   :  flag=0 (default)
             flag=1 if the numbers have more than 7 digits after the
                    decimal-point, then the result is E-format (max.E22.14)
 KEYWORDS:
   force_type: to force float format by 1. or 1.d values
   reduce_accuracy : to force reduction of accuracy for 'F'-specifiers to 1/100 of the smallest value

 OUTPUTS:
   a possible format specification for all numbers

 EXAMPLE:
   numbers=[100,2.1345,1000.]
   print,find_form(numbers)
     F10.4
   print,find_form(numbers,/reduce_accuracy)
     F10.2
   print,find_form(-40010138.D)
     I9
   print,find_form(-40010138.D,/force)
     F10.0

 MODIFICATION HISTORY:
   written by      Marsy Lisken, Dec 1997
   corrected       M.L.          Feb 1998  E-format,flag for great numbers

 1998-03-12 added force_type
   find_form(1.,/force_type) = 'F3.0'
   find_form(1)='I2'
   find_form(1,/force_type)='I2'
 1998-03-20 added handling of string format 'A*'
 1998-10-20 line 178 record changed to record_in

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\find_form.pro)


FIND_INDICES_BY_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	find_indices_by_window

 PURPOSE:
   The result of this function is a two dimensional indexfield.
   It is used to find the indices which overlaps in client time depending on master time and time_window
   The first index is the start and the second the end index of the overlapping values from client_time.

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result=find_indices_by_window(client,master,master_time_window)

 INPUTS:
	client:             The client time
	master:             The master time
   master_time_window: The time_window must have same size as master

 OUTPUTS:
   This function returns a two dimensional indexfield
   The first index is the start and the second the end index of the used time window
   -1 at an index means there were no results

 EXAMPLE:
      client=[1,2,3,4,5]
      master=[2,4]
      time_window=[0,0]
      Result=find_indices_by_window(client,master,time_window)
      help,result
      RESULT          LONG      = Array[2, 2]
      print,result
           1           1
           3           3


 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1),  1996-May-06
   1998-Mar-02 much more efficiency by combining with suche.pro (F.Rohrer)
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\find_indices_by_window.pro)


FIND_UNIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        FIND_UNIT

 PURPOSE:
        Return classification and conversion information for
        physical units. You pass a unit name, and you will
        get a standard form of that name as well as a factor
        and an offset that convert the unit to SI standard.
        To convert one unit to another, use FIND_UNIT twice
        (see example below).

 CATEGORY:
        General Science

 CALLING SEQUENCE:
        FIND_UNIT,NAME,STDNAME,FACTOR,OFFSET,CATEGORY [,keywords]

 INPUTS:
        NAME -> A string containing the name to search for

 KEYWORD PARAMETERS:
        /GET_SI -> Return the name of the SI unit of the 
            physcategory of the given unit. Factor and offset 
            will always be 1.0 and 0.0, CATEGORY will contain 
            the physcategory number.
 
        /NO_STANDARD -> Do not return the standard name of a unit. The
            standard spelling is identified as the first occurrence
            of a given unit with the same conversion factor and offset
            in the same physcategory and normally replaces the 
            input name.

        /TEST -> Check standard unit strings for consistency
            This keyword is only useful when you add extra units.

 OUTPUTS:
        STDNAME -> The unit name as saved in the stdunits array
            (e.g. 'KG' is returned as 'kg')

        FACTOR -> A conversion factor to SI 

        OFFSET -> A conversion offset

        "CATEGORY -> The class to which the unit belongs:
           -1 : unit not found
            0 : distance
            1 : area
            2 : volume
            3 : time
            4 : frequency
            5 : speed
            6 : accelaration
            7 : temperature
            8 : weight
            9 : pressure
           10 : force
           11 : energy
           12 : power
           13 : mixing ratio
           14 : currency
           15 : voltage

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        FIND_UNIT,'kM/H',stdname,factor,offset,physcategory
        print,stdname,factor,offset,physcategory
        ; prints km/h     0.277780      0.00000       5

        ; conversion from Fahrenheit to Celsius
        temp = [ 0., 32., 80., 100. ]
        FIND_UNIT,'F',fromname,fromfac,fromoff,fromcat
        FIND_UNIT,'C',toname,tofac,tooff,tocat
        if (fromcat ne tocat) then print,'bullsh...'
        ctemp = ((fromfac*temp+fromoff) - tooff) / tofac
        print,ctemp
        ; prints  -17.7778  0.000152588   26.6670   37.7782

        ; find name of corresponding SI unit 
        FIND_UNIT,'mph',stdname,/get_si
        print,stdname
        ; prints  m/s

        ; find standard form of any unit
        FIND_UNIT,'miles/hour',stdname
        print,stdname
        ; prints  mph

 MODIFICATION HISTORY:
        mgs, 26 Aug 1998: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\find_unit.pro)


FIND_VALID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	find_valid

 PURPOSE:
	This function finds valid x-and y-values 

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   valid=find_valid(xwerte,ywerte)

 INPUTS:
	xwerte:structure (output of cache)
       ywerte:structure (output of cache)
 
  the structures contain the same tag names: 
 
  .name               : the name of the parameter 
  .file               : the filename of the file 
  .param              : the param field 
  .valid              : the valid field 
  .time               : the time field 
  .param_long_name    : the long_name of the parameter 
  .param_units        : the units of the parameter 
  .time_long_name     : the long_name of the time 
  .time_units         : the units of the time 
  

 OUTPUTS:
   valid: long-integer array,which contains the indices of valid values
          -1 if there are no valid values                 


 RESTRICTIONS:

 EXAMPLE:
   valid=find_valid(xwerte,ywerte)

 MODIFICATION HISTORY:
 	Written by:	Marsy Lisken, April 1998  
                                     text taken out of fileles
          revised:         apr 1998: changed proc in function 
          corrected:       jun 1998: 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\find_valid.pro)


FINTERP

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

 USEAGE         result=finterp(table,uvar)

 PURPOSE:       Compute the floating point interpolation index of
                UVAR(i,j,k...) into TABLE(*,i,j,k...) or TABLE(*).
                For example, if uvar(i,j) is half way between
                table(4,i,j) and table(5,i,j) then result(i,j)=4.5.

                NOTE: If TABLE is a vector the action of FINTERP is
                the same as INTERPOL(findgen(n),TABLE,UVAR). However,
                FINTERP should be much faster whenever UVAR is large
                and the number of TABLE values (first dimension of
                TABLE) is small.


 INPUT    

    table       A matrix or vector.  If TABLE is not a vector, the 
                first dimension of TABLE is interpreted as a vector
                of values that correspond to each element of UVAR.
                If TABLE is a vector, the action of FINTERP is the
                same as INTERPOL(findgen(n),TABLE,UVAR)


    uvar       a matrix of field values.

 OUTPUT:
    result      the floating point interpolation index of  UVAR(i,j,k...)
                into TABLE(*,i,j,k,...). 
 
; EXAMPLE:

 a=[[5.1,8.4],[6.7,3.1]]
 tbl=fltarr(5,2,2)
 
 tbl(*,0,0)=3+findgen(5)
 tbl(*,1,0)=4+findgen(5)
 tbl(*,0,1)=4+findgen(5)*2
 tbl(*,1,1)=findgen(5)
 fi=finterp(tbl,a)
 print,f='(8a9)',' ','UVAR','/---','----','TBL','----','---\','FI' &$
 print,f='(a9,7f9.2)','(0,0):',a(0,0),tbl(*,0,0),fi(0,0) &$
 print,f='(a9,7f9.2)','(1,0):',a(1,0),tbl(*,1,0),fi(1,0) &$
 print,f='(a9,7f9.2)','(0,1):',a(0,1),tbl(*,0,1),fi(0,1) &$
 print,f='(a9,7f9.2)','(1,1):',a(1,1),tbl(*,1,1),fi(1,1) 
   
 
; EXAMPLE:
                Map surface albedo over some area, given satellite
                radiance measurement on a 2d grid.  Assumptions:

                 1. ff(m,i,j) = irradiance predictions at each point
                    in a 2d grid.  The m index is over different
                    values of surface albedo.  The table values vary
                    from point-to point (the i and j indecies) due to
                    changes in satellite and solar viewing angles as
                    well as surface albedo.

                 2. salb(m) = a vector of different surface albedos
                    used in the model caculations.  

                 3.  aa(i,j) = actual measured values of radiance
                     on the same grid. 

                To retrieve the optical surface albedo at each point
                in the image use INTERPOLATE to compute the surface
                albedo at each point:

                     salb_map=interpolate(salb,finterp(ff,aa))

                or if logrithmic interpolation is desired

                     fndx=finterp(ff,aa)
                     salb_map=interpolate(alog(salb_map+1),fndx)
                     salb_map=exp(salb_map)-1.

 PROCEDURE:     uses WHERE to identify regions for interpolation.
                a separate call to WHERE is used for each table interval.
                The floating point index may extrapolate beyond the
                limits of the TABLE. Hence UVAR values less-to or
                greater-than the corresponding TABLE entries will
                produce return values which are outside the TABLE
                subscript range (INTERPOLATE knows how to handle this).

 RESTRICTIONS:  Table entries (first index of TABLE) must be monitonically 
                increasing. If the table is not monitonically increasing
                FINTERP only finds solutions for that part of the table
                which is monitonically increasing.  In this case, the return
                value for UVAR elements less than the relative minimum of
                TABLE is set to -9999.

  author:  Paul Ricchiazzi                            apr93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\finterp.pro)


FIRSTCHAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIRSTCHAR
 PURPOSE:
       Position of first non-whitespace char in string.
 CATEGORY:
 CALLING SEQUENCE:
       p = firstchar(txt)
 INPUTS:
       txt = text string to examine.                    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       p = position of first non-whitespece character.  out
 COMMON BLOCKS:
 NOTES:
       Note: For no non-whitespace characters p = -1.
 MODIFICATION HISTORY:
       R. Sterner, 20 Sep, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\firstchar.pro)


FIRST_CHAR_CONTLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  first_char_contline

 PURPOSE:
   This functions resolves continuation lines identified
   by the first character or string

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=FIRST_CHAR_CONTLINE(str)

 INPUTS:
   str:    string array containing the text

 KEYWORD PARAMETERS:
   CHAR:   this is the continuation line char, last nonspace char
           default '$'
   EXCH:   char will be exchanged with space or with char given in exch
           default ' '

 OUTPUTS:
   Result: this function returns a string array where continuation
           lines are merged with the previous line. The size of the
           returned string array is reduced accordingly

 EXAMPLE:
   str=['123','$ 123', '456']
   print, first_char_contline(str)
   IDL prints:
       123  123
       456

 MODIFICATION HISTORY:
   Written by: Theo Brauers / Franz Rohrer 1997-JAN-28
   Modifications:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\first_char_contline.pro)


FISHER_Z

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   fisher_z

 PURPOSE:
   This routine returns the the fisher-Z transformed data or performes
   the inverse transformation

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = FISCHER_Z(x)

 INPUTS:
   X: Scalar or array of float or double values

 KEYWORD PARAMETERS:
   INVERSE:    if this keyword set perform inverse trafo
   GAMMA:      if set to a single number

 MODIFICATION HISTORY:
   Written by Theo Brauers, 2000 april

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\fisher_z.pro)


FIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIT
 PURPOSE:
       Curve fit program. Polynomial, exponential, power law.
 CATEGORY:
 CALLING SEQUENCE:
       fit, x, y, [cur]
 INPUTS:
       x,y = input curve data arrays.                      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       cur = optional description of the last fit done.    out
          cur has following format:
          cur = [FTYPE, XOFF, YOFF, NDEG, C0, C1, ..., Cn]
                for polynomial,
          cur = [FTYPE, XOFF, YOFF, A, B]
                for exponential and power law.
          Useful for generating data using the fitted curve
          by calling y = gen_fit( x, cur)
          where x and cur are inputs, y is generated output.
       
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  13 Oct, 1986.
       RES 9 Oct, 1989 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fit.pro)


FIT12

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIT12
 PURPOSE:
       For internal use by FIT only.
 CATEGORY:
 CALLING SEQUENCE:
       fit12,x,y,xoff,yoff,ftype,ptype,cur,err0
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 9 Oct, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fit12.pro)


FIT6

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIT6
 PURPOSE:
       For internal use by FIT only.
 CATEGORY:
 CALLING SEQUENCE:
       fit6,x,y,xoff,yoff,ftype,cur,err0,go,fitflag,opt
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 9 Oct, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fit6.pro)


FITEXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	fitexy

 PURPOSE:
	Linear Least-squares approximation in one-dimension (y = a + b*x),
		when both x and y data have errors (e.g. Gaussian noise).

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	fitexy, x, y, A, B, X_SIG=sigx, Y_SIG=sigy, [sigma_A_B, chi_sq, q ]

 INPUTS:
	x = array of values for independent variable.
	y = array of data values assumed to be linearly dependent on x.

 KEYWORD PARAMETERS:
	X_SIGMA = scalar or array specifying the standard deviation of x data (required).
	Y_SIGMA = scalar or array specifying the standard deviation of y data (required).
	TOLERANCE = desired accuracy of minimum & zero location, default=1.e-3.

 OUTPUTS:
	A_intercept = constant parameter result of linear fit,
	B_slope = slope parameter, so that:
			( A_intercept + B_slope * x ) approximates the y data.

 OPTIONAL OUTPUTS:
	sigma_A_B = two element array giving standard deviation of
		 A_intercept and B_slope parameters, respectively.
                The standard deviations are not meaningful if (i) the
                fit is poor (see parameter q), or (ii) b is so large that
                the data are consistent with a vertical (infinite b) line.
                If the data are consistent with *all* values of b, then
                sigma_A_B = [1e33,e33]
	chi_sq = resulting minimum Chi-Square of Linear fit, scalar
       q - chi-sq probability, scalar (0-1) giving the probability that
              a correct model would give a value equal or larger than the
              observed chi squared.   A small value of q indicates a poor
              fit, perhaps because the errors are underestimated.

 COMMON BLOCKS:
	common fitexy, communicates the data for computation of chi-square.

 CALLS:
	function chisq_fitexy
	pro minf_bracket
	pro minf_parabolic
	function zbrent
       function chisqr_pdf   (from Statistics library)

 PROCEDURE:
	From "Numerical Recipes" column by Press and Teukolsky:
       in "Computer in Physics",  May, 1992 Vol.6 No.3

 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC  September 1992.
       Now returns q rather than 1-q   W. Landsman  December 1992
	16.06.1999, Frank Holland:
 		...\idl_work\icg_lib\fit_exy.pro is a modified version of
 		...\idl_lib\astro\pro\fitexy.pro.
 		Two obsolete IDL (RSI) routines (stdev.pro, chi_sqr1.pro) have been
 		replaced by new IDL (RSI) routines (stddev.pro, chisqr_pdf.pro).
	23.06.1999, Frank Holland: Header edited
	27.07.1999, Frank Holland:	fit_exy umbenannt in fitexy
	31.01.2000:	Frank Holland: Category entry was fixed.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\fitexy.pro)


FIXANG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIXANG
 PURPOSE:
       Fix angle discontinuety at 0-360.
 CATEGORY:
 CALLING SEQUENCE:
       b = fixang(a)
 INPUTS:
       a = input array of angles.                         in
 KEYWORD PARAMETERS:
       Keywords:
         /RADIANS means angles are in radians.
 OUTPUTS:
       b = array of angles with discontinueties removed.  out
 COMMON BLOCKS:
 NOTES:
       Notes: Assumes no valid delta angle GT 180 deg.
         Looks for large jumps in the angle.  Offset each
         section to match one before.  Angles may not be in
         the range 0 to 360 when done.
 MODIFICATION HISTORY:
       Ray Sterner  13 Aug, 1985.
       R. Sterner, 14 May, 1993 --- Cleaned up a little bit.
       R. Sterner, 1998 May 8 --- Added new keyword /RADIANS.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fixang.pro)


FIXANGH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIXANGH
 PURPOSE:
       Fix angle wraparound using a hysteresis method.
 CATEGORY:
 CALLING SEQUENCE:
       out = fixangh(in,delta)
 INPUTS:
       in = input angle in degrees.    in
       delta = hysteresis value.       in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = fixed angle.              out
 COMMON BLOCKS:
 NOTES:
       Notes: when angle in varies above 360+delta it is reset
       to delta.  When it varies below -delta it is reset to
       360-delta.  This should reduce the annoying jitter when
       the angle varies about the 0/360 break point.
       Plot resulting angle for yran=[-delta,360+delta].
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 12

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fixangh.pro)


FIXGAPS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FIXGAPS
 PURPOSE:
       Linearly interpolate across data gaps in an array.
 CATEGORY:
 CALLING SEQUENCE:
       out = fixgaps(a, tag)
 INPUTS:
       a = array to process.                 in
       tag = value in data gaps (def=0).     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = interpolated array.             out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       RES 20 Oct, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fixgaps.pro)


FLAT2SPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FLAT2SPH
 PURPOSE:
       Map a flat map onto a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       flat2sph, flat, lng1, lng2, lat1, lat2, $
 INPUTS:
       flat = array containing flat map.                    in
         Longitude in X, Latitude in Y.
       lng1, lng2 = start and end longitude in flat (deg).  in
       lat1, lat2 = start and end latitude in flat (deg).   in
       lng0, lat0 = Long. and Lat. of sphere center (deg).  in
       r = radius of sphere in pixels.                      in
           r may also be an array: [r,pa,ncx,ncy] where
           r = radius in pixels,
           pa = axis position angle in degrees,
           ncx, ncy = center in normalized coordinates.
       nx, ny = size of sphere image in pixels.             in
 KEYWORD PARAMETERS:
 OUTPUTS:
       sphere = output image of sphere.                     out
 COMMON BLOCKS:
 NOTES:
       Note: flat may contain only a partial map.
 MODIFICATION HISTORY:
       R. Sterner,  6 Nov, 1989.
       R. Sterner, 26 Feb, 1991 --- Renamed from flat2sphere.pro
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\flat2sph.pro)


FLICKER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FLICKER

 PURPOSE:
	Flicker between two output images

 CATEGORY:
	Image display, animation.

 CALLING SEQUENCE:
	FLICKER, A, B

 INPUTS:
	A:	Byte image number 1, scaled from 0 to 255.
	B:	Byte image number 2, scaled from 0 to 255.

       if a and b are not supplied FLICKER will enter interactive mode
       wherin the user will be asked to select two windows (by a LMB
       click inside the chosen window).  These two windows will be read
       using tvrd() and compared.
       
               

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Sunview: Modifies the display, changes the write mask.
	X and Windows: uses two additional pixmaps.

 RESTRICTIONS:
	None.

 PROCEDURE:
  SunView:
	Image A is written to the bottom 4 bits of the display.
	Image B is written to the top 4 bits.
	Two color tables are created from the current table, one that
	shows the low 4 bits using 16 of the original colors, and one
	that shows the high 4 bits.  The color table is changed to
	switch between images.
  Other window systems:
	two off screen pixmaps are used to contain the images.
       on exit image A is left on the display

 MODIFICATION HISTORY:
	DMS, 3/ 88.
	DMS, 4/92, Added X window and MS window optimizations.
       PJR/ESRG, 1/94, "flicker" control by mouse
       PJR/ESRG, 1/94, put in tvrd() of windows for interactive use


 EXAMPLE:
	
       plot,sin(dist(10))     & a=tvrd()
       plot,sin(dist(10)+.05) & b=tvrd()
       flicker,a,b
	       
  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\flicker.pro)


FLIGHT_ANGLE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  flight_angle

 PURPOSE:  compute zenith and azimuth of a unit vector pointing "up" 
           in coordinate system attached to an aircraft.

 USEAGE:   flight_angle,pitch,roll,heading,zenith,azimuth

 INPUT:    
  pitch    pitch angle (degrees) positive values indicate nose up
  roll     roll angle (degrees) positive values indicate right wing down
  heading  compass direction aircraft is pointed. Positive values
           represent clockwise, with respect to true North.  NOTE:
           This heading is the direction the airplane is pointed, not
           the direction it is moving

 KEYWORD_INPUT

  radians  if set all input and output angles are in radians

 OUTPUT:

  zenith   zenith angle of "up" unit vector
  azimuth  azimuth angle of "up" unit vector.  Positive values 
           represent clockwise, with respect to true North.

 EXAMPLE:  
 
;  compute the solar zenith angle of a airbourne sensor given 
;  (roll,pitch,heading) = (2,3,45) degrees at 10 am today

   doy=julday()-julday(1,0,1994)                          
   zensun,doy,12,34.456,-119.813,z,a,/local
   print,f='(6a13)','z','a','sunzen','sunaz','sunmu','corrected'
   flight_angle,2.,2.,45.,zen,az
   print,zen,az,z,a,cos(z*!dtor),muslope(z,a,zen,az)
   flight_angle,2.,-2.,45.,zen,az
   print,zen,az,z,a,cos(z*!dtor),muslope(z,a,zen,az)
   flight_angle,2.,0.,0.,zen,az
   print,zen,az,z,a,cos(z*!dtor),muslope(z,a,zen,az)
           

 AUTHOR:   Paul Ricchiazzi                        25 Feb 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\flight_angle.pro)


FNDWRD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FNDWRD
 PURPOSE:
       Find number, locations, lengths of words in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       fndwrd, txt, nwds, loc, len
 INPUTS:
       txt = text string to examine.                    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       nwds = number of words found in txt.             out
       loc = array of word start positions (0=first).   out
       len = array of word lengths.                     out
 COMMON BLOCKS:
 NOTES:
       Note: Words must be separated by spaces or tabs.
 MODIFICATION HISTORY:
       Ray. Sterner,  11 Dec, 1984.
       RES  Handle null strings better.   16 Feb, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN
       BLG  9 Dec, 1992 --- Modified to use tabs as delimiters as well.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fndwrd.pro)


FONTS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:       fonts

 userage:       fonts,greek=greek,math=math,gothic=gothic,script=script,$
                   italic=italic,all=all

 PURPOSE:       display available fonts in a new window
 INPUTS:        none
  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fonts.pro)


FORDATA

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      fordata

 USEAGE:       fordata,name,v,format=format,margin=margin,ng=ng,
                       append=append,/less=less

 PURPOSE:      print a fortran data statement to file "junk" 
               defining variable NAME with data values v

 input:
   name        name of variable or string to placed between the fortran
               "data" and "/" keywords, as in 
 
               data NAME / ...

   v           vector of values

 keyword input
   format      format specifier (string) of the form 
               x# or x## x#.# x##.# where x = { i, g, f, e } 
               and # is a digit (default = 'g10.4').  Note that
               the format string does not include parenthesis.

   append      append to file "junk". if append = 0 then junk is
               piped into less to allow a preview of the data format.

   margin      number of leading blanks (margin=0 starts at column 7)
               (default=2)

   ng          number of elements written in an implied fortran loop
               for example ng=5 in the following snippit of fortran 

               data (v(i),i=1,5)/10,12,24,11,22/
               data (v(i),i=6,10)/13,44,45,22,33/

               The default value is chosen to produce 20 fortran
               continuation statements.  pick a smaller value if 
               the number of continuations allowed on your fortran
               compiler is less than 20.  Set ng to a large number
               if no implied loops are desired.

 output:       none
 
 Side effects: writes data statement to file "junk"

 EXAMPLE:

   v=sin(findgen(200))
   fordata,'(v(i),i=1,100)',v(0:99),f='f12.6'
   fordata,'(v(i),i=101,200)',v(100:199),f='f12.6',/append

; automatically put in fortran implied do list to avoid an excessive
; number of continuation statements, preview with less

   fordata,'v',v,f='f10.6',/less
   fordata,'v',v,f='f12.6',/less
                                  

  author:  Paul Ricchiazzi                            jun92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fordata.pro)


FORDATIN

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    fordatin

 PURPOSE:    read fortran data statements

 USEAGE:     result=fordatin(file,varname)

 INPUT:      
   file      name of fortran source file containing target
             data statement (string)

   varname   name of fortran variable initialized in data statement 
             (string)

 KEYWORD INPUT:
 pu          the name of the program unit which contains the data
             initialization.  Specify enough of the leading
             characters of the program unit name to make it
             unique. White space and case are ignored.  For example

                    pu='subroutine foo'
                    pu='      subroutine   foobar' 
                    pu='SUBROUTINE FOOBAR(x1,' 

             all match 

                    subroutine foobar(x1,x2,x3)    ! a comment

 help        print this documentation header

 OUTPUT:
   result    array of initial values of variable VARNAME.

 PROCEDURE:  FORDATIN first searches through the fortran source file
             for a program unit matching PU (if this optional
             parameter is provided).  Next it looks for a line
             containing the keywords DATA and the variable name
             VARNAME. It reads all the following characters until it
             finds two matching forward slashes (/).  All characters
             between the matching slashes are scanned and turned into
             either an integer or float array as appropriate.
             

 RESTRICTIONS:
             this routine is designed to extract the part of the data
             block following a typical array initialization such as

                 data varname/ 1,2,3,4,5,5
                &          7,8,9/

             if the data statement looks like 

                 data (varname(i),i=1,3) /1,2,3/        
                 data (varname(i),i=4,6) /3,2,4/

             you can read the data as

                 v1=fordatin('file.f','(varname(i),i=1,3)')
                 v2=fordatin('file.f','(varname(i),i=4,6)')
                 v=[v1,v2]

             but beware, FORDATIN will read all the numbers between
             slashes in a multi-variable data statement such as

                 data v1,v2,v3/12,24,25/ 

 EXAMPLE:
             
; plot temperature profile of TROPICAL standard atmosphere

             z1=fordatin('/home/paul/rtmodel/atms.f','z1')
             t1=fordatin('/home/paul/rtmodel/atms.f','t1')
             plot,z1,t1

; plot coalbedo of ice particles as a function of wavelength

             wl=.29*(333.33/.29)^(findgen(400)/399)
             w=fordatin('/home/paul/rtmodel/cloudpar.f','(ww(i,14),i=1,mxwv)')
             plot,wl,1.-w,xrange=[0,4]

 REVISIONS:

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\fordatin.pro)


FORMSTRLEN (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        FORMSTRLEN  (function)

 PURPOSE:
        Return the (approximated) length of a strign that 
        contains Hershey formatting characters. If the string 
        does not contain any formatting characters, the result
        equals that of STRLEN, otherwise it will be shorter.
        Hershey characters ('!'+1 char) are ignored, characters in
        super or subscript mode are counted with a width of 0.6.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        len = FORMSTRLEN(s)

 INPUTS:
        S -> A string that may contain Hershey formatting characters.
             As with strlen, s may be a string array.

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        A float(!) value that gives the "true" length of the string

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        print,formstrlen('C2H6')
        ; IDL prints: 4
        print,formstrlen('C!L2!NH!L6!N')
        ; IDL prints 3.2

 MODIFICATION HISTORY:
        mgs, 27 Oct 1998: VERSION 1.00
        mgs, 24 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\formstrlen.pro)


FORM_FEED

[Previous Routine] [Next Routine] [List of Routines]
 routine       write a form feed (ascii 12) to file connected to LUN
 useage        form_feed,lun
 input         
   lun         unit number

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\form_feed.pro)


FPU_FIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		FPU_FIX
 VERSION:
		4.0
 PURPOSE:
		Clears Floating Point Underflow errors, setting the offending values to
		zero.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = FPU_FIX( X)
 INPUTS:
	X
		Arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/NO_ABS
		Switch.  If set, uses value instead of absolute value for comparison
		with machine minimum.  For internal use only.
 OUTPUTS:
		If the input is of any numeric type, returns the input, with the
		possible substitution of 0 for all occurences of Floating Point
		Underflow.  A non-numeric input is returned as is.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses the system routines CHECK_MATH and MACHAR.  Also
		calls ABS_MM and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 30-AUG-1998 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\fpu_fix.pro)


FRAME2NORM_POSITION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   frame2norm_position

 PURPOSE:
   This function will convert frame position (plot-window going from 0,0 to 1,1 in frame position) to position in normal koordinates

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   result=frame2norm_position([x,y] or [xl,yl,xr,yr])

 INPUT PARAMETERS:
   x,y-positions

 OUTPUTS:
   result: position in normal koordinates

 EXAMPLE:
   result=frame2norm_position([0.5,0.5])
   result=frame2norm_position([0.5,0.5,0.9,0.8])

 MODIFICATION HISTORY:
   Written by Franz Rohrer Apr 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\frame2norm_position.pro)


FREE_ALL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  free_all

 PURPOSE:  free up all logical units

 USEAGE:   free_all

 OUTPUT:   none

 DISCUSSION:
           Produces a list of all open files.  For each item in the
           list the user may enter one of the following reponses:

           quit -- do not close this file, quit free_all
           view -- do not close this file, view list of remaining open files
           all  -- close this file and all remaining open files
           yes  -- close this file
           no   -- do not close this file

           Note: only the first letter of the response is actually used in
           free_all.

 SIDE EFFECTS:
           closes open files
  
 EXAMPLE:  
         IDL> openw,/get_lun,lun1,'junk1'
         IDL> openw,/get_lun,lun2,'junk2'
         IDL> openw,/get_lun,lun3,'junk3'
         IDL> openw,/get_lun,lun4,'junk4'
         IDL> openw,/get_lun,lun5,'junk5'
         IDL> free_all
         Close junk1, logical unit 101 (quit,view/all/yes/no)?: y
         Close junk2, logical unit 102 (quit,view/all/yes/no)?: y
         Close junk3, logical unit 103 (quit,view/all/yes/no)?: a 
         Close junk4, logical unit 104 
         Close junk5, logical unit 105 
         

 AUTHOR:   Paul Ricchiazzi                        17 Mar 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\free_all.pro)


FRESNEL_INT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		FRESNEL_INT
 VERSION:
		4.0
 PURPOSE:
		Calculates the Fresnel Integrals, C(x) or S(X).
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = FRESNEL_INT (X [, keywords])
 INPUTS:
	X
		Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/SINE
		Switch.  If set, the Fresnel sine integral, S(X), is returned.
	/COMPLEMENTARY
		Switch.  If set, 1/2 - C(X) (or S(X)) is returned.
 OUTPUTS:
		Returns the Fresnel Cosine integral C(X) or, if /COMPLEMENTARY is set,
		the sine integral S(X).  If /COMPLEMENTARY is set, the output is
		1/2 (the value at infinity) - C(X) (or S(X)).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		While the function is defined also for complex values of X, large
		complex values may cause calculational instabilities.  A warning is
		issued in this case.
 PROCEDURE:
		Uses the function ERRORF_MM from MIDL, as well as CAST and TYPE, also
		from MIDL.
 MODIFICATION HISTORY:
		Created 20-MAR-1996 by Mati Meron.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\fresnel_int.pro)


FR_JSPL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       fr_jspl

 PURPOSE:
       Make a time series plot with time in Julian Seconds.

 CATEGORY:
     PLOT/PLOTXY

 CALLING SEQUENCE:
     fr_jspl, js, y

 INPUTS:
     js = Time array in Julian Seconds.   in
     y  = Data to be plotted.             in
 KEYWORD PARAMETERS:
       Keywords:
         GAP=gs  Gap in seconds.  This or greater time difference
           will cause a break in the curve.  If a plot symbol
           is desired use a negative psym number to connect pts.
         CCOLOR=cc     Curve and symbol color (def=same as axes).
         XTITLE=txt    Time axis title text.
         XTICKLEN=xtl  Time axis tick length (fraction of plot).
         XTICKS=n      Suggested number of time axis ticks.
           The actual number of tick marks may be quite different.
         FORMAT=fmt    Set date/time format (see timeaxis,/help).
         LABELOFF=off  Adjust label position (see timeaxis,/help).
         MAJOR=mjr     Major grid linestyle.
         MINOR=mnr     Minor grid linestyle.
         TRANGE=[js1,js2] Specified time range in JS.
         OFF=off       Returned JS of plot min time. Use to plot
           times in JS: VER, js(0)-off.
         /OVER         Make overplot.  oplot,js-off,y also works
           but will not handle any gaps.
         Any plot keywords will be passed on to the plot call.
         Following related to background sun colors:
         /SUN display day/night/twilight as background colors.
         COLOR=clr     Plot color (set to black by /SUN).
         LONG=lng, LAT=lat = observer location for sun colors.
         ZONE=hrs  Hours ahead of GMT (def=0). Ex: zone=-4 for EDT.
 OUTPUTS:
 COMMON BLOCKS:
       js_com
 NOTES:
       Notes:  Julian seconds are seconds after 0:00 1 Jan 2000.
         See also dt_tm_tojs(), dt_tm_fromjs(), ymds2js(), js2ymds.
 MODIFICATION HISTORY:
       R. Sterner 1994 Mar 30
       R. Sterner, 1994 May 17 --- Added common js_com.
       R. Sterner, 1996 Sep 16 --- Added sun colors.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

18. 8.97 : yvalue an timeaxis weitergeschleust
 F.Rohrer, ICG3, 12.5.1997
 New code to allow thick , lableoffset and dy for timeaxis
________NEW CODE F.ROHRER___________________________________________
 s_extra=size(extra)
 xthick=1.0
 if s_extra(2) ne 1 then begin
 tnames=tag_names(extra)
 nxthick=where(tnames eq 'XTHICK',nxthickcount)
 if nxthickcount gt 0 then xthick=extra.xthick
 endif
________CHANGED CODE F.ROHRER___________________________________________
        if not keyword_set(over) then $
          timeaxis, jd=jd, form=frm, nticks=ntics, title=xtitl, $
            ticklen=xtl*100, labeloffset=lbloff, charsize=csz, $
            color=clr, major=mjr, minor=mnr , thick=xthick
________CHANGED CODE F.ROHRER___________________________________________
pro jsplot, t, y0, help=hlp, charsize=csz, color=clr, $
          format=frm, xtitle=xtitl, xticklen = xtl, xticks=ntics, $
          labeloff=lbloff, _extra=extra, major=mjr, minor=mnr, $
          trange=tran, gap=gap, max_value=maxv, linestyle=lstyl, $
          thick=thk, ccolor=cclr, off=off, psym=psym, symsize=symsize, $
          nodata=nodata, over=over, xtick_get=xtkget, ytick_get=ytkget, $
          sun=sun, long=lng, lat=lat, zone=zone, $
          nolabels=nolabels, dy=dy
FR 24.8.1998 'and n_elements(t) gt 1 ' eingefügt in GAP_Steuerung
RB 20.10.1998 line 219 if not w[0] eq -1 eingefuegt damit wenn gar keine Daten innerhalb des gaps sind es nicht krascht.
RB 1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
RB/FR 1999-Jun-16 maxvalue from oplot removed
________________________________________________________________________

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\fr_jspl.pro)


FSC_COLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FSC_COLOR

 PURPOSE:

       The purpose of this function is to obtain drawing colors
       by name and in a device-decomposition independent way. The
       color names and values may be read in as a file, or 88
       color names and values are supplied from the program. These
       were obtained from the file rgb.txt, found on most X-Window
       distributions. Representative colors were chose from across
       the color spectrum. To see a list of colors available, type:
       Print, FSC_Color(/Names).

 AUTHOR:

       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics, Color Specification.

 CALLING SEQUENCE:

       color = FSC_COLOR(theColor, theColorIndex)

 NORMAL CALLING SEQUENCE FOR DEVICE-INDEPENDENT COLOR:

       axisColor = FSC_COLOR("Green", !D.Table_Size-2)
       backColor = FSC_COLOR("Charcoal", !D.Table_Size-3)
       dataColor = FSC_COLOR("Yellow", !D.Table_Size-4)
       Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
       OPlot, Findgen(11), Color=dataColor

 OPTIONAL INPUT PARAMETERS:

       TheColor: A string with the "name" of the color. To see a list
           of the color names available set the NAMES keyword.

           Valid names depend on the colors loaded in the program, but
           typically include such these colors as these:

              Black       Pink
              Magenta     Aqua
              Cyan        SkyBlue
              Yellow      Beige
              Green       Charcoal
              Red         Gray
              Blue        Orchid
              Navy        White

           The color WHITE is used if this parameter is absent. To see a list
           of the color names available in the program, type this:

              Print, FSC_COLOR(/Names)

       TheColorIndex: The color table index where the specified color is loaded.
           The color table index parameter should always be used if you wish to
           obtain a color value in a color-decomposition-independent way in your
           code. See the NORMAL CALLING SEQUENCE for details.

 RETURN VALUE:

       The value that is returned by FSC_COLOR depends upon the keywords
       used to call it and on the version of IDL you are using. In general,
       the return value will be either a color index number where the specified
       color is loaded by the program, or a 24-bit color value that can be
       decomposed into the specified color on true-color systems.

       If you are running IDL 5.2 or higher, the program will determine which
       return value to use, based on the color decomposition state at the time
       the program is called. If you are running a version of IDL before IDL 5.2,
       then the program will return the color index number. This behavior can
       be overruled in all versions of IDL by setting the DECOMPOSED keyword.
       If this keyword is 0, the program always returns a color index number. If
       the keyword is 1, the program always returns a 24-bit color value.

       If the TRIPLE keyword is set, the program always returns the color triple,
       no matter what the current decomposition state or the value of the DECOMPOSED
       keyword. Normally, the color triple is returned as a 1 by 3 column vector.
       This is appropriate for loading into a color index with TVLCT:

          IDL> TVLCT, FSC_Color('Yellow', /Triple), !P.Color

       But sometimes (e.g, in object graphics applications) you want the color
       returned as a row vector. In this case, you should set the ROW keyword
       as well as the TRIPLE keyword:

          viewobj= Obj_New('IDLgrView', Color=FSC_Color('charcoal', /Triple, /Row))

       If the ALLCOLORS keyword is used, then instead of a single value, modified
       as described above, then all the color values are returned in an array. In
       other words, the return value will be either an NCOLORS-element vector of color
       table index numbers, an NCOLORS-element vector of 24-bit color values, or
       an NCOLORS-by-3 array of color triples.

       If the NAMES keyword is set, the program returns a vector of
       color names known to the program.

 INPUT KEYWORD PARAMETERS:

       ALLCOLORS: Set this keyword to return indices, or 24-bit values, or color
              triples, for all the known colors, instead of for a single color.

       DECOMPOSED: Set this keyword to 0 or 1 to force the return value to be
              a color table index or a 24-bit color value, respectively.

       FILENAME: The string name of an ASCII file that can be opened to read in
              color values and color names. There should be one color per row
              in the file. Please be sure there are no blank lines in the file.
              The format of each row should be:

                  redValue  greenValue  blueValue  colorName

              Color values should be between 0 and 255. Any kind of white-space
              separation (blank characters, commas, or tabs) are allowed. The color
              name should be a string, but it should NOT be in quotes. A typical
              entry into the file would look like this:

                  255   255   0   Yellow

       NAMES: If this keyword is set, the return value of the function is
              a ncolors-element string array containing the names of the colors.
              These names would be appropriate, for example, in building
              a list widget with the names of the colors. If the NAMES
              keyword is set, the COLOR and INDEX parameters are ignored.

                 listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16)

       ROW:   If this keyword is set, the return value of the function when the TRIPLE
              keyword is set is returned as a row vector, rather than as the default
              column vector. This is required, for example, when you are trying to
              use the return value to set the color for object graphics objects. This
              keyword is completely ignored, except when used in combination with the
              TRIPLE keyword.

       SELECTCOLOR: Set this keyword if you would like to select the color name with
              the PICKCOLORNAME program. Selecting this keyword automaticallys sets
              the INDEX positional parameter. If this keyword is used, any keywords
              appropriate for PICKCOLORNAME can also be used. If this keyword is used,
              the first positional parameter can be either a color name or the color
              table index number. The program will figure out what you want.

       TRIPLE: Setting this keyword will force the return value of the function to
              *always* be a color triple, regardless of color decomposition state or
              visual depth of the machine. The value will be a three-element column
              vector unless the ROW keyword is also set.

       In addition, any keyword parameter appropriate for PICKCOLORNAME can be used.
       These include BOTTOM, COLUMNS, GROUP_LEADER, INDEX, and TITLE.

 OUTPUT KEYWORD PARAMETERS:

       CANCEL: This keyword is always set to 0, unless that SELECTCOLOR keyword is used.
              Then it will correspond to the value of the CANCEL output keyword in PICKCOLORNAME.

       COLORSTRUCTURE: This output keyword (if set to a named variable) will return a
              structure in which the fields will be the known color names (without spaces)
              and the values of the fields will be either color table index numbers or
              24-bit color values.

       NCOLORS: The number of colors recognized by the program. It will be 88 by default.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 ADDITIONAL PROGRAMS REQUIRED:

   PICKCOLORNAME: This file can be found in the Coyote Library:

             http://www.dfanning.com/programs/pickcolorname.pro

 EXAMPLE:

       To get drawing colors in a device-decomposed independent way:

           axisColor = FSC_COLOR("Green", !D.Table_Size-2)
           backColor = FSC_COLOR("Charcoal", !D.Table_Size-3)
           dataColor = FSC_COLOR("Yellow", !D.Table_Size-4)
           Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
           OPlot, Findgen(11), Color=dataColor

       To set the viewport color in object graphics:

           theView = Obj_New('IDLgrView', Color=FSC_Color('Charcoal', /Triple))

       To change the viewport color later:

           theView->SetProperty, Color=FSC_Color('Antique White', /Triple)

 MODIFICATION HISTORY:
       Written by: David Fanning, 19 October 2000. Based on previous
          GetColor program.
       Fixed a problem with loading colors with TVLCT on a PRINTER device. 13 Mar 2001. DWF.
       Added the ROW keyword. 30 March 2001. DWF.
       Added the PICKCOLORNAME code to the file, since I keep forgetting to
          give it to people. 15 August 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_color.pro)


FSC_DROPLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_DROPLIST

 PURPOSE:

   The purpose of this compound widget is to provide an alternative
   to the DROPLIST widget offered in the IDL distribution. What has
   always annoyed me about a droplist is that you can't get the current
   "value" of a droplist easily. This compound widget makes this and
   other tasks much easier.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   droplistObj = FSC_Droplist(parent, Title='Animals: ", Value=['Dog'. 'Cat', 'Coyote'], Index=2)

   The return value of the FSC_Droplist (droplistObj in this example) is
   an object reference. Interaction with the droplist will occur through
   object methods.

 INPUT PARAMETERS:

   parent -- The parent widget ID of the compound widget. Required.

 INPUT KEYWORDS:

 Any keyword that is appropriate for the Widget_Droplist function can be used.
 In addition, these keywords are explicitly defined.

   EVENT_FUNC -- Set this keyword to the name of an Event Handler Function.
   EVENT_PRO -- Set this keyword to the name of an Event Handler Procedure.
   FORMAT -- A format specifier for the "format" of the values in the droplist.
   INDEX -- The index number of the current selection.
   SPACES -- A two-element array that indicates the number of blank spaces to be added
             to the the beginning and end of the formatted values. If a single number
             is provided, this number of blank spaces is added to both the beginning
             and the end of the value.
   TITLE -- The title of the droplist widget.
   UNAME -- The user name of the droplist widget. (Only available in IDL 5.2 and higher.)
   UVALUE -- The normal "user value" of the droplist.
   VALUE -- An array of the droplist "selections". May be any data type.

 COMMON BLOCKS:

   None.

 DEPENDENCIES:

   Requires ERROR_MESSAGE from the Coyote Library..

 EVENT STRUCTURE:

   An event is returned each time the droplist value is changed. The event structure
   is defined like this:

   event = { FSC_DROPLIST_EVENT, $ ; The name of the event structure.
             ID: 0L, $             ; The ID of the compound widget's top-level base.
             TOP: 0L, $            ; The widget ID of the top-level base of the hierarchy.
             HANDLER: 0L, $        ; The event handler ID. Filled out by IDL.
             INDEX: 0L, $          ; The index number of the current selection.
             SELECTION:Ptr_New() $ ; A pointer to the current selection "value".
             SELF:Obj_New() }      ; The object reference of the compound widget.

 PUBLIC OBJECT METHODS:

   GetID -- A function with no arguments that returns the widget identifier
      of the droplist widget.

      droplistID = droplistObj->GetID()

   GetIndex -- A function with no arguments that returns the index
      number of the current droplist selection.

      currentIndex = droplistObj->GetIndex()

   GetSelection -- A function with no arguments that returns the current
      droplist selection.

      currentSelection = droplistObj->GetSelection()

   GetUValue -- A function with no arguments that returns the "user value"
      of the compound widget i.e., the value set with the UVALUE keyword).

      myUValue = droplistObj->GetUValue()

   GetValues -- A function with no arguments that returns the "values" or
      "selections" for the droplist.

      possibleSelections = droplistObj->GetValues()

   Resize -- A procedure that sets the X screen size of the droplist. It is
      defined like this:

      PRO Resize, newSize, ParentSize=parentSize

      The "newSize" keyword is the new X screen size. If this argument is
      missing, the screen X size of the compound widget's parent is used.
      The parentSize keyword is an output keyword that returns the X screen
      size of the compound widget's parent.

      droplistObj->Resize, 400

      Note that not all devices (e.g., X Windows devices) support droplist resizing.

   SetIndex -- A procedure that sets the current droplist selection based on
      the given index. This is equivalent to Widget_Control, droplistID, Set_Droplist_Select=newIndex

      droplistObj->SetIndex, newIndex

   SetSelection -- Whereas a regular droplist widget can only be set by index
      number, this compound widget can also be set by a "selection". The new selection
      can be any data type and corresponds to one of the "values" of the droplist.

      droplistObj->SetSelection, newSelection


 EXAMPLE:

   An example program is provided at the end of the FSC_DROPLIST code. To run it,
   type these commands:

      IDL> .Compile FSC_DROPLIST
      IDL> Example

 MODIFICATION HISTORY:

   Written by: David Fanning, 17 Jan 2000. DWF.
   Added FORMAT and SPACES keywords 28 April 2000. DWF.
   Fixed a small problem with event processing when the EVENT_FUNC keyword
      was used. 29 Dec 2000. DWF.
   Attached the UNAME value to the TLB of the compound widget instead
      of to the droplist widget itself. 11 Jan 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_droplist.pro)


FSC_FIELD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_FIELD

 PURPOSE:

   The purpose of this compound widget is to provide an alternative
   to the CW_FIELD widget offered in the IDL distribution. One weakness
   of the CW_FIELD compound widget is that the text widgets do not
   look editable to the users on Windows platforms. This program
   corrects that deficiency and adds some features that I think
   will be helpful. For example, you can now assign an event handler
   to the compound widget, ask for positive numbers only, and limit
   the number of digits in a number, or the number of digits to the
   right of a decimal point. The program is written as a widget object,
   which allows the user to call object methods directly, affording
   even more flexibility in use. This program replaces the earlier
   programs FSC_INPUTFIELD and COYOTE_FIELD.

   The program consists of a label widget next to a one-line text widget.
   The "value" of the compound widget is shown in the text widget. If the
   value is a number, it will not be possible (generally) to type
   alphanumeric values in the text widget. String values behave like
   strings in any one-line text widget.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 TYPICAL CALLING SEQUENCE:

   fieldID = FSC_FIELD(parent, Title="X Size:", Value=256, Object=fieldObject, Digits=3)

 INPUT PARAMETERS:

   parent -- The parent widget ID of the compound widget. Required.

 INPUT KEYWORDS:

   COLUMN        Set this keyword to have the Label widget above the Text widget.
                 The default is to have the Label widget in a row with the Text widget.

   CR_ONLY       Set this keyword if you only want Carriage Return events returned to
                 your event handler. If this keyword is not set, all events are returned.
                 Setting this keyword has no effect unless either the EVENT_PRO or
                 EVENT_FUNC keyword is used.

   DECIMAL       Set this keyword to the number of digits to the right of the decimal
                 point in floating point or double precision numbers. Ignored for STRING values.

   DIGITS        Set this keyword to the number of digits permitted in integer numbers.

   EVENT_FUNC    Set this keyword to the name of an event handler function. If this
                 keyword is undefined and the Event_Pro keyword is undefined,
                 all compound widget events are handled internally and not
                 passed on to the parent widget.

   EVENT_PRO     Set this keyword to the name of an event handler procedure. If this
                 keyword is undefined and the Event_Func keyword is undefined,
                 all compound widget events are handled internally and not
                 passed on to the parent widget.

   FIELDFONT     The font name for the text in the text widget.

   FRAME         Set this keyword to put a frame around the compound widget.

   LABEL_LEFT    Set this keyword to align the text on the label to the left.

   LABEL_RIGHT   Set this keyword to align the text on the label to the right.

   LABELFONT     The font name for the text in the label widget.

   LABELSIZE     The X screen size of the label widget.

   NAME          A string containing the name of the object. The default is ''.

   NOEDIT        Set this keyword to allow no user editing of the input text widget.

   NONSENSITIVE  Set this keyword to make the input text widget non-sensitive.

   POSITIVE      Set this keyword if you want only positive numbers allowed.

   SCR_XSIZE     The X screen size of the compound widget.

   SCR_YSIZE     The Y screen size of the compound widget.

   TITLE         The string text placed on the label widget.

   UNDEFINED     Set this keyword to the value to use for "undefined" values. If
                 not set, then !Value.F_NAN is used for numerical fields and a
                 NULL string is used for string fields. This applies to values
                 obtained with the GET_VALUE method or the GET_VALUE function.

   UVALUE        A user value for any purpose.

   VALUE         The "value" of the compound widget. Any type of integer, floating, or string
                 variable is allowed. The data "type" is determined automatically from the
                 value supplied with this keyword. Be sure you set the type appropriately for
                 your intended use of the value.

   XSIZE         The X size of the text widget in the usual character units.

 OUTPUT KEYWORDS:

   OBJECT        Set this keyword to a named variable to receive the compound widget's
                 object reference. This is required if you wish to call methods on the object.
                 Note that the object reference is also available in the event structure
                 generated by the widget object. Note that the object reference will be
                 necessary if you want to get or set values in the compound widget.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   None.

 EVENT STRUCTURE:

   All events are handled internally unless either the Event_Pro or Event_Func
   keywords are used to assign an event handler to the compound widget. By
   default all events generated by the text widget are passed to the assigned
   event handler. If you wish to receive only Carriage Return events, set the
   CR_Only keyword.

   event = { FSC_FIELD_EVENT, $   ; The name of the event structure.
             ID: 0L, $            ; The ID of the compound widget's top-level base.
             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
             OBJECT: Obj_New(), $ ; The "self" object reference. Provided so you can call methods.
             VALUE: Ptr_New(), $  ; A pointer to the widget value.
             TYPE:""              ; A string indicating the type of data in the VALUE field.
           }

   Note that if the field is "empty", the VALUE will be a pointer
   to an undefined variable. You should check this value before you
   use it. You code will look something like this:

     IF N_Elements(*event.value) EQ 0 THEN $
         Print, 'Current Value UNDEFINED.' ELSE $
         Print, 'Current Value: ', *event.value

 GETTING and SETTING VALUES:

   Almost all the properties of the widget can be obtained or set via
   the object's GetProperty and SetProperty methods (described below).
   Traditional compound widgets have the ability to get and set the "value"
   of the compound widget identifier (e.g., fieldID in the calling
   sequence above). Unfortunately, it is impossible to retreive a variable
   in this way when the variable is undefined. In practical terms, this
   means that the undefined variable must be set to *something*. You can
   determine what that something is with the UNDEFINED keyword, or I will set
   it to !VALUES.F_NAN for numerical fields and to the null string for string
   fields. In any case, you will have to check for undefined variables before
   you try to do something with the value. For a numerical field, the code
   might look something like this:

      fieldID = FSC_FIELD(parent, Title="X Size:", Value=256, Object=fieldObject, Digits=3)
      currentValue = fieldObject->Get_Value()
      IF Finite(currentValue) EQ 0 THEN Print, 'Value is Undefined' ELSE Print, currentValue

   Additional examples are provided in the numerical example fields in Example Program below.

   Setting the value of the compound widget is the same as calling the Set_Value
   method on the object reference. In other words, these two statements are equivalent.

        fieldObject->Set_Value, 45.4
        Widget_Control, fieldID, Set_Value=45.4

   The data type of the value is determined from the value itself. Be sure you set it appropriately.

 OBJECT PROCEDURE METHODS:

   GetProperty -- This method allows various properties of the widget to be
       returned via output keywords. The keywords that are available are:

       CR_Only -- A flag, if set, means only report carriage return events.
       DataType -- The data type of the field variable.
       Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
       Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
       Event_Func -- The name of the event handler function.
       Event_Pro -- The name of the event handler function.
       Name -- A scalar string name of the object.
       NoEdit -- A 1 means the widget is non-editable.
       NonSensitive -- A 1 means the widget is non-sensitive.
       NonSensitive -- Set this keyword to make the widget non-sensitive.
       Positive -- Indicates if the Positive number flag is set (1) or not (0).
       UValue -- The user value assigned to the compound widget.
       Value -- The "value" of the compound widget.

   MoveTab -- This method moves the focus to the widget identified in the "next" field,
        which must be set with the SetTabNext method. No parameters. Called automatically
        when a TAB character is typed in the text widget.

   Resize -- This method allows you to resize the compound widget's text field.
        The value parameter is an X screen size for the entire widget. The text
        widget is sized by using the value obtained from this value minus the
        X screen size of the label widget.

          objectRef->Resize, screen_xsize_value

   Set_Value -- This method allows you to set the "value" of the field. It takes
       one positional parameter, which is the value.

          objectRef->Set_Value, 5


   SetEdit -- This procedure turns editing on (value of 1) or off (value of 0).

   SetProperty -- This method allows various properties of the widget to be
       set via input keywords. The keywords that are available are:

       CR_Only -- Set this keyword if you only want Carriage Return events.
       Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
       Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
       Event_Func -- Set this keyword to the name of an Event Function.
       Event_Pro -- Set this keyword to the name of an Event Procedure.
       LabelSize --  The X screen size of the Label Widget.
       Name -- A scalar string name of the object. (default = '')
       NoEdit -- Set this keyword to make the widget non-editable.
       NonSensitive -- Set this keyword to make the widget non-sensitive.
       Positive -- Set this keyword to indicate only positive numbers are allowed.
       Scr_XSize -- The X screen size of the text widget.
       Scr_YSize -- The Y screen size of the text widget.
       Title -- The text to go on the Label Widget.
       UValue -- A user value for any purpose.
       Value -- The "value" of the compound widget.
       XSize -- The X size of the Text Widget.

   SetSensitive -- This procedure turns text widget sensitivity on (value of 1) or off (value of 0).

 OBJECT FUNCTION METHODS:

      Get_Value -- Returns the "value" of the field. No parameters. Will be undefined
          if a "number" field is blank. Should be checked before using:

          IF N_Elements(objectRef->Get_Value()) NE 0 THEN Print, Value is: ', objectRef->Get_Value()

      GetID -- Returns the widget identifier of the compound widget's top-level base.
         (The first child of the parent widget.) No parameters.

      GetLabelSize -- Returns the X screen size of the label widget. No parameters.

      GetTextID -- Returns the widget identifier of the compound widget's text widget.
         No parameters.

      GetTextSize -- Returns the X screen size of the text widget. No parameters.


 PRIVATE OBJECT METHODS:

   Although there is really no such thing as a "private" method in IDL's
   object implementation, some methods are used internally and not meant to
   be acessed publicly. Here are a few of those methods. I list them because
   it may be these private methods are ones you wish to override in subclassed
   objects.

      MoveTab -- This method moves the cursor to end of the text in the widget identified
        by the nexttab field. (This will be set with the SetTabNext method.)

      Text_Events -- The main event handler method for the compound widget. All
        text widget events are processed here.

      ReturnValue -- This function method accepts a string input value and converts
        it to the type of data requested by the user.

      Validate -- This function method examines all text input and removes unwanted
        characters, depending upon the requested data type for the field. It makes it
        impossible, for example, to type alphanumeric characters in an INTEGER field.

 EXAMPLE:

   An example program is provided at the end of the FSC_FIELD code. To run it,
   type these commands:

      IDL> .Compile FSC_Field
      IDL> Example

 MODIFICATION HISTORY:

   Written by: David Fanning, 18 October 2000. Based heavily on an earlier
      FSC_INPUTFIELD program and new ideas about the best way to write
      widget objects.
   Added LABEL_LEFT, LABEL_RIGHT, and UNDEFINED keywords. 29 Dec 2000. DWF.
   Modified the way the value is returned in the GET_VALUE method and the
      GET_VALUE function. Modified Example program to demonstrate. 30 Dec 2000. DWF.
   Added NOEDIT and NONSENSITIVE keywords, with corresponding SETEDIT and SETSENNSITIVE
      methods. 19 Jan 2001. DWF.
   Actually followed through with the changes I _said_" I made 29 Dec 2000. (Don't ask....) 13 June 2001. DWF.
   Added GetTextSize and GetLabelSize methods for obtaining the X screen
      size of the text and label widgets, respectively. 21 July 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_field.pro)


FSC_FILESELECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_FILESELECT

 PURPOSE:

   The purpose of this compound widget is to provide a means
   by which the user can type or select a file name. The
   program is written as an "object widget", meaning that
   the guts of the program is an object of class FSC_FILESELECT.
   This is meant to be an example of the obvious advantages of
   writing compound widget programs as objects.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   filenameID = FSC_FileSelect(parent)

 INPUT PARAMETERS:

   parent -- The parent widget ID of the compound widget. Required.

 INPUT KEYWORDS:

   Event_Pro -- The event handler procedure for this compound widget.By default: "".
   Event_Func -- The event handler function for this compound widget. By default: "".

      If neither EVENT_PRO or EVENT_FUNC is defined, program events are handled internally by the compound widget.

   DirectoryName -- The initial name of the directory. By defaut: current directory.
   Filename -- The initial file name in the filename text widget.
   Filter -- The file filter. By default: "*".
   Frame -- Set this keyword for a frame around the compound widget.
   LabelFont -- The font for the label widget. By default: "".
   LabelName -- The text on the label widgt. By default: "Filename: ".
   LabelSize -- The X screen size of the label widget. By default: 0.
   MustExist -- A flag that indicates selected files must exist. By default: 0.
   NoMaxSize -- A flag to prohibit automatic text widget sizing. By default: 0.

     If this keyword is not set, the compound widget will automatically resize itself to
     the largest widget in its parent base widget. It will do this by changing the size of
     the text widgets holding the file and directory names.

   Read -- Set this keyword to have file selection for reading a file. By default: 1.
   SelectDirectory -- The default directory for file selection. In other words, this is the
     default directory for DIALOG_PICKFILE, which is accessed via the BROWSE buttons.
   SelectFont -- The font for the "Browse" button. By default: "".
   SelectTitle -- The title bar text on the file selection dialog. By default: "Select a File...".
   TextFont -- The font for the filename text widget. By default: "".
   UValue -- User value for any purpose.
   Write -- Set this keyword to open a file for writing. By default: 0.
   XSize -- The X size of the text widget holding the filename. By default: StrLen(filename) * 1.5 > 40.

 OUTPUT KEYWORDS:

   ObjectRef -- Assign this keyword to an output variable that will hold the internal object reference.
                With the object reference you can call object methods to easily change many properties of
                the compound widget.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   Probably doesn't work correctly on VMS systems :-( If you can help, please
   contact me. I don't have a VMS system to test on.

 EVENT STRUCTURE:

   All events are handled internally unless either the Event_Pro or Event_Func
   keywords are used to assign an event handler to the compound widget. All events
   generated by the text widgets are passed to the assigned event handler.

   event = { CW_FILESELECT, $     ; The name of the event structure.
             ID: 0L, $            ; The ID of the compound widget's top-level base.
             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
             Basename: "", $      ; The base filename without directory specifiers.
             Filename: "", $      ; The fully qualified filename.
             Filter: ::, $        ; The currently active file filter.
             Directory: "", $     ; The name of the current file directory.
           }

 EXAMPLE:

   An example program is provided at the end of the FSC_FILESELECT code. To run it,
   type these commands:

      IDL> .Compile fsc_fileselect
      IDL> Example

   Or, if you want to obtain the object reference, type this:

      IDL> Example, theObject

   Now you can call the object's methods. For example:

      IDL theObject->SetProperty, XSize=150

 GETTING and SETTING VALUES:

   So as not to disrupt the accepted paradigm in using compound widgets, you
   can use the return value of the FSC_FILESELECT function with WIDGET_CONTROL to
   get and set the "value" of the widget.

       Widget_Control, filenameID, Set_Value='C:\RSI\IDL52\DATA\cyclone.dat'

   The program will automatically separate the file name portion of the value
   from the directory portion and put things in the correct text widgets.

   Similarly, you can get the "value" of the widget:

       Widget_Control, filenameID, Set_Value=theValue
       Print, theValue

           C:\RSI\IDL52\DATA\cyclone.dat

   The return value is the fully qualified file path to the file.

 USING OBJECT METHODS to CHANGE PROGRAM PROPERTIES:

   If you obtain the object reference, you have a great deal more control
   over the properties of the compound widget. You obtain the object reference
   by calling the function like this:

      filenameID = FSC_FILESELECT(parent, ObjectRef=theObject)

 OBJECT PROCEDURE METHODS:

   GetProperty -- This method allows various properties of the widget to be
       returned via output keywords. The keywords that are available are:

      DirectoryName -- The current directory.
      Event_Func -- The name of the event handler function for this compound widget.
      Event_Pro -- The name of the event handler procedure for this compound widget.
      Filename -- The current base filename.
      Filter -- The current file filter.
      LabelName -- The text on the label widget.
      LabelSize -- The X screen size of the label widget.
      MustExist -- A flag that indicates selected files must exist to be selected.
      Parent -- The parent widget of the compound widget.
      Read=read -- The file selection for reading flag.
      SelectTitle -- The title bar text on the file selection dialog.
      TLB -- The top-level base of the compound widget.
      UValue -- The user value of the compound widget.
      Write -- The file selection for writing flag.
      XSize -- The X size of the text widget holding the filename.

   LabelSize -- This method makes sure that the directory name and file name labels
      are the same size. Normally, this procedure is called internally. No parameters.

   MatchSize -- This method resizes the compound widget so that it is as long as the
      the longest widget in the parent base widget. This is done automatically upon
      realization unless the NOMAXSIZE keyword is set. The method aids in writing
      resizeable widget programs.

   SetProperty -- This method allows various properties of the widget to be
       set via input keywords. The keywords that are available are:

      DirectoryName -- The current directory.
      Event_Func -- The name of the event handler function for this compound widget.
      Event_Pro -- The name of the event handler procedure for this compound widget.
      Filename -- The current base filename.
      Filter -- The current file filter.
      LabelName -- The text on the label widget.
      LabelSize -- The X screen size of the label widget.
      MustExist -- A flag that indicates selected files must exist to be selected.
      Read -- The file selection for reading flag.
      SelectTitle -- The title bar text on the file selection dialog.
      UValue -- The user value of the compound widget.
      Write -- The file selection for writing flag.
      XSize -- The X size of the text widget holding the filename.

 OBJECT FUNCTION METHODS:

      GetFileName -- Returns the fully qualified filename. No parameters.

      GetTLB -- Returns the top-level base ID of the compound widget. No Parameters.

      Inspect_DirectoryName -- Inspects the directory name for correctness. Requires one positional parameter.

        directoryName -- The name of the directory from the directory text widget.
        textSelection -- The current text selection position.

        At the moment all this does is remove any blank characters from either
        end of the directory name and makes sure the last character of the directory
        name does not end in a subdirectory specifier (except for VMS).

     Inspect_Filename -- Inspects the file name for correctness. Requires one positional parameter.

        filename -- The name of the file from the filename text widget.
        textSelection -- The current text selection position.

        At the moment all this does is remove any blank characters from either
        end of the file name

 MODIFICATION HISTORY:

   Written by: David Fanning, 21 NOV 1999.
   Fixed bug in File Name selection button. 18 MAR 2000. DWF.
   Fixed an error in which directory the Browse buttons should start
       searching. 29 SEP 2000. DWF.
   Previously returned events only for typing in text widgets. Now
       Browse button events are also returned. 29 SEP 2000. DWF.
   Fixed a bug in setting the file filter. 29 SEP 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_fileselect.pro)


FSC_INPUTFIELD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_INPUTFIELD

 PURPOSE:

   The purpose of this compound widget is to provide an alternative
   to the CW_FIELD widget offered in the IDL distribution. What has
   always bothered me about CW_FIELD is that the text widgets do not
   look editable to the users on Windows platforms. This program
   corrects that deficiency and adds some features that I think
   would be helpful. For example, you can now assign an event handler
   to the compound widget. The program is written entirely as an object.
   A companion program, COYOTE_FIELD, has much the same functionality,
   but is written as a traditional compound widget. The point of writing
   the same program in two different ways is to give you the opportunity
   to compare and contrast the two methods. I personally think there
   is no substitute for the power of object programs. :-)

 AUTHOR:
   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   objectRef = FSC_INPUTFIELD(parent, Title='X Size: ", Value=256, /IntegerValue)

 INPUT PARAMETERS:

   parent -- The parent widget ID of the compound widget. Required.

 INPUT KEYWORDS:

   Column -- Set this keyword to have the Label Widget above the Text Widget.
   CR_Only -- Set this keyword if you only want Carriage Return events. If
              this keyword is not set, all events are returned. No events
              are returned unless the EVENT_PRO or EVENT_FUNC keywords are used.
   Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
   Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
   DoubleValue -- Set this keyword if you want DOUBLE values returned.
   Event_Func -- Set this keyword to the name of an Event Function. If this
                 keyword is undefined and the Event_Pro keyword is undefined,
                 all compound widget events are handled internally and not
                 passed on to the parent widget.
   Event_Pro -- Set this keyword to the name of an Event Procedure. If this
                keyword is undefined and the Event_Func keyword is undefined,
                all compound widget events are handled internally and not
                passed on to the parent widget.
   FieldFont -- The font name for the text in the Text Widget.
   FloatValue -- Set this keyword for FLOAT values.
   Frame -- Set this keyword to put a frame around the compound widget.
   IntegerValue -- Set this keyword for INTEGER values.
   LabelFont -- The font name for the text in the Label Widget.
   LabelSize -- The X screen size of the Label Widget.
   LongValue -- Set this keyword for LONG values.
   Name -- A scalar string name of the object. (default = '')
   Positive -- Set this keyword if you want only positive numbers allowed.
   Row=row -- Set this keyword to have the Label beside the Text Widget. (The default.)
   Scr_XSize -- The X screen size of the compound widget.
   Scr_YSize -- The Y screen size of the compound widget.
   StringValue -- Set this keyword for STRING values. (The default.)
   Title -- The text to go on the Label Widget.
   UValue -- A user value for any purpose.
   Value -- The "value" of the compound widget.
   XSize -- The X size of the Text Widget.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   None.

 EVENT STRUCTURE:

   All events are handled internally unless either the Event_Pro or Event_Func
   keywords are used to assign an event handler to the compound widget. By
   default all events generated by the text widget are passed to the assigned
   event handler. If you wish to receive only Carriage Return events, set the
   CR_Only keyword.

   event = { FSC_FIELD, $         ; The name of the event structure.
             ID: 0L, $            ; The ID of the compound widget's top-level base.
             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
             ObjRef: Obj_New(), $ ; The "self" object reference. Provided so you can call methods.
             Value: Ptr_New(), $  ; A pointer to the widget value.
             Type:""              ; A string indicating the type of data in the VALUE field.
           }                      ; Values are "INT", "LONG", "FLOAT", "DOUBLE", or "STRING".

 GETTING and SETTING VALUES:

   Almost all the properties of the widget can be obtained or set via
   the object's GetProperty and SetProperty methods (described below).
   But since traditional compound widgets have the ability to get and
   set the value of the compound widget, this capability is implemented
   as special methods.

   To get the value of the field, do this: value = objectRef->Get_Value()
   To set the value of the field, so this: objectRef->Set_Value, value, /IntegerValue

   The proper keyword should be used to set the data type of the value. If a keyword
   is not used, the data type is determined from the value itself.

 OBJECT PROCEDURE METHODS:

   GetProperty -- This method allows various properties of the widget to be
       returned via output keywords. The keywords that are available are:

       CR_Only -- A flag, if set, means only report carriage return events.
       DataType -- The data type of the field variable.
       Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
       Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
       Event_Func -- The name of the event handler function.
       Event_Pro -- The name of the event handler function.
       Positive -- Indicates if the Positive number flag is set (1) or not (0).
       UValue -- The user value assigned to the compound widget.
       Value -- The "value" of the compound widget.
     Name -- A scalar string name of the object.

   MoveTab -- This method moves the focus to the widget identified in the "next" field,
        which must be set with the SetTabNext method. No parameters. Called automatically
        when a TAB character is typed in the text widget.

   Resize -- This method allows you to resize the compound widget's text field.
        The value parameter is an X screen size for the entire widget. The text
        widget is sized by using the value obtained from this value minus the
        X screen size of the label widget.

          objectRef->Resize, screen_xsize_value

   Set_Value -- This method allows you to set the "value" of the field. It takes
       one positional parameter, which is the value.

          objectRef->Set_Value, 5

       Keywords available are these to set the type of the data. If keywords
       are not used, the data type is determined from the value.

       DoubleValue -- Set this keyword if you want DOUBLE values returned.
       FloatValue -- Set this keyword for FLOAT values.
       IntegerValue --  Set this keyword for INTEGER values.
       LongValue -- Set this keyword for LONG values.
       StringValue -- Set this keyword for STRING values. (The default.)

   SetProperty -- This method allows various properties of the widget to be
       set via input keywords. The keywords that are available are:

       CR_Only -- Set this keyword if you only want Carriage Return events.
       Decimal -- Set this keyword to the number of digits to the right of the decimal
              point in FLOATVALUE and DOUBLEVALUE numbers.
       Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
       DoubleValue -- Set this keyword if you want DOUBLE values returned.
       Event_Func -- Set this keyword to the name of an Event Function.
       Event_Pro -- Set this keyword to the name of an Event Procedure.
       FloatValue -- Set this keyword for FLOAT values.
       IntegerValue --  Set this keyword for INTEGER values.
       LabelSize --  The X screen size of the Label Widget.
       LongValue -- Set this keyword for LONG values.
       Name -- A scalar string name of the object. (default = '')
       Positive -- Set this keyword to indicate only positive numbers are allowed.
       Scr_XSize -- The X screen size of the text widget.
       Scr_YSize -- The Y screen size of the text widget.
       StringValue -- Set this keyword for STRING values. (The default.)
       Title -- The text to go on the Label Widget.
       UValue -- A user value for any purpose.
       Value -- The "value" of the compound widget.
       XSize -- The X size of the Text Widget.

 OBJECT FUNCTIONS METHODS:

      Get_Value -- Returns the "value" of the field. No parameters. Will be undefined
          if a "number" field is blank. Should be checked before using:

          IF N_Elements(objectRef->Get_Value()) NE 0 THEN Print, Value is: ', objectRef->Get_Value()

      GetID -- Returns the widget identifier of the compound widget's top-level base.
         (The first child of the parent widget.) No parameters.

      GetLabelSize -- Returns the X screen size of the label widget. No parameters.

      GetTextID -- Returns the widget identifier of the compound widget's text widget.
         No parameters.

      GetTextSize -- Returns the X screen size of the text widget. No parameters.

 PRIVATE OBJECT METHODS:

   Although there is really no such thing as a "private" method in IDL's
   object implementation, some methods are used internally and not meant to
   be acessed publicly. Here are a few of those methods. I list them because
   it may be these private methods are ones you wish to override in subclassed
   objects.

      MoveTab -- This method moves the cursor to end of the text in the widget identified
        by the nexttab field. (This will be set with the SetTabNext method.)

      Text_Events -- The main event handler method for the compound widget. All
        text widget events are processed here.

      ReturnValue -- This function method accepts a string input value and converts
        it to the type of data requested by the user.

      Validate -- This function method examines all text input and removes unwanted
        characters, depending upon the requested data type for the field. It makes it
        impossible, for example, to type alphanumeric characters in an INTEGER field.

 EXAMPLE:

   An example program is provided at the end of the FSC_INPUTFIELD code. To run it,
   type these commands:

      IDL> .Compile FSC_InputField
      IDL> Example

 MODIFICATION HISTORY:

   Written by: David Fanning, 23 NOV 1999.
   Added DECIMAL and DIGITS keywords, 2 Jan 2000, DWF.
   Changed the calling sequence to that of a function rather than an object
      creation call. This is more familiar to users of compound widgets. 4 Jan 00. DWF.
   Added GetID and Resize methods. 7 Jan 00. DWF.
   Added the Positive keyword and functionality. 12 Jan 00. DWF
   Modified (slightly) the behavior on deleting characters. 12 Jan 00. DWF.
   If a number field is blank, the Get_Value method will now return an undefined variable.
      Be sure you check this value before you use it for something! 17 Jan 00. DWF.
   Fixed a small typo: "aveDecimal" to "haveDecimal". 10 March 2000. DWF.
   Added the ability to tab between FSC_INPUTFIELD widgets with the SetTabNext,
      MoveTab, and GetTextID methods. 31 July 2000. DWF.
   Added NAME field property, a scalar string name for the object 2 AUG 2000 BT
   Added ObjRef field to the FSC_FIELD event structure and added field selection
      for the TAB events added 31 July. 7 AUG 2000. DWF
   Added GetTextSize and GetLabelSize methods for obtaining the X screen
      size of the text and label widgets, respectively. 30 Jan 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_inputfield.pro)


FSC_PLOTWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_PLOTWINDOW

 PURPOSE:

   The purpose of this compound widget is to create a resizeable
   "plot window" inside a larger "page window". I'm not sure it
   has any value except as a utility routine for the PostScript
   configuration object FSC_PSCONFIG__DEFINE, but it's a neat
   program anyway. :-)

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   Utility routine for FSC_PSCONFIG__DEFINE.

 CALLING SEQUENCE:

   plotwindowObject = CW_PlotWindow(parent)

 REQUIRED INPUT PARAMETERS:

   parent - The parent base widget of this compound widget.

 RETURN VALUE:

   plotwindowObject - The object reference of the compound widget.

 KEYWORDS:

   COLOR - If set, display the window in "color". This is the default on 24-bit devices.
   DEBUG - Set this keyword to turn traceback error handling on in the error handling code.
   EVENT_PRO - The event procedure for the widget. Required for events to be generated. Otherwise, all events are handled internally.
   LANDSCAPE - If set, display the page in landscape mode. Otherwise the page is display in portrait mode.
   PAGESIZE - The "pagesize" of the widget. Possible values are: "LETTER", "LEDGER", "LEGAL", "A4", and "DISPLAY".
   UNITS - A string indicating INCHES or CENTIMETER units. DEVICE units represented by a null string, "".
   UVALUE - A user value for the caller of this program.
   WINDOWCOLOR - A three-element array specifying the background window color (RGB).
   WINDOWSIZE - The size of the "window" on the page. A four-element array of normalized coordinates in the form [x0, y0, x1, y1].

 EVENT STRUCTURE:

   The event structure that is returned from this compound widget is defined like this,
   where the sizes and offsets locate the target "window" on the page in normalized units:

      event = {ID:0L, TOP:0L, HANDLER:0L, XSize:0.0, YSize:0.0, XOffset:0.0, YOffset:0.0}

 MODIFICATIONS:

   Written by David Fanning, 31 January 2000.
   Fixed a small bug that prevented it working on Macintosh computers. 26 Sept 2000. DWF.
   Added a "DISPLAY" page size, so the program can be used to position
      plots and other graphics in a display window. The "page area" will
      have the same aspect ratio is the current graphics window. 17 March 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_plotwindow.pro)


FSC_PSCONFIG__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FSC_PSCONFIG__DEFINE

 PURPOSE:

   The purpose of this program is to implement an object that
   can keep track of--and allow the user to change--the current
   configuration of the PostScript device.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 DOCUMENTATION:

   Complete documentation for the FSC_PSCONFIG object, including
   keyword and method descriptions, and example programs using the object
   can be found on the Coyote's Guide to IDL Programming web page:

     http://www.dfanning.com/programs/docs/fsc_psconfig.html

   Or, if you would prefer, you can download a self-contained PDF file:

     http://www.dfanning.com/programs/docs/fsc_psconfig.pdf

 KEYWORDS:

   Any keyword accepted by the FSC_PSCONFIG object can be used with
   this program. Here are a few of the most popular keywords.

   Bits_per_Pixel - The number of image bits saved for each image pixel: 2, 4, or 8. The default is 8.
   Color - Set this keyword to select Color PostScript output. Turned on by default.
   DefaultSetup - Set this keyword to the "name" of a default style. Current styles (you can easily
     create and add your own to the source code) are the following:

       "System (Portrait)" - The normal "default" system set-up. Also, "System".
       "System (Landscape)" - The normal "default" landscape system set-up.
       "Centered (Portrait)" - The window centered on the page. Also, "Center" or "Centered".
       "Centered (Landscape)" - The window centered on the landscape page. Also, "Landscape".
       "Square (Portrait)" - A square plot, centered on the page.
       "Square (Landscape)" - A square plot, centered on the landscape page.
       "Figure (Small)" - A small encapsulated figure size, centered on page. Also, "Encapsulated" or "Encapsulate".
       "Figure (Large)" - A larger encapsulated figure size, centered on page. Also, "Figure".
       "Color (Portrait)" - A "centered" plot, with color turned on. Also, "Color".
       "Color (Landscape)" - A "centered" landscape plot, with color turned on.

   Directory - Set this keyword to the name of the starting directory. The current directory is used by default.
   Encapsulate - Set this keyword to select Encapsulated PostScript output. Turned off by default.
   European - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). Turned off by default.
   Filename - Set thie keyword to the name of the PostScript file. The default is "idl.ps".
   Inches - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters. Set by European keyword by default.
   Landscape - Set this keyword to select Landscape page output. Portrait page output is the default.
   PageType - Set this keyword to the "type" of page. Possible values are:
       "Letter" - 8.5 by 11 inches. (Default, unless the European keyword is set.)
       "Legal" - 8.5 by 14 inches.
       "Ledger" - 11 by 17 inches.
       "A4" - 21.0 by 29.7 centimeters. (Default, if the European keyword is set.)
   XOffset - Set this keyword to the X Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
   XSize - Set this keyword to the X size of the PostScript "window". Uses "System (Portrait)" defaults.
   YOffset - Set this keyword to the Y Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
   YSize - Set this keyword to the Y size of the PostScript "window". Uses "System (Portrait)" defaults.

   In addition, the following keywords can be used:

   CANCEL -- An output keyword that will be set to 1 if the user
   chooses the Cancel button on the form. It will be 0 otherwise.

   FONTINFO -- Set this keyword is you wish to have font information
   appear on the form. The default is to not include font information.

   FONTTYPE -- Set this keyword to a named variable that will indicate
   the user's preference for font type. Values will be -1 (Hershey fonts),
   0 (hardware fonts), and 1 (true-type fonts). This keyword will always
   return -1 unless the FONTINFO keyword has also been set.

   GROUP_LEADER -- Set this keyword to a widget identifier of the widget
   you wish to be a group leader for this program.

 EXAMPLE:

   A simple sequence of using the object would look something like this:

     psObject = Obj_New("FSC_PSCONFIG")
     psObject->GUI
     psKeywords = psObject->GetKeywords()
     thisDevice = !D.Name
     Set_Plot, 'PS'
     Device, _Extra=psKeywords
     TVImage, image
     Device, /Close_File
     Set_Plot, thisDevice
     Obj_Destroy, psObject

  Note that the object can also be called from the PS_CONFIG interface:

     psKeywords = PSConfig()

 OTHER PROGRAMS NEEDED:

   The following programs are required to run this one:

     fsc_droplist.pro
     fsc_fileselect.pro
     fsc_field.pro
     fsc_plotwindow

 MODIFICATIONS:

   Written by David Fanning, 31 January 2000.
   Added capability to call GUI methods when the current graphics device
      doesn't support windows. Device is restored when the GUI exits. 11 May 2000. DWF.
   Changed the default value for the Color keyword to 1. 16 May 2000. DWF.
   Fixed a bug where filename changed when switching Setups. 8 AUG 2000. DWF.
   Fixed a bug when saving setup in Landscape mode. 8 AUG 2000. DWF.
   Added the ability to Get and Set the object's name via the SetProperty
      and a very abbreviated GetProperty method. Also added a GetName method. 26 SEP 2000. DWF.
   Fixed a problem in which the proper configuration was not restored if in Landscape mode. 20 Nov 2000. DWF.
   Made a number of modifications at the request of Martin Schultz. 4 Dec 2000. DWF.
   Fixed a bug when setting file  and directory names with the SetProperty method. 18 Dec 2000. DWF.
   Fixed a small problem in initializing the page size properly. 3 Jan 2001. DWF.
   Corrected a problem that resulted from a change to FSC_DROPLIST. 6 Jan 2001. DWF.
   Added the ability to restore the font type instead of always reverting to !P.Font. 7 Jan 2001. DWF.
   Increased the length of the file/directory name fields. 7 Jan 2001. DWF.
   Fixed another problem with Landscape mode interacting with A4 paper size. 7 Jan 2001. DWF.
   Seems I only half fixed the previous problem. :-( 26 April 2001. DWF.
   Forgot to update program to reflect change in FSC_FIELD. Fixed 26 April 2001. DWF.
   Changed BOOKMAN keyword to BKMAN to avoid conflict with BOOKSTYLE keyword. 26 April 2001. DWF.
   Modified the System Defaults to say "None" if none is used. Improved documentation. 10 September 2001. DWF.
   Added the ability to specify a filename at the same time as a Default Setup. 10 September 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_psconfig__define.pro)


FSC_SURFACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FSC_SURFACE

 PURPOSE:

       The purpose of this program is to demonstrate how to
       create a rotating surface using object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       FSC_SURFACE, data, x, y

 REQUIRED INPUTS:

       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       COLORTABLE: Set this keyword to a number between 0 and 40 to select one
       of the pre-selected IDL color tables for elevation shading.

       ELEVATION_SHADING: Set this keyword to put elevation shading into effect.

       EXACT: Set this keyword to a one-, two-,or three-element array to set exact axis
       scaling for the X, Y, and Z axes, respectively. If Exact is a one-element array,
       all three axes are set to the same value. For example, to set the X axis to
       exact scaling and the Y and Z axes to normal scaling, type:

           IDL> FSC_Surface, Exact=[1,0,0]

       _EXTRA: This keyword collects otherwise undefined keywords that are
        passed to the IDLgrSURFACE initialization routine.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       SHADED: Set this keyword to set up a shaded surface plot rather than a wire
       mesh surface, which is the default.

       TITLE:  A string used as the title of the plot.

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

       ZTITLE: A string used as the Z title of the plot.


 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       None.

 DEPENDENCIES:

       This program requires the following additional files from the Coyote Library:

          error_message.pro
          fsc_droplist.pro
          getcolor.pro
          loaddata.pro
          pickcolor.pro
          xcolors.pro

 EXAMPLE:

       To use this program with your data, type:

        IDL> FSC_Surface, data

 MODIFICATION HISTORY:

       Written by David Fanning, 8 June 97.
       Made axis scaling more robust. 17 Sept 97. DWF.
       Minor modifications to incorporate better understanding
          of how objects work. 4 Oct 97. DWF.
       Fixed error cleaning up all of my created objects. 12 Feb 98. DWF.
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Fixed mis-spelling of HELVETICA14. 29 June 98. DWF.
       Added the EXACT keyword to the X and Y axes to force axis ranging. 27 July 98. DWF
       Added the ability to select rendering "drag" quality for faster operation. 22 Aug 98. DWF.
       Added ability to get non-exact axis scaling. 12 May 99. DWF.
       Improved documentation and readability of code. 12 May 99. DWF.
       Added VECTOR and LANDSCAPE keywords and improved printing capability. 16 Feb 2000. DWF.
       Added different lights and a Light Controller option. 28 April 2000. DWF.
       Added elevation shading. 8 May 2000. DWF.
       Removed VECTOR keyword. Replaced with VECTOR/BITMAP/COLOR Print buttons. 8 May 2000. DWF.
       Added HIDDEN_LINE keyword. 8 May 2000. DWF.
       Added EXACT keyword extensions and changed name from XSURFACE to FSC_SURFACE. 11 May 2000. DWF.
       Made change to Light Control code to accomodate FSC_DROPLIST changes. 6 Jan 2001. DWF.
       Removed unused color table vector code from a LONG time ago. 17 Jan 2001. DWF.
       Added TIFF file output and removed GIF output for IDL 5.4. 11 Feb 2001. DWF.
       Added short wait before taking image snapshot for JPEG and TIFF files to avoid
          extraneous text in output files. 22 October 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_surface.pro)


FSC_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FSC_WINDOW

 PURPOSE:

       This routine implements a "smart" resizeable graphics window.
       It is used as a wrapper for built-in IDL graphics procedures
       such as SURFACE, CONTOUR, PLOT, SHADE_SURF, etc. In additon,
       it can be used to display any user-written graphics procedure
       so long as that procedure follows three simple rules: (1) It
       does not open it's own graphics windows, (2) It is defined with
       no more than three positional arguments (an unlimited number
       of keyword arguments are allowed), and (3) It uses no device-
       specific commands, such as "WSet", "Device, Decomposed=1", etc.

       Keyword arguments permit the window to have its own portion
       of a color table and to be able to change the colors loaded in
       that portion of the color table. Colors are updated
       automatically on both 8-bit and 24-bit color displays. In
       addition, the window colors will "protect" themselves. I mean
       by this that the window will re-load its own colors into the
       color table when the window gains keyboard focus. This
       prevents other applications from changing the colors used to
       display data in this window. (This is an issue mainly in
       IDL 5 applications where widget applications can run
       concurrently with commands from the IDL command line.)

       Keyword arguments also permit the window to create output
       files of its contents. These files can be color and
       gray-scale PostScript, and color BMP, GIF, JPEG, PICT, PNG,
       TIFF, or JPEG files. Output can also be sent directly to
       the default printer.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Graphics.

 CALLING SEQUENCE:

       FSC_WINDOW, command, P1, P2, P3

 REQUIRED INPUTS:

       COMMAND: The graphics procedure command to be executed. This parameter
       must be a STRING and the the command must be a procedure. Examples
       are 'SURFACE', 'CONTOUR', 'PLOT', etc.

 OPTIONAL INPUTS:

       P1: The first positional parameter appropriate for the graphics
           command.

       P2: The second positional parameter appropriate for the graphics
           command.

       P3: The third positional parameter appropriate for the graphics
           command.

 INPUT KEYWORD PARAMETERS:

       WBACKGROUND: The background color index for the window. Setting this color
           along with the WERASEIT keyword causes the window to be erased with
           this color. Set to !P.Background by default.

       WERASEIT: Setting this keyword "erases" the contents of the current
       graphics window before re-executing the graphics command. For example,
       this keyword might need to be set if the graphics "command" is TVSCL.
       The default is to NOT erase the display before reissuing the graphics
       command.

       _EXTRA: This keyword forms an anonymous structure of any unrecognized
       keywords passed to the program. The keywords must be appropriate
       for the graphics command being executed.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       WTITLE: This is the window title. It is the string "COMMAND Window (1)"
       by default, where COMMAND is the input parameter. And the number
       (1 in this case) is the window index number of the draw widget.

       WXPOS: This is the initial X offset of the window. Default is to
       position the window in the approximate middle of the display.

       WYPOS: This is the initial Y offset of the window. Default is to
       position the window in the approximate middle of the display.

       WPOSTSCRIPT: Set this keyword to 1 to include a PostScript File button under
       the Save As button. This keyword is set automatically on 24-bit display
       devices. To turn the button OFF on 24-bit devices, set the keyword value to 0.
       There is no guaranteed way to create perfect PostScript output when the program
       is run on 8-bit displays. This will depend entirely on how the "graphics command"
       is written. Hence the button is turned off automatically on 8-bit devices.

       WPRINT: Set this keyword to 1 to include a Print button under the File button.
       This keyword is set automatically on 24-bit display devices. To turn the
       button OFF on 24-bit devices, set the keyword value to 0. There is no
       guaranteed way to print output correctly when the program is run on
       8-bit displays. This will depend entirely on how the "graphics command"
       is written. Hence the button is turned off automatically on 8-bit devices.

       WXSIZE: This is the initial X size of the window. Default is 400
       pixels.

       WYSIZE: This is the initial Y size of the window. Default is 400
       pixels.

       WCOLORS: Using this keyword adds a "Colors..." button to the
       "File" menu. Set this keyword to the number of colors available
       in the window and the starting index of the first color. For example,
       to allow the window access to 100 colors, starting at color index 50
       (i.e., color indices 50 to 149), use WColors=[100, 50]. If you use the
       keyword syntax "/WColors", all the colors available will be used, not just
       one color. If the keyword is set to a scalar value greater than 1, the
       starting color index is set to 0. The default value for this keyword
       is [(!D.Table_Size, 0].

 COMMON BLOCKS:

       None.

 RESTRICTIONS:

       This program requires additional programs from the Fanning
       Software Consulting library:

       CENTERTLB.PRO
       ERROR_MESSAGE.PRO
       FSC_PSCONFIG__DEFINE.PRO
       FSC_DROPLIST.PRO
       FSC_FIELD.PRO
       FSC_FILESELECT.PRO
       FSC_INPUTFIELD.PRO
       FSC_PLOTWINDOW.PRO
       PSCONFIG.PRO
       PSWINDOW.PRO
       TVREAD.PRO
       XCOLORS.PRO

       If the "command" program requires keywords that are also keywords
       to FSC_WINDOW, then you must use the keyword twice on the command line.

 EXAMPLE:

       If the program is called with no parameters whatsoever, it will load
       example data.

       IDL> FSC_WINDOW

       To use the program with an IDL PLOT command, for example:

       IDL> FSC_WINDOW, 'PLOT', Findgen(11), Charsize=1.5, Title='Example Plot'

       To build your own graphics display command, you can do something like this.
       Here is a command program that takes an image, a column number, and a row number,
       and plots a column and row profile next to one another:

          PRO COL_ROW_PLOT, image, column, row, _Extra=extra
          ; Check parameters.
          IF N_Elements(image) EQ 0 THEN image = DIST(200)
          IF N_ELements(column) EQ 0 THEN column = 100
          IF N_Elements(row) EQ 0 THEN row = 100
          ; Set up plots.;
          !P.Multi = [0, 2, 1]
          Plot, image[column, *], Title='Row Profile', YRange=[Min(image), Max(image)], $
             XStyle=1, XTitle='At Column No: ' + StrTrim(column,2), _Extra=extra
          Plot, image[*, row], Title='Column Profile', YRange=[Min(image), Max(image)], $
             XStyle=1, XTitle='At Row No: ' + StrTrim(row,2), _Extra=extra
          !P.Multi = 0
          END

       This command program is used with FSC_WINDOW, like this:

       IDL> Demo_GetData, image, Filename='ctscan.dat'
       IDL> FSC_WINDOW, 'COL_ROW_PLOT', image, 30, 185, YTitle='Image Value'

 MODIFICATION HISTORY:

       Written by: David Fanning, Sept 2000. Based on previous XWINDOW program.
       Whoops! Left out the line to resize draw widgets on UNIX machines. Fixed. 12 Oct 2000, DWF.
       Removed support for GIF files for IDL 5.4. 18 Jan 2001. DWF.
       Beefed up documentation. 27 March 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\fsc_window.pro)


FSLIDER_SETRANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FSLIDER_SETRANGE
 PURPOSE:
       Set new min/max for cw_fslider.
 CATEGORY:
 CALLING SEQUENCE:
       fslider_setrange, id, min, max, val
 INPUTS:
       id = widget id of cw_fslider to modify.   in
       min = New minimum value (def=0.).         in
       max = New maximum value (def=100.).       in
       val = New slider value (def=(min+max)/2). in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: new value is set to update slider
         position and labeled value.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Jun 10

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\fslider_setrange.pro)


FSTAT2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   fstat2

 PURPOSE:
   This function returns an extended fstat information.
   You will get back a structure with fstat-information, modification-,
   access-, creationtime, uid and gid.

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=my_fstat(file)

 INPUTS:
 file: the file name of a file


 MODIFICATION HISTORY:
       Written by:     J.Ankenbrand (ICG-1), 2000-Feb-01

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\fstat2.pro)


FXGCLOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGCLOSE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Closes a generic resource

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXGCLOSE, UNIT

 DESCRIPTION:

   FXGCLOSE closes a generic resource originally opened by FXGOPEN.
   All associated system resources are freed.

   You must use the specialized 'FXG' style functions to read, write
   and seek on file units opened with FXGOPEN:

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 INPUTS:

   UNIT - the unit number of the currently open resource.  The unit
          must have been previously opened by FXGOPEN.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxgclose.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgclose.pro)


FXGFILTERED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGFILTERED

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Determine if a unit has been opened by FXGOPEN.

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   Q = FXGFILTERED(UNIT)

 DESCRIPTION:

   FXGFILTERED is a function which determines whether a UNIT has been
   opened by FXGOPEN and requires special handling.

   In principle, only 'FXG' procedures should be used to access file
   units returned by FXGOPEN.  However, if the unit turns out to be a
   normal file then special treatment is not required.  User programs
   can use the FXGFILTERED function to find out this information.

   If FXGFILTERED returns 0, then normal file-access procedures (such
   as READU, WRITEU, CLOSE, and POINT_LUN) can be used.  Otherwise,
   the 'FXG' routines must be used.

 INPUTS:

   UNIT - Any file LUN.

 RETURNS:
   0 - resource is a normal file.
   1 - resource is not a normal file.

 EXAMPLE:

  if fxgfiltered(unit) EQ 0 then begin  
    ;; If zero then can use standard IDL routines
    point_lun, unit, position
    readu, unit, buffer
    close, unit
  endif

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

 TODO:
   * Add more protocols
   * Make more windows friendly

  $Id: fxgfiltered.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgfiltered.pro)


FXGOPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGOPEN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Open generic resource as a seekable file.

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXGOPEN, UNIT, RESOURCE, ACCESS=ACCESS, ERRMSG=ERRMSG

 DESCRIPTION:

   FXGOPEN opens a generic "resource" for reading or writing.  A
   "resource" can be a file or a Unix pipe, and eventually it is
   hoped to add support for generic URLs (i.e., Internet locators
   such as http, FTP), shared files, and an in-memory file system.

   Readable resources are fully random access.  You are permitted to
   perform seek operations on both files and streams such as Unix
   pipes.  In the case of a stream, the stream is read upon demand
   and saved to an on-disk cache.

   FXGOPEN also automatically recognizes some standard Unix file
   extensions and operates on them.  For example, files ending with
   '.gz' are recognized as being compressed with gzip, and are passed
   through gzcat to uncompress them.  You can display existing
   filename extension mappings and add new ones using the FXMAKEMAP
   procedure.

   The UNIT number is allocated using GET_LUN; however, the internal
   implementation may allocate more LUNs.  Therefore you must use
   FXGCLOSE to close the LUN and be sure that all resources are
   deallocated.

   You must use the specialized 'FXG' style functions to read, write
   and seek on the resulting unit number:

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 INPUTS:

   UNIT - FXGOPEN will return a LUN in this variable.  It should be
          subsequently read and written with FXGREAD, FXGWRITE, and
          closed with FXGCLOSE.

   RESOURCE - a string, describing the resource to be opened.
              FXGOPEN will automatically determine how to open it
              according to:

              * If a filename the suffix may be mapped according to
              FXMAKEMAP.  In that case the appropriate pipe command
              is opened as a Unix pipe with FXPOPENR.

              * If a string beginning with "|" then the remaining
              part of the string is interpretted as a Unix pipe
              command, to be opened with FXPOPENR.

              * If a URL (uniform resource locator), then it is
              accessed.  Currently supported protocols are:

                file - a local file
            
              That's all!  I would like to support FTP at least, and
              also some sort of in-memory files, probably with a
              "mem" protocol.


 KEYWORD PARAMETERS:

   ACCESS - a string, set to the access privileges of the resource.
            Possible values are:
 
              'R'  - read-only
              'W'  - write/create
              'RW' - write/update

            Not all protocols support writing.
            DEFAULT: 'R'

   ERRMSG - If a named variable is passed with this keyword, an error
            message is returned: the empty string indicates success;
            a non-empty string indicates failure.  If a named
            variable is not passed, and the ERROR keyword is not
            used, then execution is stopped upon an error.

   ERROR - If a named variable is passed with this keyword, the error
           status is returned: a zero indicates success; non-zero
           indicates failure.  If a named variable is not passed, and
           the ERRMSG keyword is not used, then execution is stopped
           upon an error.

   SUFFIX - Force a particular file type by specifying the suffix.
            Default is to extract the suffix from the file name
            itself.

 EXAMPLE:

   fxgopen, unit, 'myfile.gz', errmsg=errmsg
   if errmsg NE '' then do_error_message
   bb = bytarr(1000)  ;; Read 1000 bytes
   fxgread, unit, bb
   fxgclose, unit

   This example opens the file myfile.gz using FXGOPEN.  It is
   automatically gunzip'ed on demand as the request for a 1000-byte
   read is made.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Added correct ERROR keyword behavior, 04 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM
   Modified to use ARG_PRESENT for ERRMSG and ERROR, 21 Sep 2000, CM
   Added SUFFIX keyword, 31 Oct 2000, CM

 TODO:
   * Add more protocols
   * Make more windows friendly

  $Id: fxgopen.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgopen.pro)


FXGREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform an unformatted read on a generic resource.

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXGREAD, UNIT, BUFFER, TRANSFER_COUNT=TC

 DESCRIPTION:

   FXGREAD performs an unformatted read on the unit UNIT.  The UNIT
   must have previously been opened by FXGOPEN.

   Currently only unformatted reads are permitted because the precise
   number of bytes to read must be known ahead of time.

   In other respects, this procedure is similar to the READU built-in
   IDL procedure.

   You must use the specialized 'FXG' style functions to read, write
   and seek on file units opened with FXGOPEN:

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 INPUTS:

   UNIT - the unit number to operate on.  The unit must have been
          previously opened by FXGOPEN.

   BUFFER - an array of the desired type and size is passed upon
            input to FXGREAD.  Only basic types are permitted.  Upon
            output, the array will have been filled with data from
            the resource.  The full extent of the transfer can be
            determined by examining the TRANSFER_COUNT.


 KEYWORD PARAMETERS:

   TRANSFER_COUNT - upon output, contains the number of elements
                    transferred to BUFFER.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxgread.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgread.pro)


FXGSEEK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGSEEK

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform a seek operation on a generic resource.

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXGSEEK,  UNIT, POSITION   ;; Sets the current file position
   FXGSEEK, -UNIT, POSITION   ;; Queries the current file position

 DESCRIPTION:

   FXGSEEK performs a seek on the selected resource.  Depending on
   the sign of UNIT, the current file position is either queried or
   set, in much the same manner as the built-in IDL procedure
   POINT_LUN.

   If the resource is a stream, the seek operation does not
   necessarily force a read until FXGREAD is called (i.e., reads are
   "lazy").

   You must use the specialized 'FXG' style functions to read, write
   and seek on file units opened with FXGOPEN:

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 INPUTS:

   UNIT - the unit number to operate on.  The unit must have been
          previously opened by FXGOPEN.  The operation of FXGSEEK
          depends on the sign of UNIT.  If UNIT is positive, then the
          current file position of file UNIT is set to POSITION.  If
          UNIT is negative, then the current file position of file
          |UNIT| is placed in the variable POSITION.

   POSITION - Depending on the sign of UNIT, the behavior is
              different.  When UNIT is positive, POSITION is an input
              variable containing the new file position.  When UNIT
              is negative, POSITION is an output variable to contain
              the file's current file position.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxgseek.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgseek.pro)


FXGWRITE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXGWRITE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform an unformatted write to a generic resource.

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXWRITE, UNIT, BUFFER, TRANSFER_COUNT=TC

 DESCRIPTION:

   FXGWRITE performs an unformatted write to the unit UNIT.  The UNIT
   must have previously been opened by FXGOPEN with write access.

   Currently only unformatted reads are permitted because the precise
   number of bytes to written must be known ahead of time.

   In other respects, this procedure is similar to the WRITEU
   built-in IDL procedure.

   You must use the specialized 'FXG' style functions to read, write
   and seek on file units opened with FXGOPEN:

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 INPUTS:

   UNIT - the unit number to operate on.  The unit must have been
          previously opened by FXGOPEN.

   BUFFER - the array to be written. Only basic types are permitted.
            The actual number of bytes transferred can be determined
            by examining the TRANSFER_COUNT.


 KEYWORD PARAMETERS:

   TRANSFER_COUNT - upon output, contains the number of elements
                    transferred from BUFFER.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxgwrite.pro,v 1.2 2001/03/25 18:10:45 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxgwrite.pro)


FXMAKEMAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXMAKEMAP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Change configuration of FXG - FXFILTER'ed behavior

 MAJOR TOPICS:
   File I/O, Pipes, URLs, FITS

 CALLING SEQUENCE:
   FXMAKEMAP, SUFFIX, COMMAND              or
   FXMAKEMAP, /INFO                        or
   FXMAKEMAP, [SCRATCH_DIR=scratch,] [BUFFER_MAX=bufmax,] 
     [BUFFER_GRAN=bufgran,] [RM_COMMAND=rmcommand,] [/GET]

 DESCRIPTION:

   FXMAKEMAP queries or sets the behavior of the FXFILTER family of
   functions (FXGOPEN, FXGREAD, FXGWRITE, FXGSEEK, and FXGCLOSE).

   To add a new file extension mapping, which associates a filename
   suffix with a particular Unix pipe command, use the first form of
   the command.

   To print the current settings, including the file extension maps,
   use the /INFO form of the command.

   To set an individual parameter, call FXMAKEMAP with the
   appropriate keyword argument.

   To query an individual parameter, call FXMAKEMAP with /GET and the
   appropriate keyword argument.

 INPUTS:

   SUFFIX - the trailing suffix of the filename to be associated,
            *without* the period.  For example, for a gzipped file,
            the suffix is 'gz'

   COMMAND - an IDL-style format command which specifies how the
             filename should be converted into a Unix pipe command.
             The actual command is constructed by passing the
             filename to STRING() with this format string.  For
             example, to convert a gzip file the proper format string
             is, '("gzip -dc ",A0)'.

 KEYWORD PARAMETERS:

   INFO - print the current settings and return.
  
   GET - if this keyword is set, then the following keyword commands
         cause the current setting to be returned in the specified
         keyword.  Otherwise the default is to assert a new setting.

   BUFFER_GRAN - the buffer granularity in bytes.  I/O operations on
                 pipes and streams are performed in multiples of this
                 size.  Default: 4096 bytes.

   BUFFER_MAX - the maximum allowed buffer size in bytes.  I/O
                operations on pipes and streams are performed with at
                most this many bytes.  Default: 32 kbytes.

   RM_COMMAND - the Unix command used to delete files.  
                Default:  '/bin/rm'

   SCRATCH_DIR - the scratch directory where cache files are stored.
                 When operations on Unix pipes or streams are
                 performed, the data are stored in individual files
                 in this directory.

 MODIFICATION HISTORY:
   Written, 1999, CM
   Documented, 02 Oct 1999, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxmakemap.pro,v 1.2 2001/03/25 18:10:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxmakemap.pro)


FXPBUFFR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXPBUFFR

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Internal routine to read data from the pipe and store it in a
            cache file.

 DESCRIPTION:

   See the following procedures for appropriate documentation.

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 PARAMETERS
   unit - LUN of the pipe, *not* the cache file.

   newlen - the new desired length of the file.  After a successful
            call to FXPBUFFR, the length of the cache file will be at
            least this long.

 Side Effects

  The pipe is read and the cache increases in size.

 MODIFICATION HISTORY:
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxpbuffr.pro,v 1.2 2001/03/25 18:10:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxpbuffr.pro)


FXPCLOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXPCLOSE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Internal routine to close a pipe file.

 DESCRIPTION:

   See the following procedures for appropriate documentation.

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 PARAMETERS
   unit - LUN of the pipe, *not* the cache file.

 Side effects
   The pipe is closed.
   The cache file is closed and deleted.

 MODIFICATION HISTORY:
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxpclose.pro,v 1.2 2001/03/25 18:10:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxpclose.pro)


FXPOPENR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXPOPENR

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Internal routine to open a Unix pipe command for read access.

 DESCRIPTION:

   See the following procedures for appropriate documentation.

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 Usage: FXPOPENR, UNIT, COMMAND, ERRMSG=ERRMSG

 PARAMETERS

   unit - FXPOPENR returns the pipe LUN, created by GET_LUN in this
          parameter.  The LUN should not be "pre-opened".
          Unformatted reads on this LUN should be performed with
          FXPREAD.

   command - a scalar string, the pipe command to execute.  The
             standard output of the command is redirected into UNIT.
             Standard error is not redirected.

             A failure of the command can only be discovered upon
            trying to read from the LUN with FXPREAD.

 Keywords
 
   errmsg - If set to defined value upon input, an error message is
            returned upon output.  If no error occurs then ERRMSG is
            not changed.  If an error occurs and ERRMSG is not
            defined, then FXPOPENR issues a MESSAGE.

 Side Effects

   The pipe command is opened with SPAWN, and an additional cache file
   is opened with read/write access.

   The FXFILTER family of commons is updated.

 MODIFICATION HISTORY:
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxpopenr.pro,v 1.2 2001/03/25 18:10:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxpopenr.pro)


FXPREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXPREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Internal routine to read from a Unix pipe.

 DESCRIPTION:

   See the following procedures for appropriate documentation.

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 PARAMETERS

   unit - LUN of the pipe command, *not* the cache file.

   buffer - the buffer to accept the data.  Data is read in
            *unformatted*.

 Side Effects
 
   The pipe is read as needed and the cache is populated.
   The file pointer advances.

 MODIFICATIONS
   Corrected error message, 21 Sep 2000, CM
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxpread.pro,v 1.2 2001/03/25 18:10:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxpread.pro)


FXPSEEK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   FXPSEEK

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Internal routine to perform seek on a Unix Pipe.

 DESCRIPTION:

   See the following procedures for appropriate documentation.

     FXGOPEN  - open resource
     FXGCLOSE - close resource
     FXGREAD  - read from resource
     FXGWRITE - write to resource
     FXGSEEK  - seek on resource (i.e., perform POINT_LUN)

     FXGFILTERED - determine if resource is a normal file.

 PARAMETERS

   unit - the pipe LUN.  If positive, then the file pointer is moved
          to POSITION in the pipe output.  [ In reality the file
          pointer is moved in the cache file. ]  If negative, then
          the file pointer of the file unit -LUN is returned in
          POSITION.

   position - the file pointer, either passed or returned as defined
              by UNIT.

 Side Effects

   The file pointer may be updated.
   Actual file accesses are postponed until needed (ie, when FXPREAD
   is called).

 MODIFICATION HISTORY:
   Changed copyright notice, 21 Sep 2000, CM

  $Id: fxpseek.pro,v 1.2 2001/03/25 18:10:47 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\fxpseek.pro)


FZJ_LOGO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	fzj_logo

 PURPOSE:
   This procedure generates the FZJ Logo on a plot with the optional text 'Forschungszentrum Jülich'

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   fzj_logo,[logo_title=logo_title],[/landscape],[/line],[/fz_title],[/transparency]

 KEYWORD PARAMETERS:
   title:       obsolete, don't use anymore, use logo_title instead
   logo_title:  a string for the title instead of /fz_title
   landscape:   if set output format is landscape
   line:        if set line is drawed
   fz_title:    if set Forschungszentrum Jülich is drawed
   transparency if set output is reduced for transparencies
   char_scale_factor: is used for device dependent scaling of the title
   charthick: thickness of characters in logo_title

 EXAMPLE:
  fzj_logo,/line,/fz_title
  

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-03-10 08.02.2000: Default for landscape set to 0 New keyword parameter LOGO_TITLE To avoid confusion with title of plot keyword parameter TITLE was marked as obsolete. The section of code that handles the title was changed. New keyword parameter CHARTHICK 09.05.2000: If the keyword parameter LANDSCAPE = landscape is not provided in_landscape is set to 1 if !D.X_SIZE > !D.Y_SIZE else in_landscape is set to 0 (formerly in_landscape was set to 0 if not provided)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\fzj_logo.pro)


F_CACHE_FILE_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_cache_file_name

 PURPOSE:
   This function returns the necessary file_name of a cache file for netCDF Files
   It is necessary to identify over the name of the cache file possible differences or changes to
   the netCDF data file.
   Therefore the name is defined by:
   file name
   experiment name,
   the js first time
   short name,
   param_units,
   the array index,
   the modification parameter time
   and the defintion time of inhalt_def.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_cache_file_name(file_name,name,[array_index])

 INPUTS:
   file_name:   The name of the netCDF File
   name:        The short name of the parameter
   array_index: the read position for the trajectories

 OUTPUTS:
   This function returns a string with the filename for the cache file

 EXAMPLE:
   result=f_cache_file_name('otto.nc','N2O')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), May, 22 1997
   1998-Jun-25 R.Bauer some more code ncdf_attinq for non icg netCDF files
   1998-Jun-25 R.Bauer some people are using eperiment names truncated by space
                       therefore replace_string is used
   1998-Jun-30 R.Bauer all spaces now changed to '_'
   1998-Jul-1  R.Bauer use_units added
   1998-Sep-03 R.Bauer unix did not accept () in filenames therefore they are replaced by
   1998-Sep-09 R.Bauer f_link_file replaced by first time of time because it takes to much time to resolve the linkpath
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_cache_file_name.pro)


F_CAMPAIGN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	f_campaign

 PURPOSE:
	This function reads the campaign name from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_campaign(file_name,[/xp])

 INPUTS:
	file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
	xp:   launch pickfile to choose a file

 OUTPUTS:
	This function returns a string or stringarray of campaign names

 EXAMPLE:
   result=f_campaign('otto.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), May, 22 1997
   1998-Aug-06 altered syntax to ncdf_get_one_global_attribute

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_campaign.pro)


F_CATEGORY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_category

 PURPOSE:
   This function returns the category value from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_category(file_name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
  This function returns a string or stringarray of categories

 EXAMPLE:
   result=f_category('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 22 1997
  1998-Aug-06 altered syntax to ncdf_get_one_global_attribute

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_category.pro)


F_EXPERIMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_experiment

 PURPOSE:
  This function reads the experiment Name from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_experiment(file_name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of experimentnames

 EXAMPLE:
   result=f_experiment('otto.nc')

 MODIFICATION HISTORY:
  Written by:	R.Bauer (ICG-1), May, 22 1997
  1998-Aug-06 altered syntax to ncdf_get_one_global_attribute

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_experiment.pro)


F_FIRST_LAST_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	f_first_last_param

 PURPOSE:
	This function reads the first and last value of time from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_first_last_param(file_name)

 INPUTS:
	file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
	xp:   launch pickfile to choose a file
   char: The result array will be a stringarray

 OUTPUTS:
 This function returns a 2 dimensional array of begin and end param of a netCDF File


 EXAMPLE:
   result=f_first_last_param('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June, 11 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_first_last_param.pro)


F_FIRST_LAST_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	f_first_last_time

 PURPOSE:
	This function reads the first and last value of time from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_first_last_time(file_name,[/char],[/xp])

 INPUTS:
	file_name: The name of the netCDF File or an array of files

 KEYWORD PARAMETERS:
	xp:   launch pickfile to choose a file
   char: The result array will be a stringarray

 OUTPUTS:
	This function returns a 2 dimensional array of begin and end time of a netCDF File

 EXAMPLE:
   result=f_first_last_time('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June, 11 1997
                       R.Bauer, Aug. 3 1997  input file could be an array of files
	26.02.99, FH:	Aufruf von PICKFILE (obsolete IDL-Routine) durch DIALOG_PICKFILE ersetzt.
   1999-Nov-06 help added
   2000-05-23: offset and scale_factor used for time

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_first_last_time.pro)


F_FLIGHTDAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	f_flightday

 PURPOSE:
	This function reads the flightday from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_flightday(file_name,[/nasa],[/hour],[/comp],[/xp])

 INPUTS:
	file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   nasa: give the time information for creating the nasa files
   hour: gives only the time information hour back
   comp: give the complete time information
	xp:   launch pickfile to choose a file


 OUTPUTS:
	This function returns a string or stringarray of flightdays


 EXAMPLE:
   result=f_flightday('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 22 1997
               R.Bauer June, 11 1997 file_name could be now an array
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_flightday.pro)


F_HISTORY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_history

 PURPOSE:
   This function returns the history value from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_history(file_name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of history names

 EXAMPLE:
   result=f_history('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), August, 12 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_history.pro)


F_LINK_FILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_link_files

 PURPOSE:
   This function returns the original file position and file name from a linked file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=f_link_files(file_name,[/no_current],[/xp])

 INPUTS:
   file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file
   no_current: won't add the actually path

 OUTPUTS:
   This function returns a string or stringarray of file positions

 RESTRICTIONS:
  This routine will only work whith unix

 EXAMPLE:
   result=f_link_files('otto.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), June, 30 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_link_files.pro)


F_LONG_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_long_name

 PURPOSE:
   This function returns the long_name from a parameter from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_long_name(file_name,short_name,[/xp])

 INPUTS:
   file_name:  The name of the netCDF File
   short_name: The short name of a netCDF parameter

 KEYWORD PARAMETERS:
  xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of long_name
   You can choose to submit one file and many short names or
   many files and one short_name or many files and many short names

 EXAMPLE:
   result=f_long_name('otto.nc','H2O')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), May, 22 1997
   1998-Aug-06 altered syntax to ncdf_get_one_param_attribute

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_long_name.pro)


F_NAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_names

 PURPOSE:
   This function returns the short names from a defined File Type.
   Defined Filetypes are: netCDF, NASA Ames, mfd, ials, hdf

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_names(file_name,[/time],[/all],[/sort],[/xp],[uppercase_only=uppercase_only],[lowecase_only=lowercase_only])

 INPUTS:
   file_name: The name of the netCDF File

 OPTIONAL INPUTS:
   file=file: [obsolete] equivalent to file_name
   debug: [obsolete] could be used for debugging

 KEYWORD PARAMETERS:
   time:  'time' is included in the result
   sort:  The result is sorted
   xp:    launch pickfile to choose a file
   all:   gaves all names back includes *@* names
  uppercase_only: if argpresent then uppercased short_names are set to this argument
  lowercase_only: if argpresent then lowercased short_names are set to this argument

 OUTPUTS:
   This function returns a stringarray of short names

 EXAMPLE:
   result=f_names('otto.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), Feb, 17 1997
   R.Bauer          Mar, 04 1997  filename added
   R.Bauer          Oct. 14 1997 'TIME' changed to 'time'
   R.Bauer          Oct. 14 1997 filter to remove time from the namelist changed
                                 because models did not save time parameter as the first one
   1998-01-16 : 1010 added
   1998-Mar-07 Fehler behoben, wenn Timeflags gesetzt wurden,
               wurden irrtuemlicherweise Leerstrings an den Anfang  des Rueckgabewertes gesetzt.
   1998-Mar-30 keyword all added to give all names back by netcdf useful
   1998-Aug-05 syntax reorganiced because of ASAD netCDF Files as initialising files not having 'time' data
   1998-Aug-27 netCDF Part reorganiced
   1999-Nov-06 help added
   1999-Dez-05 argpresent keywords added for netCDF
   2000-Feb-18 official nasa reader is used for Nasa Ames files
   2000-Mar-20 sort_by_keys replaced by sort_by_name

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_names.pro)


F_NAME_DIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       f_name_dim

 PURPOSE:
       This function reads the dimensions of a prameter in a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_name_dim(file_name,name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File
   name:      The name of a parameter in the netCDF File

 KEYWORD PARAMETERS:
       structure:   returns a structure of
          .name : name of dimension
          .size : size of dimension

 OUTPUTS:
       This function returns the dimension of the parameter as an array


 EXAMPLE:
   result=f_name_dim('otto.nc','LAT')

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), Oct, 12 1997
                                        Dec. 10 1997 addition of time
                                        1999-01-13 added keyword structure
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_name_dim.pro)


F_P_CREATION_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_p_creation_time

 PURPOSE:
  This function returns the param_creation_time from a parameter from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_p_creation_time(file_name,short_name,[/xp])

 INPUTS:
  file_name: The name of the netCDF File
  short_name: The prametername of interest


 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of param_creation_time
   You can choose to submit one file and many short names or
   many files and one short_name or many files and many short names


 EXAMPLE:
   result=f_p_creation_time('otto.nc','H2O')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 22 1997
                       R.Bauer          July, 28 1997 added name

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_p_creation_time.pro)


F_P_MODIFICATION_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_p_modification_time

 PURPOSE:
  This function returns the param_creation_time from a parameter from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_p_modification_time(file_name,short_name,[/xp])

 INPUTS:
  file_name: The name of the netCDF File
  short_name: The prametername of interest


 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of param_modification_time
   You can choose to submit one file and many short names or
   many files and one short_name or many files and many short names

 EXAMPLE:
   result=f_p_modification_time('otto.nc','H2O')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 22 1997
                       R.Bauer          July, 28 1997 added name

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_p_modification_time.pro)


F_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_time

 PURPOSE:
   This function returns the time data from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_time(file_name)

 INPUTS:
   file_name: The name of the netCDF File

 OUTPUTS:
    This function returns the parameter time from a netCDF File

 EXAMPLE:
   result=f_time('otto.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), July, 8 1997
   1999-05-05 offset and scale factor added
   1999-Nov-06 help added
   2000-May-19 'offset' changed to 'add_offset'

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_time.pro)


F_UNITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  f_units

 PURPOSE:
   This function reaturns the param_units from a parameter from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_units(file_name,short_name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File
   short_name: The parameter name in the netCDF File

 OPTIONAL INPUTS:
     name: the name of the parameter is obsolete in this way will be removed soon

 KEYWORD PARAMETERS:
    xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of param_units
   You can choose to submit one file and many short names or
   many files and one short_name or many files and many short names

 EXAMPLE:
   result=f_units('otto.nc')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 22 1997
                       R.Bauer          July, 28 1997 added name
1998-01-14: 2000-01-01 = 2000-1-1 definiert

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_units.pro)


F_VERSION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   f_version

 PURPOSE:
   This function returns the version value from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=f_version(file_name,[/xp])

 INPUTS:
   file_name: The name of the netCDF File

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of versionnames

 EXAMPLE:
   result=f_version('otto.nc')

 MODIFICATION HISTORY:
  Written by:	R.Bauer (ICG-1), 1997-Sept-08
  1998-Aug-06 altered syntax to ncdf_get_one_global_attribute

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\f_version.pro)


GAMMA_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		GAMMA_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates the gamma function.  Replacement for the IDL GAMMA function
		which accepts only real input.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = GAMMA_MM (X)
 INPUTS:
	X
		Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the gamma function of X.  Output type is same as input (but no
		lower than FLOAT), form is same as input.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The real part of X should be greater than 0.
 PROCEDURE:
		Calls LNGAMMA_MM
 MODIFICATION HISTORY:
		Created 30-MAR-1996 by Mati Meron as M_GAMMA.
		Renamed 25-SEP-1999 by Mati Meron, to GAMMA_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\gamma_mm.pro)


GAUSS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GAUSS
 PURPOSE:
       Return a fitted gaussian curve for a given histogram.
 CATEGORY:
 CALLING SEQUENCE:
       fit = gauss(x,h)
 INPUTS:
       x = array of histogram bin center values.       in
       h = histogram array.                            in
 KEYWORD PARAMETERS:
       Keywords:
         MEAN=mn returned histogram mean.
         SDEV=sd returned histogram standard deviation.
 OUTPUTS:
       fit = expected histogram values for a gaussian.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 21 May, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gauss.pro)


GAUSS1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   GAUSS1

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute Gaussian curve given the mean, sigma and area.

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   YVALS = GAUSS1(XVALS, [MEAN, SIGMA, AREA], SKEW=skew)

 DESCRIPTION:

  This routine computes the values of a Gaussian function whose
  X-values, mean, sigma, and total area are given.  It is meant to be
  a demonstration for curve-fitting.

  XVALS can be an array of X-values, in which case the returned
  Y-values are an array as well.  The second parameter to GAUSS1
  should be an array containing the MEAN, SIGMA, and total AREA, in
  that order.

 INPUTS:
   X - Array of X-values.

   [MEAN, SIGMA, AREA] - the mean, sigma and total area of the 
                         desired Gaussian curve.

 INPUT KEYWORD PARAMETERS:

   SKEW - You may specify a skew value.  Default is no skew.

   PEAK - if set then AREA is interpreted as the peak value rather
          than the area under the peak.

 RETURNS:

   Returns the array of Y-values.

 EXAMPLE:

   p = [2.2D, 1.4D, 3000.D]
   x = dindgen(200)*0.1 - 10.
   y = gauss1(x, p)

   Computes the values of the Gaussian at equispaced intervals
   (spacing is 0.1).  The gaussian has a mean of 2.2, standard
   deviation of 1.4, and total area of 3000.

 REFERENCES:

 MODIFICATION HISTORY:
   Written, Jul 1998, CM
   Correct bug in normalization, CM, 01 Nov 1999
   Optimized for speed, CM, 02 Nov 1999
   Added copyright notice, 25 Mar 2001, CM
   Added PEAK keyword, 30 Sep 2001, CM

  $Id: gauss1.pro,v 1.4 2001/10/13 17:41:48 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\gauss1.pro)


GAUSS1P

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   GAUSS1P

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute Gaussian curve given the mean, sigma and area (procedure).

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   GAUSS1, XVALS, [MEAN, SIGMA, AREA], YVALS, SKEW=skew

 DESCRIPTION:

  This routine computes the values of a Gaussian function whose
  X-values, mean, sigma, and total area are given.  It is meant to be
  a demonstration for curve-fitting.

  XVALS can be an array of X-values, in which case the returned
  Y-values are an array as well.  The second parameter to GAUSS1
  should be an array containing the MEAN, SIGMA, and total AREA, in
  that order.

 INPUTS:
   X - Array of X-values.

   [MEAN, SIGMA, AREA] - the mean, sigma and total area of the 
                         desired Gaussian curve.

   YVALS - returns the array of Y-values.


 KEYWORD PARAMETERS:

   SKEW - You may specify a skew value.  Default is no skew.

 EXAMPLE:

   p = [2.2D, 1.4D, 3000.D]
   x = dindgen(200)*0.1 - 10.
   gauss1p, x, p, y

   Computes the values of the Gaussian at equispaced intervals
   (spacing is 0.1).  The gaussian has a mean of 2.2, standard
   deviation of 1.4, and total area of 3000.

 REFERENCES:

 MODIFICATION HISTORY:
   Transcribed from GAUSS1, 13 Dec 1999, CM
   Added copyright notice, 25 Mar 2001, CM

  $Id: gauss1p.pro,v 1.2 2001/03/25 18:55:12 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\gauss1p.pro)


GAUSS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   GAUSS2

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute Gaussian curve given the mean, sigma and area.

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   YVALS = GAUSS2(X, Y, [XCENT, YCENT, SIGMA, PEAK])

 DESCRIPTION:

  This routine computes the values of a Gaussian function whose
  X-values, mean, sigma, and total area are given.  It is meant to be
  a demonstration for curve-fitting.

  XVALS can be an array of X-values, in which case the returned
  Y-values are an array as well.  The second parameter to GAUSS1
  should be an array containing the MEAN, SIGMA, and total AREA, in
  that order.

 INPUTS:
   X - 2-dimensional array of "X"-values.
   Y - 2-dimensional array of "Y"-values.

   XCENT - X-position of gaussian centroid.
   YCENT - Y-position of gaussian centroid.

   SIGMA - sigma of the curve (X and Y widths are the same).

   PEAK - the peak value of the gaussian function.

 RETURNS:

   Returns the array of Y-values.

 EXAMPLE:

   p = [2.2D, -0.7D, 1.4D, 3000.D]
   x = (dindgen(200)*0.1 - 10.) # (dblarr(200) + 1)
   y = (dblarr(200) + 1) # (dindgen(200)*0.1 - 10.)
   z = gauss2(x, y, p)

   Computes the values of the Gaussian at equispaced intervals in X
   and Y (spacing is 0.1).  The gaussian has a centroid position of
   (2.2, -0.7), standard deviation of 1.4, and peak value of 3000.

 REFERENCES:

 MODIFICATION HISTORY:
   Written, 02 Oct 1999, CM
   Added copyright notice, 25 Mar 2001, CM

  $Id: gauss2.pro,v 1.2 2001/03/25 18:55:13 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\gauss2.pro)


GENARROW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GENARROW
 PURPOSE:
       Generate an arrow polygon.
 CATEGORY:
 CALLING SEQUENCE:
       genarrow, x1, y1, x2, y2, x, y
 INPUTS:
       (x1,y1) = tail of arrow.           in
       (x2,y2) = head of arrow.           in
 KEYWORD PARAMETERS:
       Keywords:
         AWID=hw   arrowhead width.  Def=20% of shaft length.
         ALEN=hl   arrowhead length. Def=40% of shaft length.
         SHAFT=sw  shaft width.      Def=10% of shaft length.
         /PERCENT means above values given as % arrow length.
 OUTPUTS:
       x,y = arrow polygon (closed).      out
 COMMON BLOCKS:
 NOTES:
       Note: if /PERCENT is given then all values are in %.
         If /PERCENT is not given then given values are in
         same units as (x1,y1), (x2,y2), and unspecified values
         are default percents.
 MODIFICATION HISTORY:
       R. Sterner.  5 SEP, 1986. FROM TVARROW.PRO.
       R. Sterner, 17 Sep, 1992 --- upgraded to IDL V2.  Added some keywords.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\genarrow.pro)


GENELLIPSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GENELLIPSE
 PURPOSE:
       Generate points on an ellipse.
 CATEGORY:
 CALLING SEQUENCE:
       genellipse, xm, ym, ang, a, b, x, y
 INPUTS:
       xm, ym = Center of ellipse.      in
       ang = Angle of ellipse.          in
       a, b = Semi-axes.                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x, y = Ellipse points.           out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  10 june, 1986.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\genellipse.pro)


GENGRID

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE      gengrid
 USEAGE       gengrid,a0,a1,a2,a3,a4
 PURPOSE      convert the input quantities from vectors to arrays
              of dimension (nn0,nn1,nn2,nn3,nn4) where nn0=n_elements(a0),
              etc. 

                 a0(i) => a0(i,*,*,*,*) for i=0,nn0-1
                 a1(i) => a1(*,i,*,*,*) for i=0,nn1-1
                 a2(i) => a2(*,*,i,*,*) for i=0,nn2-1
                 a3(i) => a3(*,*,*,i,*) for i=0,nn3-1
                 a4(i) => a4(*,*,*,*,i) for i=0,nn4-1

 INPUT:
   a0         input vector or scalor array size of the first index
   a1         input vector or scalor array size of the second index
   a2         input vector or scalor array size of the third index
   a3         input vector or scalor array size of the fourth index
   a4         input vector or scalor array size of the fifth index

              if one of these arguments is set to a scalor, then that
              value is used to set the dimension of corresponding 
              array subscript

 EXAMPLE:    
              a0=[1,2,3,4,5]
              a1=[10,20,30]
              gengrid,a0,a1
              print,a0
              
                         1  2  3  4  5
                         1  2  3  4  5
                         1  2  3  4  5
              print,a1
                        10 10 10 10 10
                        20 20 20 20 20
                        30 30 30 30 30

              here are some other examples:

              ;turn a 5 element vector into a 5x6 array

              x=findgen(3)
              gengrid,x,6
              print,x

                   0.00000      1.00000      2.00000
                   0.00000      1.00000      2.00000
                   0.00000      1.00000      2.00000
                   0.00000      1.00000      2.00000
                   0.00000      1.00000      2.00000
                   0.00000      1.00000      2.00000

              ;turn a 5 element vector into a 6x5 array

              x=findgen(3)
              gengrid,4,x
              print,x

		    0.00000      0.00000      0.00000      0.00000 
		    1.00000      1.00000      1.00000      1.00000 
		    2.00000      2.00000      2.00000      2.00000 
               

  author:  Paul Ricchiazzi                            mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\gengrid.pro)


GENSHAPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GENSHAPE
 PURPOSE:
       Generate x,y coordinates to draw named shaped.
 CATEGORY:
 CALLING SEQUENCE:
       genshape, name, x, y
 INPUTS:
       name = name of shape:			in
         triangle, square, diamond, pentagon, hexagon,
         poly, polyN (N = # sides, 3-9),
         star, starN (N = # points, 3-9),
         tree, treeN (N = # points on side, 1-9),
         flower, flowerN (N = # petals, 3-9),
         circle, balloon,
 KEYWORD PARAMETERS:
 OUTPUTS:
       x, y = returned x,y for shape.		out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 2 Nov, 1986.
       R. Sterner, 14 Mar, 1990 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\genshape.pro)


GENTILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GENTILE
 PURPOSE:
       Generate a Netscape web page background tile.
 CATEGORY:
 CALLING SEQUENCE:
       gentile, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         INIT=[nx,ny]  Set tile size in pixels.
         COLOR=clr    Curve color (def=!p.color).
         FILL=fclr    If given fill polygon x,y.
         THICK=thk    Curve thickness (def=!p.thick).
         LINESTY=sty  Curve linestyle (def=!p.linestyle).
         /NOTES       List notes on making Netscape backgrounds.
 OUTPUTS:
 COMMON BLOCKS:
       gentile_com
 NOTES:
       Notes:
         Point coordinates are pixels into tile from lower
         left corner.  Curve gets repeated a total of 9 times
         so that tile edges match.  When all curves have been
         plotted resulting image may be modified in some way
         (like topo shading) and then an nx x ny patch read
         back from anywhere in the plotted area.  This patch
         may be used as a background tile.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 20

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gentile.pro)


GEN_COASTLINE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  GEN_COASTLINE

 USEAGE:   gen_coastline
           gen_coastline,alat,alon,file=file,image=image

 PURPOSE:  generate coastal outline map for satellite images

 INPUTS:   ALAT         2-D array of image latitude values (one value for
                        each image pixel)
           ALON         2-D array of image longitude values

                        if ALON and ALAT are not provided,
                        GEN_COASTLINE assumes a linear mapping of lat
                        and lon to the current x and y ploting range.

           FILE         Name of map coordinate data file. If FILE is
                        not provided, GEN_COASTLINE queries for an
                        output file name.  FILE is written in portable
                        XDR binary format which can be read by the 
                        companion procedure COASTLINE.

 OPTIONAL KEYWORD INPUT:
           image        Image from which to infer coastal outline.
                        If an image array is not provided, it is assumed
                        that an image has already been displayed using
                        the TVIM procedure.
           
 SIDE EFFECT:           writes map file in current working directory

 PROCEDURE:
  Before entering input mode the following pop-up menu appears,
 
 1. DEFINE AN OPEN CURVE                 Start a new coastal outline segment

 2. DEFINE A CLOSED CURVE                Start an island outline segment

 3. QUIT                                 Flush buffers and quit.  
 
 After option 1 or 2 is selected, coastline coordinates are input by 
 using the mouse to click on coastal features from an image in the 
 default window.  The mouse buttons perform the following actions:

 LMB: left mouse button connects points along coastline
 MMB: middle mouse erases most recent point(s)
 RMB: right mouse button finishes a coastline segment.
    
 If a coastal outline is intended to represent an island (option 2), 
 pressing the RMB causes the last point on the curve to be connected 
 to the first.

 The collection of [latitude, longitude] coordinates are written to the
 file FILE.  This map data file can be used as input for the companion
 procedure,  COASTLINE.PRO which plots the coast line data onto arbitrarily
 oriented image files. 


 EXAMPLE:
          x=findgen(128)
          y=findgen(128)
          gengrid,x,y
          d=randata(128,128,s=4)
          d=d gt 3
          gen_coastline,y,x,file='junk.dat',image=d
          coastline,file='junk.dat',/view

 AUTHOR:     Paul Ricchiazzi    oct92 
             Earth Space Research Group, UCSB

 REVISIONS
 29oct92: accomodate TRACE revision of 29oct92

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\gen_coastline.pro)


GEN_FIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GEN_FIT
 PURPOSE:
       Fitted Y array for given X array from given fit parameters.
 CATEGORY:
 CALLING SEQUENCE:
       y = gen_fit(x, cur)
 INPUTS:
       x = array of desired x values. May be a scalar.       in
       cur = array describing the fitted curve.              in
         Has following format:
         cur = [ftype, xoff, yoff, ndeg, c0, c1, ..., cn]
               for polynomial,
         cur = [ftype, xoff, yoff, a, b]
               for exponential and power.
         ftype = 0, 1, 2 for Polynomial, Exponential, Power Law.
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = fitted y values. May be a scalar.                 out
 COMMON BLOCKS:
 NOTES:
       Note: CUR may be obtained from the routine FIT.
       
 MODIFICATION HISTORY:
       R. Sterner.  14 Oct, 1986.
       RES 9 Oct, 1989 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gen_fit.pro)


GEN_INH2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	gen_inh2

 PURPOSE:
	Include of @gen_inh2 will create the structure INHALT

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   @gen_inh2

 INPUTS:
   all momentanly defined variables

 OUTPUTS:
   The include of @gen_inh2 generates the structure INHALT


 EXAMPLE:
   @gen_inh2

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), September 1996
               R.Bauer  Feb   26. 1997 areal renamed to type
               R.Bauer  March 17. 1997 valid_last_index as new parameter attribute
               R.Bauer  March 19. 1997 param_stdev, param_accuracy,param_detection_limit,
                                       param_high_err,param_low_err as new parameter attribute
               F.Rohrer !   gen_inh2_suche=where(strmid(gen_inh2_defn(gen_inh2_i),0,15) eq
                            strmid(inhalt_def(0,*),0,15),gen_inh2_count)
                            downgrade to idl 3.6.1

                            array mode ist dazugekommen
               R.Bauer May  16. 1997 arrays_sind and gethelp replaced by variab
               R.Bauer May  @inhalt_def embedded
               R.Bauer 1998-11-16 alt_inhalt_def instead of inhalt_def

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\gen_inh2.pro)


GETBITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETBITS
 PURPOSE:
       Pick out specified bits from a value.
 CATEGORY:
 CALLING SEQUENCE:
       out = getbits(in, s, n)
 INPUTS:
       in = integer value (scalar or array) to pick from. in
       s = bit number to start at (LSB is 0).             in
       n = number of bits to pick out (def=1).            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = returned value.                              out
 COMMON BLOCKS:
 NOTES:
       Notes: Input value must be an integer data type:
         byte, int, u_int, long, u_long, long_64, u_long_64
         Returned value is same data type.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 3

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getbits.pro)


GETCOLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETCOLOR

 PURPOSE:
       The original purpose of this function was to enable the
       user to specify one of the 16 colors supported by the
       McIDAS color map by name. Over time, however, the function
       has become a general purpose function for handling and
       supporting drawing colors in a device-independent way.
       In particular, I have been looking for ways to write color
       handling code that will work transparently on both 8-bit and
       24-bit machines. On 24-bit machines, the code should work the
       same where color decomposition is turned on or off. The program
       now supports 88 colors.

 AUTHOR:
       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Graphics, Color Specification.

 CALLING SEQUENCE:
       result = GETCOLOR(color, index)

 OPTIONAL INPUT PARAMETERS:
       COLOR: A string with the "name" of the color. Valid names are:
           black
           magenta
           cyan
           yellow
           green
           red
           blue
           navy
           pink
           aqua
           orchid
           sky
           beige
           charcoal
           gray
           white

           The color YELLOW is returned if the color name can't be resolved.
           Case is unimportant.

           If the function is called with just this single input parameter,
           the return value is either a 1-by-3 array containing the RGB values of
           that particular color, or a 24-bit integer that can be "decomposed" into
           that particular color, depending upon the state of the TRUE keyword and
           upon whether color decomposition is turned on or off. The state of color
           decomposition can ONLY be determined if the program is being run in
           IDL 5.2 or higher.

       INDEX: The color table index where the specified color should be loaded.
           If this parameter is passed, then the return value of the function is the
           index number and not the color triple. (If color decomposition is turned
           on AND the user specifies an index parameter, the color is loaded in the
           color table at the proper index, but a 24-bit value is returned to the
           user in IDL 5.2 and higher. This assumes the INDEXED keyword is NOT set.)

       If no positional parameter is present, then the return value is either a 16-by-3
       byte array containing the RGB values of all 16 colors or it is a 16-element
       long integer array containing color values that can be decomposed into colors.
       The 16-by-3 array is appropriate for loading color tables with the TVLCT command:

           Device, Decomposed=0
           colors = GetColor()
           TVLCT, colors, 100


 INPUT KEYWORD PARAMETERS:

       NAMES: If this keyword is set, the return value of the function is
              a 88-element string array containing the names of the colors.
              These names would be appropriate, for example, in building
              a list widget with the names of the colors. If the NAMES
              keyword is set, the COLOR and INDEX parameters are ignored.

                 listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16)

       INDEXED:  If this keyword is set, the return value is always an index
              into the color table. In the absence of a color table INDEX
              parameter, the color is loaded at !P.COLOR < (!D.Table_Size-1).

       LOAD:  If this keyword is set, all 88 colors are automatically loaded
              starting at the color index specified by the START keyword.
              Note that setting this keyword means that the return value of the
              function will be a structure, with each field of the structure
              corresponding to a color name. The value of each field will be
              an index number (set by the START keyword) corresponding to the
              associated color, or a 24-bit long integer value that creates the
              color on a true-color device. What you have as the field values is
              determined by the TRUE keyword or whether color decomposition is on
              or off in the absense of the TRUE keyword. It will either be a 1-by-3
              byte array or a long integer value.

       START: The starting color index number if the LOAD keyword is set. This keyword
              value is ignored unless the LOAD keyword is also set. The keyword is also
              ignored if the TRUE keyword is set or if color decomposition in on in
              IDL 5.2 and higher. The default value for the START keyword is
              !D.TABLE_SIZE - 89.

       TRUE:  If this keyword is set, the specified color triple is returned
              as a 24-bit integer equivalent. The lowest 8 bits correspond to
              the red value; the middle 8 bits to the green value; and the
              highest 8 bits correspond to the blue value. In IDL 5.2 and higher,
              if color decomposition is turned on, it is as though this keyword
              were set.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       The TRUE keyword causes the START keyword to be ignored.
       The NAMES keyword causes the COLOR, INDEX, START, and TRUE parameters to be ignored.
       The COLOR parameter is ignored if the LOAD keyword is used.
       On systems where it is possible to tell the state of color decomposition
       (i.e., IDL 5.2 and higher), a 24-bit value (or values) is automatically
       returned if color decomposition is ON.

 EXAMPLE:
       To load a yellow color in color index 100 and plot in yellow, type:

          yellow = GETCOLOR('yellow', 100)
          PLOT, data, COLOR=yellow

       or,

          PLOT, data, COLOR=GETCOLOR('yellow', 100)

       To do the same thing on a 24-bit color system with decomposed color on, type:

          PLOT, data, COLOR=GETCOLOR('yellow', /TRUE)

       or in IDL 5.2 and higher,

          DEVICE, Decomposed=1
          PLOT, data, COLOR=GETCOLOR('yellow')

       To load all 88 colors into the current color table, starting at
       color index 100, type:

          TVLCT, GETCOLOR(), 100

       To add the color names to a list widget:

           listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16)

       To load all 88 colors and have the color indices returned in a structure:

           DEVICE, Decomposed=0
           colors = GetColor(/Load, Start=1)
           HELP, colors, /Structure
           PLOT, data, COLOR=colors.yellow

       To get the direct color values as 24-bit integers in color structure fields:

           DEVICE, Decomposed=1
           colors = GetColor(/Load)
           PLOT, data, COLOR=colors.yellow

       Note that the START keyword value is ignored if on a 24-bit device,
       so it is possible to write completely device-independent code by
       writing code like this:

           colors = GetColor(/Load)
           PLOT, data, Color=colors.yellow

 MODIFICATION HISTORY:
       Written by: David Fanning, 10 February 96.
       Fixed a bug in which N_ELEMENTS was spelled wrong. 7 Dec 96. DWF
       Added the McIDAS colors to the program. 24 Feb 99. DWF
       Added the INDEX parameter to the program 8 Mar 99. DWF
       Added the NAMES keyword at insistence of Martin Schultz. 10 Mar 99. DWF
       Reorderd the colors so black is first and white is last. 7 June 99. DWF
       Added automatic recognition of DECOMPOSED=1 state. 7 June 99. DWF
       Added LOAD AND START keywords. 7 June 99. DWF.
       Replaced GOLD with CHARCOAL color. 28 Oct 99. DWF.
       Added INDEXED keyword to force indexed color mode. 28 Oct 99. DWF.
       Fixed problem of "aqua" and "pink" being mixed up. 18 Mar 00. DWF.
       Changed ON_ERROR from 1 to 2, and improved error handling. 2 Aug 00. DWF.
       Increased the known colors from 16 to 88. 19 October 2000. DWF.
       Fixed typos in which "thisColor" was written as "theColor". 10 AUG 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\getcolor.pro)


GETDATABLOCK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        GETDATABLOCK

 PURPOSE:
        retrieve information stored in a Fortran like DATA block
        somewhere within an IDL routine. The DATA block must be
        "hidden" as comment lines for the IDL compiler. It begins
        with an identifier (default '/DATA/') and ends with the first
        non-comment line. The data will be returned as string array.

 CATEGORY:
        general programming

 CALLING SEQUENCE:
        GETDATABLOCK,DATA [,FILENAME=FILENAME] [,LABEL=LABEL]

 INPUTS:

 KEYWORD PARAMETERS:
        FILENAME -> optional filename. Normally, the data block is
            read from the file that contains the procedure which
            calls getdatablock.

        LABEL -> a unique identifier for the start of the data block.
            Default is '/DATA/'. The end of the data block is reached
            at the end of file or if the block of comment lines ends.

 OUTPUTS:
        DATA -> a string array with the information contained in the 
            data block

 SUBROUTINES:
        none

 REQUIREMENTS:
        uses routine_name

 NOTES:
        The file with the datablock is always searched in !PATH

 EXAMPLE:
        getdatablock,sdata

        ; This will retrieve a data block labeled '/DATA/' from the
        ; file of the current IDL routine

 MODIFICATION HISTORY:
        mgs, 22 Apr 1998: VERSION 1.00
        mgs, 25 Aug 2000: -changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\getdatablock.pro)


GETENV2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETENV2
 PURPOSE:
       Version of getenv portable across operating systems.
 CATEGORY:
 CALLING SEQUENCE:
       val = getenv(var)
 INPUTS:
       var = Name of environmental variable.        in
 KEYWORD PARAMETERS:
       Keywords:
         LIST=v  1 means list source, else 0 (default).
           Remembers last setting during session.
 OUTPUTS:
       val = Returned value of requested variable.  out
             Null string if variable not found.
 COMMON BLOCKS:
       getenv2_com
 NOTES:
       Notes: The requested variable may either be an actual
       environmental variable, or the contents of a file with
       that name located in !base_dir.  The second case is portable
       across operating systems.  Just define !base_dir in your
       IDL startup file to point to some directory.  Example:
         defsysv, '!base_dir', '/homes/sterner/idl/base_dir', 1
       The value from !base_dir takes precedence.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Mar 18
       R. Sterner, 1998 May 18 --- fixed to work if !base_dir not defined.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getenv2.pro)


GETFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETFILE
 PURPOSE:
       Read a text file into a string array.
 CATEGORY:
 CALLING SEQUENCE:
       s = getfile(f)
 INPUTS:
       f = text file name.      in
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  error flag: 0=ok, 1=file not opened,
           2=no lines in file.
         /QUIET means give no error message.
         LINES=n  Number of lines to read (def=all).
           Much faster if number of lines is known.
 OUTPUTS:
       s = string array.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 20 Mar, 1990
       R. Sterner, 1999 Apr 14 --- Added LINES=n keyword.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getfile.pro)


GETFILELN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETFILELN
 PURPOSE:
       Get a line from a text file.
 CATEGORY:
 CALLING SEQUENCE:
       txt = getfileln(file)
 INPUTS:
       file = text file name.               in
 KEYWORD PARAMETERS:
       Keywords:
         LINE=L  file line number to return.  First = 1.
         KEY=K   Keyword to search for.  First line in
           which keyword K is found is returned as txt.
           File is searched up to line L (def=1000).
         START=S line to start keyword search.
         FOUND=F line in which keyword was found.
         ERROR=e error flag.  0=ok, 1=file not opened,
           2=LINE out of range, 3=KEY not found.
 OUTPUTS:
       txt = returned text string.          out
 COMMON BLOCKS:
 NOTES:
       Notes: If LINE or KEY not specified the first line
         is returned.  If both LINE and KEY are specified
         then the search for KEY is limited to LINE lines.
         If LINE is out of range or KEY is not found then
         a null string is returned.
 MODIFICATION HISTORY:
       R. Sterner, 9 Mar, 1990
       R. Sterner, 26 Feb, 1991 --- Renamed from getfileline.pro

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getfileln.pro)


GETFPOSCM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   getfposcm

 PURPOSE:
   convert cm position to normal

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   Result = GETFPOSCM(poscm)

 INPUTS:
   pos_in_cm (can be array or matrix)
   lower left x, lower left y, upper right x, upper right y... in cm

 OPTIONAL INPUTS:
   /axis           upper right are axis length

 OUTPUTS:
   pos:    updated position

 EXAMPLE:
       ....................

 REVISION HISTORY:
   Written         Theo Brauers, June 1997
   Corrected
   Revised         IDL 5.0

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\getfposcm.pro)


GETGROUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETGROUP
 PURPOSE:
       N'th group of identical elements from a given array.'
 CATEGORY:
 CALLING SEQUENCE:
       g = getgroup(a, n, [m])
 INPUTS:
       a = array to process.                        in
       n = group number to get (first = 0 = def).   in
       m = optional last group number to get.       in
 KEYWORD PARAMETERS:
       Keywords:
         LOCATION = l.  Return group n start location.
         /LAST means n is offset from last group.  So n=0 gives
           last group, n=-1 gives next to last, ...
           If n=-2 and m=0 then last 3 groups are returned.
         /LONGEST returns the longest group. n returned, m ignored.
 OUTPUTS:
       g = returned group or groups.                out
 COMMON BLOCKS:
 NOTES:
       Note: Getgroup works on any array type that allows.
         the EQ operator.
         See ngroups.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 02

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getgroup.pro)


GETIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETIMAGE

 PURPOSE:
       The purpose of this function is to allow the user to open either
       regular or XDR binary image files of two or three dimensions.

 CATEGORY:
       Widgets, File I/O.

 CALLING SEQUENCE:
       image = GETIMAGE(filename)

 OPTIONAL INPUTS:
       filename: The name of the file to open for reading.

 OPTIONAL KEYWORD PARAMETERS:

       CANCEL: An output variable that can be set to a named variable.
       The value of the return variable will be 1 if the user clicked
       the "Cancel" button or if there was a problem reading the file.

       CATCH: Set this keyword to 0 if you wish to turn error catching OFF.

       DIRECTORY: The name of the directory the file is located in. By
       default the program looks in the "coyote" directory under the
       main IDL directory, if one exists. Otherwise, it defaults to the
       current directory.

       FRAMES: The 3rd dimension of a 3D data set. Defaults to 0.

       HEADER: The size of any header information in the file in BYTES.
       Default is 0.

       PARENT: The group leader for this widget program. The PARENT is
       required if GETIMAGE is called from another widget program in order
       to make this program a MODAL widget program.

       XDR: Set this keyword if the binary file is of XDR type.

       XOFFSET: This is the X offset of the program on the display. The
       program will be placed approximately in the middle of the display
       by default.

       XSIZE: The size of the 1st dimension of the data.

       YOFFSET: This is the Y offset of the program on the display. The
       program will be placed approximately in the middle of the display
       by default.

       YSIZE: The size of the 2nd dimension of the data.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       A "CANCEL" operation is indicated by a 0 return value.
       Any error in reading the file results in a 0 return value.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To load the image "galaxy.dat" in the $IDL/examples/data
       directory, type:

       image = GETIMAGE('galaxy.dat', DIRECTORY=!DIR + '/examples/data', $
          XSIZE=256, YSIZE=256, Cancel=cancelled, Parent=event.top)
       IF NOT cancelled THEN TV, image

 MODIFICATION HISTORY:
       Written by: David Fanning, 3 February 96.
       Fixed bug that prevented reading INTEGER data. 19 Dec 96.
       Modifed program for IDL 5 MODAL operation. 19 Oct 97.
       Added CANCEL keyword. 27 Oct 97. DWF.
       Fixed CANCLE keyword spelling. Sigh... 29 JUN 98. DWF.
       Added COYOTE_FIELD, improved appearance. 19 NOV 99. DWF.
       Updated with latest version of COYOTE_FIELD. 18 FEB 2000. DWF.
       Added CATCH keyword so the program will break when I want
       it to. :-) 18 MAR 2000. DWF.
       Added GROUP_LEADER keyword, which is synonymous with PARENT. 31 MAR 2000. DWF.
       Updated obsolete PICKFILE call to DIALOG_PICKFILE. 17 JAN 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\getimage.pro)


GETKEY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETKEY
 PURPOSE:
       Return a keyboard key.  Interpret escape sequences.
 CATEGORY:
 CALLING SEQUENCE:
       k = getkey()
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /INIT initializes internal lookup tables, should never
           be needed but once was.  If arrow keys or other such
           escape sequence keys gives wrong value try /INIT.
 OUTPUTS:
       k = key string.  Actual key or key name.   out
           Waits for a key. No type ahead allowed.
 COMMON BLOCKS:
       getkey_com
 NOTES:
       Notes: Key is returned as a string.  Keys that produce
         escape sequences are interpreted and returned as a single
         string.  For example the F2 key returns 'F2', the right
         arrow key returns 'RIGHT', and so on.  Not all keys return
         something.  To find what a key returns do print,getkey()
         and press the desired key.
         Has problems if there is a pause between calls to getkey.
         Tries to handle problems but cannot always do so.  Its
         best to type slowly when there are pauses between calls,
         like for computations, etc.
 MODIFICATION HISTORY:
       R. Sterner, 8 Nov, 1989
       R. Sterner, 18 Apr, 1990 --- major rewrite.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getkey.pro)


GETRUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETRUN
 PURPOSE:
       N'th run of consecutive integers from a given array.'
 CATEGORY:
 CALLING SEQUENCE:
       w2 = getrun(w, n, [m])
 INPUTS:
       w = output from where to process.          in
       n = run number to get (first = 0 = def).   in
       m = optional last run number to get.       in
 KEYWORD PARAMETERS:
       Keywords:
         LOCATION = l.  Return run n start location.
         /LAST means n is offset from last run.  So n=0 gives
           last run, n=-1 gives next to last, ...
           If n=-2 and m=0 then last 3 runs are returned.
         /LONGEST returns the longest run. n returned, m ignored.
 OUTPUTS:
       w2 = returned run or runs.                 out
 COMMON BLOCKS:
 NOTES:
       Note: Getrun is meant to be used on the output from where.
             if m > n then w2 will be a string of runs from run n to
             run m.  If no m is given then w2 will be a single run.
             If n<0 returns runs starting at run abs(n) to end of w.
             If n is out of range then a -1 is returned.
             See also nruns.
 MODIFICATION HISTORY:
       R. Sterner, 18 Mar, 1990
       R. Sterner, 12 Aug, 1993 --- minor simplification.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getrun.pro)


GETSTR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETSTR
 PURPOSE:
       Get delimited strings from a text string or array.
 CATEGORY:
 CALLING SEQUENCE:
       s = getstr(txt)
 INPUTS:
       txt = input text string or string array.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = Returned array of strings found.       out
 COMMON BLOCKS:
 NOTES:
       Notes: Delimited strings must be surrounded by
         a single or double quote.  The other type of
         quote may be contained within the delimited string.
         The strings may be separated by white space, commas,
         or any other kind of separator.
         If no strings are found a null string is returned.
         Only delimited strings are returned, all other items
         are ignored.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Apr 10

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getstr.pro)


GETSYSNAMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETSYSNAMS
 PURPOSE:
       Get a list from a file specified by an environmental var.
 CATEGORY:
 CALLING SEQUENCE:
       getsysnams, evar, n, lst1, [lst2, lst3]
 INPUTS:
       evar = environ var (symbol in VMS) with file name.   in
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  0=ok, 1=no such environmental variable,
       2=file not found.
 OUTPUTS:
       n = number of elements in each list.                 out
       lst1, lst2, lst3 = output lists.                     out
 COMMON BLOCKS:
 NOTES:
       Notes: the lines in the file are returned divided into as
         many output lists as are requested, with the first line
         in the first list, second in second, ....  File lines
         starting with * are considered comments and are ignored.
         This routine is useful for system dependent lists, such
         as postscript printers or tape drives.
         As an example for printers let the file contain:
         *----  Example printers file  --------
         print/queue=cps_ps
         Postscript printer # 1 in room A.
         print/queue=cps_ps2
         Postscript printer # 2 in room B.
       
         To use:
         (1) Set up a systen environmental variable, like 
             IDL_PSPRINTERS, with the name of the above file.
         (2) getsysnams,'idl_psprinters', n, cmds, nams
             will give: n = 2, cmds = string array of print
             commands, nams = string array of descriptive names
             (good for menus).
 MODIFICATION HISTORY:
       R. Sterner, 22 May, 1990
       R. Sterner, 26 Feb, 1991 --- Renamed from get_sysnames.pro

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getsysnams.pro)


GETVIEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETVIEW
 PURPOSE:
       Return current viewport.
 CATEGORY:
 CALLING SEQUENCE:
       getview, vx1, vx2, vy1, vy2
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       vx1, vx2, vy1, vy2 = current viewport.	out.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 11 Nov, 1988.
       R. Sterner, 26 Feb, 1991 --- renamed from get_viewport.pro
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getview.pro)


GETWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETWINDOW
 PURPOSE:
       Get data window coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       getwindow, xmn, xmx, ymn, ymx, [err]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         XMID=x  gives window x midvalue.
         YMID=y  gives window y midvalue.
 OUTPUTS:
       xmn, xmx = window edge min and max data x.   out
       ymn, ymx = window edge min and max data y.   out
       err = window status: 0=ok, 1=not set.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 21 Feb 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getwindow.pro)


GETWRD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GETWRD
 PURPOSE:
       Return the n'th word from a text string.
 CATEGORY:
 CALLING SEQUENCE:
       wrd = getwrd(txt, n, [m])
 INPUTS:
       txt = text string to extract from.         in
         The first element is used if txt is an array.
       n = word number to get (first = 0 = def).  in
       m = optional last word number to get.      in
 KEYWORD PARAMETERS:
       Keywords:
         LOCATION = l.  Return word n string location.
         DELIMITER = d. Set word delimiter (def = space & tab).
         /LAST means n is offset from last word.  So n=0 gives
           last word, n=-1 gives next to last, ...
           If n=-2 and m=0 then last 3 words are returned.
         /NOTRIM suppresses whitespace trimming on ends.
         NWORDS=n.  Returns number of words in string.
 OUTPUTS:
       wrd = returned word or words.              out
 COMMON BLOCKS:
       getwrd_com
 NOTES:
       Note: If a NULL string is given (txt="") then the last string
             given is used.  This saves finding the words again.
             If m > n wrd will be a string of words from word n to
             word m.  If no m is given wrd will be a single word.
             n<0 returns text starting at word abs(n) to string end
             If n is out of range then a null string is returned.
             See also nwrds.
 MODIFICATION HISTORY:
       Ray Sterner,  6 Jan, 1985.
       R. Sterner, Fall 1989 --- converted to SUN.
       R. Sterner, Jan 1990 --- added delimiter.
       R. Sterner, 18 Mar, 1990 --- added /LAST.
       R. Sterner, 31 Jan, 1991 --- added /NOTRIM.
       R. Sterner, 20 May, 1991 --- Added common and NULL string.
       R. Sterner, 13 Dec, 1992 --- Made tabs equivalent to spaces.
       R. Sterner,  4 Jan, 1993 --- Added NWORDS keyword.
       R. Sterner, 2001 Jan 15 --- Fixed to use first element if not a scalar.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\getwrd.pro)


GET_ALREADY_COMPILED_ROUTINES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_already_compiled_routines

 PURPOSE:
	The result of this function is a vector holding all names of previously compiled routines


 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=get_already_compiled_routines()


 OUTPUTS:
	result: A Vector of idl script names


 EXAMPLE:
   print,get_already_compiled_routines()
   arr2string array2textable dependences_of_family drop_comments dtime2js dt_tm_fromjs

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-05
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_already_compiled_routines.pro)


GET_ASAD_INITIAL_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 get_asad_initial_data

 PURPOSE:
  Read  initial chemical values (for ASAD-model-runs ) 
  from a net-CDF-file (see example: initial.nc) and 
  write them to an ascii-file (see example: initial.dat)


 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   get_asad_inital_data,file.outfile


 INPUTS:
   file : input netCDF File
   outfile:  name of ASCII file

  PROCEDURE:
    Example Output file from get_asad_initial_data:
    LAT LONG O(3P)
    224.503128        12.        0.0000000


 EXAMPLE:
   get_asad_inital_data,'inital.nc','initial1.out'
   Syntax of ASCII file
   INPUT FILE FROM: initial1.nc
   LAT           12.000000
   LONG          4.3500671
   EQLAT         1.5379410
   TND           8.2151784e+17


 MODIFICATION HISTORY:
  R.Bauer 1998-Aug-04
  M.Kraemer 1998-Aug-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mk_lib\get_asad_initial_data.pro)


GET_BOUNDINGBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_boundingbox

 PURPOSE:
   This function returns the boundingbox of the last plot

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   result=get_boundingbox()


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-10-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_boundingbox.pro)


GET_CASES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     get_cases

 PURPOSE:
   This function returns the indices of upper or lower cased names

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=get_cases(text,[/upper],[/lower])

 INPUTS:
  text:  a string vector of text

 KEYWORD PARAMETERS:
  upper: if set it returns the indices of uppercased strings of text
  lower: if set it returns the indices of lowercased strings of text

 EXAMPLE:
  print,get_cases(['Anton','BERTA','caesar'],/upper)
  1
  print,get_cases(['Anton','BERTA'],/lower)
  -1
  print,get_cases(['Anton','BERTA','caesar'],/lower)
  2

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Oct-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_cases.pro)


GET_COLOR_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_color_struct

 PURPOSE:
 
This procedure defines a colorindices of 20 possible colors for plotxy
CATEGORY: PLOT/PLOTXY CALLING SEQUENCE: RESULT=get_color_struct() OUTPUTS: RESULT. : is a structure defining color names .black :0 .red :1 .blue :2 .green :3 .pink :4 .violett :5 .orange :6 .dark_red :7 .cyan :8 .yellow :9 .blue_green :10 .white :11 .light_grey :12 .medium_grey:13 gold :14 aquamarine :15 orchid :16 beige :17 EXAMPLE: colors_nc=get_color_struct() help,colors_nc,/str ** Structure <30027fbc>, 12 tags, length=24, refs=1: BLACK INT 0 RED INT 1 BLUE INT 2 GREEN INT 3 PINK INT 4 VIOLETT INT 5 ORANGE INT 6 DARK_RED INT 7 CYAN INT 8 YELLOW INT 9 BLUE_GREEN INT 10 WHITE INT 11 LIGHT_GREY INT 12 MEDIUM_GREY INT 13 MODIFICATION HISTORY: Written by R.Bauer 1999-10-20

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_color_struct.pro)


GET_COMPILED_LIB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_compiled_lib

 PURPOSE:
   This function compiles all procedure and functions in a given path

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
  get_compiled_lib,path

 INPUTS:
   path: the path of the idl library


 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), Nov 5 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_compiled_lib.pro)


GET_COORDINATION_PARAMETER_NAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     get_coordination_parameter_names

 PURPOSE:
   This function returns the name and the coordination parameter names of a netCDF datafile Parameter.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=get_coordination_parameter_names(file,name)

 INPUTS:
   file: the name of the netCDF File
   name: the short name of the netCDF Parameter


 EXAMPLE:
  print,get_coordination_parameter_names('ghost.nc','F12')
  F12 time


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Mar-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_coordination_parameter_names.pro)


GET_COUNT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GET_COUNT
 PURPOSE:
       Get next count value, from 1 up.
 CATEGORY:
 CALLING SEQUENCE:
       c = get_count(tag)
 INPUTS:
       tag = Any text string.                 in
 KEYWORD PARAMETERS:
       Keywords:
         FILE=file  Name of count file to use (def=count_file.txt
           in current directory.
         /ZERO  zero counter for given tag.  Does not return
           a count.  Count for next normal call will be 1.
         SET=c  set counter to given value for given tag.  Does not
           return a count. Count for next normal call will be c+1.
 OUTPUTS:
       c = Count corresponding to given tag.  out
         Returned as a string.
 COMMON BLOCKS:
 NOTES:
       Notes: this routine returns the number of times it has
         been called with the given tag.  The counts are saved
         in a count file which defaults to count_file.txt in
         current directory.  This is a simple text file and
         may be modifed.  Useful for creating a series of
         related file names.  Could use date2dn to generate
         a tag value.  Use a unique tag for each purpose.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Jul 6

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\get_count.pro)


GET_DATE_OF_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_date_of_file

 PURPOSE:
   This function reads the modification time stamp from a given path and file

 CATEGORY:
   CASE_TOOLS


 CALLING SEQUENCE:
   result=get_date_of_file(path,file_name)


 INPUTS:
	path:      the path where the file is in
   file_name: the name of the file

 OUTPUTS:
	This function returns the time stamp of the give file

 EXAMPLE:
	result=get_date_of_file('.','test.pro')
   print,result



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 16 1997
                       Dec-1 output corrected
 1998-Jan-26: Output corrected for years changing.
 1998-Mar-15: z.B. init_dev bei tb_lib enthaellt keine Uhrzeit im File Zeit String
                   das wird jetzt abgefangen
 1998-Jun-24: -Fdl is changed to -l
 1999-Jan-26  most code replaced by file_info
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_date_of_file.pro)


GET_DBD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    get_dbd

 PURPOSE:
  This function returns the filenames from the databases by several criterions.

 CATEGORY:
   DATAFILES/DBD

 CALLING SEQUENCE:
   Result=get_dbd(bdb,[short_name=short_name],[date=date],[mission=mission],[type_of_data=type_of_data],[platform_name=platform_name],[experiment=experiment],[campaign=campaign],[count=count],
          [get_missions=get_missions],[get_experiments=get_experiments],[get_platform_names=get_platform_names],[get_time=get_time],[_extra=pkey]

 INPUTS:
  dbd: the database structure, definition in read_dbd

 KEYWORD PARAMETERS:
   date:  the Date (parts of string date e.g. '07-10'
   short_name: the short_name of the parameter
   mission:  The mission of e.g. flight: 0723_1
   type_of_data: The type of the data
   platform_name: The name oof the platform
   experiment: the experiment name of the dataset
   campaign: the campaign where the dataset are belonging to
   count:  the number of hits
   get_missions: if arg_present() all missions
   get_experiments: if arg_present() all experiments
   get_platform_names:  if arg_present() all platform names
   get_time:   if arg_ppresent() all [['Start_TIME'],['End_TIME']]


 EXAMPLE:
   dbd=read_dbd('S:\links\daten\experiments\stream1996',/final_base)
   result=get_dbd(dbd,short_name='O3')
   print,result
    S:/links/daten/experiments/stream1996/database/../0522_1/cessna_imau_o3.nc
    S:/links/daten/experiments/stream1996/database/../0523_1/cessna_imau_o3.nc
    S:/links/daten/experiments/stream1996/database/../0527_1/cessna_imau_o3.nc
    S:/links/daten/experiments/stream1996/database/../0530_1/cessna_imau_o3.nc
    S:/links/daten/experiments/stream1996/database/../0531_1/cessna_imau_o3.nc
    S:/links/daten/experiments/stream1996/database/../0601_1/cessna_imau_o3.nc

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1),  2000-May-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_dbd.pro)


GET_DEFAULTFORMAT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        GET_DEFAULTFORMAT (function)

 PURPOSE:
        Return format string that will produce legible and
        concise strings for a given value range. The format
        should be applied in a string() statement and the 
        string should be trimmed.
        See also: autoformat -- both routines experimental at best!

 CATEGORY:
        String handling

 CALLING SEQUENCE:
        myformat = GET_DEFAULTFORMAT(minval,maxval [,/LOG])

 INPUTS:
        MINVAL, MAXVAL -> the range of values that shall be 
            displayed with this format.

 KEYWORD PARAMETERS:
        /LOG -> set this keyword if you plan logarithmic labels.
            (changes behaviour for 0.001)

        DEFAULTLEN -> 1 or 2 strings with the default length 
            specification for 'f' and 'e' formats. If only one
            string is passed, it will be used for both, otherwise
            the first string applies to 'f' and the second to 'e'.
            Example: DEFAULTLEN='10.3' results in 'f10.3'.

        THRESHOLD -> threshold value to switch from 'f' to 'e' format.
            Default is '2' for linear and '3' for log scale. This
            value is determined by the negative decadal log of (maxv-minv)
            plus 2.

 OUTPUTS:
        A format string (e.g. '(f14.2)' )

 SUBROUTINES:
        none

 REQUIREMENTS:
        none

 NOTES:
    Not my best routine. See also AUTOFORMAT which is likewise to be
    considered experimental.

 EXAMPLE:
        print,get_defaultformat(0.01,1.)

        returns  '(f14.2)'

        print,get_defaultformat(0.0001,0.01)

        returns  '(e12.3)'

 MODIFICATION HISTORY:
        mgs, 17 Mar 1999: VERSION 1.00
        mgs, 25 Mar 1999: - added DEFAULTLEN keyword
        mgs, 19 May 1999: - DEFAULTLEN now converted to string.
                          - added THRESHOLD keyword
        mgs, 23 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\get_defaultformat.pro)


GET_DIMENSIONS_FROM_ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    get_dimensions_from_icg_struct

 PURPOSE:
   This function returns a structure with all neccessary information to define Parameters and their flags

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=get_dimensions_from_icg_struct(struct,status,count)

 INPUTS:
  struct: the ICG defined datastructure
  status: the extracted status structure of the netCDF ICG datastructure

 OUTPUTS:
   count: the n_elements of short_names
   result is a structure:
   e.g.
   TIME            STRUCT
                   NAME            STRING    ['time']
                   SIZE            LONG      [100]
                   P_ID            LONG                -1
                   D_IDS           LONG      [-1]
                   TYPE            LONG                 5
   N2O:            STRUCT
                   NAME            STRING    ['time']
                   SIZE            LONG      [100]
                   P_ID            LONG                -1
                   D_IDS           LONG      [-1]
                   TYPE            LONG                 4



 EXAMPLE:
  HELP,get_dimensions_from_icg_struct(structure,status,count),/str
  * Structure <1358398>, 4 tags, length=80, refs=1:
    TIME            STRUCT    ->  Array[1]
    N2O             STRUCT    ->  Array[1]
    TAG_NAME        STRING    Array[2]
    SHORT_NAME      STRING    Array[2]


 
TIME N2O TAG_NAME SHORT_NAME
str[1]str[1]TIMEtime
N2ON2O


TIME
NAME SIZE P_ID D_IDS TYPE
time100-1-15


N2O
NAME SIZE P_ID D_IDS TYPE
time100-1-14

If flags are defined output is:
TIME N2O FLAG TAG_NAME SHORT_NAME
str[1]str[1]str[1]TIMEtime
N2ON2O


TIME
NAME SIZE P_ID D_IDS TYPE
time100-1-15


N2O
NAME SIZE P_ID D_IDS TYPE FLAG
time100-1-14str[1]


FLAG
STDEV
str[1]


STDEV
NAME SIZE P_ID D_IDS TYPE
time100-1-15


FLAG
N2O
str[1]


N2O
SHORT_NAME TAG_NAME
N2O@STDEVSTDEV

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Mar-02 1999-Mar-31: now only struct.xxx.flag defines which additional parameters are written to the netCDF file e.g. if STDEV is defined and flag is NONE then STDEV isn't written to the netCDF File

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_dimensions_from_icg_struct.pro)


GET_DIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_dir

 PURPOSE:
   This function finds all subdirectories of a given path

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=get_dir([path],[/all],[/sort])

 OPTIONAL INPUTS:
	path: The start path where get_dir should look for subdirectories

 KEYWORD PARAMETERS:
	all:  in addition to the normal subdirectories the entries . and ..
   sort: sorts the output

 OUTPUTS:
	The result of this function is a string array of subdirectories

 EXAMPLE:
   Result=get_dir('/usr/local')
   or
   Result=get_dir('\windows')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_dir.pro)


GET_DIR_TREE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_dir_tree

 PURPOSE:
   This function finds all subdirectories of a given path

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=get_dir_tree(path)

 INPUTS:
   path: The start path where get_dir should look for subdirectories


 KEYWORD PARAMETERS:
   LEVEL: this input set the number of directory levels to be searched (def=1) (-1 all levels)
   COUNT: if set to a named variable the number files is returned
   SORT:  if keyword set the output will be sorted

 OUTPUTS:
   The result of this function is a string array of subdirectories

 EXAMPLE:
   Result=get_dir_tree('/usr/local', level=-1, count=c)
   or
   Result=get_dir_tree('\windows', level=2, count=c)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), May 1997
   Modified by:    Theo Brauers (ICG-3), Nov 1997
                   Franz Rohrer (ICG-3), Aug 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\get_dir_tree.pro)


GET_ENZ_TEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_enz_text

 PURPOSE:
   This function returns the column identifiers of an enz/zchn-file

 CATEGORY:
    DATAFILES/ZCHN

 CALLING SEQUENCE:
   Result = GET_ENZ_TEXT(Filename)

 INPUTS:
   Filename:  a valid filename

 KEYWORD PARAMETERS:
   HEADER:     if set to a named variable the full header is returned
   ERROR:      set to a named variable to return an a error status (0: OK)

 OUTPUTS:
   This function returns a string array conatining the column names

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-Feb-8

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\get_enz_text.pro)


GET_FAKTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_faktor

 PURPOSE:
   This function multiplicates all values of an array

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result=get_faktor(array)

 INPUTS:
	array: An Array: Type: long, int, float

 OUTPUTS:
   This function returns a value


 EXAMPLE:
   Result=get_faktor([10,20])
   Result is 200

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 1997
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_faktor.pro)


GET_FILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   get_file

 PURPOSE:
   This function reads ascii data from a file

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=get_file(file,[type=type],[columns=columns],[reform=reform],[comments=comments],[/transpose],[/get_columns],[_extra=extra])

 INPUTS:
   file:  the filename to read in

 KEYWORD PARAMETERS:
 type:        if n_elements eq 0 then type is string else the integer type code defined by size
 columns:     if set the number of columns of the file
 reform:      if n_elements gt 0 and eq get_faktor(array) then the array will be reformed
 comments:    the number of comment lines to ignore
 header:      if comments are present you will found them in header
 trailer:     if trailer comments are present you will found them in trailer
 separator:   the separator sign between the entries default is ' '
 transpose:   to tranpose after reading
 get_columns: to autodetect number of columns
 get_separator: to autodetect the data separator
 get_comments:  to autodetect comment lines
 get_lastline: to autodetect last data line
 lastline:    if set it is used as the data array length
 BYTEARRAY:   if set a bytearray instead of string array is returned
 MESSAGE:     if set a message is printed
 STRUCTURE:   if set result is a structure
              file: the file name
              separator: the used separator
              data:  the data
              comments: the number of comment lines
              header: the comment strings
              trailer: the trailer comments

 _extra: for passing arguments to get_file

 RESTRICTIONS:
 datasets which uses ';' as separator without a space behind like '; ' will not readed correctly

 EXAMPLE:
    a=get_file('ghost.nas',type=4,/get_columns,/get_comments,/get_separator,/STR)
    help,a,/str
    ** Structure <136ade8>, 5 tags, length=936, refs=1:
       FILE            STRING    'ghost.nas'
       SEPARATOR       STRING    ' '
       DATA            FLOAT     Array[3, 63]
       HEADER          STRING    Array[20]

    if a file holding these lines
    0 1 2 3 4 5 6 7 8 9
    10 11 12 13 14 15 16 17 18 19

    print,get_file('test.dat')
    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
    ==
    print,get_file('test.dat',type=5,/get_columns)
    0.00000000       1.0000000       2.0000000       3.0000000       4.0000000       5.0000000       6.0000000       7.0000000       8.0000000       9.0000000
    10.000000       11.000000       12.000000       13.000000       14.000000       15.000000       16.000000       17.000000       18.000000       19.000000
    ==
    print,get_file('test.dat',type=3,/get_columns,reform=[4,5])
     0           1           2           3
     4           5           6           7
     8           9           10          11
     12          13          14          15
     16          17          18          19
    ==
    print,get_file('test.dat',type=3,/get_columns,/transpose)
           0          10
           1          11
           2          12
           3          13
           4          14
           5          15
           6          16
           7          17
           8          18
           9          19
    ==
     COL_0 COL_1 COL_2 COL_3 COL_4 COL_5 COL_6 COL_7 COL_8 COL_9
     0 1 2 3 4 5 6 7 8 9
     10 11 12 13 14 15 16 17 18 19

     print,get_file('data.txt',comments=1,/get_columns,type=4)
     0.000000      1.00000      2.00000      3.00000      4.00000      5.00000      6.00000      7.00000      8.00000      9.00000
      10.0000      11.0000      12.0000      13.0000      14.0000      15.0000      16.0000      17.0000      18.0000      19.0000

    ==
     COL_0 COL_1 COL_2 COL_3 COL_4 COL_5 COL_6 COL_7 COL_8 COL_9
     0 1 2 3 4 5 6 7 8 9
     10 11 12 13 14 15 16 17 18 19

     print,get_file('data.txt',comments=1,/get_columns,type=4,header=header)
      0.000000      1.00000      2.00000      3.00000      4.00000      5.00000      6.00000      7.00000      8.00000      9.00000
      10.0000      11.0000      12.0000      13.0000      14.0000      15.0000      16.0000      17.0000      18.0000      19.0000
    IDL> print,header
    COL_0 COL_1 COL_2 COL_3 COL_4 COL_5 COL_6 COL_7 COL_8 COL_9

    ==
     COL_0, COL_1, COL_2, COL_3, COL_4, COL_5, COL_6, COL_7, COL_8, COL_9
     0,  1,  2,  3,  4,  5,  6,  7,  8,  9
     10, 11, 12, 13, 14, 15, 16, 17, 18, 19
     print,get_file('data.txt',comments=1,/get_columns,type=4,separator=',')

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Jun-05
               1998-10-27 the feature messge and bytarray from Th.Brauers getfile2 are added
   Modified Theo brauers bug with extra removed
   1998-11-09 much more /get_* automatic mechanism added
   1998-11-10 more efficency by F.Rohrer and R.Bauer (we thought) but unfortunately it is not faster as the old version
              reads and readu takes a bit more time as for times reading the file
   2000-Feb-18 help changed to call_help
   2000-Feb-20 get_faktor removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_file.pro)


GET_FIRSTCHAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Get_FirstChar

 PURPOSE:
	This function returns the first character of a string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	fc = Get_FirstChar(charstr)

 INPUTS:
	charstr:	string of which the first character should be returned

 OUTPUTS:
	fc:	first character of charstr

 EXAMPLE:
	a = 'Hello'
	fc = Get_FirstChar(a)
	PRINT, fc
		-> H

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 16. Jul. 1998
	17.09.98:	Renamed routine from FirstChar to Get_FirstChar

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_firstchar.pro)


GET_FLAG_DESCRIPTION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     get_flag_description

 PURPOSE:
   This function returns the description of a flag (default is german)

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=get_flag_description(flag)

 INPUTS:
   flag: the name of the flag defined for the ICG data structure

 EXAMPLE:
  print,get_flag_description('STDEV')
  Standardabweichung der gemittelten Werte


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Mar-07

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_flag_description.pro)


GET_FOCUS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_focus

 PURPOSE:
   This functions returns the number of the plot over which the cursor is placed
	while running the interactive_cursor routine.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result = get_focus(ppos)

 INPUTS:
   ppos: Array with normal coordinates of the plot positions of each plot on the page
		  ppos can be obtained by calling the function get_plot_position

 OUTPUTS:
   This function returns the index of the plot over which the cursor is located
	while running the interactive_cursor routine.

 EXAMPLE:
	see test_interactive_cursor.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 01-Jun-1998.
	16.03.2000:	Removed debug command
					Changed call to VekLogik against call to indexlogic

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_focus.pro)


GET_FZJ_LOGO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_fzj_logo

 PURPOSE:
	This function returns an image of the FZJ logo
	with an optional phrase "Forschungszentrum Jülich"

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	image = get_fzj_logo([tif_file] [,/HEADER])

 OPTIONAL INPUTS:
	tif_file:	Name of the input image file in tif format.
					default logo: S:\links\idl_source\idl_work\fh_lib\data\fzj_logo.tif
					default header: S:\links\idl_source\idl_work\fh_lib\data\fzj_header.tif

 KEYWORD PARAMETERS:
	/HEADER:	If set, the FZJ logo will be displayed together with
				the phrase "Forschungszentrum Jülich"
	DATFILE = datfile:	Name of an IDL SAVE file with either the FZJ logo or
								the FZJ header (both stored with variable name 'image').

 OUTPUTS:
	true color image of the FZJ logo (three-dimensional array of type byte)
	with optional phrase "Forschungszentrum Jülich"

 EXAMPLE:
	TV, get_fzj_logo(/HEADER), TRUE = 3

	In order to write the logo to a PS file TV has to be called with additional keywords:

	TV, get_fzj_logo(), x, y, XSIZE = xsize, YSIZE = ysize, /CENTIMETERS, TRUE = 3

	x, y: lower-left coordinate (in cm if /CENTIMETERS is set) of the displayed image,
			relative to the lower-left corner of the ps device.
	xsize, ysize: Size of the picture in cm (if /CENTIMETERS is set).

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer, Frank Holland, 05.03.99

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_fzj_logo.pro)


GET_ICGS_COORD_VAR_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_icgs_coord_var_name

 PURPOSE:
	This function returns the coordinate variable name(s) of an ICG (sub) structure.

 CATEGORY:
	ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
	result = get_icgs_coord_var_name(icgs [, name])

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	name: short name(s) of parameter(s) in ICG structure. If omitted name is set
		to a vector including all parameter short names.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set name is interpreted as tag name.

 OUTPUTS:
	This function returns a vector with the short names of the coordinate
	variables in an ICG structure

 EXAMPLE:
	hox_data = read_ncdf('hox.nc')
	PRINT, get_icgs_coord_var_name(hox_data)   ---> 'time'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 18.02.2000
	03.03.2000: Removed bug if tag name was passed in lower case letters.
					Introduced keyword flag /NO_DIM_NAME in call to get_status_from_icg_struct

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_icgs_coord_var_name.pro)


GET_INCLUDES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_includes

 PURPOSE:
   This function reads included files

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result = get_includes(Str)

 INPUTS:
   Str:    string array with include information to be read from file

 KEYWORD PARAMETERS:
   INCLUDE_IDENT:  identifier for include file (def: '#include')
   IGNORE_CASE:    if set, case insensitive search of include_ident
   COMMENT:        comment string, will be used to comment the
                   include_identifier on return (def: ';')
   INCLUDE_ERROR:  count the number of include files which where NOT found
   RECURSE_FLAG:   if set the function is called recursively for the
                   includes found in the string array after processing
   RECURSE_IDENT:  identifier for recursive call in files (def: '#recurse_include')

 OUTPUTS:
   String array containg the original string array plus the text read from
   the include files


 EXAMPLE:
   str=['123','#include 123.txt', '345']
   putfile, '123.txt', str
   str2=get_includes(str)
   print, transpose(str2)
   IDL prints:
       123
       ;include 123.txt
       123
       #include 123.txt
       ;include 123.txt
       345

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1997-DEC
   Modified:   T.B. 1998-JAN-11
                   use incl for str_sep in loop
               T.B. 1998-JAN-14
                   new ignore_case for search of incl
               T.B. 1998-JAN-14
                   new include_error for return of error codes
               T.B. 1998-JAN-14
                   new file_search, see file_search function
               T.B. 1998-JUL-31
                   new recurse into include files of include files

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\get_includes.pro)


GET_INTERNAL_SOURCE_NAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  get_internal_source_names

 PURPOSE:
  The result of this function are the names of other functions or procedures defined in one source file

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   Result=get_internal_source_names(file_name)

 INPUTS:
   file_name: The name of the file

 OUTPUTS:
  This function returns  a vector of implemented routines

 EXAMPLE:
   result=get_internal_source_names('ct_ncdf.pro')
   ct_ncdf
   ct_ncdf_make_gif

   result=get_internal_source_names('xp_symbols.pro')
   xp_symbols
   xp_symbols_get_or_write_buttons
   xp_symbols_line_def
   xp_symbols_negativ
   xp_symbols_pconst_color
   xp_symbols_plots_symbol
   xp_symbols_positiv
   xp_symbols_show_symbol
   xp_symbols_top_syms_event

  result=get_internal_source_names('get_internal_source_names.pro')
   get_internal_source_names

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),1998-Aug-24
   Modifies by F.Rohrer (ICG-3),1998-Aug-25
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_internal_source_names.pro)


GET_LASTCHAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Get_LastChar

 PURPOSE:
	This function returns the last character of a string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	lc = Get_LastChar(charstr)

 INPUTS:
	charstr:	string of which the last character should be returned

 OUTPUTS:
	lc:	last character of charstr

 EXAMPLE:
	a = 'Hello'
	lc = Get_LastChar(a)
	PRINT, lc
		-> o

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 16. Jul. 1998
	17.09.98:	Renamed routine from LastChar to Get_LastChar

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_lastchar.pro)


GET_LINK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_link

 PURPOSE:
   This function checks, if a file is a link, and returns the original file
   to this linkfile. If the input file is no link, the input file is returned.
   To use this function, the program
   $ICG/icg/idl_sources/idl_work/ja_lib/c_sources/server
   has to run on an UNIX workstation.

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=get_link(file,your_unix_userid,server)

 INPUTS:
   file : the file to be checked

 KEYWORDS:
   server: a unix-workstation IP adress, where the corresponding unix-server
           C program is running

 OUTPUTS:
   result : the original file to a link

 EXAMPLE:
   result= get_link('S:\haloe\abc_link')

   result= get_link('S:\haloe\abc_link','ich289.ich.kfa-juelich.de')

 MODIFICATION HISTORY:
   Written     Juergen Ankenbrand, 11.05.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\get_link.pro)


GET_MAIN_VARS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    get_main_vars

 PURPOSE:
   This functions returns all main level variables

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   result=get_main_vars([level=level])

 KEYWORD PARAMETERS:
  level: the level to look for variables e.g. 1 means from this routine the Main Level.
         If this function is called by another routine you need 2 to get to the main level

 PROCEDURE:

  ROUTINE_NAMES is an undocumented command.  It is highly
  recommended that you not use it in any code which you plan
  to run in future versions of IDL.  Its argument and keyword lists
  may change, or it may disappear completely.

  Use it at your own risk only in code which you won't mind changing
  again in the future.

 EXAMPLE:
   PRO test
     HELP,call=call
     s=get_main_vars(level=N_ELEMENTS(call)+1)
     HELP,s,/str
   END


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_main_vars.pro)


GET_NCDF_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_ncdf_data

 PURPOSE:
	This function reads a parameter from a ncdf file.

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	result = get_ncdf_data(ncdf_file, param_name [,FLAG = flag] [,ERR = err])

 INPUTS:
	ncdf_file: Name of ncdf file
	param_name: Name of parameter

 KEYWORD PARAMETERS:
	FLAG = flag:	(input, string). If defined only inhalt.flag is returned.
	ERR = err:		(output, int). err = 1 if error was encountered (else 0).

 OUTPUTS:
	This function returns a structure with all the information
	of a certain ncdf parameter. If an error occured the structure
	{inhalt: 'empty structure'} is returned.

 EXAMPLE:
	s = get_ncdf_data('.\examples\sfpa_no.nc', 'No', FLAG = 'PARAM', ERR = err)
	HELP, err, s
		ERR             INT       =        0
		S               DOUBLE    = Array[35290]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland
	22.03.1999:	Header added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_ncdf_data.pro)


GET_NCDF_DIMIDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_ncdf_dimids

 PURPOSE:
    This routine returns all by defined and used dimension ids from a netCDF file

 CATEGORY:
  DATAFILES/NETCDF

 CALLING SEQUENCE:
  result=get_ncdf_dimids(file)

 OUTPUTS:
  result is a skalar or vector of dimension ids ;

 EXAMPLE:
  result=get_ncdf_dimids('ghost.nc')

 MODIFICATION HISTORY:
 	Written by:	R. Bauer ICG-1 , 1998-10-15
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_ncdf_dimids.pro)


GET_NCDF_DIM_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  get_ncdf_dim_info

 PURPOSE:
  This routine returns information about size, name and length of dimension variables from a netCDF file

 CATEGORY:
  DATAFILES/NETCDF

 CALLING SEQUENCE:
  result=get_ncdf_dim_info(file)

 OUTPUTS:
  result is a structure with these tags:
      dim_id : the netcdf internal dimension id
      name   : the name of the dimension
      size   : the size of the dimension

 EXAMPLE:
  result=get_ncdf_dimids('ghost.nc')

 MODIFICATION HISTORY:
   Written by:	R. Bauer ICG-1 , 1998-10-15
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_ncdf_dim_info.pro)


GET_NCDF_PARAM_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_ncdf_param_name

 PURPOSE:
	This function returns the case sensitive name of a ncdf parameter.

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result = get_ncdf_param_name(file, name)

 INPUTS:
	file: Name of ncdf file.
	name: Name of ncdf parameter disregarding case setting.


 OUTPUTS:
	This function returns the case sensitive name of a ncdf parameter
	which is needed for the e.g. read_ncdf routine.
	If name is not a valid parameter name then '' is returned.

 EXAMPLE:
	PRINT, get_ncdf_param_name('.\examples\sfpa_no.nc', 'No')
	--> NO

 MODIFICATION HISTORY:
 	Written by:	Frank Holland
	22.03.1999:	Header added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_ncdf_param_name.pro)


GET_NFILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_nfiles

 PURPOSE:
   destinates the number of files of a directory or an array of directories

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   nfiles=GET_NFILES(dirarray)

 INPUTS:
   dirarray : directory name to be searched for with full path or 
              stringarray of directory names (output of GET_DIR_TREE + path)

 KEYWORD PARAMETERS:
   DIR2HTMLFILE: name of the html-file, which contains the table of informations
                 about the directories (default=dir2html.html)  
   EXCLUDE:   string array of file search patterns to be excluded
   INCLUDE:   string array of file search patterns to be included (only these files will be taken)

 OUTPUTS:
   nfiles:  integer array (nd,2), nd =dimension of directory array
            the first column contains the number of files in the directory 
            the second column contains 1 if a linkfile does exist and 0 otherwise

 EXAMPLE:
    nfiles=get_nfiles('\RSI\IDL51\',INCLUDE=['*.pro'])
   or
    nfiles=get_nfiles('/home3/ich388/IDL/',INCLUDE=['*.pro'])

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_nfiles.pro)


GET_NUM_OF_FILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_num_of_files

 PURPOSE:
   destinates the number of files of a directory or an array of directories

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   nfiles=GET_NUM_OF_FILES(dirarray)

 INPUTS:
   dirarray : directory name to be searched for with full path or
              stringarray of directory names (output of GET_DIR_TREE + path)

 KEYWORD PARAMETERS:
   EXCLUDE:   string array of file search patterns to be excluded
   INCLUDE:   string array of file search patterns to be included (only these files will be taken)

 OUTPUTS:
   integer array (nd,2), nd =dimension of directory array the first column contains the number of
   files in the directory the second column contains 1 if a linkfile does exist and 0 otherwise

 EXAMPLE:
    nfiles=get_nun_of_files('\RSI\IDL51\',INCLUDE=['*.pro'])

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998
   Revised& Corrected  Theo Brauers Oct 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\get_num_of_files.pro)


GET_PEAK_POS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   GET_PEAK_POS

 PURPOSE:

  Estimates the approximate locations of peaks in a "peaky"
  data set.  The return value of the function is an array of
  estimates for the peak locations. This function works well
  for data whose peaks do not overlap significantly.


 AUTHOR:

     Robert M. Dimeo, Ph.D.
     NIST Center for Neutron Research
     100 Bureau Drive
     Gaithersburg, MD 20899
     Phone: (301) 975-8135
     E-mail: robert.dimeo@nist.gov
     http://www.ncnr.nist.gov/staff/dimeo

 CATEGORY:

     Data analysis, model fitting, mathematics

 CALLING SEQUENCE:

     PEAK_LOC = GET_PEAK_POS(   X,Y,NPEAKS,                   $
                                INDICES = indices,            $
                                N_CROSSINGS = n_crossings,    $
                                DEGREE = degree,              $
                                NLEFT = nleft,                $
                                NRIGHT = nright,              $
                                FWHM = fwhm

 INPUT PARAMETERS (required)

   X:         array of x values (independent variable)
   Y:         array of y values (dependent variable) containing the peaks
   NPEAKS:    number (integer) specifying the number of peaks to return

 INPUT KEYWORD PARAMETERS (optional)

   DEGREE:    Degree of polynomial used in the Savitsky-Golay filter (def: 4)
   NLEFT:     Number of points to the left of the filtered point over which
              the filter extends (default: 5)
   NRIGHT:    Number of points to the right of the filtered point over which
              the filter extends (default: 5)

 OUTPUT KEYWORD PARAMETERS (optional)

   FWHM:      Estimate of the full-width at half maximum for each peak
   INDICES:   array of indices specifying the index into the x-array
              describing the peak position,
              i.e. XPEAKS = INTERPOLATE(X,INDICES)
   N_CROSSINGS:  number of zero crossings of the first derivative of the
                 smoothed function (using a Savitsky-Golay filter).
 COMMON BLOCKS:

   NONE

 KNOWN LIMITATIONS:

   This algorithm can get fooled when peaks are too close together.

 REQUIREMENTS:

   IDL 5.4 or higher

 EXAMPLE:

   See the code appended to the end of this file.
   IDL> .COMPILE GET_PEAK_POS
   IDL> TEST_PEAK

 DISCLAIMER

   This software is provided as is without any warranty whatsoever.
   Permission to use, copy, modify, and distribute modified or
   unmodified copies is granted, provided this disclaimer
   is included unchanged.

 MODIFICATION HISTORY:

  Written 5/07/03 (RMD)

  Removed the main loop over each data point to increase the execution
   speed: RMD (01/05/04)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\get_peak_pos.pro)


GET_PLOT_POSITION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_plot_position

 PURPOSE:
   This functions returns the normal coordinates of the positions of all plots on one page

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result = get_plot_position()

 KEYWORD PARAMETERS:
   N_COLUMN, N_ROW: Number of columns, rows (see !P.MULTI in IDL Online Help)
	COLUMN_MAJOR = crm: 0 - column major (plots from left to right), 1 - row major (plots from top to bottom)
   XMARGIN, YMARGIN: margins in units of character size (see !X.MARGIN in IDL Online Help)
	XOMARGIN, YOMARGIN: outer margins in units of character size (see !X.OMARGIN in IDL Online Help)

 OUTPUTS:
   This function returns an array with the normal coordinates of the positions (x0, y0, x1, y1)
	of all plots on one page

 OPTIONAL OUTPUTS:
	PLOT_AREA: Set to a named variable. On return this variable will contain
	the normal coordinates of the plot area occupied by all plots

 EXAMPLE:
	.....

 MODIFICATION HISTORY:
	Code extracted from Init_mplot.pro, TB, FH
	Minor changes: Frank Holland, 1998-Jun-01

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_plot_position.pro)


GET_PLOT_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      get_plot_struct

 PURPOSE:
       This procedure set up the environment structer plot for standardized plotting

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
      plot=get_plot_struct()

 OUTPUTS:
     plot  : structure with plot-options
           (plot2d,plot2d_bar)
           .c_annotation    : The label to be drawn on each contour.
           .c_charsize      : The size of the characters used to annotate contour labels.
           .c_colors        : The color index used to draw each contour.
           .c_lables        : Specifies which contour levels should be labeled.
           .c_linestyle     : The line style used to draw each contour.
           .c_line_color    : predefined
           .c_marker        : If you want to show where in real are values on X
           .c_orientation   : If the FILL keyword is set, this keyword can be set to the angle, in degrees counterclockwise from the horizontal, of the lines used to fill contours.
           .c_spacing       : If the FILL keyword is set, this keyword can be used to control the distance, in centimeters, between the lines used to fill the contours.
           .c_thick         : The line used to draw each contour level.
           .cache_data      : default = 0 if 1 the last data of the last plot are cached
           .cache_clear     : default = 0 if 1 the cache will be cleared before taking new data
           .cbar            : flag to get colorbar or not
           .cbar_labels     : Specifies which color in the colorbar shold be labeld
           .cbar_min_value  : The minimum value for the colorbar
           .cbar_max_value  : The maximum value for the colorbar
           .cbar_spacing    : The space between colorbar and the axis
           .cbar_title      : The title of the colorbar
           .cbar_position   : The position 'right','left','top','bot' of the colorbar
           .cbar_values     : needed by nlevels>0 , the contourlabels
           .cbar_width      : The width of the colorbar
           .closed          : Set this keyword to close contours that intersect the plot boundaries.
           .downhill        : Set this keyword to label each contour with short, perpendicular tick marks that point in the "downhill" direction, making the direction of the grade readily apparent.
           .fill            : Set this keyword to produce a filled contour plot.
           .follow          : In IDL version 5, CONTOUR always uses a line-following method.
           .framethick      : The thickness of the frames (x and y axis and the colorbar)
           .irregular       : Set this keyword to indicate that the input data is irregularly gridded.
           .levels          : Specifies a vector containing the contour levels drawn by the CONTOUR procedure.
           .max_value       : Data points with values equal to or above this value are ignored (i.e., treated as missing data) when contouring.
           .min_value       : Data points with values less than this value are ignored (i.e., treated as missing data) when contouring.
           .nlevels         : The number of equally spaced contour levels that are produced by CONTOUR. If it is not 0 the levels will be ignored
           .xgridstyle      : The gridstyle of a x axis
           .xstyle          : The style of a x axis
           .ygridstyle      : The gridstyle of a y axis
           .ystyle          : The style of a y axis
           .zstyle          : The style of a possible z axis
           .ztitle          : The title of the z dataset
 = =  = = = = = = = =  = = = = = === = = = = = == === ==  == = = = == =
 (plotxy und plot2d)
           .psflag     : 0:Bildschirmausgabe  1:PS-File   2:EPS-File
           .landscape  : 0:portrait    1:landscape    2:portrait quadratisch
           .stamp      : im PS-File  0:keine Ausgabe  1:Ausgabe von Programmnamen/Datum/PSFile  2:zus„tzliche Ausgebe der beteiligten Filenamen
           .xrange     : Bereich der x-Werte           -999 : MIN/MAX aus Datenreihe nehmen
           .xtitle     : Titel fr die x-Achse         ''   : wird aus Datenfile genommen
           .sprache    : Sprache fr den x/y-Titel     d    : deutsch  e:englisch
           .new        : 0:oplot ausfhren  1:neuen plot ausfhren  2:oplot ausfhren, keine Legende
           .xaxis      : 0:normale Achse , 1:nur Achse unten 2:nur Achse oben
           .xtype      : 0:normale Achse , <>0 logarithmische Achse (wenn nicht Zeitachse)
           .yaxis      : 0:normale Achse , 1:Achse links 2:Achse rechts
           .ytype      : 0:normale Achse , <>0 logarithmische Achse (wenn nicht Zeitachse)
           .grid       : 0:kein Grid  1:Grid bei Haupteinteilung
           .timeformat : legt Ausgabeformat der Zeitachse fest, Voreinstellung bei Uebergabe '' ist !h$:m$:s$@!d$.nn$.Y$
           .x_interstice: to adjust the space between to plots
           .y_interstice: to adjust the space between to plots

       color_nc : structure with predifined color indices (should be used instead pconst_xxx)
       p_colors : array containing information about color-names and indices (for internal use in plot-widget)

 SIDE EFFECTS:
         !p.thick    is set to 1
         !p.charsize is set to 1
         !x.charsize is set to 1
         !y.charsize is set to 1
 EXAMPLE:
           @init
           plotinit,plot
           plotxy,plot,x=[0,1],y=[0,1]
           plotend,plot

 MODIFICATION HISTORY:
       Written         Franz Rohrer, June 1997
       Corrected
21. 4.97 : plot.symsize von 1 auf 1. gesetzt
21. 4.97 : plot.zeilen von 1. auf 1 gesetzt
21. 4.97 : plot.spalten von 1. auf 1 gesetzt
21. 4.97 : plot.linestyle eingefuehrt
21. 4.97 : Definition des str-Feldes p_colors eingefuehrt, das jeweils die gueltigen Farben mit ihren Namen enthalten soll
22. 4.97 : plot.window eingefuehrt, bestimmt im Screen-Modus die Nummer des aktiven Fensters
23. 4.97 : plot.xtype und plot.ytype eingefuehrt
27. 4.97 : Aufruf von debug eingefuehrt
12. 5.97 : plot.grid eingefuehrt
20. 5.97 : plot.xticks fuer JSPLOT-Aufruf in Plotxy eingefuehrt
22. 5.97 : !version auch auf WIN95 eingerichtet
22. 5.97 : Farben violett und orange eingefuehrt
22, 5.97 : plot.legend_name eingefuehrt, soll im Fall, dass es gesetzt wurde, in die Legende anstatt long_name eingesetzt werden
27. 5.97 : plot.beschriftung eingefuehrt; Filenamen werden in PS-Plot ausgegeben, wenn plot.stamp gt 1
29. 5.97 : timeformat eingefuehrt
18. 6.97 : legend_position : 0:Links oben neben dem Plot 1:rechts oben im plot
 1. 7.97 : Yaxis 0,1,2 eingefuehrt  0:Box-Style Achse links 1:Achse rechts 2:Achse links
29. 7.97 : xtitle,ytitle zu Feldern gemacht, so dass jetzt auch geschachtelte plots mit mehreren Achsenbezeichnungen m÷glich sind
 1. 8.97 : current_charsize : aktueller charsize des plot's (aus plotxy) zur Uebergabe an andere Programme
 1. 8.97 : current_position : aktuelle Positon des plot's (aus plotxy) zur Uebergabe an andere Programme
20. 8.97 : neue Farben nach Vorgabe von Oliver eingefuehrt
29. 8.97 : plot.xtype und plot.ytype als Felder eingefuehrt
 2. 9.97 : distance_x2 als Abstand des x-Titels der x-Achse 2 zur Achse in Zeilen
 2. 9.97 : plot_breite etc. in die Struktur als waehlbaren Parameter uebernommen
 2. 9.97 : Struktur colors_ncdf in color_nc umbenannt, color_nc als ersatz fuer pconst_xxx aufgebaut, Belegung von p_colors(1,*) automatisiert
 3. 9.97 : xrange und yrang vom fltarr zum dblarr deklariert, damit xrange bei Zeitachse genau genug ist
 3. 9.97 : plot.breite etc. gegen englische Ausdruecke umgetauscht
10. 9.97 : pconst_white eingefuehrt
11. 9.97 : tickv und tickname auf 25 Eintraege pro Achse geaendert
30. 9.97 : all indicated tags by plot2d and plot2dbar added
18.11.97 : plot.xgap zur Steuerung von gaps bei Zeitreihen eingefuehrt: wenn Zeit zwischen zwei Punkten gr÷˜er xgap, wird Linie unterbrochen
19.11.97 ; x_interstice and y_interstice added
20.11.97 : page_title etc. eingefuehrt
21.11.97 : xgap von double(3600*24) auf double(3600.*24.) gesetzt
22.11.97 : symsize und thick zur Uebergabe an Legende vorbereitet
12.12.97 : Voreinstellung plot.window von 0 auf 1 geaendert
17.12.97 : linestyle zur Uebergabe an Legende vorbereitet
22.12.97 : cbar_boxstyle eingefuehrt umzeichnet jedes einzelne Farbkaestchens des Farbbalkens
30.12.97 : cbar_labels_format erlaubt die Formatierung z.B. mit 'F6.2' der Labels am Farbbalken
30.12.97 : cbar_labels_align fuer die Ausrichtung der Labels am Farbbalken ('r)igh','l)eft','c)enter')
30.12.97 : cbar_labels_step mit Beginn und Schritt variable Bezeichnung des Farbbalkens m÷glich
30.12.97 : cbar_show_max_value um den echten H÷chstwert am Farbbalken zu zeigen
30.12.97 : x_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
30.12.97 : y_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
30.12.97 : z_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
11.01.98 : charsize_norm_factor zur Normierung der Schriftgroesse eingefuehrt
14.01.98 : plot.legend_framepostion und plot.legend_align eingefuehrt  mb
18.05.98 ; Struktur map_set fuer plotmap implementiert
25.05.98 ; yticks eingefuehrt
26.05.98 ; xticks und yticks auf 0 gesetzt
16.07.98 ; active_color_scheme: und color_table_positions: definiert wird fuer die Benutzung von mehreren gleichzeitig definierten colortables benoetigt
         ; active_color_table: der index des zu benutzenden colortables entspricht der Reihenfolge des Uebergabefeldes von color_scheme,plot,scheme_code=[1,2]
         ; color_table_positions: ist ein 2D-Feld der Laenge n colortables das die jeweiligen Start und Endpositionen der Farbsysteme enthaelt (wird von color_scheme definiert)
13.08.98 ; if def_n_colors() gt 256 then message,'Number of colors ('+strtrim(string(def_n_colors()),2)+') greater than 256'
         ; av_colors=def_n_colors()-1<255
1999-Feb-05; because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
1999-Mar-03: legend_title added
1999-Mar-29: plot.plot_frameposition added; FR
1999-May-05: plot.cbar_show_minvalue:1  default 1 to show lower value on plot2d_bar
1999-May-27: FR clolor_nc mit in plot-Struktur übernommen
24.09.1999 : legend_charsize :1. eingeführt, FR
2000-Jan-21 : trigrid Parameter added
2000-Jan-26 : surface Parameter added
2000-Apr-25 : label added
2000-Jun-05 : symbols structure added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_plot_struct.pro)


GET_POINTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  get_pointer

 PURPOSE:
   This routine gets a defined pointer over the structure name

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   a=get_pointer(name)

 INPUTS:
  name : the name of the pointer

 OUTPUTS:
   the pointer or -1 if it is not defined

 EXAMPLE:
    a=PTR_NEW(CREATE_STRUCT(name='dd','name','a','value',24))
    b=get_pointer('dd')
    HELP,*b,/str
    ** Structure DD, 2 tags, length=12:
    NAME            STRING    'a'
    VALUE           INT             24


 MODIFICATION HISTORY:
   Idea was given by F.Rohrer ICG-3
      Written by:     R.Bauer (ICG-1), 1999-03-15

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_pointer.pro)


GET_POS1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       get_pos1

 PURPOSE:
       This function calculates the actual position of the plot depending on the number of rows and columns.
       The plotarea depends on plot.zeilen and plot.spalten.
       The plotposition depends on plot.bild_nummer; plot.bild_nummer=1 places the plot at the top and left side.

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       result=get_pos1(plot)

 INPUTS:
       plot: plot-structure for ICG-plot-modules

 OUTPUTS:
       result: normalized plotting koordinates for placement of the plotaxis

 EXAMPLE:
       position=get_pos1(plot)

 MODIFICATION HISTORY:
       Written by:     Franz Rohrer
       September, 1997
       Nov-19,R.Bauer: x_interstice and y_interstice added to adjust the space between plots
       Nov-19, R.Bauer: y_interstice factor corrected
       12. 1.98 : bei plot.landscape=2 wird dy=dx (in cm), y2=y2, y1=y2-dy
       29. 3.99 : FR plot.plot_frameposition added; wenn ne -999 dann wird der neue plot verkleinert als insert dargestellt.
       03.06.00 : plot.spalten+plot.zeilen nach plot.columns+plot.rows umbenannt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_pos1.pro)


GET_POS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       get_pos2

 PURPOSE:
       This function calculates the actual position of a sub-plot
       The plotarea depends on pl_yx.n_xn and pl_xy.n_yn
       The plotposition depends on pl_yx.i_xn and pl_xy.i_yn

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       result=get_pos2(pl_xy,position1)

 INPUTS:
       pl_xy    : parameter-structure for plotxy-parameters
                  must contain tags i_xn, i_yn, n_xn, n_yn
       position1: normalized plotting koordinates for placement of the plot

 OUTPUTS:
       result   : normalized plotting koordinates for placement of the actual sub-plot

 EXAMPLE:
       position2=get_pos2(pl_xy,position1)

 MODIFICATION HISTORY:
       Written by:     Franz Rohrer, September 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_pos2.pro)


GET_POSCB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       get_poscb

 PURPOSE:
       This function is used to define the position for the colorbar

 CATEGORY:
       PLOT/PLOT2D

 CALLING SEQUENCE:
       result=get_poscb(plot,[/cbar_right],[/cbar_left],[/cbar_top],[/cbar_bot])

 INPUTS:
       plot: plot-structure for ICG-plot-modules

 KEYWORD PARAMETERS:
      /cbar_right to get the position for the right color bar
      /cbar_left  to get the position for the left color bar
      /cbar_top   to get the position for the top color bar
      /cbar_bot   to get the position for the bottom color bar

 OUTPUTS:
       result: normalized plotting koordinates for placement of the plotaxis

 EXAMPLE:
       position=get_poscb(plot)

 MODIFICATION HISTORY:
       Written by:     Franz Rohrer
       September, 1997
       R.Bauer  1997-09-25 cbar_top,cbar_bot,cbar_left,cbar_right keywords added
       Nov-19,R.Bauer: x_interstice and y_interstice added to adjust the space between plots
       Nov-19, R.Bauer: y_interstice factor corrected
       1998-Jan-12: quite shorter
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_poscb.pro)


GET_PROFILE_PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_profile_path

 PURPOSE:
   This function will return the path were the calling script resides.

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   result=get_profile_path()

 INPUTS: None

 OUTPUTS:
    result: path

 EXAMPLE:
   result=get_profile_path()

 MODIFICATION HISTORY:
   Written by Franz Rohrer Jan 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_profile_path.pro)


GET_P_COLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_p_colors

 PURPOSE:
 This procedure defines an array with color names

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
   RESULT=get_p_colors()

 OUTPUTS:

 EXAMPLE:


 MODIFICATION HISTORY:
 	Written by R.Bauer 1999-10-20

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_p_colors.pro)


GET_SIMULTANEOUSLY_DISPLAYABLE_COLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  get_simultaneously_displayable_colors

 PURPOSE:
   This function returns the number of simultaneously displayable colors, e.g. 16bit is 65536

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result=get_simultaneously_displayable_colors()

 OUTPUTS:
	The result of this function is the number of simultaneously displayable colors

 EXAMPLE:
   Result=get_simultaneously_displayable_colors()
   help,result
   RESULT          LONG      =        65536

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Sep-19
   1999-May-26 Z-Buffer did not have colors: defined

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_simultaneously_displayable_colors.pro)


GET_SOURCE_FILE_NAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  get_source_file_names

 PURPOSE:
	The result of this function is a structure holding informations of a given idl library
   It returns all routine names beeing in a given path.


 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=get_source_file_names(path,[count])

 INPUTS:
   path:      The library path e.g. '+\usr\local\icg\icg\idl_source\idl_work'


 OUTPUTS:
   count: n_elements(names)
	The result is a structure with these tagnames defined
    names:      The file names and the path
    only_names: only the file names without the path
    pthaus:     The input path variable


 EXAMPLE:
   result=get_source_file_names(+'/usr/local/icg/icg/idl_source/idl_work')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-27
   1999-02-25 count added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_source_file_names.pro)


GET_STATUS_FROM_ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    get_status_from_icg_struct

 PURPOSE:
   This function gets the status structure dimension part of each parameter of the ICG data structure.
   If status isn't defined it is builded from the structure.

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   Result=get_status_from_icg_struct(structure,[/no_dim_name])

 INPUTS:
   structure: The ICG datastructure without or with status information.

 KEYWORD PARAMETERS:
  no_dim_name: if set no dimension names are created in status.dim.name which are not defined as coordination variable

 RESTRICTIONS:
  no_dim_name is only useful if time is defined as coordination variable.
  And at the moment it only works for icg Structures where status isn't defined
  This is planned to change lanter


 EXAMPLE:
 print,get_status_from_icg_struct(structure)
N2O F12 CH4 TIME
str[1]str[1]str[1]str[1]


N2O
DIM PARAM
str[1]str[1]


DIM
NAME SIZE
time10000


PARAM
TYPE
4


F12
DIM PARAM
str[1]str[1]


DIM
NAME SIZE
time10000


PARAM
TYPE
4


CH4
DIM PARAM
str[1]str[1]


DIM
NAME SIZE
time10000


PARAM
TYPE
4


TIME
DIM PARAM
str[1]str[1]


DIM
NAME SIZE
time10000


PARAM
TYPE
5

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Mar-02 2000-Feb-25: CATEGORY changed 2000-Mar-03: keyword: no_dim_name added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_status_from_icg_struct.pro)


GET_TAGNAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_tagname

 PURPOSE:
   This function generates a new structure from a given structure by a search string


 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=get_tagname(structure,search_string,[index],[without=without])

  INPUTS:
   structure:   The structure which should be scaned
   search_string:      The string which should be used for searching in the structure
   index:       if set a single index of the tagname is returned used by extract_extra

  OPTIONAL INPUTS:
   without:     A string which should not included in the result

 OUTPUTS:
   The return value is a structure
   defined by the search parameter

 EXAMPLE:
   Result=get_tagname(inhalt,'pi*')
   gives back all tags starting with pi

   ** Structure <11867f8>, 1 tags, length=8, refs=1:
      PI_NAME         STRING    'Peter Mustermann'

   Result=get_tagname(inhalt,'*name')
   gives back all tags ending with name

   ** Structure <1186108>, 4 tags, length=32, refs=1:
      PI_NAME         STRING    'Peter Mustermann'
      NAME            STRING    'sin0'
      PARAM_LONG_NAME STRING    'SIN(X)'
      TIME_LONG_NAME  STRING    'time'

   Result=get_tagname(inhalt,'*name*')
   gives back all tags including name

   ** Structure <1171ce8>, 5 tags, length=112, refs=1:
      PI_NAME         STRING    'Peter Mustermann'
      GPARAM_NAMELIST STRING    Array[10]
      NAME            STRING    'sin0'
      PARAM_LONG_NAME STRING    'SIN(X)'
      TIME_LONG_NAME  STRING    'time'

   Result=get_tagname(inhalt,'*name*',without='gparam_namelist')
   gives back all tags including name without gparam_namelist

   ** Structure <1180108>, 4 tags, length=32, refs=1:
      PI_NAME         STRING    'Peter Mustermann'
      NAME            STRING    'sin0'
      PARAM_LONG_NAME STRING    'SIN(X)'
      TIME_LONG_NAME  STRING    'time'

   Result=get_tagname(inhalt,'name')
   gives back the tag name named 'name'

   ** Structure <118ab68>, 1 tags, length=8, refs=1:
      NAME            STRING    'sin0'


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-07-30
   1999-10-03 without could be now an vector or scalar
   1999-11-13 : excluded filter
   2000-04-18 : added index

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_tagname.pro)


GET_TAG_AND_SHORT_NAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     get_tag_and_short_names

 PURPOSE:
   This function returns a structure of short_names and tag_names belonging to the ICG data-structure

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   Result=get_tag_and_short_names(Struct,count,[uppercase_only=uppercase_only],[lowecase_only=lowercase_only],[/NO_TIME])

 INPUTS:
  struct: the ICG defined datastructure

 KEYWORD PARAMETER:
  uppercase_only: if argpresent then uppercased short_names are set to this argument
  lowercase_only: if argpresent then lowercased short_names are set to this argument
  /NO_TIME: If set tag and short name of parameter time are not returned.

 OUTPUTS:
   count: the n_elements of short_names

 EXAMPLE:
  help,get_tag_and_short_names(Struct,count),/str
  * Structure <1356898>, 2 tags, length=32, refs=1:
   TAG_NAME        STRING    Array[2]
   SHORT_NAME      STRING    Array[2]

 PRINT,get_tag_and_short_names(Struct)
 
TAG_NAME SHORT_NAME
N2ON2O
TIMEtime

PRINT,count 2 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Mar-02 16.02.2000: Added keyword parameter /NO_TIME 2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_tag_and_short_names.pro)


GET_TAG_CONTENTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_tag_contents

 PURPOSE:
   This function returns values of tags identified by a string array

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=get_tag_contents(struc,search[,error=error][,fill_value=fill_value])

 INPUTS:
   struc      : inputstructure
   search     : string vector or scalar of the tag names in question

 KEYWORD PARAMETERS:
   fill_value : result if no match was found, default=-12345
   error      : 0:no error  1: no matching tag found

 OUTPUTS:
   result : value of struc.search

 EXAMPLE:
   struc={NO2:1, NO:100}
   search=['NO','NO2','NOx']
   print,get_tag_contents(struc,search,error=e),' ,  Error=',e
      100.000      1.00000     -12345.0,  Error=       1

   print,get_tag_contents(struc,search[1],error=e),' ,  Error=',e
          1,  Error=       0

 MODIFICATION HISTORY:
       Written by: Franz Rohrer, ?
       Modified  7.10.98 FR search vector and keyword fill_value included
       Modified 27.10.98 FR : if n_elements(search)     eq 0 then search=tag_names(struc)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\get_tag_contents.pro)


GET_TEMPLATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_template

 PURPOSE:
	This function reads the template of an idl source

 CATEGORY:
	CASE_TOOLS

 CALLING SEQUENCE:
   Result=get_template(filename,[tmp_path=tmp_path],[/log],[no_newline],[help])

 INPUTS:
   filename: the name of the idl Source File

 OPTIONAL INPUTS:
   tmp_path: the path where the errored files are logged

 KEYWORD PARAMETERS:
   help: gives a short description
   no_newline: no !C will attempt at end of line
   log: to store in tmp_path wrong routine names
   categories_def_path: path where CATEGORIES.DEF is only if set files will be stored in mail directory

 OUTPUTS:
   This function returns the template as a structure
   NAME             STRING     ROUTINE_NAME
   PATH             STRING     The library path
   FILE             STRING     The path+file name of the script
   FILE_NAME        STRING     The file name of the script whithout path
   PURPOSE          STRING     Tell what your routine does here. I like to ...
   CATEGORY         STRING     Put a category (or categories) here. For exa...
   CALLING_SEQUENCE STRING     Write the calling sequence here. Include onl...
   INPUTS           STRING     Parm1: Describe the positional input paramet...
   OPTIONAL_INPUTS  STRING     Parm2: Describe optional inputs here. If you...
   OUTPUTS          STRING     Describe any outputs here. For example, Thi...
   OPTIONAL_OUTPUTS STRING     Describe optional outputs here. If the routi...
   COMMON_BLOCKS    STRING     BLOCK1: Describe any common blocks here. If ...
   SIDE_EFFECTS     STRING     Describe "side effects" here. There aren't a...
   PROCEDURE        STRING     You can describe the foobar superfloatation ...
   EXAMPLE          STRING     Please provide a simple example here. An exa...
   NOTES            STRING     Notes
   TYPE             STRING     P(rocedure) or F(unction) or M(ain)/J(ournal)
   PATH             STRING     The path of the routine
   LIB              STRING     The library where the routine belongs too
   FILE             STRING     The file name whithout .pro
   FILE_NAME        STRING     The file name whith .pro
   DEBUG            STRING     Holds the Debug information string
   STATUS_NAME      INT        1 if file_name, name and (pro or fun) name are equal else 0
   MODIFICATION_DATE STRING    Holds the modification date of the file



 RESTRICTIONS:
     Did not run on idl 3.5.1


 EXAMPLE:
   Result=get_template('ncdf_g.pro')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 22 1997
                       R.Bauer Sept. 10 ; slash_s for / or \
                       R.Bauer Sept. 18
                      ; CATEGORY:
                      ; TIME

                      ;CATEGORY:
                      ; TIME
                 these syntaxes are now equal
                      ;
       1997-10-16 debug added to output structure
       1997-10-23 debug
       1997-10-23 status_name added to structure
       1997-10-26 read status output removed only errors will be reported
       1997-10-28 errorstatus 3 added
       1997-10-31 read of debug corrected
       1997-11    modification date for unix added
       1997-11-27 modification date for unix corrected
       1998-05-26 tmp_path and log added
       1998-07-21 now file_name needn't extension .pro
       1998-07-21 instead of NONE now lib_path will be inserted at category if it's not defined
                  or if it is ''
 1998-08-10 Problem with spaces in header resolved
 1998-08-11 Additional Mailing if Category isn't defined
 1999-02-10 and 1999-02-09 additional keyword added categories_def_path
            I hope now all path problems are removed for runtime and development
 1999-02-23 added USERLEVEL for request
 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_template.pro)


GET_TEMPLATE_ONE_VALUE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_template_one_value

 PURPOSE:
	The result of this function is a string with template information

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=get_template_one_value(file_name,attribute,[/declaration])

 INPUTS:
   file_name: the name of the idl source file
   attribute: the attribute of the template to read

 KEYWORD PARAMETERS:
   declaration: the attribute to add to the output string
   translate_description_to_purpose:  some external authors are using DESCRIPTION: instead of PURPOSE:.
                                      if this key is set DESCRIPTION: is translated to PURPOSE:
   translate_routine_to_name: some external authors are using ROUTINE: instead of NAME:.
                                      if this key is set ROUTINE: is translated to NAME:

 OUTPUTS:
	result: the readed template information behind the attribute

 EXAMPLE:
   print,get_template_one_value('get_template_one_value','CALLING SEQUENCE')
   result=get_template_one_value(file_name,attribute,[/declaration])


 MODIFICATION HISTORY:
 	Written by	R.Bauer (ICG-1), 1998-Aug-30
   1998-Oct-26 mistake removed for using the last declaration before ; -
   1999-Nov-6 a bit smaller now
              embedded bytes2strarr,arr2string,filesize
   2000-Jan-23 : attribute could be an array now
   2000-Feb-08 : translate_description_to_purpose and translate_routine_to_name added
   2000-Feb-25 : def_strings implemented, free search of : disabled
   2000-Apr-04 : file_name could be an array now

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_template_one_value.pro)


GET_TYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	get_type

 PURPOSE:
	Returns the type of a variable (undefined, byte, integer, ... )

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = get_type(var)

 INPUTS:
	var: variable for which the type information is needed

 KEYWORD PARAMETERS:
	/TEXT: type of variable is returned as text string ('undefined', 'byte', 'integer', ...)

 OUTPUTS:
	This function returns the type of the variable as integer or as text string
	according to the numeration defined in the SIZE function.

 EXAMPLE:
	A = 9L
	PRINT, get_type(A, /TEXT)
	-> Long

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\get_type.pro)


GET_UNIX_JOB_LINK_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   get_unix_job_link_file

 PURPOSE:
   This function returns the original file position and file name from a linked file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=get_unix_job_link_file(file_name)

 INPUTS:
   file_name: The name of the File


 OUTPUTS:
   This function returns a string of the right file position

 EXAMPLE:
   result=get_unix_job_link_file('S:\links\daten\experiments\stream1998\0719_1\ghost.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), 1999-Apr-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\get_unix_job_link_file.pro)


GIF2ANIM_SINGLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  gif2anim_single

 PURPOSE:
  This function extracts multiple gif files to single gif images

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   gif2anim_single,file

 INPUTS:
   file: The file name(s) of the gif files


 PROCEDURE:
   You need write access to the directory where you are

 EXAMPLE:
  gif2anim_single,'chem_film_NO.gif'

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 2000-Jan-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\gif_anim2single.pro)


GIF2ANIM_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  gif2anim_struct

 PURPOSE:
 This function reads multiple gif files to the animation_structure used by x_animation

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=gif2anim_struct(file,[/cut_white_off],[step=step],[scale=scale])

 INPUTS:
    file: The file name(s) of the gif files

 OPTIONAL INPUTS:
  step:   the increment step of the animation sequence
  scale:  the scale factor of the animation

 OUTPUTS:
  Result is a possible sub structure where these tagnames are defined:
  animation:  a 3-dim array with the image sequence
  red:        the red color table
  green:      the green color table
  blue:       the blue color table
  count:      the number of images of the animation


 RESTRICTIONS:
  The image size and the number of images have to be the same for each sequence

 KEYWORD PARAMETERS:
  cut_white_off:         If set the white border around the animation is cutted of
  new_cache:             If set a new cache file is written

 EXAMPLE:
  result=gif2anim_struct(['chem_film_NO.gif','chem_film_O3P.gif'],/cut,scale=1.2)

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999, August 21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\gif2anim_struct.pro)


GIF2HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   gif2html

 PURPOSE:
  This function stores a screen dump into a gif file and
  returns the HTML Source string for the implementation of this file.

 CATEGORY:
  PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=gif2html(file,_extra=e)

 INPUTS:
  file: the name of the gif file to create

 KEYWORD PARAMETERS:
  _extra=e all keywords submitted to  array2htmltable


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Apr-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\gif2html.pro)


GIF2JPEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GIF2JPEG
 PURPOSE:
       Convert a GIF image to a JPEG image.
 CATEGORY:
 CALLING SEQUENCE:
       gif2jpeg, file
 INPUTS:
       file = GIF image file name.       in
         Prompted for if not given.
 KEYWORD PARAMETERS:
       Keywords:
         QF=qf  JPEG quality factor (def=75).
         MAG=m  Mag factor (def=1).
         JPEG=jpg  returned JPEG file name.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: 
         Output file name is same as input but with .jpg as type.
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 4

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gif2jpeg.pro)


GIF2PNG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GIF2PNG
 PURPOSE:
       GIF to PNG converter
 CATEGORY:
 CALLING SEQUENCE:
       gif2png, file
 INPUTS:
       file = Input GIF image.       in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Saves image with same name but extension .png
 MODIFICATION HISTORY:
       R. Sterner, 2000 Oct 25

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gif2png.pro)


GIFADD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GIFADD
 PURPOSE:
       Add R,G,B color components for list of GIF images.
 CATEGORY:
 CALLING SEQUENCE:
       gifadd, list
 INPUTS:
       list = string array with GIF image names.   in
 KEYWORD PARAMETERS:
       Keywords:
       /DITHER  means use dithering to combine images.
       COLORS=clrs  number of colors to use in result (def=256).
       /JPEG means use jpeg color combine algorithm.
       /PIXMAP uses pixmap instead of screen.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Displays result on screen.  All images must be
         same size.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 7

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gifadd.pro)


GIFSCREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GIFSCREEN
 PURPOSE:
       Save current screen image and color table to a GIF file.
 CATEGORY:
 CALLING SEQUENCE:
       gifscreen, [file]
 INPUTS:
       file = name of GIF file.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 11
       R. Sterner, 2000 Sep 11 --- fixed for 24 bit.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gifscreen.pro)


GIF_READ

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      gif_read

 PURPOSE:      copy image on current window to a gif image file

 USEAGE:       gif_read,file

 INPUT:
   file        gif file name

 KEYWORD INPUT:
  view         if set display the image 

 OUTPUT:       
   im          image array
   r,g,b       color vectors

 SIDE EFFECTS: if VIEW is set, the color table is altered to match the
               RGB settings read from the file

 EXAMPLE:
               loadct,5
               window,0
               tvim,sin(hanning(200,200))
               gif_write,'test_image.gif'
               wdelete,0
               gif_read,'test_image.gif',/view

  author:  Paul Ricchiazzi                            feb94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\gif_read.pro)


GIF_WRITE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      gif_write

 PURPOSE:      copy image on current window to a gif image file

 USEAGE:       gif_write,file

 INPUT:
   file        output file name, image will be written in gif image format

 KEYWORD INPUT:
   wid         index of the idl window from which to copy the image,
               if not set gif_write copies from current default window

   bgc         background color.  sets color index 0 of gif image to 
               specified RGB value.  Does not affect current color table.
               A scalor value of BGC is automatically turned into a color
               triplet, i.e., bgc=255   =>  RGB=[255,255,255]

   fgc         foreground color.  sets color index 255 of gif image to 
               specified RGB value.  Does not affect current color table.
               A scalor value of FGC is automatically turned into a color
               triplet, i.e., fgc=0   =>  RGB=[0,0,0]

 OUTPUT:       none

 EXAMPLE:
           loadct,5
           window,0
           tvim,sin(20*hanning(200,200)*dist(200)),title='GIF test image',/sc
           gif_write,'test_image.gif',fgc=0,bgc=[210,255,210]
           exit

           xv test_image.gif

  author:  Paul Ricchiazzi                            feb94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\gif_write.pro)


GLOBE_IMAGE

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

 AUTHOR:                 Terry Figel, ESRG, UCSB 10-21-92

 USEAGE:   globe_image,image

           globe_image,image,animation,title=title,limits=limits,$
                    windowsize=windowsize


 PURPOSE:             Display an image on a rotating globe


 INPUT    input           image quantity
 OUTPUT   output          3d array containg output images for animation

 Optional keyword input:

          title       plot title
          windowsize  Controls the size of the window, Directly responsible
                      for memory usage
          limits      4 item array [min lat,min lon,max lat,max lon] of
                      input image, if omitted presumed global 
                      coverage [-90,0,90,360]
			whole      treats image as whole world for map_image

 SIDE EFFECTS:        Uses a LOT of MEMORY ~30-50 MEGS, takes a few minutes
                      to set up animation
                      If windowsize left at 300 approx 13 megs used on DEC

 PROCEDURE            GLOBE_IMAGE first map an image to a globe
                      Then it saves the image, rotates 10 degrees and repeats
                      Then it animates the saved images

 LOCAL PROCEDURES:    None

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\globe_image.pro)


GLOBE_IMAGE2

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

 AUTHOR:                 Terry Figel, ESRG, UCSB 10-21-92

 USEAGE:   globe_image,image

           globe_image,image,animation,title=title,limits=limits,$
                    windowsize=windowsize


 PURPOSE:             Display an image on a rotating globe


 INPUT    input           image quantity

 Optional keyword input:

          title       plot title
          windowsize  Controls the size of the window, Directly responsible
                      for memory usage
          limits      4 item array [min lat,min lon,max lat,max lon] of
                      input image, if omitted presumed global 
                      coverage [-90,0,90,360]
			whole      treats image as whole world for map_image

 SIDE EFFECTS:        Uses a LOT of MEMORY ~30-50 MEGS, takes a few minutes
                      to set up animation
                      If windowsize left at 300 approx 13 megs used on DEC

 PROCEDURE            GLOBE_IMAGE first map an image to a globe
                      Then it saves the image, rotates 10 degrees and repeats
                      Then it animates the saved images

 LOCAL PROCEDURES:    None

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\globe_image2.pro)


GMT_OFFSEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GMT_OFFSEC
 PURPOSE:
       Return offset in seconds from local time to GMT (UT).
 CATEGORY:
 CALLING SEQUENCE:
       off = gmt_offsec()
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: Times are rounded to the nearest 1/4 hour.
         This should handle any time zone, even fractional ones.
 MODIFICATION HISTORY:
       R. Sterner, 2 Dec, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\gmt_offsec.pro)


GRAB_COMMANDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GRAB_COMMANDS
 PURPOSE:
       Grab command line recall commands and save in a text file.
 CATEGORY:
 CALLING SEQUENCE:
       grab_commands
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FILE=file  File to save commands in,
           def=IDL_commands_hhmmss.txt, hhmmss = time tag.
 OUTPUTS:
 COMMON BLOCKS:
       grab_commands_com
 NOTES:
       Note a separate file is used for each session of IDL.
       SETFILE=file  Sets save file and then returns.  Useful
         to set your own default save file name in your
         IDL startup file.
       Note: You may set the number of lines in the recall buffer
       by setting !EDIT_INPUT=n in your IDL startup file.  n is
       20 by default but may be set to a large value (like 1000).
 MODIFICATION HISTORY:
       R. Sterner, 1998 Sep 24
       R. Sterner, 1998 Sep 30 --- Added time tag to default file.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\grab_commands.pro)


GRAPHFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       GRAPHFILE
 PURPOSE:
       List a file on the graphics device.
 CATEGORY:
 CALLING SEQUENCE:
       graphfile, x, y, txt
 INPUTS:
       x,y = norm. coord. of upper-left corner of file.  in
       txt = name of text file or array to list.         in
 KEYWORD PARAMETERS:
       Keywords:
         SIZE = text size factor.
         LSPACE = factor.  Line spacing factor.
         COLOR=c  text color.
         /ARRAY means txt is a string array instead of a file name.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 31 Aug, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\graphfile.pro)


GREP2

[Previous Routine] [Next Routine] [List of Routines]
 GREP2.PRO

 Search .PRO files for a search string

 Syntax
   GREP, search_string [, /INSENSITIVE] [, /PATH]

   search_string		The text string to match in .pro files
   /INSENSITIVE		Optional. Do a case-insensitive search for the search_string
   /PATH				=1 Search current directory (not recursively), and then the IDL !PATH
						=0 Default is to search the current directory only including subdirectories

 Example 1
   grep, 'map_proj_forward', /i

   Not case sensitive search.
   Searches the current directory and all subdirectories for .pro files containing the string 'map_proj_forward'

 Example 2
   Not case sensitive.
   Searches in the current directory and then !PATH
   Does not search subdirectories of the current dir.

 IDL> grep, 'map_image', /i, /path
 Searching for String: map_image
 Search String Found In: C:\RSI\IDL62\lib\map_image.pro
 Search String Found In: C:\RSI\IDL62\lib\map_patch.pro
 Search String Found In: C:\RSI\IDL62\examples\demo\demosrc\d_map.pro
 Search String Found In: C:\RSI\IDL62\examples\widgets\wexmast\worlddemo.pro
 Search String Found In: C:\RSI\IDL62\examples\widgets\wexmast\worldrot.pro

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\grep2.pro)


H2OSAT

[Previous Routine] [Next Routine] [List of Routines]
 routine:      h2osat

 purpose:      compute saturated density of water vapor

 useage:       result=h2osat(t)

 input:
   temp        air temperature in kelvin

 output:
   result      water vapor density at 100% saturation (g/m3)
               if keyword vp is set result is saturated water 
               vapor pressure (mb).  

                            
      NOTE:         h2osat(t)=h2osat(t,/vp)/Mkt

               where M is the molecular mass of h2o, and k
               is boltzman's constant.

 reference:    Here is how I came up with the polynomial fit you see below

               1. copy out table of saturated water vapor pressure 
                  vs temparature from Handbook of Chemistry and Physics 
               2. find a polynomial fit of log(P) vs (1/t) 
                  (Clausius-Clapeyron equation has P = Po exp(-to/t))
               3. convert vapor pressure to density using the molecular mass
                  of H2O (standard isotope mix)

 EXAMPLE:                                              

;  compute water density at a relative humidity of 50% and
;  an air temperature of 25 C.

               k=1.38e-23 & rh=.5 & t=25.0+273.15 & p=101325.
               wdens=h2osat(25.0+273.15)
               wden=rh*wdens/(1.-k*t*wdens*(1.-rh)/p)

; at pressures greater than ~300mb this is well approximated by

               wden=rh*wdens



; compute water density (g/m3) corresponding to a dew point
; temperature of 10 C and ambient temperature of 25 C.
; The dew point is the temperature to which air must be 
; cooled at constant pressure and constant mixing ratio to
; reach 100% saturation with respect to a plane water surface
;
;      by definition    mixing ratio ~ Nw/(N-Nw) = SVP(Tdew)/(P-SVP(Tdew))
;
;          Nw kT/(P-Nw kT) = SVP(Tdew)/(P-SVP(Tdew))
;
;          Nw = SVP(Tdew)/kT

;
; where SVP is the saturated vapor pressure

               tdew=10.+273.15
               t=25+273.15
               
               Pvap=h2osat(tdew)
               wden=h2osat(tdew)*tdew/t    ; mass density   (g/m3)


  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\h2osat.pro)


HCOLORBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HCOLORBAR

 FILENAME:

       hcolorbar__define.pro
;
 PURPOSE:

       The purpose of this program is to create a horizontal
       colorbar object to be used in conjunction with other
       IDL 5 graphics objects.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

       Object Graphics.

 CALLING SEQUENCE:

       thisColorBar = Obj_New('HColorBar')

 REQUIRED INPUTS:

       None.

 INIT METHOD KEYWORD PARAMETERS:

       COLOR: A three-element array representing the RGB values of a color
          for the colorbar axes and annotation. The default value is
          white: [255,255,255].

       FONTSIZE: A floating value that is the point size of the font
           used for the axis and title annotations. Set to 8 point by default.

       NAME: The name associated with this object.

       NCOLORS: The number of colors associated with the colorbar. The
          default is 256.

       MAJOR: The number of major tick divisions on the colorbar axes.
          The default is 5.

       MINOR: The number of minor tick marks on the colorbar axes.
          The default is 4.

       PALETTE: A palette object for the colorbar. The default palette
           is a gray-scale palette object.

       POSITION: A four-element array specifying the position of the
           colorbar in normalized coordinate space. The default position
           is [0.10, 0.90, 0.90, 0.95].

       RANGE: The range associated with the colorbar axis. The default
           is [0, NCOLORS].

       TITLE: A string containing a title for the colorbar axis
           annotation. The default is a null string.

 OTHER METHODS:

       Clamp (Procedure): Given a two-element array in the data range of
          the colorbar, the colorbar image is clamped to this range. In
          other words, the range of colors is clamped to the specified
          range. Values above or below the range in the colorbar are set to
          the minimum and maximum range values, respectively.

       GetProperty (Procedure): Returns colorbar properties in keyword
          parameters as defined for the INIT method. Keywords allowed are:

               COLOR
               MAJOR
               MINOR
               NAME
               PALETTE
               POSITION
               RANGE
               TEXT
               TITLE
               TRANSFORM

       SetProperty (Procedure): Sets colorbar properties in keyword
          parameters as defined for the INIT method. Keywords allowed are:

               COLOR
               MAJOR
               MINOR
               NAME
               PALETTE
               POSITION
               RANGE
               TEXT
               TITLE
               TRANSFORM

 SIDE EFFECTS:

       A HColorBar structure is created. The colorbar INHERITS IDLgrMODEL.
       Thus, all IDLgrMODEL methods and keywords can also be used. It is
       the model that is selected in a selection event, since the SELECT_TARGET
       keyword is set for the model.

 RESTRICTIONS:

       None.

 EXAMPLE:

       To create a colorbar object and add it to a plot view object, type:

       thisColorBarObject = Obj_New('HColorBar')
       plotView->Add, thisColorBarObject
       plotWindow->Draw, plotView

 MODIFICATION HISTORY:

       Written by David Fanning, from VColorBar code, 20 Sept 98. DWF.
       Changed a reference to _Ref_Extra to _Extra. 27 Sept 98. DWF.
       Fixed bug when adding a text object via the TEXT keyword. 9 May 99. DWF.
       Fixed the same bug when getting the text using the TEXT keyword. :-( 16 Aug 2000. DWF.
       Fixed a bug with getting the text object via the TEXT keyword. 16 Aug 2000. DWF.
       Added the TRANSFORM keyword to GetProperty and SetProperty methods. 16 Aug 2000. DWF.
       Added RECOMPUTE_DIMENSIONS=2 to text objects. 16 Aug 2000. DWF.
       Added a polygon object around the image object. This allows rotation in 3D space. 16 Aug 2000. DWF.
       Removed TEXT keyword (which was never used) and improved documentation. 15 AUG 2001. DWF.
       Added ENABLE_FORMATTING keyword to title objects. 22 October 2001. DWF.
       Added a CLAMP method. 18 November 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\hcolorbar__define.pro)


HEAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		HEAD
 VERSION:
		4.0
 PURPOSE:
		Displays the beginning ("head") or, optionally, a selected part of an
		1-2D array.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		HEAD, A [,B ...H] [,keywords]
 INPUTS:
	A [,B ...H]
		One or more arrays, of arbitrary type.  If more than one array is
		provided, all the arrays have to be 1D.  A single array can have 1 or
		2 dimensions, but no more than 2.
 OPTIONAL INPUT PARAMETERS:
		All but the first input are optional.
 KEYWORD PARAMETERS:
	NR
		The number of rows to be displayed.  Default value is 10 (except for
		the case of a single 1D array in wrapping mode (see keyword NO_WRAP,
		below), when it is 12).  If explicit values for the starting and ending
		row numbers are provided through the keyword ROW (see below), NR is
		ignored.
	NC
		Same as NR, for columns.  Default value is 6, maximal value is 8.
		In the case of a single 1D array in wrapping mode, NC is
		interchangeable with NR and, if both are provided, NC is ignored.
	ROW
		Specifies the first (and possibly last) row of the displayed array
		part.  For an array with N rows, the possibilities are as follows:

			1)	No value provided: display area is from row #0 through row
				#(NR - 1) or last row, whichever comes first.
			2)	Scalar value r0:  display area is from row #r0 through row
				#(r0 + NR - 1) or last row, whichever comes first.
			3)  Single vector value r0 (for example, ROW = [4]):  this is
				interpreted as a vector input, ROW = [r0,r0] (see case 4 below)
				and a single row (#r0) is output.
			4)	Two element vector of the form ROW = [r0,r1]:  In this case
				display area is from row #r0 through row #r1.

		In the case of a single 1D array in the default wrapping mode (see
		keyword NO_WRAP, below), ROW is interchangeble with COLUMN and
		specifies the first (and, possibly, last) element to be displayed).
	COLUMN
		Same as ROW, for columns of the display area.  For a 2D array the
		default number of displayed columns is the smaller of 6 and the actual
		number of columns in the data.  For 1D arrays COLUMN is ignored,
		except for the case of a single 1D array in wrapping mode.  In this
		case COLUMN is interchangeable with ROW (see above) and ignored if ROW
		is provided.
		Maximal possible number of displayed columns is 8.
	/TRANSPOSE
		Switch.  If set and the input array is 2D, the transpose of the array
		is used.  Thus HEAD, A, /TRANSPOSE is equivalent to HEAD, TRANSPOSE(A).
		Ignored for multiple 1D inputs.
	/SHOW_INDEX
		Switch.  If set, the indices of the rows and columns shown are
		displayed, on the right (for rows) and top (for columns).
	/NO_WRAP
		Switch.  Turns off wrapping mode which is on, by default for single 1D
		arrays.  In the wrapping mode the array is displayed over as many lines
		as needed, same as when being displayed using the PRINT statement.  In
		a non-wrapping mode only a portion of a 1D array that fits on a single
		line may be displayed.  If the input consists of a 2D array or multiple
		1D arrays, the wrapping mode is off.
	FORMAT
		Character array, containing format specifications for the columns.
		If not provided, default TABULATE formats are used.  If only a single
		entry provided, it'll be used for all columns.  For more details see
		TABULATE.
		If multiple entries are provided in the wrapping mode, only the first
		one is used.
	_EXTRA
		A formal keyword used to pass keywords to TABULATE.  Not to be used
		directly.  All TABULATE keywords are available.
 OUTPUTS:
		None, other then the printed output.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		As mentioned above:
			1)	Arrays with more then 2 dimensions not accepted.
			2)	For 2D, only a single array is allowed.
			3)	For 1D, up to 8 arrays allowed.  They can be of different
				types but must have same length.
			4)  Wrapping is only possible with a single 1D array.
 PROCEDURE:
		HEAD serves as a front end to TABULATE.  It selects a part of the
		input, based on the row and column settings, and passes it to TABULATE
		which displays it.  In addition to TABULATE, HEAD calls DEFAULT,
		HOW_MANY, STRPARSE_MM and TYPE from MIDL.
		In the wrap mode, HEAD bypasses TABULATE and uses PRINT, directly.
 MODIFICATION HISTORY:
		Created 1-NOV-1997 by Mati Meron.
		Modified 5-OCT-1998 by Mati Meron.  Added wrap mode for 1D arrays.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\head.pro)


HEADKEYS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HEADKEYS

 PURPOSE:
       creates a structure with keys for header of ZCHN

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       k=headkeys()

 INPUTS:

 OPTIONAL INPUTS:

 OUTPUTS:
       structure containing the keys for ZCHN-files and
       ncdf-structure INHALT

 SIDE EFFECTS:
       if there are not the necessary informations in the header,
       they are set by program

 RESTRICTIONS:
       None.

 EXAMPLE:
       key = {kl,found_key: 0,type: 0, zchn:' ', ncdf:' ', exec:' '}
       found_key = 1 if a key of header of zchn is found
       found_key = 2 if the found key is also ncdf-key
       found_key =-1 if a key is not found in the predefined structure
       exec:  contains the value or text of the key
       type:  type code of exec
       the first line of the structure:
       {kl, -1,  -1, ' ', ' ', ' '}

       the second line of the structure:
       {kl,  2, 7, 'PI_NAME', 'pi_name=', 'Unbekannt'}
                        /\        /\           /\
                key of ZCHN-file              predefined
                          key of ncdf-structure INHALT

 MODIFICATION HISTORY:
       Written         Theo Brauers, SEP 1997
       Corrected       Marsy Lisken, DEC 1997
       Revised         M.L.          FEB 1998  predifined values for header

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\headkeys.pro)


HELPFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HELPFILE
 PURPOSE:
       Display a file of help text.
 CATEGORY:
 CALLING SEQUENCE:
       helpfile, file
 INPUTS:
       file = name of help text file.   in
 KEYWORD PARAMETERS:
       Keywords:
         DIRECTORY=d  give help text file directory.
           Default is the current directory.
         EXIT_CODE=excode.  Exit code.  If excode is 'QUIT'
           then do a return.  Meant to exit recursively.
         /TXTMENU use TXTMENU type screen menus.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: the simplest help text file is simply an
         ordinary text file.  It will be displayed to the screen
         using the /MORE option.  Lines must not start with *
         in column 1, such lines are not displayed (see below).
         Help text files may also have optional comment lines
         and setup a menu used to display other help text files.
         A help text file has the following format:
         There are 4 types of lines:
         1. Comment lines: have * in column 1.  Not displayed.
         2. Text to display: must not have * in column 1.
         3. Menu control lines: must start in column 1.
            There are 2 menu control lines:
            .menu_start
            .menu_end
            Menus are optional.
         4. Menu lines: must be between .menu_start and .menu_end
            lines and have the following format:
            menu text | action code
            The menu text may be any text and will be displayed
            in a menu.  The action code must be one of 5 options:
            title --- means use as menu title,
            noop --- no operation when selected,
            link filename --- means display filename as help text,
            back --- means go back to calling routine,
            quit --- means recursively exit all levels.
         Example:
       *----  This is an example help text file  ------
       *----  These two lines are comments and not displayed.
       A line of text to display.
        . . . any number of lines . . .
       .menu_start
       Example menu | title
       Go back to last menu | back
       Quit help | quit
       Overview | link overview.hlp
       Setting up defaults | link defaults.hlp
        . . . any number of menu lines . . .
       .menu_end
        May display more lines of text after returning from a
        menu call. . . .
 MODIFICATION HISTORY:
       R. Sterner, 10 jan, 1992
       R. Sterner, 15 Jan, 1992 --- added DIRECTORY=

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\helpfile.pro)


HELPFORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   HELPFORM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Generate a descriptive string in IDL HELP format

 CALLING SEQUENCE:
   STRINGS = HELPFORM(NAME, VALUE, [/SHORTFORM,] [/SINGLE,] [WIDTH=width])

 DESCRIPTION: 

   The HELPFORM function converts an IDL data value into a
   representation very similar to the format produced by the built-in
   command HELP.  Programmers can thus present data types and values
   to users in a format they are familiar with.

   For example, if the variable A is defined in the following manner,
   and HELP is called, then the following transcript will result:

     IDL> a = [1,2]
     IDL> help, a
     A               INT       = Array[2]

   The same result can be achieved with the HELPFORM function:

     IDL> print, helpform('A', a)
     A               INT       = Array[2]

   The benefit is that the output of HELPFORM is a string that can be
   outputted or reformatted.  This capability is not available in all
   versions of IDL.

   HELPFORM actually produces *two* forms of output.  The above
   output is considered the "long" form, as it appears in the IDL
   HELP command, and is the default.  A "short" form can also be
   produced, and is very similar to the information that appears in
   certain terse IDL error messages.  It is activated by setting the
   SHORTFORM keyword.

   If the variable name is too long, the HELPFORM may be forced to be
   two lines long to have consistent formatting.  In that case a
   two-element string is returned.  If a single line is desired, use
   the SINGLE keyword, but this comes at the expense of consistent
   output formatting.

 INPUTS:

   NAME - A scalar string containing the name of the IDL variable.
          An empty string is permitted.  The name is ignored if the
          SHORTFORM keyword is set.

   VALUE - Any IDL value to be examined.  VALUE is optional if the
           SIZE keyword is passed and uniquely describes the data.
           VALUE should be passed for scalars and structures, since
           the help form for these values requires additional
           information beyond the SIZE.

 KEYWORDS:

   SIZE - the IDL SIZE descriptor for the value to be printed.
          Default: information is taken from VALUE.

   SINGLE - if set, then output which would normally
            appear on two lines for consistent formatting, appears on
            one single line instead.

   FULL_STRUCT - if set, then a detailed output is printed for
                 structures, similar to HELP, VALUE, /STRUCTURE.

   SHORTFORM - set this keyword for a shorter output format that can
               be used in error messages.

   WIDTH - the width of the terminal in characters (used for
           formatting).
           Default: 80

 RETURNS:

   An array of strings containing the HELPFORM output, which may have
   more than one element depending on the length of NAME, SHORTFORM
   and SINGLE.  The helpforms of pointer- and object-typed values
   does not include the sequence number, but are otherwise correct.

 EXAMPLE:

     IDL> print, helpform('A', size=[1,2,1,2])
     A               BYTE      = Array[2]
     ;; Do not pass VALUE and instead use SIZE to specify the type

     IDL> print, helpform('A', size=[1,2,1,2], /shortform)
     BYTE     (Array[2])
     ;; Compare to the short form, which is meant to be placed in
     ;; error messages

     IDL> print, helpform('fjsldkfjsldfkjslkdfjslkdfjslkdfjsldkfjk',a)
     fjsldkfjsldfkjslkdfjslkdfjslkdfjsldkfjk
                      INT       = Array[2]
     IDL> print, helpform('fjsldkfjsldfkjslkdfjslkdfjslkdfjsldkfjk',a,/single)
     fjsldkfjsldfkjslkdfjslkdfjslkdfjsldkfjk INT       = Array[2]
     ;; Compare the long and short forms


 SEE ALSO:

   INPUTFORM, HELP

 MODIFICATION HISTORY:
   Written, CM, 13 May 2000
   Documented, 04 Jul 2000
   Improved output for objects, CM, 11 Jan 2001
   Added support for full structure output, CM 08 Feb 2001
   Added forward_function declaration for safety, CM 08 Apr 2001
   Print more info about POINTER type, CM 08 Apr 2001

 $Id: helpform.pro,v 1.5 2001/04/11 00:43:54 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\helpform.pro)


HELPON

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   helpon

 PURPOSE:
   This procedure reads the pro or function line of a given routine. This information is printed on screen

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   helpon,routine,[/calling_sequence],[_extra=key_words]

 INPUTS:
   routine: the routine name as string without .pro

 OPTIONAL INPUTS:
 _extra: all defined tagnames will be sended as string to get_template_one_value

 KEYWORD PARAMETERS:
  calling_sequence: switches the output form returning the routine start entry to the one defined by CALLING SEQUENCE

 EXAMPLE:
   helpon,'f_names'
   function f_names,file=file,debug=debug,filename,time=time,sort=sort,all=all,_extra=extra,help=help

   helpon,'f_names',/call
   Result=f_names(file_name,[/time],[/all],[/sort],[/xp])


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Aug-31
   1998-Jan-06 message added: routine not found
   1999-May-19 it's not more necesarry to submit routine as string
   2000-Feb-18 help changed to call_help
   2000-Apr-04 routine name defined in strlowcase

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\helpon.pro)


HELP_CALLING_SEQUENCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	help_calling_sequence

 PURPOSE:
	The result of this function is a string with the CALLING SEQUENCE value

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=help_calling_sequence(file_name)

 INPUTS:
   file_name: the name of the idl source file

 KEYWORD PARAMETERS:
   example: if is set then the example sequence of the template is returned

 OUTPUTS:
	result: the readed template information behind the attribute

 EXAMPLE:
   print,help_calling_sequence('get_template_one_value')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Aug-30
   1999-June-28 KEYWORD: example added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\help_calling_sequence.pro)


HELP_SAVE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HELP_SAVE2
 PURPOSE:
       Look at files made by save2 and list what they contain.
 CATEGORY:
 CALLING SEQUENCE:
       help_save2, filename
 INPUTS:
       filename = name of file made by save2.     in
 KEYWORD PARAMETERS:
       Keywords:
          /DEBUG to list debug info for save2 file.
          /XDR examine an XDR save2 file.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 29 Jun, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\help_save2.pro)


HENKE

[Previous Routine] [Next Routine] [List of Routines]
 pro henke2, compound_name, density, energy, f1, f2, delta, beta, $
	graze_mrad, reflect, inverse_mu=inverse_mu, atwt=atwt

 All you give it is compound_name and density

 CJJ April 97

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\henke.pro)


HENKE_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 pro henke_array, compound_name, density, energies, f1, f2, delta, beta, $
	graze_mrad, reflect, inverse_mu=inverse_mu, atwt=atwt

 All you give it is compound_name and density

 CJ, April 97 - even newer version of Henke data, rewrite of
 file format.
 BH 2004-06-26 add keyword inverse_mu
 CJ 2004-10-14 add keyword atwt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\henke_array.pro)


HENKE_EXTRA

[Previous Routine] [Next Routine] [List of Routines]
 This procedure gets the extra energies and puts them in
 the proper place in an overall array.  It works on
 element_index which is 0 for hydrogen and so on.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\henke_extra.pro)


HEXDUMP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HEXDUMP
 PURPOSE:
       Display a file in hex.
 CATEGORY:
 CALLING SEQUENCE:
       hexdump, file
 INPUTS:
       file = File to display.  in
          File may optionally be a byte array to dump.
 KEYWORD PARAMETERS:
       Keywords:
         NBYTES=n Bytes to display on each line (def=10).
         LINES=lns Lines in group (def=20).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2000 Nov 22

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hexdump.pro)


HGET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HGET
 PURPOSE:
       Get a handle value.
 CATEGORY:
 CALLING SEQUENCE:
       v = hget(h)
 INPUTS:
       h = handle ID.              in
       v = Returned handle value.  in
 KEYWORD PARAMETERS:
       Keywords:
         /NO_COPY if given copies contents the handle to v
           and sets h to undefined.  Useful for large items
           if h is not needed after hget.  For very large items
           it may be better to use handle_value directly.
         ERROR=err  Error flag: 0=ok, 1=invalid handle.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: this routine is often more convenient to use since
         it is a function so may be called within expressions.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jan 15

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hget.pro)


HILIGHT

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION: This procedure 
           - select values according to a user defined criterion
           - display the selected values.
           - display the histogram of the selected values in the
             array tab.

 INPUTS  : tab1     --> 2 or 3 dimensional array (NO DEFAULT)
         : thresmin --> minimum value for which the value 
                        is selected (NO DEFAULT if use - see OPTIONS)
         : thresmax --> maximum value for which the value 
                        is selected (NO DEFAULT if use - see OPTIONS)

 OPTIONS : select  --> if thresmin and thresmax are ommitted 
                       allows to specify the criterion based on a 
                       different array features.
           binsize --> defines the size of the bin for the
                       histogram (DEFAULT = 1.)

 USE     : HILIGHT, ARRAY1, 10., 20., BINSIZE=1 : 
               select and display on the the values in arrray1
               between 10. and 20. 

           HILIGHT, ARRAY1, SELECT=WHERE(ARRAY2 LE 5.43) :
               select and display the values in the array1 where
               array2 is less or equal than 5.43  


 CONTACT : Didier JOURDAN   didier@esrg.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hilight.pro)


HILITE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     hilite,im,select

 EXAMPLE:     hilite,avhrr1,where(avhrr3-avhrr4 lt 5.)

 PURPOSE:     To hilite a region which satifies a specified set of 
              conditions

 INPUT:       im          2-D image array (any type but string)
              select      Index array of points to hilite.  These may be
                          generated with the WHERE proceedure.
              rate        rate of flicker

 KEYWORD INPUT:
              keep        do not destroy window on exit
              zoom        2 element vector which specifies zoom factor
                          in x and y direction

 OUTPUT:                  NONE
 COMMON BLOCKS:           NONE
 SIDE EFFECTS:            Creates and uses a new window 
 
 PROCEEDURE:  Selected region is hilighted by use of the FLICK proceedure.

 EXAMPLE

    c=cmplxgen(100,100,/cent)/20
    s=sin(float(c+c^2))
    mve,c
    hilite,s,where(float(c+c^4) gt 1. and imaginary(c+c^4) lt 1.),zoom=2

  author:  Paul Ricchiazzi                            sep92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hilite.pro)


HIST2D[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HIST2D
 PURPOSE:
       Compute a 2-d histogram for an array of points.
 CATEGORY:
 CALLING SEQUENCE:
       h2d = hist2d( x, y)
 INPUTS:
       x, y = 2-d point coordinates.                 in
 KEYWORD PARAMETERS:
       Keywords:
         MIN=mn set lower left corner of region to
           histogram in (x,y) space.  If x and y are
           of type byte the default is 0.  If MIN is not
           given and type is not byte then the arrays are
           searched for their min values.  If MIN is a scalar
           or 1 element array then that value is applied to both
           x and y.  To set both x and y minimums separately
           send MIN as the 2 element array [xmin, ymin].
         MAX=mx set upper right corner of region to
           histogram in (x,y) space.  If MAX is not given then
           the arrays are searched for their max values. If MAX
           is a scalar or 1 element array then that value is applied to
           both x and y.  To set both x and y maximums separately
           send MAX as the 2 element array [xmax, ymax].
         BIN=bn sets the histogram bin widths.  If BIN is a
           scalar or a single element array then it is applied
           to both x and y.  To set both x and y bins separately
           send BIN as the 2 element array [xbin, ybin].
           If BIN is not given then a value is chosen to give
           roughly 200 bins in both x and y.
         /LIST lists the x and y ranges and bin sizes used
           to compute the 2-d histogram.
 OUTPUTS:
       h2d = The computed 2-d histogram of x and y.  out
 COMMON BLOCKS:
       array_map_com
       array_map_com
 NOTES:
 MODIFICATION HISTORY:
	R. Sterner, 24 May, 1991.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hist2d.pro)


HIST2D[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HIST2D

 PURPOSE:
       Plot a 2-dimensional histogram.

 CALLING SEQUENCE:
       hist2d,x_values,y_values

 INPUTS:
       x_variable     self-explanatory
       y_variable     self-explanatory

 KEYWORD INPUTS:
       bindim         number of bins on one side
       tvim           plot image rather than contour
       xtitle         title for x axis
       ytitle         title for y axis
       title          title for plot
       nlevels        number of levels for contouring
       follow         keyword to contour to select algorithm allowing labeling
       c_charsize     contour charsize

 OPTIONAL INPUTS:

 OUTPUTS:

 OPTIONAL OUTPUTS:

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  3/15/94

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hist2d.pro)


HISTO

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION: This procedure displays the histogram of 
           the array tab1.

 INPUTS  : tab1 --> array
         : mini --> minimum value 
         : maxi --> maximum value 
         : bin  --> size of bin 

 OUTPUTS : diplay

 keyword Input:
           default   --> percentage 
           /abs      --> compute the histogram in number of values
           /cumul    --> compute the cumulative histogram 
           /overplot --> overplot the histogram  
           title     --> title of plot
           xtitle    --> xtitle of plot
           ytitle    --> ytitle of plot
           xrange    --> xrange of plot
           yrange    --> yrange of plot

 USE     : histo, array1,0,500,1, /cumul

 CONTACT : Didier JOURDAN   didier@esrg.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\histo.pro)


HIST[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HIST
 PURPOSE:
       Compute histogram and corresponding x values. Allows weights.
 CATEGORY:
 CALLING SEQUENCE:
       h = hist(a, [x, bin])
 INPUTS:
       a = input array.                             in
       bin = optional bin size.                     in
         Def is a size to give about 30 bins.
         NBINS over-rides bin value and returns value used.
 KEYWORD PARAMETERS:
       Keywords:
         MINH=mn  sets min histogram value.
         MAXH=mx  sets max histogram value.
         /EXACT means use MINH and MAXH exactly. Else
           adjusts so histogram goes to 0 at ends.
         /BIN_START means return x as bin start values,
           else x is returned as bin mid values.
         MAXBINS = mx.  Set max allowed number of bins to mx.
           Over-rides default max of 1000.
         NBINS = n.  Set number of bins used to about n.
           Actual bin size is a nice number giving about n bins.
           Over-rides any specified bin size.
         WEIGHT=wt Array of weights for each input array element.
           If this is given then the weights are summed for each
           bin instead of the counts.  Returned histogram is a
           floating array.  Slower.
 OUTPUTS:
       x = optionally returned array of x values.   out
       h = resulting histogram.                     out
 COMMON BLOCKS:
 NOTES:
       Notes: the boundaries of the histogram bins are positioned
         as follows: [...,-2*bin,-bin,0,bin,2*bin,...].
         To be compatable with plot,x,h,psym=10 the returned x
         array has values at the bin centers, that is:
         [...,-2.5*bin,-1.5*bin,-.5*bin,.5*bin,1.5*bin,...].
         This may be over-ridden using the /BIN_START keyword
         which returns the X array with the bin starting X instead
         of the bin center.
 MODIFICATION HISTORY:
       R. Sterner. Converted to SUN 11 Dec, 1989.
       R. Sterner. Added MINH, MAXH, EXACT, and BIN_START, 14 Aug, 1991.
       R. Sterner. Fixed integer overflow problem for bin size. 2 Oct, 1992.
       R. Sterner. Added weighted histogram. 1994 Jan 27.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hist.pro)


HIST[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HIST

 PURPOSE:
         call histo procedure to plot a histogram with
         correct values along the x-axis.  Calculates min, max for you.
         If binsz is set, uses it, otherwise = 1.
       

 CALLING SEQUENCE:
       hist,variable

 INPUTS:
         arr    array to be plotted

 KEYWORD INPUTS:

 OPTIONAL INPUTS:
         binsz         bin size of histogram
         /abs      --> compute the histogram in number of values
         /cumul    --> compute the cumulative histogram
         /overplot --> overplot the histogram

 OUTPUTS:

 OPTIONAL OUTPUTS:

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  9/22/92

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hist.pro)


HLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HLINE
 PURPOSE:
       Plot a horizontal line after erasing last plotted line.
 CATEGORY:
 CALLING SEQUENCE:
       hline, [y]
 INPUTS:
       y = y coordinate of new line.   in
         If y not given last line is erased.
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means use device coordinates (default).
         /DATA means use data coordinates.
         /NORM means use normalized coordinates.
         /NOERASE means don't try to erase last line.
         /ERASE means just erase last line without plotting another.
         RANGE=[xmin, xmax] min and max x coordinates of line.
         NUMBER=n line number (0 to 9, def=0).
         COLOR=c set plot color.
         LINESTYLE=s set line style.
 OUTPUTS:
 COMMON BLOCKS:
       hline
       hline
 NOTES:
 MODIFICATION HISTORY:
       R. sterner, 5 June, 1992
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hline.pro)


HLP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HLP
 PURPOSE:
       Variant of HELP.  Gives array min, max.
 CATEGORY:
 CALLING SEQUENCE:
       hlp, a1, [a2, ..., a9]
 INPUTS:
       a1, [...] = input variables.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 11 Dec, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hlp.pro)


HMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:         hms

 PURPOSE:      convert time in seconds to a time string in hh:mm:ss format

 USEAGE:       time_string=hms(time)
 
 INPUTS:       time (seconds)

 RESTRICTIONS  time must be positive

 KEYWORDS:     none

 OUTPUTS:      return time string

 AUTHOR:       Paul Ricchiazzi       4jan94
               Earth Space Research Group, UC Santa Barabara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hms.pro)


HOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HOR
 PURPOSE:
       Plot a horizontal line on a graph at specified y value.
 CATEGORY:
 CALLING SEQUENCE:
       hor, y
 INPUTS:
       y = Y value of horizontal line.  Scalar or array.    in
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means work in device coordinates.
         /NORMALIZED means work in normalized coordinates.
           Default is data coordinates.
         LINESTYLE=s.  Linestyle (def=!p.linestyle).
         COLOR=c.      Line color (def=!p.color).
         THICKNESS=t   Line thickness (def=!p.thick).
         FILL=clr        Optional color to fill between line pairs.
           Fills between lines 0 and 1, 2 and 3, and so on.
         POINTER=pt      Draw arrowhead pointers at left and right
           instead of lines.  Arrowhead dimensions may be given as
           fraction of screen or plot window size, the value of
           pt is height, or [height, width].  For /pointer the
           default used is [.03,.03].
         /LEFT  used with POINTER to plot left pointers only.
         /RIGHT used with POINTER to plot right pointers only.
         /OUT   Keep pointers outside axes (Data coord only).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: see ver.
 MODIFICATION HISTORY:
       R. Sterner, 2 Aug, 1989.
       R. Sterner, 21 May, 1992 --- fixed for log X axes.
       R. Sterner,  3 Nov, 1992 --- Added /device.
       R. Sterner, 20 Jun, 1993 --- Added /normalized.
       R. Sterner,  1994 Feb  2 --- Added THICK.
       R. Sterner, 1994 Jun 3 --- Added FILL.
       R. Sterner, 1994 Jun 16 --- Added POINTER, /TOP, /BOTTOM.
       R. Sterner, 1997 Jul 11 --- Added /OUT.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hor.pro)


HORI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HORI
 PURPOSE:
       Interactive horizontal line on screen or plot.
 CATEGORY:
 CALLING SEQUENCE:
       hori, [y]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Causes data coordinates to be used (default).
         /DEVICE Causes window device coordinates to be used.
         /NORMAL Causes normalized coordinates to be used.
         COLOR=c Set color of line (ignored for /XOR).
         LINESTYLE=s Line style.
         XFORMAT=xfn  These kywords are given names of functions
         YFORMAT=yfn  that accept the numeric value of x or y
           and return a corresponding string which is displayed
           in place of the actual value.  For example, Julian
           days could be displayed as a date with jd2date.
         XSIZE=xs, YSIZE=ys  Coordinate display widths.
         /JS  Means X axis is time in Julian seconds.
         /NOSTATUS   Inhibits status display widget.
         SETSTAT=st  May use the same status display widget on
           each call to hori (stays in same position).
           On first call: the status widget structure is returned.
           Following calls: send st.  Must use with /KEEP.
           To delete status display widget after last box1 call:
             widget_control,st.top,/dest (or drop /KEEP)
         /KEEP   Do not delete status widget on exit.
         /XMODE means use XOR plot mode instead of tvrd mode.
         INSTRUCTIONS=t  String array with exit instructions.
           Default: Press any button to exit.
         /DIALOG Means give an exit dialog box.
         MENU=m  A string array with exit dialog box options.
           Def=Exit. An option labeled Continue is always added.
         EXITCODE=x Returns exit code.  Always 0 unless a dialog
           box is requested, then is selected exit option number.
         BUTTON=b   Returned button code: 1=left, 2=middle, 4=right.
 OUTPUTS:
       y = Y coordinate of line.      in, out
 COMMON BLOCKS:
       js_com
 NOTES:
       Note: data coordinates are default.
         Y may be set to starting position in entry.
 MODIFICATION HISTORY:
       R. Sterner, 11 Sep, 1990
       R. Sterner, 21 Oct, 1991 --- added /NOCOMMANDS, EXITCODE=x
       R. Sterner,  6 Nov, 1991 --- added EXITCODE=0.
       R. Sterner, 23 Dec, 1991 --- made x be both in and out.
       R. Sterner, 23 Dec, 1991 --- Added wait,.2 for HP workstation.
       R. Sterner, 21 May, 1992 --- fixed for log axes.
       R. Sterner, 1994 Jan 20 --- One mouse button,/NORMAL,/DATA.
       R. Sterner, 1994 jan 21 --- Added /NOSTATUS, SETSTAT, /KEEP.
       R. Sterner, 1994 Feb 16 --- Fixed a few minor bugs.
       R. Sterner, 1994 Mar  4 --- Added XFORMAT, YFORMAT, & BUTTON keywords.
       R. Sterner, 1994 May 17 --- Added XSIZE,YSIZE,/DIALOG,INSTRUCTIONS,
       MENU, and rearranged display.
       R. Sterner, 1995 Jan 11 --- Added /JS for time in JS.
       R. Sterner, 1995 Aug 17 --- Was not using initial y.  Fixed.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1998 Mar 11 --- Attempt to deal with true color.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hori.pro)


HOUR_OF_DAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  hour_of_day

 PURPOSE:
   This function calculates the time of the day from julian seconds

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   result=hour_of_day(js)

 INPUTS:
   js: scalar or vector of julian seconds

 OUTPUTS:
   result: time of the day in hours

 EXAMPLE:
   print,hour_of_day(str2js('12:30:00 01.01.1900'))
      12.500000

   MODIFICATION HISTORY:
   Written by: Franz Rohrer August 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\hour_of_day.pro)


HOW_MANY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		HOW_MANY
 VERSION:
		4.0
 PURPOSE:
		Called with up to 8 keyword parameters, HOW_MANY checks how many and
		which of the corresponding variables are defined and (optionally)
		within given type limits.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = HOW_MANY ([FIRST ... ] [LOW =LO] [HIGH = HI] [/NOZERO] $
			[WHICH_ONES = BCOD])
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	FIRST	|
	SECOND	|
	THIRD	|
	FOURTH	|	Each of these keywords accept an arbitrary input,
	FIFTH	|	including no input or undefined input.
	SIXTH	|
	SEVENTH	|
	EIGHTH	|

	/NOZERO
		Switch.  If set, specifies that only non zero (or non null string)
		values are to be recognized as existing.
	LOW
		Optional numeric input, specifying the lowest limit of type code that
		is recognized.  For example, if LOW is set to 3, variables of type BYTE
		and INTEGER will not be recognized as defined.  Default value is 1,
		i.e. everything is recognized.
	HIGH
		Same as LOW for the upper limit.  Default value is 12, i.e. everything
		is recognized.
	WHICH_ONES
		Optional output, see below.
 OUTPUTS:
		Returns the number of defined keyword variables, regardless of their
		types and values.
 OPTIONAL OUTPUT PARAMETERS:
	WHICH_ONES
		The name of a variable to receive a a binary representation of the
		defined variables, as a long integer.  For example, if the variables
		corresponding to FIRST, FIFTH and SIXTH are defined, the result is
			2^0 + 2^4 + 2^5 = 49.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Currently HOW_MANY is restricted to a maximum of 8 variables.  If
		needed, the number can be increased.
 PROCEDURE:
		Straightforward.  Calls DEFAULT and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-AUG-1994 by Mati Meron, as a more general version of ONE_OF.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\how_many.pro)


HPRNUTANG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   HPRNUTANG

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute high precision earth precession, nutation and orientation angles

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   HPRNUTANG, JDTT, ZETA, THETA, Z, DPSI, DEPS, $
              POLAR_X=PMX, POLAR_Y=PMY, JD_UT1=JD_UT1, /USE_EOPDATA, $
              TBASE=, FIXED_EPOCH=, FIXED_BASE=, $
              /JPL, /NO_UT1, $
              MEAN_OBLIQUITY=EPS0, TRUE_OBLIQUITY=EPS, $
              GMS_TIME=GMST, GAS_TIME=GAST, EQ_EQUIONOX=EQEQ
              

 DESCRIPTION:

  The procedure HPRNUTANG computes values of the earth
  orientation-related angles, including precession and nutation,
  which are used for high precision earth-based astronomy
  applications.  

  It is the goal of this procedure to provide all angles relevant in
  determining the position of an earth station, as measured in an
  earth-fixed coordinate system, and converting to space-fixed
  coordinates.  This is useful in applications where observations by
  a station in the earth-fixed frame are taken of an astrophysical
  object which is in the non-rotating space-fixed frame.

  This routine potentially depends on the following external
  procedures, which also themselves depend on external data files:

      EOPDATA - estimates Earth orientation parameters (if
                USE_EOPDATA keyword is set), depends on earth
                orientation data file.
      TAI_UTC - computes time difference TAI - UTC (leap seconds),
                depends on leap seconds file.

  This interface is somewhat provisional.  See OPEN QUESTIONS below.

  The user requests the quantities for a particular set of epoch
  times, as measured in Julian days, in the system of Terrestrial
  Dynamical Time ( = TDT = TT ).  

  HPRNUTANG returns several quantities.  It is not possible to
  describe each of these quantities in full detail in this
  documentation.  The user is referred to the Explanatory Supplement
  to the Astronomical Almanac (Sec 3.2) for more complete
  descriptions.  The quantities are:

    * ZETA, THETA, Z, which are euler angles representing the
      precession of the mean celestial ephemeris pole with respect to
      the space-fixed coordinate system defined by the FIXED epoch.
      For a vector R_MEAN_OFDATE, whose space-fixed coordinates are
      referred to the mean pole of date, the transformation to
      space-fixed coordinates referred to the mean pole of the fixed
      epoch is:

        R_FIXED = qtvrot(R_MEAN_OFDATE, $
                        qteuler(['z','y','z'], -zeta, +theta, -z))

      By default the "fixed" epoch is J2000.0.  [ See below for
      definitions of QTVROT and QTEULER. ]

    * DPSI, DEPS, which are the angles representing the nutation in
      longitude and obliquity of the true of-date celestial ephemeris
      pole with respect to the mean pole of date.  For a vector
      R_TRUE_OFDATE, whose space-fixed coordinates are referred to
      the true pole of date, the transformation to space-fixed
      coordinates referred to the mean pole of date is:

        R_MEAN_OFDATE = qtvrot(R_TRUE_OFDATE, $
                              qteuler(['x','z','x'], $
                                      +eps0, -dpsi, -eps0-deps)

      where EPS and EPS0 are defined below.

    * EPS0, which is the mean obliquity of the ecliptic plane,
      referred to the mean equator of date, at the requested epoch.
      For a vector, R_ECL_OFDATE, whose space-fixed coordinates are
      referred to the mean ecliptic and equinox of date, the
      transformation to space-fixed coordinates referred to the mean
      equator and equinox of date is:

        R_MEAN_OFDATE = qtvrot(R_ECL_OFDATE, $
                               qteuler(['x'], eps0)

    * EPS, which is the true obliquity of the ecliptic plane,
      referred to the mean equator of date, at the requested epoch.

    * GMST, GAST, which are the mean and apparent Greenwich Sidereal
      Times at the requested epoch.  For a vector R_TRUE_EARTHFIXED,
      whose earth-fixed coordinates are referred to the true pole of
      date, the transformation to space-fixed coordinates referred to
      the true pole of date are:

        R_TRUE_OFDATE = qtvrot(R_TRUE_EARTHFIXED, $
                              qteuler(['z'], +gast))

    * EQEQ, the equation of the equinoxes at the requested epoch.
      This quantity may be more commonly known as the "precession of
      the equinox."

    * PMX, PMY, the coordinates of the celestial ephemeris pole as
      measured in the earth-fixed coordinate system (set to zero if
      the USE_EOPDATA keyword is not set).  For a vector
      R_MEAN_EARTHFIXED, whose earth-fixed coordinates are referred
      to the International Reference Pole, the transformation to
      earth-fixed coordinates referred to the true pole of date are:

        R_TRUE_EARTHFIXED = qtvrot(R_MEAN_EARTHFIXED, $
                                  qteuler(['x','y'], -pmy, -pmx))

      The vector R_MEAN_EARTHFIXED, could be for example, the
      coordinates of a station on the earth, as determined from its
      geodetic latitude and longitude.

    * JD_UT1, the UT1 time (expressed in Julian days) (set to UTC if
      the USE_EOPDATA keyword is not set or if NO_UT1 is set).

  Users may select different techniques to compute some of these
  quantities.  See keywords JPL and USE_EOPDATA.


 OPEN QUESTIONS

   How will the transition to a new IERS EOP series be accomplished?
   Using a keyword?  How can users select different nutation series?
   How can users select different fundamental arguments for the
   planets.


 VERIFICATION

   The precession and nutation quantities were compared against those
   produced by the SLALIB telescope pointing library.  

   For the epoch JD 2450449 (TT), the precession quantities of
   HPRNUTANG agree numerically with SLALIB SLA_PREC to within 0.1
   microarcseconds, and the nutation quantities agree SLALIB SLA_NUTC
   to within 6 microarcseconds (and 54 microarcseconds in the mean
   obliquity).  The GMST values agree with SLALIB SLA_GMSTA to better
   than 1 nanosecond.  Of course this says nothing about the accuracy
   of the IAU 1976/1980 precession and nutation models with respect
   to the true precession and nutations.

   The precession and nutation quantities computed in this procedure
   -- ZETA, THETA, Z, DPSI and DEPS -- were also used to compute the
   space-fixed coordinates of the Goldstone DSS-63 deep space network
   tracking station.  These values were compared against values
   produced by JPL Horizons ephemeris generator.  Agreement was found
   at the 60 cm level.  Accuracy at that level is probably limited by
   the JPL DE406 earth ephemeris used by Horizons.

   Polar motion values were estimated at the same epoch using
   EOPDATA, and applied to three orthogonal unit vectors.  The above
   quaternion transformation produces the same coordinate values,
   when compared against SLALIB_POLMO.


 QTEULER and QTVROT

   The functions QTEULER and QTVROT are functions from the Markwardt
   quaternion library.  QTEULER composes a chain of Euler-like
   rotations into a single quaternion.  QTVROT applies a quaternion
   rotation to a 3-vector.

   The user need not use these functions.  Any function which
   constructs a set of Euler-like rotations, and then applies them to
   3-vectors will work fine.


 INPUTS:

   JDTT - a vector or scalar, the TT epoch time(s) for which high
          precision values are to be computed.

          For reference, JDTT = JDTAI + 32.184/86400d, where JDTAI is
          the international atomic time measured in days.  The value
          of the keyword TBASE is added to JDTT to arrive at the
          actual Julian date.

 OUTPUTS:

   ZETA, THETA, Z - Euler angles of precession of the mean celestial
                    ephemeris pole, expressed in ANGUNITS units.

   DPSI, DEPS - the nutation angles in longitude and obliquity of the
                true pole with respect to the mean pole, expressed in
                ANGUNITS units.  By default the values are based on
                the IAU 1980 theory of nutation.  The user can select
                JPL to interpolate the JPL nutation ephemerides.

                When USE_EOPDATA is set, the nutation angles are
                augmented by the offset correction terms supplied in
                the EOP file.

 KEYWORD PARAMETERS:

   TBASE - a fixed epoch time (Julian days) to be added to each value
           of JDTT.  Since subtraction of large numbers occurs with
           TBASE first, the greatest precision is achieved when TBASE
           is expressed as a nearby julian epoch, JDTT is expressed
           as a small offset from the fixed epoch.  
           Default: 0

   FIXED_EPOCH - a scalar or vector number, the fixed epoch (in TT
                 Julian Days) against which the precession angles of
                 the mean pole are referred.  
                 Default: JD 2451545.0 TT ( = J2000.0 )

   FIXED_BASE - a fixed epoch time to be added to FIXED_EPOCH, in
                much the same way that TBASE is added to JDTT.
                Default: 0

   POLAR_X, POLAR_Y - upon return, the quantities PMX and PMY, in
                      ANGUNITS units, if USE_EOPDATA is set.  If
                      USE_EOPDATA is not set then zero is returned
                      for both PMX and PMY.

   JD_UT1 - upon return, the time in the UT1 system at the requested
            epoch, if the USE_EOPDATA keyword is set.  If the
            USE_EOPDATA keyword is not set, or if NO_UT1 is set, then
            the time in UTC is returned (which is guaranteed to be
            within +/- 0.9 seconds of UT1).

   MEAN_OBLIQUITY - upon return, the quantity EPS0, in ANGUNITS
                    units.

   TRUE_OBLIQUITY - upon return, the quantity EPS, in ANGUNITS units.

   GMS_TIME - upon return, the quantity GMST in radians.

   GAS_TIME - upon return, the quantity GAST in radians.

   EQ_EQUINOX - upon return, the quantity EQEQ in ANGUNITS units.

   ANGUNITS - scalar string, output units of angular parameters.
              Possible values are 'ARCSEC' or 'RADIAN'.
              Default value: 'RADIAN'

   JPL - if set, then use the JPL nutation ephemeris to determine the
         nutation angle quantities.

   NO_UT1 - if set, then do not compute UT1, but use UTC instead.

   USE_EOPDATA - if set, use the EOPDATA procedure to determine earth
                 orientation parameters at the requested epoch.
                 These include polar motion values, corrections to
                 the 1980 IAU nutation theory, and the UT1
                 correction.


 EXAMPLE:

   Need an example converting topocentric to/from J2000.0

   Need an example converting station position earth-fixed
   coordinates to/from space-fixed coordinates.



 SEE ALSO:

   HPRNUTANG, TAI_UTC (Markwardt Library)
   PRECESS, NUTATE, PREMAT, JPRECESS, BPRECESS (IDL Astronomy Library)


 REFERENCES:

   Aoki, S., Guinot, B., Kaplan, G.H., Kinoshita, H., McCarthy, D.D.,
     Seidelmann, P.K., 1982: Astron. Astrophys., 105, 359-361.

   HORIZONS, JPL Web-based ephemeris calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html

   McCarthy, D. D. (ed.) 1996: IERS Conventions, IERS T.N. 21.
     http://maia.usno.navy.mil/conventions.html

   Seidelmann, P.K. 1992, *Explanatory Supplement to the Astronomical
     Almanac*, ISBN 0-935702-68-7


 MODIFICATION HISTORY:
   Written, 30 Jan 2002, CM
   Documented, 15 Feb 2002, CM
   Added docs about ecliptic; added default of 'RADIAN' to code; 01
     Mar 2002, CM
   Corrected equation of equinoxes (had DPSI*COS(EPS0), when it
     should be DPSI*COS(EPS)), 01 Mar 2002, CM
   Added default message, 04 Mar 2002, CM
   Added more logic to detect JPL ephemeris file, 17 Mar 2002, CM

  $Id: hprnutang.pro,v 1.11 2002/05/13 06:43:53 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\hprnutang.pro)


HPRSTATN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   HPRSTATN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute high precision earth station positions in inertial coordinates

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   HPRSTATN, JDTT, R_ITRF, R_ECI, V_ECI, $
             [ /JPL, /USE_EOP, /NO_UT1, TBASE= ]

 DESCRIPTION:

  The procedure HPRSTATN computes the coordinates and velocities of
  an earth station in J2000 equatorial earth-centered inertial
  coordinates (ECI).  This may be useful in any application where an
  earthbound observatory is used to collect data on a non-terrestrial
  phenomenon.

  The user must have the following routines involved: HPRNUTANG;
  Markwardt Quaternion Library; JPLEPHREAD and JPLEPHINTERP (if JPL
  keyword is used); EOPDATA (if USE_EOP keyword is set); and TAI_UTC.
  Also, the appropriate data files for TAI-UTC and Earth Orientation
  Parameters must be installed.

  The user must specify the position of the earth station in
  earth-centered, earth-fixed, cartesian coordinates of the ITRF.
  The Z-axis points to terrestrial north, the X-axis lies in the
  terrestrial equator pointing towards the Greenwich meridian, and
  the Y-axis forms the right handed coordinate system.  Any
  positional units may be specified.

  For the highest precision, the preferred method is to know the
  coordinates from a direct IRTF reduction, i.e., via VLBI.  A
  procedure for estimating cartesian coordinates based on geodetic
  coordinates (lat, lon) referred to the WGS84 ellipsoid is given
  below.

  The values returned are the earth-centered inertial J2000
  coordinates and velocities of the station.  All the effects of
  earth rotation, precession, nutation, and polar motion are
  potentially included.  The user has a choice of the kinds of
  transformations that are included (see JPL, USE_EOP and NO_UT1
  keywords).

  The returned positional units are the same as the input units.  The
  returned velocity units are (units of input) PER SECOND.

  It is possible specify more than one time, or more than one station
  position, or both.  If both more than one time and position are
  specified, then there must be an equal quantity of both.


 CARTESIAN COORDINATES FROM GEODETIC COORDINATES

  For example, for a station whose geodetic latitude LAT, east
  longitude LON and elevation H specified relative to the geoid, the
  cartesian coordinates are:

         R_ITRF = [ (A + H)*COS(LAT)*COS(LON), $
                    (A + H)*COS(LAT)*SIN(LON), $
                    (A + H)*(1 - F)*SIN(LAT) ]

  where for the WGS84 geoid, A = 6378.137 km, and the flattening
  factor F = 1/298.257223563.


 INPUTS:

   JDTT - a scalar or N-vector, the TT epoch time(s) for which
          station coordinates are to be computed.

          For reference, JDTT = JDTAI + 32.184/86400d, where JDTAI is
          the international atomic time measured in days.  The value
          of the keyword TBASE is added to JDTT to arrive at the
          actual Julian date.

   R_ITRF - cartesian coordinates of earth station.  Either a
            3-vector, or a 3xN array.  Units can be any positional
            units.


 OUTPUTS:

   R_ECI - upon output, the coordinates of the station at the given
           time(s), referred to the earth-centered J2000 coordinate
           system.  Either a 3-vector or 3xN array depending on the
           input.  Units are the same as for R_ITRF.

   V_ECI - upon output, the velocities of the station at the given
           time(s), referred to the earth-centered J2000 coordinate
           system.  Either a 3-vector or 3xN array depending on the
           input.  Units are (units of R_ITRF) PER SECOND.


 KEYWORD PARAMETERS:

   TBASE - a fixed epoch time (Julian days) to be added to each value
           of JDTT.  Since subtraction of large numbers occurs with
           TBASE first, the greatest precision is achieved when TBASE
           is expressed as a nearby julian epoch, JDTT is expressed
           as a small offset from the fixed epoch.  
           Default: 0

   JPL - if set, then the JPL ephemeris is used to compute nutation
         angles.  Otherwise the series representation of HPRNUTANG is
         used.

   USE_EOP - if set, then use earth orientation parameters, returned
             by EOPDATA, to further refine the station coordinates.
             Otherwise, only precession and nutation are used.

   NO_UT1 - if set, then do not use the UT1-UTC conversion.


 EXAMPLE:

   ;; ITRF coordinates of Deep Space Network Antenna 63 (METERS)
   R_DSN63 = [+4849092.647d, -0360180.569d, +4115109.113d]

   ;; Time: 2000/01/01 01:30 TT
   JDTT = jday(2000d,1,1) + 1.5/24

   ;; Compute position of antenna in J2000 coordinate system using
   ;; full Earth Orientation Parameters.
   HPRSTATN, JDTT, R_DSN63, R_ECI, V_ECI, /USE_EOP


 SEE ALSO:

   HPRNUTANG, TAI_UTC (Markwardt Library)
   EOPDATA, JPLEPHREAD, JPLEPHINTERP


 REFERENCES:

   McCarthy, D. D. (ed.) 1996: IERS Conventions, IERS T.N. 21.
     http://maia.usno.navy.mil/conventions.html

   Seidelmann, P.K. 1992, *Explanatory Supplement to the Astronomical
     Almanac*, ISBN 0-935702-68-7


 MODIFICATION HISTORY:
   Written, 6 May 2002, CM
   Documented, 12 May 2002, CM

  $Id: hprstatn.pro,v 1.2 2002/05/13 06:44:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\hprstatn.pro)


HSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HSET
 PURPOSE:
       Set a handle value.
 CATEGORY:
 CALLING SEQUENCE:
       hset, h, v
 INPUTS:
       v = value to store in handle.    in
 KEYWORD PARAMETERS:
       Keywords:
         /NO_COPY if given copies contents of v to handle
           and sets v to undefined.  Useful for large items
           if v is not needed after hset.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: if h is not a valid handle then it is set to
         a valid handle which is returned.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jan 15

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\hset.pro)


HTML_EXAMPLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_example

 PURPOSE:
	This routine shows the usage of the html_header,
	struct2htmltable, and html_trailer functions

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
  	HTML_EXAMPLE

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1997-DEC

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\examples\html_example.pro)


HTML_EXAMPLE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_example2

 PURPOSE:

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1997-DEC

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\examples\html_example2.pro)


HTML_FILE_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   html_file_array

 PURPOSE:
   This routine combines html_header, array2htmltable, and html_trailer
   functions with put_file

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   HTML_FILE_ARRAY, filename, array

 KEYWORD PARAMETERS:
   INFOTEXT: if this keyword set a string or string array the text is written
       to the outputfile before the tables. This parameter can contain
       plain text or HTML code.

   all keywords of the respective routines are passed thru _EXTRA
   TITLE=string
   LOGO=filename
   DESCRIPTION=string
   KEYWORDS=string
   EMAIL=emailaddress_string
   NAME=name_of_
   /UPDATE
   DATE= date_string
   /BORDER
   /ROW_NUMBERS
   /COL_NUMBERS
   ROW_TITLES=string array
   COL_TITLES=string array
   CAPTION=string
   ALIGNMENT=float
   /SMALL
   /FIXED
   /NOBREAK

 MODIFICATION HISTORY:
   Written by Theo Brauers, JAN 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_file_array.pro)


HTML_FILE_ASCII

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_file_ascii

 PURPOSE:
   This routine combines html_header, ascii2html, and html_trailer
   functions with put_file

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   HTML_FILE_ASCII, filename, text

 KEYWORD PARAMETERS:
   INFOTEXT: if this keyword set a string or string array the text is written
       to the outputfile before the tables. This parameter can contain
       plain text or HTML code.

   all keywords of the respective routines are passed thru _EXTRA
   TITLE=string
   LOGO=filename
   DESCRIPTION=string
   KEYWORDS=string
   EMAIL=emailaddress_string
   NAME=name_of_
   /UPDATE
   DATE= date_string
   /BORDER
   /ROW_NUMBERS
   /COL_NUMBERS
   ROW_TITLES=string array
   COL_TITLES=string array
   CAPTION=string
   ALIGNMENT=float
   /SMALL
   /FIXED
   /NOBREAK

 MODIFICATION HISTORY:
   Written by Theo Brauers, JAN 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_file_ascii.pro)


HTML_FILE_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   html_file_struct

 PURPOSE:
   This routine combines html_header, array2htmltable, and html_trailer
   functions with put_file

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   HTML_FILE_STRUCT, filename, array

 KEYWORD PARAMETERS:
   INFOTEXT: if this keyword set a string or string array the text is written
       to the outputfile before the tables. This parameter can contain
       plain text or HTML code.

   all keywords of the respective routines are passed thru _EXTRA
   TITLE=string
   LOGO=filename
   DESCRIPTION=string
   KEYWORDS=string
   EMAIL=emailaddress_string
   NAME=name_of_
   /UPDATE
   DATE= date_string
   /BORDER
   IGNORE=ignore tags with string
   /NUMBERS
   /HRULE
   CAPTION=string
   /SUBTABLES
   MAX_ARRAY=integer
   ALIGNMENT=float
   /SMALL
   /FIXED
   /NOBREAK

 MODIFICATION HISTORY:
   Written by Theo Brauers, jan 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_file_struct.pro)


HTML_FORM_ALPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	html_form_alph

 PURPOSE:
   The result of this function is a string containing the html code for an alphabetical list

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=html_form_alph(alph_key)

 INPUTS:
 alph_key: stringarray of Characters

 KEYWORD PARAMETERS:
 charsize: the relative font size for html

 EXAMPLE:
 alph_key=['A','D','R','Y','Z']
 result=html_form_alph(alph_key)
 print, result
 
MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-May-11 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\html_form_alph.pro)


HTML_FORM_DROPLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	html_form_droplist

 PURPOSE:
   The result of this function is a string containing the html code for a droplist


 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
  result=html_form_droplist(listvalue,[form_name=form_name],[function_name=function_name],[size=size],[select_name=select_name],[_extra=pkey])

 INPUTS:
  listvalue: stringarray or string with the values for the list

 OPTIOANL INPUTS:
  title: if arg_present() the left hand title of the droplist

 EXAMPLE:
 form=html_form_droplist(['A'],select_name='DO',function_name='do_selection')
 
MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-May-11 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\html_form_droplist.pro)


HTML_HEADER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_header

 PURPOSE:
   This functions creates a header for a html file with title and
   some other info

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = HTML_HEADER()

 KEYWORD PARAMETERS:
   TITLE:  string used as title of the page
   LOGO:   file name of logo/centered at top of page
   KEYWORDS: string containing keaywords of this html page
   DESCRIPTION:    string containg the description entry of the head
   PERIODIC_UPDATE: update page to the url given in update_url
   UPDATE_URL: an url to jump to after seconds given in periodic_update
   NO_HRULES:  if this keyword is set no hrules are printed

 OUTPUTS:
   This function returns a string array containing html-code for
   the header of a page

 EXAMPLE:
   see html_example.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-19
   Modified:   T.B. 1998-MAY-12 new keyword NO_HRULES

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_header.pro)


HTML_REPLACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_replace

 PURPOSE:
   This functions replaces html code from string array

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = ASCII2HTML(string)

 INPUTS:
   string:   array

 OUTPUTS:
   String array

 EXAMPLE:
   see html_example.pro and html_example2.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_replace.pro)


HTML_STRUCT_NAMES_AND_HREFS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    html_struct_names_and_hrefs

 PURPOSE:
   This functions returns a javascript function to show a structure as a tree in an html files
   You are able to set hrefs at the tag_name or at the sub_structure level or in combination

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=html_struct_names_and_hrefs(names=names,node_values=node_values,folder_values=folder_values,is_dir=is_dir,recurse=recurse,folder_name=folder_name,level=level,n_counters=n_counters,_extra=extra)

 KEYWORD PARAMETERS:
  names:   a vector of tag_names
  node_values: the target names of the notes
  folder_values: the target names of the folders
  is_dir:  if is set javascript code for directories is written
  recurse: is used by recursion of html_struct_names_and_hrefs
  level:   is used by recursion of html_struct_names_and_hrefs
  n_counters: is used by recursion of html_struct_names_and_hrefs


 EXAMPLE:
   This examples show by generateTree_rb() how the javascript code is generated for the several possiblities of the tree

   names=['A.B','A.C','B','C.A']
   node_values=['1','2','3','4']
   folder_values=['A','C']
   js=html_struct_names_and_hrefs(names=names,node_values=node_values,folder_values=folder_values)

   printtab,js

   function generateTree_rb()
   {
    var aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8
    foldersTree  = folderNode("STRUCT","");
    aux0=foldersTree;
    aux1 = appendChild(aux0, folderNode("A","A"))
    appendChild(aux1, leafNode("B","1"))
    appendChild(aux1, leafNode("C","2"))
    appendChild(aux0, leafNode("B","3"))
    aux1 = appendChild(aux0, folderNode("C","C"))
    appendChild(aux1, leafNode("A","4"))
   }

   names=['A.B','A.C','B','C.A']
   folder_values=['A','C']
   js=html_struct_names_and_hrefs(names=names,folder_values=folder_values)

   printtab,js

   function generateTree_rb()
   {
     var aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8
     foldersTree  = folderNode("STRUCT","");
     aux0=foldersTree;
     aux1 = appendChild(aux0, folderNode("A","A"))
     appendChild(aux1, leafNode("B",""))
     appendChild(aux1, leafNode("C",""))
     appendChild(aux0, leafNode("B",""))
     aux1 = appendChild(aux0, folderNode("C","C"))
     appendChild(aux1, leafNode("A",""))
    }

   names=['A.B','A.C','B','C.A']
   node_values=['1','2','3','4']
   js=html_struct_names_and_hrefs(names=names,node_values=node_values)

   printtab,js
   function generateTree_rb()
   {
     var aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8
     foldersTree  = folderNode("STRUCT","");
     aux0=foldersTree;
     aux1 = appendChild(aux0, folderNode("A",""))
     appendChild(aux1, leafNode("B","1"))
     appendChild(aux1, leafNode("C","2"))
     appendChild(aux0, leafNode("B","3"))
     aux1 = appendChild(aux0, folderNode("C",""))
     appendChild(aux1, leafNode("A","4"))
    }



 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-MAR-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\html_struct_names_and_hrefs.pro)


HTML_TAB_ITEM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_tab_item

 PURPOSE:
   This functions creates a table item in the html format

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = HTML_TAB_ITEM(Item)

 INPUTS:
   Item:   scalar (string, float, double, ....)

 KEYWORD PARAMETERS:
   SMALL:      use small fonts for table entries
   FIXED:      use fixed fonts for table entries
   NOBREAK:    no line breaks in table entries
   FLOAT_FORMAT:    format for double and float

   FORMAT:     is passed to the string function

 OUTPUTS:
   This function returns a string formatted formatted
   for a HTML table item

 EXAMPLE:
   see html_example.pro and html_example2.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-19
   Modified    T.B. Aug 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_tab_item.pro)


HTML_TRAILER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   html_trailer

 PURPOSE:
   This functions creates a trailerheader for a html file

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = HTML_HEADER()

 KEYWORD PARAMETERS:
   EMAIL:  string contining the email of the creator of this page
   NAME:   name of the creator
   UPDATE: if this keyword is set a date will be included
   USERATHOST: if this keyword is set the user ath host will be read from
           environment variables and printed
   DATE:   string containg a date for the update command, if not
           specified, the current date is used

 OUTPUTS:
   This function returns a string array containing html-code for
   the trailer of a page

 EXAMPLE:
   see html_example.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-19
   Modified:           new keyword USERATHOST

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\html_trailer.pro)


HULL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  hull

 PURPOSE:  return the index array of all boundary points of a square array

 USEAGE:   result=hull(nx,ny)

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        31 Aug 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\hull.pro)


HUMIDITY_CONVERSION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   humidity_conversion

 PURPOSE:
   This function converts relative humidities into water vapor pressure,
   water vapor concentrations or dewpoint temperatures and vice versa.

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   Result = HUMIDITY_CONVERSION( )

 OUTPUTS:
   Result:  array with requested data

 KEYWORD PARAMETERS:

   MESSAGE:  if this keyword is set messages will be printed
   RH2WVC:   if this keyword is set conversion to water vapor conc
   RH2WVP:   if this keyword is set conversion to water vapor pressure
   RH2DPT:   if this keyword is set conversion to dew point temp
   WVC2RH:   if this keyword is set conversion from water vapor conc
   WVP2RH:   if this keyword is set conversion from water vapor pressure
   DPT2RH:   if this keyword is set conversion from dew point temp
   TEMPERATURE:    input of t (def: 300K)
   PRESSURE:       input of p (def: 1013mbar)
   REL_HUMIDITY:   input of rh [%]
   DEW_POINT:      input of dewpoint temperature [K]
   DENSITY:
   WATER_CONC:     input of water vapor conc     [cm-3]
   WATER_PRESSURE: input of water vapor pressure [mbar]
   ICE:        if this keyword is set conversion using "OVER ICE" paprameters


 PROCEDURE:
   This function uses the formula
       p(H2O) = EXP( a - b/T )

 EXAMPLE:
   PRINT, humidity_conversion(DEW=299, T=300, P=20, /DPT2RH)
       93.367125

 MODIFICATION HISTORY:
   Written by:     Theo Brauers (ICG-3), 1999-April

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\humidity_conversion.pro)


HYSTAT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        HYSTAT (function)

 PURPOSE:
        Compute atmospheric pressures in hydrostatic equilibrium.
        This function is adapted from the Harvard photochemical
        point model (chem1d).

 CATEGORY:
        Atmospheric Sciences 

 CALLING SEQUENCE:
        pressure = HYSTAT,alt,temp,psurf,g0,rearth

 INPUTS:
        ALT -> Altitude in km. This can be a single value or an array.

        TEMP -> Temperatures corresponding to the altitudes in ALT

        PSURF -> A surface pressure value in mbar. Default is 1013.25 mbar.

        G0 -> acceleration du eto gravity in m/s2. Default is 9.80665 m/s2 .

        REARTH -> Radius of the earth in km. Default is 6356.77 km.

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        none

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        alt = findgen(20)   ; create altitude array 0..19 km
        temp = 205.+(19-alt)*4.  ; a semi-realistic temperature 
                                        ; profile
        press = hystat(alt,temp)        ; compute pressures
        print,press

        ; will print semi-realistic pressures
        1013.25   896.496   791.815   698.104   614.349   539.613
        473.041   413.843   361.298   314.745   273.581   237.254
        205.261   177.146    52.492   130.924   112.098   95.7080
        81.4736   69.1443

 MODIFICATION HISTORY:
        mgs, 21 Aug 1998: VERSION 1.00
        mgs, 21 Dec 1999: - removed double scaling 1e-5*1e5
        mgs, 25 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\hystat.pro)


HY_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       hy_plot

 PURPOSE:
       plot a data set of x and y and a histogram of the y values

 CATEGORY:
       PLOT/MPLOT

 CALLING SEQUENCE:
       PLX_HYPLT, x, y, plx=plx, framepos=fpos

 INPUTS:
       plot structure plx (see jx_init for definition)
       2 arrays in x and y

 OUTPUTS:
       a plot of the data set using the settings in the

 PROCEDURE:
       Uses the build-in histogram function

 REVISION HISTORY:
       Written   Theo Brauers, June 1997
       Corrected F.R. jun 97
       Revised   T.B. Jun 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\hy_plot.pro)


IBILIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IBILIN
 PURPOSE:
       Inverse bilinear interpolation.
 CATEGORY:
 CALLING SEQUENCE:
       ibilin, x, y, xe, ye, a, b
 INPUTS:
       x = array of 4 corner x values.   in
       y = array of 4 corner y values.   in
       xe = x value of desired point.    in
       ye = y value of desired point.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       a = rectangular image x fraction. out
       b = rectangular image y fraction. out
         Fractions not clipped to 0-1.
       flag = flag for point (xe,ye).    out
         1=ok, 0=no point.
 COMMON BLOCKS:
 NOTES:
       Notes: For a rectangular image, if values of some
         field are known at the corners then values at any
         point inside the image may be estimated by bilinear
         interpolation.  The inverse problem, knowing the
         corner values and the value at a desired point, and
         finding the image point is not so straight forward.
         In general, for a single scalar, there may be many
         such image points.  This routine is not that general,
         it is intended for 2-d coordinate conversion.
         Algorithm by Rick Chapman, JHU/APL.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Sep 27

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ibilin.pro)


ICG2_INT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icg2_int

 PURPOSE:
	This procedure is an example how to use ncdf_int for interpolation
   a lot of files

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   icg2_int

 OUTPUTS:
	creates a new file

 EXAMPLE:
   icg2_int

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\icg2_int.pro)


ICGS2MPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs2mplot

 PURPOSE:
	This procedure produces one plot from multiple data sets stored in different ICG structures.

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	icgs2mplot, icgs0 [, icgs1, icgs2, icgs3, icgs4, icgs5]

 INPUTS:
	(1) icgs0: ICG structure

	OR

	(2) icgs0: Structure with the following tags ([] denote optional entries):
			icgs0 =	{STRUCTURE: structure		; icg structure
						 XNAME: xname					; tagname (scalar) of x-axis parameter
						 YNAME: yname					; tagname(s) (scalar or array) of y-axis parameter
						 [INDEX = index]				; Index array of data to be plotted
						 [LTEXT: ltext]				; legend text (scalar or array)
						 [PSYM: psym]					; number of symbol to be used in the plot (scalar or array)
						 [COLOR: color]				; color to be used in the plot (scalar or array)
						 [Y_AT_XPOS: yatx]			; position where the y axis intersects the x axis (scalar or array)
						}

	OR

	(3) Array of pointers to either of these structures

 OPTIONAL INPUTS:
	icgs1 - icgs5: More structures of type (1) or (2) (may be mixed)

 KEYWORD PARAMETERS:
	/XERR: If set x-error bars will be plotted (if available).
	/YERR: If set y-error bars will be plotted (if available).
	Y_AT_XPOS = yatx:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible.
		The default is: yatx = [[0.0], [1.0], [1.25], [-0.25], [1.5], [1.75]]
	/SHARE_YAXIS: If set all data sets will be plotted on the same y axis
		The y range will be chosen such that all data points are plotted.
	Y_ASSIGNMENT = y_assignment: Integer vector assigning the data sets to different
		y axes. E.g. the vector [0, 1, 2, 0, 2] assigns data sets #1 and 4 to the
		1st (left) y axis, data set #2 is assigned to the 2nd (right) y axis, and
		data sets #3 and 5 are assigned to the 3rd y axis.

	The following two keyword parameter apply only if the input structures are
	of type ICG structure:

	XNAME = xname: short name (scalar) of x-axis parameter (default: 'time')
	YNAME = yname: short name (scalar or array) of y-axis parameter.
		If an array of parameter names is provided together with
			- ONE ICG structure then all these parameters are plotted;
			- multiple ICG structures then the 1. parameter name is assigned
				to the 1. structure, and so on.
		If the keyord parameter YNAME is omitted then the first non-time parameter name
		that does not start with a '!' is used.
	/ALL: If set all parameters of the first ICG structure (icgs0) are plotted.
	/VALID: If set only valid data (e.g. icg_struct..param[valid]) are plotted.
		The default is that all non-filled data are plotted.
	/TAG_NAME: If set xname and yname will be interpreted as tag name(s).

	The two following keyword parameters DATE and TIME allow to apply a time filter to the data set.
	DATE = date: scalar or 2-element vector of type string with date(s) of time window:
		'dd.mm.yy' or [dd1.mm1.yy1, dd2.mm2.yy2]
	TIME = time: 2-element vector of type string with time window: ['hh1:mm1:ss1', hh2:mm2:ss2']
			the default is ['00:00:00', '23:59:59']
			If date is a scalar then the resulting time window is ['date time_1', 'date time_2']
			If date is a 2-element vector then the time window is ['date_1 time_1', 'date_2 time_2']

	Any other keyword parameters which are accepted by IDL PLOT and mplot_core

 EXAMPLE:
	x1 = read_enz('O3_Daten.enz')
	x2 = read_enz('Meteo_Daten.enz')

	icgs2mplot, x1, x2

	or

	icgs0 = {STRUCTURE: x1, XNAME: 'Time', YNAME: 'O3', PSYM: 4}
	icgs1 = {STRUCTURE: x2, XNAME: 'Time', YNAME: 'Temp', PSYM: 2}
	icgs2mplot, icgs0, icgs1

	or

	icgs0 = {STRUCTURE: x2, XNAME: 'Time', YNAME: ['Temp_1', 'Temp_2'], PSYM: [4, 2]}
	icgs2mplot, icgs0, /SHARE_YAXIS

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 01.10.1999
	18.10.1999:	Some minor changes:
		- calculation of n_data,
		- handling of one-icg-structure one-y-parameter-name szenarios
		- Subtitle included if keyword parameter date is set.
	19.10.1999:	Three additional tags in input structure: LTEXT, PSYM, COLOR
					Set default of psym and color to different symbols and colors for
					the different data sets.
	21.10.1999:	ICG structures are accepted as input.
	05.11.1999: Added keyword parameter /VALID.
	02.12.1999:	Added keyword parameter /TAG_NAME.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs2mplot.pro)


ICGS2MPLOT2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs2mplot2

 PURPOSE:
	This procedure produces one plot from multiple data sets stored in different ICG structures.

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	icgs2mplot2, icgs0 [, icgs1, icgs2, icgs3, icgs4, icgs5]

 INPUTS:
	(1) icgs0: ICG structure

	OR

	(2) icgs0: Structure with the following tags ([] denote optional entries):
			icgs0 =	{STRUCTURE: structure		; icg structure
						 XNAME: xname					; tagname (scalar) of x-axis parameter
						 YNAME: yname					; tagname(s) (scalar or array) of y-axis parameter
						 [INDEX = index]				; Index array of data to be plotted
						 [LTEXT: ltext]				; legend text (scalar or array)
						 [YTITLE: ytitle]				; title of y axis (scalar or array)
						 [PSYM: psym]					; number of symbol to be used in the plot (scalar or array)
						 [SYMSIZE: symsize]			; size of symbol to be used in the plot (scalar or array)
						 [COLOR: color]				; color to be used in the plot (scalar or array)
						 [LINESTYLE: linestyle]		; linestyle to be used in the plot (scalar or array)
						 [THICK: thick]				; line thickness to be used in the plot (scalar or array)
						 [FACTOR: factor]				; factor which will be applied to the y data (= factor * y_data) (scalar or array)
						 [Y_AT_XPOS: yatx]			; position where the y axis intersects the x axis (scalar or array)
						 [YRANGE: yrange]				; Range of y axis.
						 [YSTYLE: ystyle]				; Style of y axis.
						 [YERR: yerr]					; Error flag (1: plot y-error bars).
						 [XERR: xerr]					; Error flag (1: plot x-error bars).
						 [TEXT: text]					; Text will be written to the plot.
						}

	OR

	(3) Array of pointers to either of these structures

 OPTIONAL INPUTS:
	icgs1 - icgs5: More structures of type (1) or (2) (may be mixed)

 KEYWORD PARAMETERS:
	/XERR: If set x-error bars will be plotted (if available).
	/YERR: If set y-error bars will be plotted (if available).
	Y_AT_XPOS = yatx:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible.
		The default is: yatx = [0., 1., 1.15, -0.15, 1.30, 1.45]
	/SHARE_YAXIS: If set all data sets will be plotted on the same y axis
		The y range will be chosen such that all data points are plotted.
	Y_ASSIGNMENT = y_assignment: Integer vector assigning the data sets to different
		y axes. E.g. the vector [0, 1, 2, 0, 2] assigns data sets #1 and 4 to the
		1st (left) y axis, data set #2 is assigned to the 2nd (right) y axis, and
		data sets #3 and 5 are assigned to the 3rd y axis.

	The following two keyword parameter apply only if the input structures are
	of type ICG structure:

	XNAME = xname: short name (scalar) of x-axis parameter (default: 'time')
	YNAME = yname: short name (scalar or array) of y-axis parameter.
		If an array of parameter names is provided together with
			- ONE ICG structure then all these parameters are plotted;
			- multiple ICG structures then the 1. parameter name is assigned
				to the 1. structure, and so on.
		If the keyord parameter YNAME is omitted then the first non-time parameter name
		that does not start with a '!' is used.
	/ALL: If set all parameters of the first ICG structure (icgs0) are plotted.
	/VALID: If set only valid data (e.g. icg_struct..param[valid]) are plotted.
		The default is that all non-filled data are plotted.
	/TAG_NAME: If set xname and yname will be interpreted as tag name(s).

	The two following keyword parameters DATE and TIME allow to apply a time filter to the data set.
	DATE = date: scalar or 2-element vector of type string with date(s) of time window:
		'dd.mm.yy' or [dd1.mm1.yy1, dd2.mm2.yy2]
	TIME = time: 2-element vector of type string with time window: ['hh1:mm1:ss1', hh2:mm2:ss2']
			the default is ['00:00:00', '23:59:59']
			If date is a scalar then the resulting time window is ['date time_1', 'date time_2']
			If date is a 2-element vector then the time window is ['date_1 time_1', 'date_2 time_2']

	Any other keyword parameters which are accepted by IDL PLOT and mplot_core

 EXAMPLE:
	x1 = read_enz('O3_Daten.enz')
	x2 = read_enz('Meteo_Daten.enz')

	icgs2mplot, x1, x2

	or

	icgs0 = {STRUCTURE: x1, XNAME: 'Time', YNAME: 'O3', PSYM: 4}
	icgs1 = {STRUCTURE: x2, XNAME: 'Time', YNAME: 'Temp', PSYM: 2}
	icgs2mplot, icgs0, icgs1

	or

	icgs0 = {STRUCTURE: x2, XNAME: 'Time', YNAME: ['Temp_1', 'Temp_2'], PSYM: [4, 2]}
	icgs2mplot, icgs0, /SHARE_YAXIS

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 01.10.1999
	18.10.1999:	Some minor changes:
		- calculation of n_data,
		- handling of one-icg-structure one-y-parameter-name szenarios
		- Subtitle included if keyword parameter date is set.
	19.10.1999:	Three additional tags in input structure: LTEXT, PSYM, COLOR
					Set default of psym and color to different symbols and colors for
					the different data sets.
	21.10.1999:	ICG structures are accepted as input.
	05.11.1999: Added keyword parameter /VALID.
	02.12.1999:	Added keyword parameter /TAG_NAME.
	17.01.2000:	Bug removed if no valid data were passed into mplot_core
	24.01.2000:	icgs2mplot2_pass: init_mplot is no longer called.
	26.01.2000:	Removed bug if not all tag (short) names provided are valid.
	27.01.2000:	If !D.NAME = 'PS' symsize will be multiplied by 1.72 to get the same size
		on screen and 'PS' device.
	31.01.2000:	New keyword parameters: XFACTOR, XOFFSET
	09.02.2000:	icgs2mplot2: use icgs_get_index to get indices of data to be plotted.
	09.02.2000:	icgs2mplot2, icgs2mplot2_yass: use set_bit to get ystyle right.
	01.03.2000:	icgs2mplot structure does not need a 'XNAME' or 'YNAME' tag anymore.
	03.03.2000:	Plotting of error bars can now be set individually for each data set.
	15.03.2000:	Default for y_assignment was changed.
	16.03.2000:	Removed bug with default y_assignment
	28.03.2000:	Plotting of x-error bars can now be set individually for each data set.
	29.03.2000: Individual xfactor | xoffset for each data set.
	05.04.2000:	Revisited: Plotting of error bars can now be set individually for each data set.
					Bug removed if time interval bars should be plotted (errorbar is only 0.5 of interval_t)
	13.04.2000: ICGS2MPLOT_YASS: Bug removed if one (ICG) structure with multiple y names was passed in
	14.04.2000:	Removed dangling pointer reference
	12.05.2000:	Removed bug with number of ytitles vs entries in y_assignment
	13.05.2000:	Define yatx different if there are more then two plots
	16.05.2000:	Changed handling of ytitle
	17.05.2000: THICK, SYMSIZE, ...: Returned as scalars if n_datasets = 1
	18.05.2000:	Added keyword parameter INDEX = index
	29.05.2000:	Added TEXT: text to structure definition (see above).

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs2mplot2.pro)


ICGS2PLOT2C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs2plot2c

 PURPOSE:
	This procedure does a x,y plot for a specified parameter in an ICG structure.

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	icgs2plot2c, icg_struc, [x_name,] y_name

 INPUTS:
	icg_struc: ICG structure
	x_name: Short name of X parameter
	y_name: Short name of Y parameter

 KEYWORD PARAMETERS:
	INDEX = index: Index of data to be plotted.
	/XERR: If set x-error bars will be plotted (if available).
	/YERR: If set y-error bars will be plotted (if available).
	/VALID: If set only valid data (e.g. icg_struct..param[valid]) are plotted.
	/TAG_NAME: If set the entry in y_name is interpreted as tag name.
	ERROR = err: If set to a named variable the error status will be returned
		(0: no error, 1: error)

	The two following keyword parameters can be used to apply a filter to the data set.

	DATE = date: scalar or 2-element vector of type string with date(s) of time window:
		'dd.mm.yy' or [dd1.mm1.yy1, dd2.mm2.yy2]
	TIME = time: 2-element vector of type string with time window: ['hh1:mm1:ss1', hh2:mm2:ss2']
			the default is ['00:00:00', '23:59:59']
			If date is a scalar then the resulting time window is ['date time_1', 'date time_2']
			If date is a 2-element vector then the time window is ['date_1 time_1', 'date_2 time_2']
	FILTER = filter

	Any other keyword parameters which are accepted by IDL PLOT and plot_2c.

 EXAMPLE:
	icg_struc = read_ncdf('berlioz.nc')
	icgs2plot2c, icg_struc, 'TIME', 'OH', PSYM = 4

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 21.06.1999
	24.06.1999:	Program now handels FILL_VALUE attribute in ICG structure
	26.07.1999:	Bug removed if structure icg_struc.!GLOBAL.DATASET.TITLE was not defined
	01.10.1999: Added keyword parameter INDEX = index.
	05.11.1999: Added keyword parameter /VALID.
	09.11.1999: Added keyword parameter XTITLE, YTITLE, TITLE.
					Bug removed if FILL_VALUE was 'Not a Number'
	11.11.1999:	Added keyword parameter /SHORTNAME, ERROR = err.
	12.11.1999:	Added keyword parameter FILTER = filter.
	15.11.1999:	Set default of x and y names to short name
					and exchanged keyword parameter SHORTNAME against TAG_NAME
					to indicate that the names are to be interpreted as tag names.
	19.11.1999:	Bug removed if FILLED is not defined.
					Cleaned up index definition.
	07.04.2000:	Bug removed if /XERR or /YERR were set

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs2plot2c.pro)


ICGSYM_DEFINE_SYMBOLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgsym_define_symbols

 PURPOSE:
	This procedure defines several additional plot symbols

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
   icgsym_define_symbols,stelle,psize,xarr,yarr, name=name,[bitmap=bitmap]

 INPUTS:
	stelle: Numbercode for the symbol
	psize:  size of the symbol



 KEYWORD PARAMETERS:
  name:    returns the defined names of the symbols
  symbols: if arg_present it returns the symbol structure


 OUTPUTS:
	xarr:   x Vector array
   yarr:   y Vecor array


 EXAMPLE:
   icgsym_define_symbols,name=name,bitmap=bitmap,stelle,xarr,yarr,psize

 MODIFICATION HISTORY:
 	Written by:	J.Ankenbrand (ICG-1), Date.
                 R.Bauer   14.9.1997 some errors removed
                           15.9.     renamed to icgsym_d
   R.Bauer 1998-Aug-30 Bitmap Code removed
   2000-Feb-18 help changed to call_help
   2000-Jun-06 symbols structure added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icgsym_define_symbols.pro)


ICGSYM_LOAD_SYMBOLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgsym_load_symbols

 PURPOSE:
	This function returns a structure which contains the number, the
	name and the vectors of a plotsymbol.

 CATEGORY:
  PLOT

 CALLING SEQUENCE:
   icgsym_load_symbols,instring=instring.[/ALL],[/zeichnen] ,[PSIZE=psize],[plotsym_struktur=plotsym_struktur]

 INPUTS:
   instring: the name or the number of a plotting symbol

 OPTIONAL INPUTS:
   psize:    the size of the plotting symbol vector

 KEYWORD PARAMETERS:
	all:       you get a structure which contains all plotting symbols
   zeichnen:  plotting all symbols with name and number

 OPTIONAL OUTPUTS:
	plotsym_struktur: a structure variable which contains the number ,
                     the name and the vector array of a plotting
                     symbol, if instring has been set

                     if all has been set it is a  structure variable
                     which contains the numbers , the names and the bitmap
                     arrays of all plotting symbols

 EXAMPLE:

	IDL> icgsym_load_symbols,erg, INSTRING='circle'    ;the structures contains
					           the vector of a circle
	IDL> icgsym_load_symbols,erg,/ALL ;the structures contains the bitmap arrays
                                 of all plotting symbols
	IDL> icgsym_load_symbols,erg,/ZEICHNEN ; shows all plotting symbols with
                                            name and number

 EXAMPLE:
       The  vector arrays are written in a procedure 'plotsym_def.pro',
       which is called by the procedure.


 MODIFICATION HISTORY:
       Written     J. Ankenbrand      20.06.97
                 R.Bauer   14.9.1997 some errors removed
                           15.9 procedure name changed to icgsym
       1998-Apr-07 failure with negative symbols -7 to 0 resolved
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icgsym_load_symbols.pro)


ICGSYM_N

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgsym_n

 PURPOSE:
	This procedure is used to set an additional defined usersymbol.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
	icgsym_n,PSYM,[PSIZE=psize],[thick=thick],[/symhelp] ,[plotsym_str=plotsym_Str]

 INPUTS:
	psym: The number code or name of the symbol

 OPTIONAL INPUTS:
   thick: the linethickness of the symbol
	psize: Size of the plotting symbol in multiples of the default size
	       (default PSIZE=1).  Does not need to be an integer

 OPTIONAL OUTPUTS:
	plotsym_str: a structure variable which contains the number, the name
                and the vector of the symbol, when psym has been set, else
                it contains the numbers , the names
                and an array with the numbers of all existing plotsymbols

 KEYWORD PARAMETERS:
   symhelp:  the routine plots all plotting symbols with number and name

 EXAMPLE:

   x=findgen(10) & y=findgen(20)
   icgsym_n,204
	PLOT,X,Y,PSYM=8

 MODIFICATION HISTORY:
   Written       J.Ankenbrand         June 1997
                 R.Bauer   14.9.1997 some errors removed
                           15.9.    renamed to icgsym_n
                 R.Bauer 18.9. 1997 optional input color removed
                                    because color should be set by plot(xy)*
   2000-Feb-18 help changed to call_help



(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icgsym_n.pro)


ICGS_ANALYSIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icgs_analysis

 PURPOSE:

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:

 INPUTS:


 KEYWORD PARAMETERS:

 EXAMPLE:



 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\icgs_analysis.pro)


ICGS_CONCAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icgs_concat

 PURPOSE:
   This function returns the concatination of two icg_structures

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=icgs_concat(master,[client],[second_dim_name=second_dim_name],[_extra=pkey])

 INPUTS:
  master: an icg_struct including status informations
  if master is a pointer vector icgs_concat is used recursivly.

 OPTIONAL INPUTS:
  client: an icg_struct with the same parameter tag_names as master.
  if master is no pointer client is used too

 KEYWORD PARAMETERS:
  second_dim_name: if master and client are two dimensional this is the name of the second dimension
                   this data is not concatinated

 PROCEDURE:
  At the moment I have not included valid informations for the parameters
  Later on I will add the accumulation for flags too.

  This will be done later.


 EXAMPLE:
 master=read_ncdf('hal_10-JAN-2000_SR.nc',/stat)
 client=read_ncdf('hal_11-JAN-2000_SR.nc')
 master=icgs_concat(master,client,second_dim_name='pressure')
 write_ncdf,'test.nc',master,/ignore_test

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Feb-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icgs_concat.pro)


ICGS_CORRELATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_correlate

 PURPOSE:
	This function computes the Pearson linear correlation and linear regression coefficients
	for two parameters in an ICG structure.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	result = icgs_correlate(icgs [, xname, yname])

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	xname: Short name of x parameter
	yname: Short name of y parameter

	if these parameters are not quoted the 1st and 2nd non-time parameter in icgs will
	be assigned to xname and yname, respectively. If icgs has more than two non-time parameters
	an error message is returned and the program is aborted.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set x_name and y_name are interpreted as tag names.
	INDEX = index: If supplied (long vector) the analysed data are: .tagname.param[index].
		If set to a named but undefined variable the index evaluated by this routine is returned.
	/VALID: If set only valid data are included in the fit (applies only if index is not specified).
	/FIT_EXY: linear regression with fitexy model
	/POLYFIT: linear regression with IDL POLY_FIT routine (unweighted least-square linear fit).
	/SWAP_XY: If set the entries for x and y are swapped (applies only if /POLYFIT is set).
	TOLERANCE = Tol (fitexy keyword): desired accuracy of minimum & zero location, default=1.e-3.
	/SPEARMAN: If set the Spearman's (rho) rank correlation is calculated.
	/KENDALL: If set the Kendalls's (tau) rank correlation is calculated.
	YFIT = yfit: If set to a named variable the calculated y values are returned.

	/MPLOT: If set a plot will be generated.
	/SHARE_AXIS_RANGE: If set the x and y axis will cover the same axis range.
	/ERRORBARS: If set error bars will be plotted.
	/NO_PARAMETERS: If set no parameters will be printed on the plot.
	/NO_STAMP: If set no stamp will be printed on PS plot.
	/DONT_CLOSE_DEVICE: If set the plot device will not be closed and
		the original setting of system variables will not be restored.
	BOX = 0: Set this keyword parameter to suppress the box around the text output.
	T_CHARSIZE = t_charsize: If set to a float number the charsize of the text output
		will be changed by this factor (default: 1.0).
	T_COLOR = t_color: Color of text output (default: !P.COLOR).
	L_COLOR = l_color: Color of regression line.
	/PSFLAG: If set plot will go to a PS file.
	PSFILE = psfile: Name of the PS file (default: 'icgs_correlate.ps', if the
		environment variable PSDIR is defined the default is $PSDIR$\icgs_correlate.ps)

	If margins are specified via XMARGIN = xmargin and / or YMARGIN = ymargin
	they should be quoted in fraction of the device width and height.
	The routine excepts more keyword parameters via its _EXTRA = e parameter.

 OUTPUTS:
	This function returns a structure of the following type:

   X               STRING		:	Short name of x parameter
   Y               STRING		:	Short name of y parameter
   N               LONG		:	Number of data in the fit
   R               DOUBLE    :	Correlation coefficient
   SIGNIFICANCE    FLOAT		:	Significance of r for rank correlation (Spearman, Kendal)
   ERROR           INT			:	Error flag (=0: no error)
   FIT_EXY         STRUCT		:	Data of fitexy fit
   POLYFIT         STRUCT		:	Data of POLY_FIT
   POLYFIT_SWAPXY  STRUCT		:	Data of POLY_FIT with swapped x and y axes

 FIT_EXY:
   INTERCEPT_A     DOUBLE		:	Intercept of linear regression line
   SLOPE_B         DOUBLE		:	Slope of linear regression line
   SIGMA_A         DOUBLE		:	Error of intercept
   SIGMA_B         DOUBLE		:	Error of slope
   CHI_SQ          DOUBLE		:	Minimum Chi^2 of linear fit
   Q               DOUBLE		:	Quality-of-fit parameter (0-1). Probability that
		   								a correct model would give a value equal or larger than the
			   							observed chi squared. A small value of q indicates a poor
				  							fit, perhaps because the errors are underestimated.

 POLYFIT, POLYFIT_SWAPXY:
   INTERCEPT_A     DOUBLE		:	Intercept of linear regression line
   SLOPE_B         DOUBLE		:	Slope of linear regression line
   SIGMA_A         DOUBLE		:	Error of intercept
   SIGMA_B         DOUBLE		:	Error of slope
   CHI_SQ          DOUBLE		:	Minimum Chi^2 of linear fit
   COVAR           DOUBLE		:	Covariance of A and B (only POLYFIT)
   CC              DOUBLE		:	Correlation coefficient of A and B (only POLYFIT)

 PROCEDURE:
	See fitexy.pro, IDL Online Help: CORRELATE, R_CORRELATE, POLY_FIT

 EXAMPLE:
	a = read_ncdf('hcho_data.nc')
	fit = icgs_correlate(a, 'HCHO (DOAS)', 'HCHO (Hantzsch)', /VALID, /FIT_EXY)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 07.02.2000
	11.02.2000: Bug removed if x_sigma or y_sigma are not defined
					Changed keyword parameter /NO_ERRORBARS to /ERRORBARS
						so that the default is that no error bars are plotted.
					New keyword parameter /DONT_CLOSE_DEVICE
					Extra keyword parameters passed into icgs_correlate are handled
						via _REF_EXTRA = e
	14.02.2000:	icgs_correlate_mplot: keyword parameters XMARGIN and YMARGIN
		added to the definition of the procedure.
	16.02.2000:	xname and yname are now optional input parameters.
	17.02.2000:	Adapted code to new version of get_tag_and_short_names.
	19.02.2000: New keyword parameters T_COLOR, L_COLOR
	22.02.2000: Program makes use of system variable PSDIR
	24.03.2000:	Bug removed (parameter thick in call to oplot must be scalar)
					Bug removed ('factor' must be scalar in calculation of yop)
	05.04.2000: Bug removed ('xfactor' must be scalar in calculation of yop)
	13.04.2000:	Bug removed in plot if INDEX was provided.
	17.04.2000: Function returns covariance and correlation coefficient for
              POLYFIT fit parameters.
					Bug removed in error calculation of fit (x = a + b*y) parameters.
	18.04.2000:	Changed text output on plot
	09.05.2000:	New keyword parameter FZJ-Logo
	25.05.2000:	Added parameter Chi^2 to POLYFIT parameters.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_correlate.pro)


ICGS_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_filter

 PURPOSE:
	This function applies a user defined filter to data in an ICG structure
	and returns the resulting index vector

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = icgs_filter(icg_struc, filter_string)

 INPUTS:
	icg_struc: ICG structure
	filter_string: A string with the user-defined filter of the following syntax:

		'  '

		Allowed relational operators are: EQ, NE, GE, GT, LE, LT
		If test value is of type string it must not be put into ''

		Some examples:
		'Untergrund GE 1200.' or 'Spiegelposition EQ 2' or 'Filename EQ D2079806'

		Multiple of these strings can be combined using the boolean operators
		AND, OR, XOR, or NOT (e.g. 'Untergrund GE 1200. AND Spiegelposition EQ 2')
		as well as parenthesis.

		The relational as well as the boolean operators have to be entered in capital letters.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set name entries in filter_string will be interpreted as tag names
	/VALID: If set only valid data records of the test parameter will be subject to to
		the filter condition. The default is that all non-filled data records of test param
		will be subject to the filter.
	/VERBOSE: If set the single steps of the filter_string evaluation are printed to the screen

 OUTPUTS:
	This function returns the index vector of all data records which obey to the
	filter condition.

 RESTRICTIONS:
	Filter_string must not include the ~ character

 EXAMPLE:
	icgs = read_enz('S:\links\idl_source\easy\data\examples\example1\example1.cs', /EASY, /NO)

	plot without filter:
		icgs_plot, icgs, 'Time', ['A_0', 'B_0', 'C_0'], XMARGIN = [10, 15], KEY = 3, /TAG_NAME

	plot with filter:
		icgs_plot, icgs, 'Time', 'B_0', FILTER = 'C_0 GT 4000 OR A_0 GT 4000', /TAG_NAME

	see also ex_icgs_filter

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 12.11.1999
	15.11.1999:	Set default of parameter name in filter_string to short name
					and exchanged keyword parameter SHORTNAME against TAG_NAME
					to indicate that the names are to be interpreted as tag names.
	30.11.1999:	Bug removed if TAG 'FILLED' was not defined.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_filter.pro)


ICGS_GET_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_get_data

 PURPOSE:
	This function returns the param vector from an ICG structure for a given short name.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = icgs_get_data(icgs, short_name)

 INPUTS:
	icgs: ICG structure
	short_name: (scalar) short name in ICG structure or positional index of
		tag (with short_name) in ICG structure.

 KEYWORD PARAMETERS:
	STDEV = stdev: If set to a named variable the stdev vector of short_name is returned (if defined).
	INDEX = index: If set to a named variable the positional index of short_name in icgs is returned.
		If short_name is not found: index = -1 (can be used as error condition).
	/TAG_NAME: If set short_name is interpreted as tag name.
	/VERBOSE: If set a warning message is issued if short_name is not defined in icgs.

 OUTPUTS:
	This function returns the param vector of short_name.
	If short_name is not found !VALUES.F_NAN is returned.

 EXAMPLE:
	a = read_ncdf('hcho_data.nc')
	data = icgs_get_data(a, 'HCHO (DOAS)', STDEV = stdev)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 04.02.2000
	08.02.2000:	Added the option to pass positional index of tag (with short_name)
		instead of short_name to identify the parameter in the ICG structure.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_get_data.pro)


ICGS_GET_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_get_index

 PURPOSE:
	This function returns the index vector of all non-fill-value elements of icgs.tagname.param.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = icgs_get_index(icgs, short_name)

 INPUTS:
	icgs: ICG structure
	short_name: (scalar) short name in ICG structure or positional index of
		tag (with short_name) in ICG structure.

 KEYWORD PARAMETERS:
	/VALID: If set the valid-data index is returned which accounts for
		fill_value, missing_value, quality, valid_min, valid_max.
	INDEX = index: If set to a named variable the positional index of short_name in icgs is returned.
		If short_name is not found: index = -1 (can be used as error condition).
	/TAG_NAME: If set short_name is interpreted as tag name.
	/VERBOSE: If set a warning message is issued if short_name is not defined in icgs.

 OUTPUTS:
	This function returns the index vector of non-fill-value elements of icgs.tagname.param.
	If short_name is not found -1 is returned.

 EXAMPLE:
	a = read_ncdf('hcho_data.nc')
	data = icgs_get_index(a, 'HCHO (DOAS)')

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 03.02.2000
	08.02.2000:	Added the option to pass positional index of tag (with short_name)
		instead of short_name to identify the parameter in the ICG structure.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_get_index.pro)


ICGS_MEAN_DC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_mean_dc

 PURPOSE:
	This function returns the mean diurnal cycle of a parameter stored in an ICG structure.

 CATEGORY:
	ICG_STRUCT/MATH

 CALLING SEQUENCE:
	result = icgs_mean_dc(icgs [, name])

 INPUTS:
	icgs: ICG structure.

 OPTIONAL INPUTS:
	name: short name of parameter in ICG structure (scalar or array).
		If not provided all parameters will be suject to the analysis.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set name is interpreted as tag name.
	TIME_STEP = ts: averaging time window in seconds (default: 3600D0).
	FIRST_DAY = fd: dd.mm.yy - Date of first day to be considered
		(default: first day in data set).
	LAST_DAY = ld: dd.mm.yy - Date of last day to be considered
		(default: last day in data set).
	/EXCLUDE: If set the specified time range will be excluded.
	/MEDIAN: If set the median is returned instead of the sample mean.

	/MPLOT: If set a plot will be generated.
	/XERRORBARS: If set x error bars (averaging interval) will be plotted.
	/YERRORBARS: If set y error bars (standar deviation of sample population around mean)
		will be plotted.
	/NO_STAMP: If set no stamp will be printed on PS plot.
	/DONT_CLOSE_DEVICE: If set the plot device will not be closed and
		the original setting of system variables will not be restored.
	/PSFLAG: If set plot will go to a PS file.
	PSFILE = psfile: Name of the PS file (default: 'icgs_correlate.ps', if the
		environment variable PSDIR is defined the default is $PSDIR$\icgs_correlate.ps)

	If margins are specified via XMARGIN = xmargin and / or YMARGIN = ymargin
	they should be quoted in fraction of the device width and height.
	The routine excepts more keyword parameters via its _EXTRA = e parameter.

 OUTPUTS:
	This functions returns an ICG structure with the time averaged data.

 EXAMPLE:
	a = read_ncdf('berlioz_o3.nc')
	b = icgs_mean_dc(a, 'O3', /MPLOT)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 22.02.2000
	03.03.2000: Bug removed (mean was returned if keyword flag /MEDIAN was set and vice-versa)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_mean_dc.pro)


ICGS_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_plot

 PURPOSE:
	This procedure makes a single or multiple parameter plot of an ICG structure

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	icgs_plot, icg_struc, [x_name,] y_name

 INPUTS:
	icg_struc: ICG structure
	y_name: Scalar or array to short names of Y parameters

 OPTIONAL INPUTS:
	x_name: Short name of X parameter	(default: 'Time'; specify 'NONE' for x_name
		if you want to plot y against its array element index.)

 KEYWORD PARAMETERS:
	/VALID: If set only valid data (e.g. icg_struct..param[valid]) are plotted.
	/TAG_NAME: If set the entries in y_name are interpreted as tag names.
	/XERR: If set x-error bars will be plotted (if available).
	/YERR: If set y-error bars will be plotted (if available).
	Y_AT_XPOS = yatx:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible.
		The default is: yatx = [0., 1., 1.20, -0.20, 1.40, 1.6]
	/SHARE_YAXIS: If set all data sets will be plotted on the same y axis
		The y range will be chosen such that all data points are plotted.
	Y_ASSIGNMENT = y_assignment: Integer vector assigning the data sets to different
		y axes. E.g. the vector [0, 1, 2, 0, 2] assigns data sets #1 and #4 to the
		1st (left) y axis, data set #2 is assigned to the 2nd (right) y axis, and
		data sets #3 and #5 are assigned to the 3rd y axis.
	/ALL: If set all (numeric, 1-d) parameters of the ICG structure are plotted.
	LEGEND_TEXT = legt: String array with as many elements as there are data sets in the plot.
		If specified the entries in this array are used as legend text (default: y_name's).
	/NO_LEGEND: If set plotting of the legend is suppressed.
	KEY = key: Specifies position of the legend:
		key = 0: on right side outside plot area (default)
		key = 1(2): upper left (right) corner within plot area
		key = 3(4): lower left (right) corner within plot area

	Any other keyword parameters which are accepted by the IDL PLOT and plot_2c procedure.

 OPTIONAL OUTPUTS:
	X_OFFSET = xoff: If set to a named variable the offset of the time series data will be returned.

 EXAMPLE:
	icgs = read_enz('S:\links\idl_source\easy\data\examples\example1\example1.cs', /EASY, /NO)
	icgs_plot, icgs, 'Time', 'A_0', /TAG_NAME
	icgs_plot, icgs, 'Time', ['A_0', 'B_0', 'C_0'], XMARGIN = [10, 15], KEY = 3, /TAG_NAME
	icgs_plot, icgs, 'Time', ['A_0', 'B_0', 'C_0'], XMARGIN = [15, 10], KEY = 3, /SHARE_YAXIS, /TAG_NAME
	icgs_plot, icgs, 'Time', /ALL, XMARGIN = [15, 10], KEY = 3, /SHARE_YAXIS, /TAG_NAME
	icgs_plot, icgs, 'Time', ['A_0', 'B_0', 'C_0'], XMARGIN = [15, 10], KEY = 3, Y_ASSIGN = [0, 1, 0], /TAG_NAME

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 11.11.1999
	15.11.1999:	Set default of x and y names to short name
					and exchanged keyword parameter SHORTNAME against TAG_NAME
					to indicate that the names are to be interpreted as tag names.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_plot.pro)


ICGS_SLICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_slice

 PURPOSE:
	This function returns a subset of an ICG structure based on a record index.

 CATEGORY:
	ICG_STRUCT/MATH

 CALLING SEQUENCE:
	result = icgs_slice(icgs, index [, name])

 INPUTS:
	icgs: ICG structure.
	index: Record index vector.

 OPTIONAL INPUTS:
	name: short name of parameter in ICG structure (scalar or array).
			If provided only these parameters will be included in the returned ICG struct.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set name is interpreted as tag name.
	/EXCLUDE: specified (record) index is excluded from returned data set.

 OUTPUTS:
	This functions returns an ICG structure which is part of the input ICG structure.

 EXAMPLE:
	a = read_ncdf('berlioz_o3.nc')
	b = icgs_slice(a, icgs_filter(a, 'O3 GT 10'))

	b is a subset of a with data only for O3 > 10 ppb.

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 14.02.2000
	18.02.2000: Optional input parameter 'name' added.
	25.02.2000: Removed bug if empty index vector was passed (-1).
	08.03.2000: Bug removed (IF cvd EQ ''). cvd may be an array and is never empty.
	16006.2000:	Bug removed if name is not a valid short or tag name

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_slice.pro)


ICGS_STAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_stat

 PURPOSE:
	This function returns the statistics of parameters in an ICG structure

 CATEGORY:
	ICG_STRUCT/MATH

 CALLING SEQUENCE:
	result = icgs_stat(icgs [, param_name])

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	param_name: string scalar or array of short names in ICG structure
		If not provided the statistics of all parameters are returned.

 KEYWORD PARAMETERS:
	INDEX = index: Vector with indices of data records which will be
		subject to the statistical analysis.
	FILTER = filter: String with filter condition for data (see icgs_filter.pro).
	/TAG_NAME: If set param_name will be interpreted as tag name(s).
	/VALID: If set only valid data records of param_name will be subject to the
		statistical analysis. The default is that all non-filled data records
		will be subject to the statistical analysis.
	/NO_TIME: If no parameter names are provided and NO_TIME is set the parameter 'time'
		will not be subject to the statistical analysis.

 OUTPUTS:
	This function returns a structure with the following tags:
		NAME: param_name
		TYPE: type
		N_DIM: number of dimensions
		DIM: dimensions
		N: N_ELEMENTS(data)
		FILTER: filter
		MEAN: MEAN(data)
		STDEV: STDDEV(data)
		STERR: STDDEV(data) / SQRT(N)
		MEDIAN: MEDIAN(data)
		MAX: MAX(data)
		MIN: MIN(data)

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 29.11.1999
	07.03.2000:	Index is now found by call to icgs_get_index.pro
	17.03.2000:	Minor bug removed.
	13.04.2000:	Added tag 'sterr' to returned structure (= standard error of mean)
	16.04.2000: Added keyword parameter NO_TIME
	05.06.2000:	Removed bug if param_name was not provided
	16.06.2000:	Removed bug if index is scalar

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_stat.pro)


ICGS_TIMESHIFT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icgs_timeshift

 PURPOSE:
   This function computes the linear correlation between two time series
   as a function of a time shift between the two data sets.

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   result = icgs_timeshift(master, client [, names])

 INPUTS:
   master: ICG structure whose time data defines the time grid
   client: ICG structure whose time data are shifted.

 OPTIONAL INPUTS:
   names: Short names of master and client parameters.

   if this parameter is not provided the 1st (and only) non-time parameter in master and
   client will be assigned to names[0] and names[1], respectively. If either master or client
   has more than one non-time parameter an error message is issued and the program is aborted.

 KEYWORD PARAMETERS:
   /TAG_NAME: If set x_name and y_name are interpreted as tag names.
   /VALID: If set only valid data are included in the fit (applies only if index is not specified).
   TIME_STEP = time_step: Time resolution of the shift process. (Integer scalar)
   LAG = lag: Integer vector who, when multipled with time step, yields the vector
       with time shift data (default: [-16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16])
   ADD2CLIENT_TIME = add2client_time: Additional offset which will be added to client time.

   Keyword parameters to set conditions of the time series synchronization:
   /LINEAR_INTERPOLATION: If set data gaps in client will be filled with interpolated values.
   /LINEAR_WITH_LIMIT: If set data gaps in client will be filled with interpolated values
       as long as the corresponding time interval is smaller than interpol_limit.
   INTERPOL_LIMIT = interpol_limit: Set this keyword parameter to an upper limit for the
       time distance between to data points which will used for the interpolation.

   /MPLOT: If set a plot will be generated.
   /SHARE_AXIS_RANGE: If set the x and y axis will cover the same axis range.
   /NO_STAMP: If set no stamp will be printed on PS plot.
   /NO_PARAMETERS: If set no parameters will be printed on the plot.
   /DONT_CLOSE_DEVICE: If set the plot device will not be closed and
       the original setting of system variables will not be restored.
   /PSFLAG: If set plot will go to a PS file.
   PSFILE = psfile: Name of the PS file (default: 'icgs_timeshift.ps', if the
       environment variable PSDIR is defined the default is $PSDIR$\icgs_timeshift.ps)

   If margins are specified via XMARGIN = xmargin and / or YMARGIN = ymargin
   they should be quoted in fraction of the device width and height.
   The routine excepts more keyword parameters via its _EXTRA = e parameter.

 OUTPUTS:
   This function returns a structure of the following type:

   MASTER             STRING    : Short name of master parameter
   CLIENT             STRING    : Short name of client parameter
   TIME_SHIFT         FLOAT     : Time shift at highest correlation
   R                  FLOAT     : Correlation coefficient to time_shift
   TIME_STEP          DOUBLE    : Time step (in sec) used for initialization
   TIME_ADDED2CLIENT  DOUBLE    : Additional offset added to client time.
   TSHIFT_DATA        DOUBLE    : Array with time shift data.
   R_DATA             FLOAT     : Array with correlation coefficients.
   N                  LONG      : Array with number of elements for each run.
   ERROR              INT       : Error flag: 0 is ok.

 PROCEDURE:
   After time synchonization the Pearson linear correlation coefficient is calculated.

 EXAMPLE:
   master = read_ncdf('hcho_doas.nc')
   client = read_ncdf('hcho_htzs.nc')
   result = icgs_timeshift(master, client, ['HCHO (DOAS)', 'HCHO (Hantzsch)'], /VALID, /MPLOT)

 MODIFICATION HISTORY:
   Written by: Frank Holland, 15.02.2000
   17.02.2000: names is now an optional input parameter.
   19.02.2000: Bug removed with index calculation
   22.02.2000: Error in header removed.
   23.02.2000: Bug removed, if correlation coefficient was negative.
   10.05.2000: Bug removed, if arguments of CORRELATE were scalars (TB).

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_timeshift.pro)


ICGS_TIME_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_time_filter

 PURPOSE:
	This function returns an index into an ICG structure based on certain time criteria

 CATEGORY:
	ICG_STRUCT/MATH

 CALLING SEQUENCE:
	result = icgs_time_filter(icgs [, date])

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	date:	EITHER: time window quoted as a string (see below)
			OR: 2-element vector specifying the time window in Js
			(default: the complete time range covered by icgs)

			If quoted as a string allowed entries for the time window are:

			'dd.mm.yy' 								(the program will expand this entry to the time window
														 ['dd.mm.yy 00:00:00', 'dd.mm.yy 23:59:59'])

			['dd1.mm1.yy1', 'dd2.mm2.yy2']	(the program will expand this entry to the time window
														 ['dd1.mm1.yy1 00:00:00', 'dd2.mm2.yy2 23:59:59'])

			['dd1.mm1.yy1 hh1:mm1:ss1', 'dd2.mm2.yy2 hh2:mm2:ss2']

 KEYWORD PARAMETERS:
	TIME = time: 2-element vector of type string with time-of-day window:
		['hh1:mm1:ss1', hh2:mm2:ss2']

		If specified the returned index satisfies both conditions:
		(1) data are within the time window 'date'.
		(2) data (for each day) are within the time-of-day window 'time'.

	/EXCLUDE: data within the specified time window 'date' (and optional 'time')
		are excluded from the returned index.
	TWINDOW = tw: If set to a named variable the time window which was applied to the
		data is returned as a string ('dd1.mm1.yy1 hh1:mm1:ss1 - dd2.mm2.yy2 hh2:mm2:ss2')

 OUTPUTS:
	This functions returns an index into an ICG structure.

 EXAMPLE:
	o3_icgs = read_ncdf('berlioz_o3.nc')

	time_ind = icgs_time_filter(o3_icgs, '21.07.98')

	time_ind is an index vector pointing to data records within o3_icgs which have a
		time tag in the time window ['21.07.98 00:00:00', '21.07.98 23:59:59']

	time_ind = icgs_time_filter(o3_icgs, TIME = ['10:00:00', '12:00:00'])

	time_ind is an index vector pointing to data records within o3_icgs which have a
		time tag in the time-of-day window ['10:00:00', '12:00:00']

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 08.03.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_time_filter.pro)


ICGS_TIME_SLICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	icgs_time_slice

 PURPOSE:
	This function returns a subset of an ICG structure wich is defined by
	a certain time interval.

 CATEGORY:
	ICG_STRUCT/MATH

 CALLING SEQUENCE:
	result = icgs_time_slice(icgs [, date])

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	date:	EITHER: time window quoted as a string (see below)
			OR: 2-element vector specifying the time window in Js
			(default: the complete time range covered by icgs)

			If quoted as a string allowed entries for the time window are:

			'dd.mm.yy' 								(the program will expand this entry to the time window
														 ['dd.mm.yy 00:00:00', 'dd.mm.yy 23:59:59'])

			['dd1.mm1.yy1', 'dd2.mm2.yy2']	(the program will expand this entry to the time window
														 ['dd1.mm1.yy1 00:00:00', 'dd2.mm2.yy2 23:59:59'])

			['dd1.mm1.yy1 hh1:mm1:ss1', 'dd2.mm2.yy2 hh2:mm2:ss2']

	name: short name of parameter in ICG structure (scalar or array).
			If provided only these parameters will be included in the returned ICG struct.

 KEYWORD PARAMETERS:
	TIME = time: 2-element vector of type string with time-of-day window:
		['hh1:mm1:ss1', hh2:mm2:ss2']

		If specified the returned data set satisfies both conditions:
		(1) data are within the time window 'date'.
		(2) data (for each day) are within the time-of-day window 'time'.

	/EXCLUDE: data within the specified time window 'date' (and optional 'time')
		are excluded from the returned data set.
	TWINDOW = tw: If set to a named variable the time window which was applied to the
		data is returned as a string ('dd1.mm1.yy1 hh1:mm1:ss1 - dd2.mm2.yy2 hh2:mm2:ss2')
	INDEX = ind: If set to a named variable the data record index is returned.
		If no data were identified in the specified time window then -1 is returned
		(this can be used as an error flag).
	NAME = name: short name of parameter in ICG structure (scalar or array).
		If provided only these parameters will be included in the returned ICG struct.
	/TAG_NAME: If set name is interpreted as tag name.

 OUTPUTS:
	This functions returns an ICG structure.

 EXAMPLE:
	o3_icgs = read_ncdf('berlioz_o3.nc')

	to3_icgs = icgs_time_slice(o3_icgs, '21.07.98')

	to3_icgs is a subset of all data records of o3_icgs which have a
		time tag in the time window ['21.07.98 00:00:00', '21.07.98 23:59:59']

	to3_icgs = icgs_time_slice(o3_icgs, TIME = ['10:00:00', '12:00:00'])

	to3_icgs is a subset of all data records of o3_icgs which have a
		time tag in the time-of-day window ['10:00:00', '12:00:00']

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 28.01.2000
	14.02.2000:	Category changed.
	16.02.2000:	Implemented the possibility to pass a time window (date) as a two-element
					double vector (Js) into the routine.
	24.02.2000: Optional input parameter 'name' added. Optional input parameter 'time' was
					changed to keyword parameter TIME = time
	25.02.2000:	Additional keyword parameter INDEX = index
	03.03.2000:	If statement removed
	08.03.2000:	Code rewritten to take advantage of the routine icgs_time_filter
					!!!THE MEANING OF THE INPUT PARAMETERS HAS BEEN CHANGED. SEE HEADER!!!
	10.03.2000:	Header editiert
	13.03.2000:	History output changed.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\icgs_time_slice.pro)


ICG_STRUCT2STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icg_struct2struct

 PURPOSE:
   The result of this function is a smart structure only parameters

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=icg_struct2struct(icg_struct)

 INPUTS:
   icg_struct: the defined ICG data structure

 EXAMPLE:
  a=icg_struct2struct(read_ncdf('ghost.nc'))

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-11
   2000-Feb-17 Because of idl5.3 it is not longer possible to use @ in a tag definition.
               This behaviour was in earlier versions a bug.
               Therefore I have changed the @ into $.
       2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icg_struct2struct.pro)


ICG_STRUCT2V_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icg_struct2v_struct

 PURPOSE:
   The result of this function is a v_struct

 CATEGORY:
  ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=icg_struct2v_struct(icg_struct)

 INPUTS:
   icg_struct: the defined ICG data structure

 EXAMPLE:
  a=icg_struct2v_struct(read_ncdf('ghost.nc'))

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-11
   2000-Feb-17 Because of idl5.3 it is not longer possible to use @ in a tag definition.
               This behaviour was in earlier versions a bug.
               Therefore I have changed the @ into $.
       2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icg_struct2v_struct.pro)


ICG_STRUCT4V_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   icg_struct4v_struct

 PURPOSE:
   This function is used to handle the icg_Struct by  x_v_struct

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=icg_struct4v_struct(icg_struct,[_extra=pkey])

 INPUTS:
   icg_struct: the defined ICG data structure

 KEYWORD PARAMETERS:
   _extra:  to submit keywords to x_vstruct

 EXAMPLE:
  a=icg_struct4v_struct(read_ncdf('ghost.nc'))

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-11
       2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icg_struct4v_struct.pro)


ICG_STRUCT_IDX

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   icg_struct_idx

 PURPOSE:
   The result of this function is a subset of the icg_struct by index. Index could be used to sort icg_struct param too.

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=icg_struct_idx(icg_struct,index)

 INPUTS:
   icg_struct: the defined ICG data structure
   index:      the index vector

 EXAMPLE:
  result=icg_struct_idx(icg_struct,index)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Aug-10
   1999-Nov-06 help added
   2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icg_struct_idx.pro)


ICG_STRUCT_PARAM_VALID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    icg_struct_param_valid

 PURPOSE:
   This function returns the valid information arrays for one parameter short_name of the ICG data_structure

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=icg_struct_param_valid(icg_struct,short_name)

 INPUTS:
  icg_struct: the defined icg data structure
  short_name: the short_name of one parameter

 EXAMPLE:
  valid_struct=icg_struct_param_valid(icg_Struct,'F12')

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Sep-30

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\icg_struct_param_valid.pro)


ICG_TS_SYNC

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   icg_ts_sync

 PURPOSE:
   This function adds new time synchronized entries to the master structure

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = ICG_TS_SYNC(master, client [, names])

 INPUTS:
   Master:  ICG structure including master time
   Client:   ICG structure including client time

 OPTIONAL INPUTS:
   names: parameter short names in client to be syncronized

 KEYWORD PARAMETERS:
   see time_series_sync
   /TAG_NAME: If set names is interpreted as tag name.
   /VALID: If set time synchronization is only applied to valid client data.
   /UPDATE_HISTORY: If set time_series_sync information will be written to the
      history of the returned ICG structure.

 OUTPUTS:
   This function returns an updated ICG structure

 EXAMPLE:
   a=read_enz('a1.enz')
   b=read_enz('b1.enz')
   c=icg_ts_sync(a,b, /WINDOW_AVERAGE)
   help, c, /STR

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-Jul
   Modified    Reimar Bauer, 1999-Oct  names, tag_names, valid_param
   18.11.1999: Deleted entries for VALID_MIN and VALID_MAX in resulting structure.
   Modified    Theo Brauers Reimar Bauer
   2000 jan 7: missing value from input structure
   2000 feb 7: optional fill value from input structure
   2000 feb 7: remove missing value from output struct
   15.02.2000: New keyword parameter /TAG_NAME (FH)
   17.02.2000: Missing value of client data will be chosen from (in that order):
               client.missing_value, client.fill_value, fill_value (for output)
   28.02.2000: New keyword parameter /VALID
   10.03.2000: Added keyword parameter /UPDATE_HISTORY. Added more time_series_sync
               keyword parameters to the definition statement of icg_ts_sync.

   31.03.2000: del_tag replaced by delete_tag
               einige create_struct Befehle zusammengefasst

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\icg_ts_sync.pro)


IEEE_TO_HOST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IEEE_TO_HOST
 PURPOSE:
	Translate an IDL variable from IEEE-754 to host representation 
 EXPLANATION:
	The variable is translated from IEEE-754 (as used, for
	example, in FITS data ), into the host machine architecture.

 CALLING SEQUENCE:
	IEEE_TO_HOST, data, [ IDLTYPE = , ]

 INPUT-OUTPUT PARAMETERS:
	data - any IDL variable, scalar or vector.   It will be modified by
		IEEE_TO_HOST to convert from IEEE to host representation.  Byte 
		and string variables are returned by IEEE_TO_HOST unchanged

 OPTIONAL KEYWORD INPUTS:
	IDLTYPE - scalar integer (1-9) specifying the IDL datatype according
		to the code given by the SIZE function.     This keyword
		is usually when DATA is a byte array to be interpreted as
		another datatype (e.g. FLOAT).

 EXAMPLE:
	A 2880 byte array (named FITARR) from a FITS record is to be 
	interpreted as floating and converted to the host representaton:

	IDL> IEEE_TO_HOST, fitarr, IDLTYPE = 4     

 METHOD:
	The BYTEORDER procedure is called with the appropriate keyword

 RESTRICTION:
	Assumes the IDL version is since 2.2.2 when the /XDRTOF keyword 
	became available to BYTEORDER.    There were two bad implementations
	in BYTEORDER for double precision: (1) in IDL V3.* for DecStations
	(!VERSION.ARCH = 'mipsel') and (2) on Dec Alpha OSF machines prior to
	IDL V4.0.1b.   IEEE_TO_HOST works around these cases by swapping bytes 
	directly.

 MODIFICATION HISTORY:
	Written, W. Landsman   Hughes/STX   May, 1992
	Fixed error Case statement for float and double   September 1992
	Workaround to /XDRTOD problem on DecStations January 1993 
	Assume since Version 2.2, correct double precision problems in 
	Alpha/OSF, implement Ultrix corrections from Tom McGlynn November 1994
	Added support for double precision complex   July 1995
	Workaround for BYTEORDER, /FTOXDR bug in VAX VMS V4.0  August 1995 
	Alpha/OSF problems fixed after V4.0.1b    August 1997
	Don't change double scalars to 1 element arrays November 1997
	Under VMS check for IEEE -0.0 values   January 1998
       Add new data types available in IDL 5.x, C. Markwardt, July 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\ieee_to_host.pro)


IGAMMA_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		IGAMMA_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates the incomplete gamma function.  Replacement for the IDL
		IGAMMA function which accepts only real input.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = IGAMMA_MM (X, A [,EPS ] [,/COMPLEMENTARY ])
 INPUTS:
	X
		Numeric, otherwise arbitrary.
	A
		Numeric scalar, non-complex, positive.
 OPTIONAL INPUT PARAMETERS:
	EPS
		Specifies precision level.  Default is machine precision.
 KEYWORD PARAMETERS:
	/COMPLEMENTARY
		Switch.  If set, 1 - IGAMMA(X) is returned.
 OUTPUTS:
		Returns the incomplete gamma function of x, unless /COMPLEMENTARY is
		set in which case returns 1 - the incomplete gamma function.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		For reasons having to do with machine limits on sizes of numbers, the
		parameter A cannot be too big.  The limit is roughly given by

			A < P + (Ln(2*P))/2

		Where P is the (natural) logarithm of the largest number the machine
		can process.  The limit is machine dependent.

		Also, for values of X with large negative real part the calculation
		cannot converge and the result is replaced with a very large number
		(machine limit).  A warning is displayed in this case.
 PROCEDURE:
		Uses series expansion for small ABS(X) and continued fraction
		expansion for larger values.  Calls ABS_MM, CAST, CONFRAC, DEFAULT,
		IMAGINARY_MM, ISNUM, LNGAMMA_MM and TOLER, from MIDL.
 MODIFICATION HISTORY:
		Created 15-MAR-1996 by Mati Meron as M_IGAMMA.
		Modified 20-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to IGAMMA_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\igamma_mm.pro)


IGLOBE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IGLOBE
 PURPOSE:
       Plot a globe.
 CATEGORY:
 CALLING SEQUENCE:
       iglobe, y0, x0, a0
 INPUTS:
       y0 = Central latitude (deg).  Def=0.        in
       x0 = Central longitude (deg). Def=0.        in
       a0 = Angle to rotate globe CW (deg). Def=0. in
 KEYWORD PARAMETERS:
       Keywords:
         WATER=[r,g,b]  Color for water as R,G,B.
         LAND =[r,g,b]  Color for land as R,G,B.
         BACK =[r,g,b]  Color for background as R,G,B.
         COAST=[r,g,b]  Color for Coastlines as R,G,B.
         CGRID=[r,g,b]  Color for Grid as R,G,B.
         /GRID  display a grid.
         HOR=0  do not plot horizon (def is plot horizon).
         /COUNTRIES Plot boundaries for countries.
         /NOCOLOR Draw black on white background.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Oct 06 as an ION example routine
       R. Sterner, 1999 Oct 10 --- Fixed GRID and added /NOCOLOR.

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\iglobe.pro)


ILAS_G

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

 Copyright (c) 1998, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.

 NAME:
	ilas_g

 PURPOSE:
   This procedure reads all ilas_file global Attributes into the structure INHALT


 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   ilas_g,file=file,[inpath=inpath],[/xp],[/debug] ,[inhalt=inhalt],[experiment=experiment]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File


 OPTIONAL INPUTS:
   inpath: maybe the path

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file
   debug: for debuging


 OPTIONAL OUTPUTS:
   inhalt:     the structure inhalt
   experiment: the structure experiment with all experimentspecific attributes
   type_plat:  [obsolete] the structure whith platform related informations (it's in building phase)



 EXAMPLE:
   ilas_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26 1997 areal in type renamed
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_g
                                            to ilas_g
                                            the procedure nasa_g now will use ilas_g
                                            if the NASA Format is 1001
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ilas_g.pro)


ILAS_GR

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1998, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.

 NAME:
	ilas_gr

 PURPOSE:
   This procedure reads a parameter with all it's attributes and all global informations
   into the structure inhalt from a given ILAS/NASA 1001 datafile

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   ilas_gr,file=file,name=name,[inpath=inpath],[/xp] ,[inhalt=inhalt],[experiment=experiment]

 INPUTS:
   File:   the file_name of the ilas nasa 1001 File
           if inpath too then file= inpath+File
   name:   the short_name of a parameter in a ilas nasa 1001 File


 OPTIONAL INPUTS:
   inpath: maybe the path

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file
   debug: [OBSOLETE] for debuging

 OPTIONAL OUTPUTS:
   inhalt:     the structure inhalt
   experiment: the structure experiment with all experimentspecific attributes
   type_plat:  [OBSOLETE] the structure whith platform related informations (it's in building phase)


 EXAMPLE:
   ilas_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26. 1997 areal in type renamed
                       R.Bauer June 28. 1997 param_units conversion better
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_gr
                                            to ilas_gr
                                            the procedure nasa_gr now will use ilas_gr
                                            if the NASA Format is 1001
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ilas_gr.pro)


IMAGESIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMAGESIZE
 PURPOSE:
       Compute actual postscript image size given available space.
 CATEGORY:
 CALLING SEQUENCE:
       imagesize, xmx, ymx, arr, xout, yout
 INPUTS:
       xmx = max postscript X image size available in cm.    in
       ymx = max postscript Y image size available in cm.    in
       arr = image to display.                               in
 KEYWORD PARAMETERS:
 OUTPUTS:
       xout = image X size in cm that fits in given space.   out
       yout = image Y size in cm that fits in given space.   out
 COMMON BLOCKS:
 NOTES:
       Note: use for postscript tv, arr, xsize=xout, ysize=yout.
 MODIFICATION HISTORY:
       R. Sterner, 11 Mar, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imagesize.pro)


IMAGE_BLEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMAGE_BLEND

 PURPOSE:
       The purpose of this program is to demonstrate how to
       use the alpha channel to blend one image into another.
       The specific purpose is to see a color image on top of
       a gray-scale image, with the gray-scale image showing
       through behind the color image.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, Object Graphics.

 CALLING SEQUENCE:
       Image_Blend

 REQUIRED INPUTS:
       None. The images "worldelv.dat" and "ctscan.dat" from the
       examples/data directory are used.

 OPTIONAL INPUTS:

       backgroundImage::  A 2D image variable that will be used for the background image.
       foregroundImage: A 2D image variable that will be used for the foreground image.

 OPTIONAL KEYWORD PARAMETERS:

       COLORTABLE: The number of a color table to use for the foreground image.
       Color table 3 (red temperature) is used as a default.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None. The program XCOLORS is required from the Coyote library.

 EXAMPLE:
       Image_Blend, Colortable=5

 MODIFICATION HISTORY:
       Written by David Fanning, 30 March 99.
       Fixed bug where I redefined the image parameter. Duh... 1 April 99. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\image_blend.pro)


IMAGE_MAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IMAGE_map

 PURPOSE:
	Overlay an image and a map (satellite projection)

 CATEGORY:
	General graphics.

 CALLING SEQUENCE:
	IMAGE_map, A

 INPUTS:
	A:	The two-dimensional array to display.

 KEYWORD PARAMETERS:
 WINDOW_SCALE:	Set this keyword to scale the window size to the image size.
		Otherwise, the image size is scaled to the window size.
		This keyword is ignored when outputting to devices with 
		scalable pixels (e.g., PostScript).
           [original as in image_contour]

	ASPECT:	Set this keyword to retain the image's aspect ratio.
		Square pixels are assumed.  If WINDOW_SCALE is set, the 
		aspect ratio is automatically retained.
           [original as in image_contour]

	INTERP:	If this keyword is set, bilinear interpolation is used if 
		the image is resized.
           [original as in image_contour]

     CENTERX: longitudinal position of geostationary satellite
           (default -135 = GEOS-9)

     DIST: distance of satellite from Earth surface (in earth radii)
           (default = 7)

     CONTINENTS: superimpose map continents on the image

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The currently selected display is affected.

 RESTRICTIONS:
	None.

 NOTES:
     Derived from IDL routine image_contour.
     Not very flexible - quick hack to analyze PEM-T data

 PROCEDURE:
	If the device has scalable pixels, then the image is written over
	the plot window.

 MODIFICATION HISTORY:
	mgs, Oct 1997 : based on IMAGE_CONT by DMS, May, 1988.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\image_map.pro)


IMAGINARY_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		IMAGINARY_MM
 VERSION:
		4.0
 PURPOSE:
		Returns imaginary values.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = IMAGINARY_MM (X)
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the imaginary part of the input, i.e. 0 if the input is real
		the imaginary part in FLOAT format for COMPLEX and the imaginary part
		in DOUBLE format for DCOMPLEX.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calling FPU_FIX and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 5-MAY-1996 by Mati Meron as M_IMAGINARY.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to IMAGINARY_MM.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\imaginary_mm.pro)


IMGARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGARRAY
 PURPOSE:
       Create an array of small images given a list.
 CATEGORY:
 CALLING SEQUENCE:
       imgarray, list
 INPUTS:
       list = list of GIF image file names.       in
 KEYWORD PARAMETERS:
       Keywords:
         NX=nx, NY=ny  Array size: nx x ny images.
         SAVE=gif  Name of GIF image for saving result.
         Use only one of the following 3 keywords:
         REDUCTION=fact  Size reduction factor (def=2).
         XSIZE=xs  X size of reduced images.
         YSIZE=ys  Y size of reduced images.
         MARGIN=m  Size of margin to add around reduced images.
         MCOLOR='r g b' Color of margin in R,G,B (0-255). Def=white.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Nov 08

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgarray.pro)


IMGFRM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGFRM
 PURPOSE:
       Puts a specified border around an image.
 CATEGORY:
 CALLING SEQUENCE:
       imgfrm, img, vals
 INPUTS:
       vals = array of frame values. in.
 KEYWORD PARAMETERS:
 OUTPUTS:
       img = Image to modify.        in, out.
 COMMON BLOCKS:
 NOTES:
       Notes: values in array vals are applied from
         outside border of the image inward.  A single
         scalar values just replace the border values
         in the image.  Good for zeroing image edge.
 MODIFICATION HISTORY:
       R. Sterner. 25 Sep, 1987.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgfrm.pro)


IMGLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGLINE
 PURPOSE:
       Interactive line on the screen.
 CATEGORY:
 CALLING SEQUENCE:
       imgline
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         P1=p1       Returned screen x,y of endpoint 1.
         P2=p2       Returned screen x,y of endpoint 2.
         LENGTH=len  Returned line length.
         FACTOR=f    Length conversion factor (def=1).
         COLOR=col   Plot color.
         /INITIALIZE Initialize.
         /QUIET      suppresses messages.
 OUTPUTS:
 COMMON BLOCKS:
       imgline_com
 NOTES:
       Notes: length is listed and returned in pixels unless
         over-ridden by FACTOR.
 MODIFICATION HISTORY:
       R. Sterner, 18 Mar, 1993
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgline.pro)


IMGMASK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGMASK
 PURPOSE:
       Create a mask from an image.
 CATEGORY:
 CALLING SEQUENCE:
       imgmask
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: a color is specified and the mask is created
       using a threshhold based on that color.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 29

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgmask.pro)


IMGNEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGNEG
 PURPOSE:
       Display negative of current image.
 CATEGORY:
 CALLING SEQUENCE:
       imgneg
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Made as a test routine.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Oct 1

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgneg.pro)


IMGOPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGOPEN
 PURPOSE:
       Prepare a large image to be read.
 CATEGORY:
 CALLING SEQUENCE:
       imgopen, filename, nx, ny
 INPUTS:
       filename = name of image file.         in
       nx = number of pixels per image line.  in
       ny = number of image lines.            in
 KEYWORD PARAMETERS:
       Keywords:
         TYPE=t  image data type (def = byte).
           1: byte,  2: integer, 3: long integer,
           4: float, 5: double,  6: complex.
           Strings and structures not allowed.
         OFFSET=off offset in bytes to skip over a header (def=0).
         ERROR=err  error flag.  0: OK, -1: file not found,
           -2: parameter value error.
         /LIST list name and size of a currently open image.
 OUTPUTS:
 COMMON BLOCKS:
       img_com
 NOTES:
       Notes: TYPE is the same numeric value as returned
         by the SIZE function (see manual).
         Image is read by IMGREAD.
         Image must have fixed length records.
 MODIFICATION HISTORY:
       Ray Sterner, 12 Mar, 1991
       R. Sterner, 17 Sep, 1991 --- modified common.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgopen.pro)


IMGPOLREC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGPOLREC
 PURPOSE:
       Map an angle/radius image to an X/Y image.
 CATEGORY:
 CALLING SEQUENCE:
       xy = imgpolrec(ar, a1, a2, r1, r2, x1, x2, dx, y1, y2, dy)
 INPUTS:
       ar = angle/radius image.                            in
          Angle is in x direction, and radius is in y direction
       a1, a2 = start and end angles in ar (degrees)       in
       r1, r2 = start and end radius in ar.                in
       x1, x2, dx = desired start x, end x, x step.        in
       y1, y2, dy = desired start y, end y, y step.        in
 KEYWORD PARAMETERS:
       Keywords:
         /BILINEAR does bilinear interpolation,
           else nearest neighbor is used.
         /MASK masks values outside image to 0.
         /A_EDGE means a1, a2 apply to pixel edges, not center.
         /R_EDGE means r1, r2 apply to pixel edges, not center.
 OUTPUTS:
       xy = returned X/Y image.                            out
 COMMON BLOCKS:
 NOTES:
       Notes: Angle is 0 along + X axis and increases CCW.
 MODIFICATION HISTORY:
       R. Sterner.  12 May, 1986.
       R. Sterner, 3 Sep, 1991 --- converted to IDL vers 2.
       R. Sterner, 5 Sep, 1991 --- simplified and added bilinear interp.
       R. Sterner, 1998 Apr 7 --- Added non-centered pixel keywords.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgpolrec.pro)


IMGREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGREAD
 PURPOSE:
       Read part of a large image.
 CATEGORY:
 CALLING SEQUENCE:
       out = imgread( x1, y1, [x2, y2])
 INPUTS:
       x1 = starting pixel (first=0).       in
       y1 = starting image line (first=0).  in
       x2 = optional last pixel.            in
       y2 = optional last image line.       in
 KEYWORD PARAMETERS:
       Keywords:
         SS=ss   subsample factor for x and y (1=every pixel=def).
         XSS=sx  subsample factor in x.
         YSS=sy  subsample factor in y.
         NX=nx   number of output pixels in x (def=512).
         NY=ny   number of output pixels in y (def=512).
         /REBIN means average pixels instead of subsampling.
           The averaged image will appear shifted from the
           subsampled image by an amount depending on the number
           of pixels averaged. This happens because the subsampled
           pixels are from the lower left corner of the averaged
           pixels.
         VALUE=v value for out-of-range parts of subimage (def=0).
           If VALUE is not given then output image is trimmed
           to be within the image being read.
         ERROR=err  error flag.
             0: OK, -1: part of subimage falls outside main image.
            -2: not open for read, -3: parameter value error.
         SHOW=s print a dot after every s lines is read.
         /EXAMPLES  lists some example calls.
         /DEBUG  does a debug stop.
 OUTPUTS:
 COMMON BLOCKS:
       img_com
 NOTES:
       Notes: Image opened by IMGREAD. Image need not be closed.
         If x2, y2 are given they take precedence over NX and NY.
         If x2, y2 are given and subsample factor is not 1 then
           x2, y2 may not be included in output image.
 MODIFICATION HISTORY:
       Ray Sterner, 13 Mar, 1991
       R. Sterner, 17 Sep, 1991 --- added /REBIN, modified common.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgread.pro)


IMGRECPOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGRECPOL
 PURPOSE:
       Map an X/Y image to an angle/radius image.
 CATEGORY:
 CALLING SEQUENCE:
       ar = imgrecpol(xy, x1, x2, y1, y2, a1, a2, da, r1, r2, dr)
 INPUTS:
       xy = X/Y image.					in
       x1, x2 = start and end x in xy.			in
       y1, y2 = start and end y in xy.			in
       a1, a2, da = start ang, end ang, ang step (deg).	in
       r1, r2, dr = start radius, end radius, radius step.	in
 KEYWORD PARAMETERS:
       Keywords:
         /BILINEAR does bilinear interpolation,
           else nearest neighbor is used.
         /MASK masks values outside image to 0.
 OUTPUTS:
       ar = returned angle/radius image.			out
         Angle is in x direction, and radius is in y direction.
 COMMON BLOCKS:
 NOTES:
       Notes: Angle is 0 along + X axis and increases CCW.
 MODIFICATION HISTORY:
       R. Sterner.  11 July, 1986.
       R. Sterner, 4 Sep, 1991 --- converted to IDL vers 2.
	R. Sterner, 5 Sep, 1991 --- simplified and added bilinear interp.
       Johns Hopkins Applied Physics Lab.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgrecpol.pro)


IMGREGION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGREGION
 PURPOSE:
       Interactively extract a selected image region.
 CATEGORY:
 CALLING SEQUENCE:
       out = imgregion(img)
 INPUTS:
       img = input image to operate on.                   in
         This image should be byte
         scaled, ready for display.
 KEYWORD PARAMETERS:
       Keywords:
         MISSING=val  Value for points outside region (def=0).
         WINDOW=win   Window number for image display (def=0).
         /STATS  means display statistics for selected region.
         X=x  Returned region polygon x indices.
         Y=y  Returned region polygon y indices.
 OUTPUTS:
       out = output image containing extracted region.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1993 Jan 3.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgregion.pro)


IMGSCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGSCALE
 PURPOSE:
       Interactive image scaling.
 CATEGORY:
 CALLING SEQUENCE:
       imgscale, in, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /SATURATE  Means display saturation colors as warning.
         EXIT_CODE=code  Exit code: 0=ok, 1=cancel.
 OUTPUTS:
       in=[inlo,inhi]     Input image low and high values.   out
       out=[outlo,outhi]  Output image low and high values.  out
 COMMON BLOCKS:
 NOTES:
       Notes: in and out define the requested grayscale mapping.
         The input image value inlo maps to the output image value
         outlo, and inhi maps to outhi.  All values are in the
         range 0 to 1 and are image value (as in hue,sat,val).
         The routine imgscale is used to select the desired
         scaling, it does not actually do it.  To scale do:
            new = scalearray(old,in(0),in(1),out(0),out(1))>0<1
         Where new and old are the image values.  For BW images
         just multiply imgscale results by 255 first:
         in=in*255 & out=out*255
            new = scalearray(old,in(0),in(1),out(0),out(1))>0<255
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 3
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1999 Aug 10 --- Fixed the problem of locked windows.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgscale.pro)


IMGSQZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGSQZ
 PURPOSE:
       Squeeze number of image colors used for current image.
 CATEGORY:
 CALLING SEQUENCE:
       imgsqz
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         NUMBER=n  Number of colors to free up (def=10).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: modifies image and color table to free up
       n new colors starting at 0.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Jan 6

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgsqz.pro)


IMGUNDER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGUNDER
 PURPOSE:
       Display image in same area as last plot.
 CATEGORY:
 CALLING SEQUENCE:
       imgunder, z
 INPUTS:
       z = scaled byte image to display.  in
 KEYWORD PARAMETERS:
       Keywords:
         /INTERP causes bilinear interpolation to be used,
           otherwise nearest neighbor interpolation is used.
           No interpolation used for PS plots so /INTERP
           has no effect.
         /CENTER means use centered pixels.
         XFRAC=[xmn,xmx] Fraction of image to use in x (def 0 to 1).
         YFRAC=[ymn,ymx] Fraction of image to use in y (def 0 to 1).
         /NODATA means just return without displaying anything.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Do plot,/nodata first to setup plot area,
         then use imgunder to display image, then repeat
         plot with data, but with /noerase.
 MODIFICATION HISTORY:
       R. Sterner, 15 Feb, 1991
       R. Sterner,  2 Dec, 1993 --- Added /minus_one to congrid call.
       R. Sterner, 1996 Jun 14 --- Made dy be dy+1 in congrid.
       R. Sterner, 1996 Dec 2 --- Switched to congrid2 to allow
       correct interpolation.  Also added /CENTER keyword.
       R. Sterner, 1997 Mar 5 --- Made PS do 1/2 point pixels (was 1).
       R. Sterner, 2000 Apr 20 --- Added /NODATA keyword.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgunder.pro)


IMGWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGWINDOW
 PURPOSE:
       Compute plot window needed to display given image.
 CATEGORY:
 CALLING SEQUENCE:
       t = imgwindow(img, xmn,xmx,ymn,ymx)
 INPUTS:
       img = Image. For size only.               in
       xmn, xmx = Normalized X for plot window.  in
       ymn, ymx = Normalized Y for plot window.  in
          One and only one of xmn,xmx,ymn, or ymx
          must be -1.  This is the value to be computed.
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: May use result with the routine set_window:
         set_window,x1,x2,y1,y2,xnrange=[xmn,xmx],ynrange=[ymn,ymx]
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 31

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\imgwindow.pro)


IMG_HSV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_HSV
 PURPOSE:
       Adjust Hue, Saturation, and Value for a 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_hsv(in)
 INPUTS:
       in = Input image.           in
 KEYWORD PARAMETERS:
       Keywords:
         HUE=off  Offset to add to Hue, which is in degrees, 0-360.
         SAT=fct  Factor to apply to Saturation (clipped to 0-1).
         VAL=fct  Factor to apply to Value (clipped to 0-1).
           Defaults are no change.
         ERROR=err error flag: 0=ok, 1=not 3-D,
           2=wrong number of color channels for 3-D array.
 OUTPUTS:
       out = Stretched image.      out
 COMMON BLOCKS:
 NOTES:
       Notes: For 3-D images only.
         Returned image is same type is input image.
         Example: Increase saturation and brighten:
         tv,img_hsv(img,hue=0,sat=1.5,val=1.5),tr=3
 MODIFICATION HISTORY:
       R. Sterner, 2001 Jan 08

 Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_hsv.pro)


IMG_RADIAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_RADIAL
 PURPOSE:
       Radially distort a 2-D or 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_radial(in)
 INPUTS:
       in = Input image.           in
 KEYWORD PARAMETERS:
       Keywords:
         COEFF=coeff Array of 4 coefficients.
           [a,b,c,d] where d scales image by 1/d,
           a,b,c distort image.
         Can use RED=red, GRN=grn, BLU=blu to set different
           corrections for each color.  If coeffecients not given
           then that color is not changed.  Use COEFF if same
           for all 3 colors.
         XOPT=x, YOPT=y image pixel of optical axis (else centered).
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
         /TEST test mode.  Returns needed radial values along
           source image x axis only.  Input image must be a 1-d
           array of normalized x values (0 to 1, or -1 to 1).
           XOPT may be given (normalized, def=0).  Plot returned
           result to see the effects of a,b,c, and d values.
 OUTPUTS:
       out = Resized image.        out
 COMMON BLOCKS:
       img_radial_remap_com
 NOTES:
       Note: deals with 2-D or 3-D image arrays and distorts
         correct image planes.
         Based on algorithm given in:
         http://www.fh-furtwangen.de/~dersch/barrel/barrel.html
 MODIFICATION HISTORY:

 Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_radial.pro)


IMG_RESIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_RESIZE
 PURPOSE:
       Resize a 2-D or 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_resize(in,mag)
 INPUTS:
       in = Input image.           in
       mag = Mag factor            in
          mag may be [magx,magy].
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
         May also use the keywords allowed by CONGRID.
 OUTPUTS:
       out = Resized image.        out
 COMMON BLOCKS:
 NOTES:
       Note: deals with 2-D or 3-D image arrays and resizes
         correct image planes.
 MODIFICATION HISTORY:
       R. Sterner, 2000 Sep 21
       R. Sterner, 2001 Jan 29 --- Allowed x and y mag.

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_resize.pro)


IMG_ROTATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_ROTATE
 PURPOSE:
       Rotate an 2-D or 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_rotate(in,rot)
 INPUTS:
       in = Input image.           in
       rot = rotation value        in
         Same as for IDL rotate.
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
 OUTPUTS:
       out = Rotated image.        out
 COMMON BLOCKS:
 NOTES:
       Note: deals with 2-D or 3-D image arrays and rotates
         correct image planes.
 MODIFICATION HISTORY:
       R. Sterner, 2000 Sep 21

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_rotate.pro)


IMG_SMOOTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_SMOOTH
 PURPOSE:
       Smnooth a 2-D or 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_smooth(in,sm)
 INPUTS:
       in = Input image.                in
       sm = smoothing value (def=none)  in
         1.0 is strong, 0.1 is mild smoothing for default width.
 KEYWORD PARAMETERS:
       Keywords:
         WIDTH=w  Width of convolution smoothing kernel (def=5).
           Make sure w is odd to avoid shifting the image.
         /ZERO means zero edge effect pixels instead of assuming
           repeated pixels at image edge.
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
 OUTPUTS:
       out = Smoothed image.            out
 COMMON BLOCKS:
 NOTES:
       Note: deals with 2-D or 3-D image arrays and smooths
         correct image planes.  Output data type is same as input.
         Uses convolution smoothing with a gaussian kernel.
         Wider kernels give more edge effect.
 MODIFICATION HISTORY:
       R. Sterner, 2001 Jan 05

 Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_smooth.pro)


IMG_STRETCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMG_STRETCH
 PURPOSE:
       Stretch a 2-D or 3-D image array.
 CATEGORY:
 CALLING SEQUENCE:
       out = img_stretch(in,lo,hi)
 INPUTS:
       in = Input image.           in
       lo = low cutoff (def=0).    in
       hi = high cutoff (def=255). in
 KEYWORD PARAMETERS:
       Keywords:
         OUTLO=lo2  lo maps to lo2 (default=0).
         OUTHI=hi2  hi maps to hi2 (default=255).
         /NOCLIP means do not clip output to lo2, hi2.
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
 OUTPUTS:
       out = Stretched image.      out
 COMMON BLOCKS:
 NOTES:
       Notes: Remaps image values lo and hi to lo2 and hi2.
         Returned image is same type is input image.
 MODIFICATION HISTORY:
       R. Sterner, 2001 Jan 08

 Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\img_stretch.pro)


IMPORT_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  import_data

 PURPOSE:
   This routine imports an ASCII array orientated data file as data_file_struct to a main level variabale

 CATEGORY:
   PROG_TOOLS/MACROS

 CALLING SEQUENCE:
   import_data,[filename]

 INPUTS:
   filename : the file name of a file

 OUTPUTS:
   This procedure creates a main level variable of filename+'_data'


 EXAMPLE:
   import_data,'test.dat'
   % IMPORT_ICGS:
     test_data

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 2000-April-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\import_data.pro)


IMPORT_ICGS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  import_icgs

 PURPOSE:
   This routine imports a file as ICG_STRUCT to a main level variabale

 CATEGORY:
   PROG_TOOLS/MACROS

 CALLING SEQUENCE:
   import_icgs,[filename]

 INPUTS:
   filename : the file name of a file

 OUTPUTS:
   This procedure creates a main level variable of filename+'_icgs'
   known filetypes are: ENZ, NASA AMES, NetCDF

 EXAMPLE:
   command line:
   import_icgs,'ghost.nc'
   % IMPORT_ICGS:
     ghost_icgs

   pro test
   import_icgs,file_search('ghost.nc',/use_path)
   end

  gives:

  pro test
  ghost_icgs=read_ncdf('ghost.nc',/status,_extra=e)
  ;import_icgs,'ghost.nc' replaced automaticly
  end


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 2000-April-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\import_icgs.pro)


INBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INBOX
 PURPOSE:
       Test if given point inside given box.
 CATEGORY:
 CALLING SEQUENCE:
       flag = inbox( x, y, x1, x2, y1, y2)
 INPUTS:
       x, y = x and y of point to test.         in
       x1, x2 = min and max x of test box.      in
       y1, y2 = min and max y of test box.      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       flag = result: 0=not inside, 1= inside.  out
 COMMON BLOCKS:
 NOTES:
       Notes: x and y may be a scalar or array.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Nov 10

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\inbox.pro)


INCR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   incr

 PURPOSE:
   increment operator

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = INCR(Result)

 INPUTS:
   Result:  number to be incremented

 KEYWORD PARAMETERS:
   STEP:   stepsize (default= 1)

 OUTPUTS:
   incremented number

 EXAMPLE:
   page = 0
   print, 'PAGE:', incr(page)
       -> PAGE: 1
   print, 'PAGE:', incr(page, step=100)
       -> PAGE: 101

 MODIFICATION HISTORY:
   Written by: Theo Brauers, Sep. 1997
   Modified:   T.B.    1998-JAN-26     debug removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\incr.pro)


INDEXLOGIC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IndexLogic

 PURPOSE:
	This function applies different boolean operators to two index vectors.
	This routine is much faster then VekLogik but can only used with index vectors.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = IndexLogik(vec1, vec2, log_op [, COUNT = count])

 INPUTS:
	vec1, vec2: The two index vectors to which a boolean operation should be applied.
	log_op: String parameter which spezifies the boolean operation:
		- 'AND'
		- 'OR'
		- 'XOR'
		- 'NOT'

 KEYWORD PARAMETERS:
	COUNT = count:	On return count will hold the number of elements of Result.
		If the result of the boolean operation is an empty vector count is set to 0.

 OUTPUTS:
	This function returns a vector with elements which result from the boolean operation.
	In the case of an empty output vector, -1 is returned.

 RESTRICTIONS:
	This routine is limited to index vectors (e.g. result of the WHERE function etc.).
	It does not work for vectors with negative numbers (vector = -1 will work).

 EXAMPLE:
	a = [0, 2, 4, 6, 8, 10]
	b = [3, 4, 5]
	PRINT, IndexLogic(a, b, 'AND') -> 4
	PRINT, IndexLogic(a, b, 'OR')  -> 0 2 3 4 5 6 8 10
	PRINT, IndexLogic(a, b, 'XOR') -> 0 2 3 5 6 8 10
	PRINT, IndexLogic(a, b, 'NOT') -> 0 2 6 8 10

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.11.98
	10.06.1999:	Keyword parameter COUNT = count was added.
	14.02.2000: Bug removed in sub functions indexlogic_xxx: count was undefined
		if where statement was not reached.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\indexlogic.pro)


IND_COMB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        IND_COMB

 PURPOSE:
        combine two index arrays that result from different
        WHERE calls to the same data set.

 CATEGORY:
        tools

 CALLING SEQUENCE:
        result = IND_COMB(INDEX1,INDEX2,TYPE [,keywords])

 INPUTS:
        INDEX1, INDEX2 --> the two index arrays (may be single integers
              or -1, but must be given)

        TYPE --> a string containing the type of index combination:
              The result will contain an index value if the index is 
              contained in ...
              type eq "OR":   ... at least one of INDEX1 or INDEX2
              type eq "AND":  ... INDEX1 and INDEX2
              type eq "NOR":  ... neither INDEX1 nor INDEX2
              type eq "XOR":  ... only one of INDEX1 or INDEX2
              type eq "NAND": ... not in both
        The default combination is "OR".

 KEYWORD PARAMETERS:
        TOTALN --> optional: number of elements in the data set. If not
              given, this value is calculated as max([index1,index2]).
              If this argument is passed, the user has full responsibility
              that array indices are not exceeded.
              ATTENTION: types NAND and NOR may give wrong results if 
              TOTALN is not specified (see example).

 OUTPUTS:
        an array of type lon that contains the combined indices and can be 
        used as array subscript.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        data = findgen(100)+1
        ind1 = where(data le 50)
        ind2 = where(data ge 50 AND data lt 80)
        res = ind_comb(ind1,ind2,"OR")
            print,'1:',min(data(res)),max(data(res)) 
        res = ind_comb(ind1,ind2,"AND")
            print,'2:',min(data(res)),max(data(res))
        res = ind_comb(ind1,ind2,"NOR")   ; <------  WRONG !!
            print,'3:',res                         
        res = ind_comb(ind1,ind2,"NOR",totaln=100)
            print,'4:',min(data(res)),max(data(res))
        res = ind_comb(ind1,ind2,"XOR")
            print,'5:',min(data(res)),max(data(res))
        res = ind_comb(ind1,ind2,"NAND")  ; <------  WRONG !!
            print,'6:',min(data(res)),max(data(res))
        res = ind_comb(ind1,ind2,"NAND",totaln=100)
            print,'7:',min(data(res)),max(data(res))

        IDL will print:
            1:  1    79
            2: 50    50 
            3: -1           <------  WRONG !!
            4: 80   100
            5:  1    79
            6:  1    79     <------  WRONG !!
            7:  1   100

 MODIFICATION HISTORY:
        mgs, 04 Dec 1997: VERSION 1.00
        mgs, 25 Aug 2000: - changed copyright to open source
                          - [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\ind_comb.pro)


INFACE__ENL_OPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	inface__enl_oplot

 PURPOSE:
	Interface for enl_oplot to the icg plot structure

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
	inface_enl_oplot,  plot, x,  y, [x_err=x_err], [y_err=yerr],   [s_hatlength=s_hat_length] ,
		               [s_thick=s_thick] , [s_linestyle=s_linestyle], [s_color=s_color],[/s_hat]


 INPUTS:
	X:  array of X Values
	Y:  array of Y values
   plot : the by pl_init defined structure

 OPTIONAL INPUTS:
	X_ERR : vector of error bar values (along X)
   Y_ERR : vector of error bar values (along Y)
   For both: if only on element is submitted a vector with make_array will be builded
   s_hatlength:  the lengt of the hat
   s_thick:      the tickness of the error bar lines
   s_linestyle:  the linestyle of the error bar lines
   s_color:      the color of the error bar lines

 KEYWORD PARAMETERS:
  s_hat: 1 the error bar has an hat else 0 no hat
  s_background: 1 error bar at background  else 0 foreground
  s_nskip: 1 no skip ; 0 skip


 PROCEDURE:
  This routine is an interface between the plot structure and enl_oplot


 MODIFICATION HISTORY:
  R.Bauer 1998-Apr-06
  R.Bauer 1998-Apr-09  problem with symbol 10 resolved
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\inface__enl_oplot.pro)


INHALT_DEF

[Previous Routine] [Next Routine] [List of Routines]
NAME:
inhalt_def

PURPOSE:
This @include file holds the STRING array definitions of all defined INHALT tagnames and all for execute predefined "undefined" variables 

CATEGORY:
DATAFILES/NETCDF

MODIFICATION HISTORY:
F.Rohrer/R.Bauer

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\inhalt_def.pro)


INHERIT_ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       inherit_icg_struct

 PURPOSE:
   This function is used to inherit parameter attribute from a given icg_struct to a new icg_struct structure

 CATEGORY:
    ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
    Result=inherit_icg_struct(icg_struct,[short_name],[to_names=to_names],[flag=flag])

 INPUTS:
   icg_struct: the ICG defined data structure

 OPTIONAL INPUTS:
   short_name: the short_name(s) to inherit from

 KEYWORD_PARAMETERS
   to_names: if set these names are used for short_name and tag_name
   flag   : if set to 1 all flags are inherited too

 EXAMPLE:
  pi={name:'P.Mustermann',organisation:'FZ Jülich'}
  platform={name:'cessna',type:'AIRCRAFT'}
  dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT',$
           experiment:'GHOST',title:'validation',$
           type_of_data:'MEASUREMENTS'}
  global=CREATE_STRUCT('pi',pi,'platform',platform,'dataset',dataset)
  n2o={units:'ppm',$
       sample_interval:1.0,$
       long_name:'mixing ratio',short_name:'N2O',$
       flag:'NONE'}
  time={units:'seconds since 2000-01-01 00:00:00 UTC',$
       long_name:'time',short_name:'time',flag:'NONE'}
  struct=CREATE_STRUCT('!global',global,'time',time,'n2o',n2o)

  Result=inherit_icg_struct(structure,['time','Fluoreszenz'],to_names=['time','FG'])

  n=100
  data=create_struct('time',dindgen(n),'N2O',sin(findgen(n)),$
                     'N2O$STDEV',findgen(n)/10.)  ; since idl5.3 @ is changed to $
  icg=struct2icg_struct(data,struct,/set_flag)

 MODIFICATION HISTORY:
       Written by:     R.Bauer  (ICG-1),   1999-Sep-29
       2000-02-18 build_structure exchanged by inherit_icg_struct_create
       2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\inherit_icg_struct.pro)


INIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       init

 PURPOSE:
       include-file to setup the environment for plotxy-type procedures

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       @init

 OUTPUTS:
       plot     : structure with plot-options look at pl_init
       pconst_black, pconst_red etc. : predifined color indices (obsolete)
       color_nc : structure with predifined color indices       (should be used instead pconst_xxx)
       p_colors : array containing information about color-names and indices (for internal use in plotxy-type-widgets)

 EXAMPLE:
           @init
           plotinit,plot
           plotxy,plot,x=[0,1],y=[0,1]
           plotend,plot

 REVISION HISTORY:
       Written  Franz Rohrer, June 1997
       Modified Franz Rohrer, 5.10.1997  !d.name,!version.os_family

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\init.pro)


INIT_COL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       init_col

 PURPOSE:
       Define colors 

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
       INIT_COL, black, red, blue, green, pink, violett, orange

 OUTPUTS:
       the colors black, red, blue, green, pink, violett, orange

 EXAMPLE:
       Init_Col, black, red, blue, green, pink, violett, orange

 REVISION HISTORY:
       Written by Franz Rohrer
       Modified by Frank Holland, June 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_col.pro)


INIT_COLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   init_color

 PURPOSE:
   Define colors in a structure

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result=INIT_COLOR()

 KEYWORD PARAMETERS:
   LARGE:   if set to 1

 OUTPUTS:
   Structure containing colors

 EXAMPLE:
   c = init_color()

 REVISION HISTORY:
       Written by Theo Brauers 1997-Dec-21
                 some ideas from Franz Rohrer and Frank Holland

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_color.pro)


INIT_DEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   init_dev

 PURPOSE:
   This procedure initialises the graphical output device

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   init_dev

 KEYWORD PARAMETERS:
         PSFlag=flag: 0 - output on screen (def), 1 - output in file
         PSFile=file: Filename for output (def='IDL.PS').
         Encapsulated=enc: 0 - PS output (def), 1 - EPS output
         /LANDSCAPE: If set output will be in landscape format
         /PORTRAIT: If set output will be in portrait format
         Orientation=orient: portrait (def), landscape
         Papersize=Ax: A4 (def), A3.

         If output is to a PS file the following parameters will be
         multiplied by a factor in order to show characters, lines, and
         symbols with the same size as on the screen device.

         CHARSIZE = charsize (factor 1.72)
         SYMSIZE = symsize (factor 1.72)
         THICK = thick (factor 2.0)
         CHARTHICK = charthick (factor 2.0)
         XTHICK = xthick (factor 2.0)
         YTHICK = ythick (factor 2.0)

 MODIFICATION HISTORY:
   F. Holland, 20 Jun, 1997
   05.11.1999: Changed handling of !P.COLOR, !P.BACKGROUND
                   Added keyword parameters /LANDSCAPE, /PORTRAIT
   21.01.2000: Changed size of window from 700 x 500 to 650 x 460
   02.02.2000: New keyword parameters CHARSIZE, SYMSIZE, THICK, CHARTHICK, XTHICK, YTHICK
   09.02.2000: charsize and symsize are multiplied by 1.72 (size_factor),
                   thick, charthick, xthick, and ythick are multiplied by 2.0 (thick_factor)
   11.02.2000: Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_dev.pro)


INIT_DEVICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   init_device

 PURPOSE:
   This procedure initialises the graphical output device

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   init_device

 KEYWORD PARAMETERS:
         PSFlag=flag: 0 - output on screen (def), 1 - output in file
         PSFile=file: Filename for output (def='IDL.PS').
         Encapsulated=enc: 0 - PS output (def), 1 - EPS output
         /LANDSCAPE: If set output will be in landscape format
         /PORTRAIT: If set output will be in portrait format
         Orientation=orient: portrait (def), landscape
         Papersize=Ax: A4 (def), A3.

         If output is to a PS file the following parameters will be
         multiplied by a factor in order to show characters, lines, and
         symbols with the same size as on the screen device.

         CHARSIZE = charsize (factor 1.72)
         SYMSIZE = symsize (factor 1.72)
         THICK = thick (factor 2.0)
         CHARTHICK = charthick (factor 2.0)
         XTHICK = xthick (factor 2.0)
         YTHICK = ythick (factor 2.0)

 MODIFICATION HISTORY:
   F. Holland, 20 Jun, 1997
   05.11.1999: Changed handling of !P.COLOR, !P.BACKGROUND
                   Added keyword parameters /LANDSCAPE, /PORTRAIT
   21.01.2000: Changed size of window from 700 x 500 to 650 x 460
   02.02.2000: New keyword parameters CHARSIZE, SYMSIZE, THICK, CHARTHICK, XTHICK, YTHICK
   09.02.2000: charsize and symsize are multiplied by 1.72 (size_factor),
                   thick, charthick, xthick, and ythick are multiplied by 2.0 (thick_factor)
   11.02.2000: Header edited
   28.02.2000: Removed bug if one of the parameters charsize, ... was an array.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_device.pro)


INIT_MPLOT

[Previous Routine] [Next Routine] [List of Routines]
+
 NAME:
   init_mplot

 PURPOSE:
   Multiple plots on one page using !P.MULTI

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   INIT_MPLOT, nCol, nRow

 INPUTS:
   nCol:      Number of plot columns per page
   nRow:      Number of plot rows per page

 OPTIONAL INPUTS:
   CRMAJOR  = crm : 0 - col major (def), 1 - row major
   XOMARGIN = xom : X outer margin in cm, [3, 2] (def)
   YOMARGIN = yom : Y outer margin in cm, [2, 3] (def)
   XMARGIN  = xm  : X margin in cm, [2, 1] (def)
   YMARGIN  = ym  : Y margin in cm, [2, 1] (def)
   /CHARUNIT:       If set, margins are quoted in units of character size.
   /NORMAL:         If set, margins are quoted in normal coordinates.
   /FLUSHX:         If set, the inter-row-space between plots is zero.
   /FLUSHY:         If set, the inter-column-space between plots is zero.
   CHARSIZE = charsize: The overall character size for the annotation when
       Hershey fonts are selected. A charsize of 1.0 is normal.
   /SQUARE: If set position coordinates (ppos) will be changed such that the
     resulting plot is quadratic.

 OPTIONAL OUTPUTS:
   PAREA     = parea: [x0, y0, x1, y1]
        Array with normal coordinates of plot area used by !P.MULTI
   PPOSITION = ppos : [[x0, y0, x1, y1], [...], ...]
        Array with position coordinates of all plots (in normal coordinates)
   SAVE_SYSVAR = save_sysvar: If set to a named variable, a structure with the original
        values of !P.MULTI, !X.OMARGIN, !Y.OMARGIN, !X.MARGIN, !Y.MARGIN is returned.

 SIDE EFFECTS:
    Changes the settings of !P.MULTI, !X.OMARGIN, !Y.OMARGIN, !X.MARGIN, !Y.MARGIN

 EXAMPLE:
       init_mplot, 2, 3, /FLUSHX, PPOSITION = ppos
       plot, findgen(10)
       ...
       plot, findgen(10)
       end_mplot

       If the keyword parameter CHARSIZE is passed into the plot routine
       the keyword parameter POSITION = ppos[*, n] (for n_th plot) must
       be passed as well in order to maintain the correct position of the plot.

 REVISION HISTORY:
   Written: Theo Brauers, Frank Holland, June 1997
   25.02.99, F.H.: Margin transformation cm -> char makes use of !P.CHARSIZE
       For /FLUSHX (/FLUSHY) X(Y) margins are added to X(Y) outer margins
       before they are set to zero in order to maintain a constant outer margin.
   21.01.2000, F.H.: New keyword parameter /CHARUNIT, CHARSIZE
   02.02.2000, F.H.: New keyword parameters /SQUARE, SAVE_SYSVAR

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_mplot.pro)


INIT_PLX

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       INIT_PLX 
 
 PURPOSE: 
       set up the plot structure plx  for the use with 
       plotting routines 
 
 CATEGORY: 
	PLOT/MPLOT
 
 CALLING SEQUENCE: 
       plx = PLX_INIT() 
 
 INPUTS: 
       none 
 
 OPTIONAL INPUTS: 
       none 
 
 OUTPUTS: 
       the plotting structure plx 
 
 SIDE EFFECTS: 
       None. 
 
 RESTRICTIONS: 
       None. 
 
 EXAMPLE: 
       spec = MFC_READ('A0001234') 
       plx = PLX_INIT() 
       MFC_PLOT, plx=plx, spec 
       ....... 
 
 REVISION HISTORY: 
       Written         Theo Brauers, June 1997 
       Corrected 
       Revised 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\init_plx.pro)


INPUTFORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   INPUTFORM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Generates expression string from an IDL value

 CALLING SEQUENCE:
   STRING = INPUTFORM(VALUE, ERRMSG=ERRMSG, STATUS=STATUS, ...)

 DESCRIPTION: 

   The INPUTFORM function converts an IDL data value into its string
   representation, suitable for execution at the IDL command line or
   with EXECUTE().  This is similar to the "InForm" output
   representation of Mathematica, which formats output so that it can
   be entered again on the command line.  INPUTFORM() is a
   specialized form of STRING().

   For example, the value DBLARR(2,2) has the representation

      '[[0,0],[0,0]]'

   The formal goal of INPUTFORM is for the resulting textual
   expression to be an exact represetation of the original data.
   Therefore, given the original value VARIABLE, then after executing

      R = EXECUTE( 'variable1 = '+INPUTFORM(variable) )

   The value, type, and dimension of VARIABLE1 and VARIABLE will be
   the same.

   Such behavior might useful in several circumstances:

      * for printing values meant to be "pasted" back into the
        command line by the user;
      * for constructing command arguments to be EXECUTE()'d;
      * for saving values in ASCII format for later execution.
   
   However, it should be noted that the IDL parser is not perfect.
   While IDL has many data types, not all expressions are
   representable as a textual string.  For example, the value of
   pointers cannot be printed.  Examples of the parser limitation
   include,

      * pointers have no textual representation;
      * array expressions can have no more than 90 elements;
      * bracketed array notation cannot be nested too deeply;
      * anonymous structure arrays have no textual representation;

   Given these limitations, the user of this routine must be prepared
   for failure and have contingency plans.  Error messages and status
   indicators are provided to facilitate this.  INPUTFORM() does not
   call MESSAGE, so it should never intentionally crash.

   Also, consider that the textual representation can never really be
   suitable for very large arrays.  The internal algorithm is thus
   not optimized for speed as heavily numeric routines might be, and
   instead tries to make the output slightly more readable.

 INPUTS:

   VALUE - the IDL value to be converted.  Any value which has a
           legal textual representation is permitted.

 KEYWORDS:

   STATUS - upon return, a status indicator.  A value of zero
            indicates failure; one indicates success.

   ERRMSG - upon return, a string message indicating the reason for a
            failure, if any.  The empty string ('') indicates
            success.

   MAX_ELEMENTS - maximum number of elements permitted in VALUE.  The
                  conversion fails if the maximum is exceeded.
                  Default: any number of elements is permitted.

                  NOTE: the conversion may still fail if any array
                  dimension exceeds 90.

   MAX_DIMENSIONS - maximum number of array dimensions permitted in
                    VALUE.  The conversion fails if the maximum is
                    exceeded.
                    Default: any number of dimensions is permitted.

                    NOTE: IDL does not permit deep nesting, for
                    dimensions greater than three.

   MAX_TAGS - maximum number of structure tags permitted in VALUE.
              The conversion fails if the maximum is exceeded.
              Default: any number of tags is permitted.

   MAX_LEN - approximate maximum length of returned string.  If large
             string expressions exceed this size as they are being
             composed internally, they will be terminated by a '...'
             ellipsis and returned.  This value is to be used as a
             guideline by INPUTFORM(); the precise limit may not be
             adhered to.
             Default: 16384L
            
 RETURNS:
   The resulting converted string, if successful.  Upon failure,
   STATUS is set to zero and the empty string ('') is returned.

 EXAMPLE:
   
   Convert a double array to text
   IDL> x = dblarr(2,2)
   IDL> print, inputform(x)
   [[0D,0],[0D,0]]

   Convert a structure
   IDL> x = create_struct('s1',5,'s2','strvalue','s3',intarr(3))
   IDL> print, inputform(x)
   [{S1:5,S2:'strvalue',S3:[0,0,0]}]
    

 SEE ALSO:

   STRING, PRINT, HELP, HELPFORM

 MODIFICATION HISTORY:
   Written, CM, 10 Apr 2000
   Added HELPFORM to SEE ALSO, CM, 04 Jul 2000
   Corrected case of scalar float value, CM, 13 Jul 2000
   Put a space after float types like 1E or 1D to ease parsing, CM,
     18 Jul 2000

  $Id: inputform.pro,v 1.2 2001/03/25 18:10:42 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\inputform.pro)


INRANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INRANGE
 PURPOSE:
       Find multiples of given step just inside given range.
 CATEGORY:
 CALLING SEQUENCE:
       inrange,stp, x1, x2, t1, t2, [tics]
 INPUTS:
       stp = Step size.					in.
       x1, x2 = Range limits.				in.
 KEYWORD PARAMETERS:
 OUTPUTS:
       t1, t2 = Multiples of STP just inside range.	out.
       tics = optional array of tic values.		out.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 10 Nov, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\inrange.pro)


INSERT_ELEMENT_IN_VECTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	insert_element_in_vector

 PURPOSE:
	This function inserts elements into a vector at specified positions

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = insert_element_in_vector(vector, pos, value)

 INPUTS:
	vector: Vector in which elements are to be inserted
	pos: Position in the original vector AFTER which an element will be inserted.
		Counting the elements in vector starts with 0. pos may be a scalar or vector.
		pos = -1: new_vector = [element, vector]
		pos GE N_ELEMENTS(vector) - 1: new_vector = [vector, element]
	value: value of the new element. Value may be a scalar or vector.
		If value is a vector pos must have the same number of elements.
		Otherwise value[0] is inserted at pos.

 OUTPUTS:
	This routine returns a vector with new elements inserted at specified positions.

 EXAMPLE:
	a = [4,5,6,7,8,9]
	PRINT, insert_element_in_vector(a, 0, 99)
		-->        4      99       5       6       7       8       9
	PRINT, insert_element_in_vector(a, [-1, 15], 99)
		-->       99       4       5       6       7       8       9      99
	PRINT, insert_element_in_vector(a, [0, 2, 4], [99, 88, 77])
		-->        4      99       5       6      88       7       8      77       9

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 24.06.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\insert_element_in_vector.pro)


INSIDE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:       inside

 USEAGE:        RESULT = inside(xx,yy)
                RESULT = inside(xx,yy,xpoly,ypoly,nbin=nbin)

 PURPOSE:       find the indices of the data quantities xx and yy which
                lie inside a given polygonal region

 INPUT: 
   xx           vector of quantity x, ploted on x axis of scatter plot
   yy           vector of quantity y, ploted on y axis of scatter plot

 OPTIONAL INPUT:

   xpoly        vector of x coordinates vertices of polygon
   ypoly        vector of y coordinates vertices of polygon
 
 OPTIONAL KEYWORD INPUT:

   psym         if set, selected points are marked with symbol psym.
                if psym=3, the screen is erased and a new plot is drawn.
                this only works if the boundaries are specified 
                interactively.

   nbin         number of bins with which to resolve the polygon.
                A two element vector may be used to specify number 
                in x and y directions seperately.  (DEFAULT = 100)

 OUTPUT:
                returned value = vector of array indecies inside polygon

 PROCEDURE:     If xpoly and ypoly are not supplied, the operator 
                specifies the region using the interactive graphics
                procedure, TRACE.
                

 EXAMPLE
          x=randomn(seed,20,20)
          y=sin(5*x)+.8*randomn(seed,20,20)
          plot,x,y,psym=3
          i1=inside(x,y,psym=4)         ; the indecies of the data points
          i2=inside(x,y,psym=5)         ; which are inside polygonal area
          

 AUTHOR:              Paul Ricchiazzi    oct92 
                      Earth Space Research Group, UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\inside.pro)


INSTALL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        INSTALL

 PURPOSE:
        Generic installation routine. Installs files from a
        listfile or by filemask. Creates target directory 
        and makes automatic backup of old versions. With the
        RCS keyword set, files will be extracted from the
        version control system instead of being copied from the
        master directory.

 CATEGORY:
        Installation

 CALLING SEQUENCE:
        INSTALL ,targetdir,masterdir [,options]

 INPUTS:
        TARGETDIR -> Name of the directory where the files shall
            be located. Default is '.'.

        MASTERDIR -> Name of the directory from which files tchall
            be copied. If the RCS keyword is set, this is the directory
            that contains the master repository, not the RCS directory
            itself. Default is '.'. Note: Target and master directory
            must differ.

 KEYWORD PARAMETERS:
        LISTFILE -> Name of a file that contains the names of all
            files to be copied. The files listed in LISTFILE will 
            be searched in MASTERDIR+'/'+filename, i.e. they should
            be specified with relative path information. Empty lines
            or lines that start with '#' are ignored. Tip: Use
            ls -1 > listfile   to create a listfile, then edit manually.
            LISTFILE must be given as fully qualified path.

        FILEMASK -> As an alternative to providing a listfile, one
            can specify a filemask. Then all files matching this
            filemask will be copied/extracted. Again: filemask is 
            attached to MASTERDIR.

        /RCS -> Set this flag to extract files from the version 
            control system rather than copying them over.

        R_ATTRIBUTE -> AN optional string that contains extra parameters
            for the RCS co command (e.g. '-sStab' to extract the latest
            stable version of a file).

        /NO_BACKUP -> Set this flag if you do not want to create a 
            backup copy of existing files with the same name.

        LOGFILE -> Optional filename of an IDL journal file. Default
            is '~/install.log'. Install will open (and close) a 
            journal file unless one has already been opened before 
            (i.e. by a caller routine that installs a larger package).

 OUTPUTS:
        The selected files will be installed or updated in TARGETDIR.
        A backup copy of older versions is made in TARGETDIR/BACKUP.
        A journal file is created.

 SUBROUTINES:

 REQUIREMENTS:
        Uses  strdate, strwhere, strrepl, yesno, mfindfile,
           extract_filename from the tools suite.

 NOTES:
        The IDL search path is temporarily extended (TOOLS_HOME is
        added to ensure proper working of install).

        The working directory is temporarily changed to the TARGETDIR
        and changed back at the end.

 EXAMPLE:
        Install,'./newprog','~master/IDL/progs',listfile='progs.list'

        ; Copies all files from ~master/IDL/progs/progs.list into
        ; ./newprog

        DFrom = './newprog'
        DTo   = '~master/IDL/progs'
        Install,DFrom,DTo,filemask='*.pro',/RCS,R_Attr='-sStab'  

        ; Extracts the latest stable version of all IDL pro files
        ; from ~master/IDL/progs/RCS and copies them into ./newprog

 MODIFICATION HISTORY:
        mgs, 22 Jan 1999: VERSION 1.00
        mgs, 25 Jan 1999: - Install now generic. See install_gamap.pro
               for the installation of the GAMAP package.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\install.pro)


INTEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		INTEG
 VERSION:
		4.0
 PURPOSE:
		Integrates a function provided as an array of points.
 CATEGORY:
		Mathematical Function (array).
 CALLING SEQUENCE:
		Result = INTEG([X,] Y [, keywords])
 INPUTS:
	Y
		A vector containing the Y coordinates of the data.
 OPTIONAL INPUT PARAMETERS:
	X
		A vector containing the X coordinates of the data.  If not provided,
		it is assumed that the X coordinates are equally spaced, with a default
		default spacing of 1. (unless changed by the DELTA keyword).
 KEYWORD PARAMETERS:
	DELTA
		Sets the spacing of the X coordinates of the data.  If the X coord.
		are explicitly provided (see X input above) DELTA is ignored.
	/VALUE_ONLY
		Switch.  Normally INTEG returns the integral function of Y, as a vector
		(see OUTPUTS below).  If VALUE_ONLY is set, only the full value of the
		integral is returned as scalar.  This makes the execution faster.
 OUTPUTS:
		Normally returns the integral function of Y, i.e. a vector whose i-th
		entry is the integral of Y from X(0) to X(i) (and therefore the last
		entry is the full integral of Y.  If the optional keyword VALUE_ONLY is
		set, only the full integral is returned, as a scalar.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The Y vector (and the X vector, if provided) must be of length >= 3.
 PROCEDURE:
		Simpson integration, where the mid-interval points are obtained from
		cubic interpolation using Neville's algorithm.
		Uses CALCTYPE, DEFAULT, FPU_FIX and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 20-FEB-1992 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 25-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\integ.pro)


INTEGRAL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:        integral

 USEAGE:         result=integral(x,y,xrange=xrange,accumulate=accumulate)

 PURPOSE:        integration by trapezoid rule

 INPUT:
   x             vector of x axis points. If XRANGE is not set,
                 limits of integration will be from x(0) to x(n_elements(x)-1)
                 If XRANGE is not set, X need not be monitonic.

   y             vector of corresponding y axis points

 KEYWORD_INPUT:

   xrange        2 element vector, lower and upper limit of integration
                 The use of XRANGE with a non-monitonic variation in x may
                 produce incorrect results.

   accumulate    if set, return value is a vector giving the accumulated
                 integral at each value of x. XRANGE can't be used when
                 this option is set.

 OUTPUT:         result of integration

 EXAMPLE:
;                 /4
; find            |  x dx
;                 /0 
  x=findgen(5) & y=x
  print,integral(x,y)     
  8.00000                             ; answer for linear integrand is exact


;                 /5.5
; find            |  x^2 dx
;                 /0 

  x=findgen(7) & y=x^2               &$
  print,"    numerical     analytic" &$
  print,integral(x,y,xrange=[0,5.5]), 5.5^3/3
     56.3750      55.4583             

; use more resolution in x to improve answer

  x=findgen(551)/100. & y=x^2        &$
  print,"    numerical     analytic" &$
  print,integral(x,y), 5.5^3/3
     55.4584      55.4583             ; much better

  author:  Paul Ricchiazzi                            3NOV92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:
 sep93: fixed error in treatment of xrange, added examples
 apr96: allow use of xrange with monitonically decreasing x

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\integral.pro)


INTERACTIVE_CURSOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   interactive_cursor

 PURPOSE:
   This function returns the data coordinates of any point within a plot.
	It also handels multiple plots on one page.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   result = interactive_cursor(ppos)

 KEYWORD PARAMETERS:
   XTRANS = xs, YTRANS = ys: two dimensional arrays (2, n) (n is the number of plots)
		with the scaling factors for converting between data coordinates
		and normalized coordinates for the different plots.
		After issuing a plot command this information is stored in the
		system variables !X.S and !Y.S and has to be saved in xs and ys
		before the next plot is done.
		This input is not needed if there is only one plot on the page.

 OUTPUTS:
   This functions returns a 2-element array - [x, y]
		- with the position of the cursor in data coordinates if the cursor is inside a plot
		- with [!VALUES.F_NAN, !VALUES.F_NAN] if the cursor is outside a plot.

 OPTIONAL OUTPUTS:
	FOCUS = i_focus: Number of the plot (0, 1, ...) which has the focus
		(e.g. over which the cursor is placed).
		i_focus = -1 if the cursor is outside a plot.
	MOUSE_BUTTON = mb - On return the parameter mb will be 1
		if the left mouse button was pressed otherwise it will be 0.

 EXAMPLE:
	see test_interactive_cursor.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 03-Jun-1998.
	16.03.2000:	Removed debug command
					Changed output from get_focus from array[1] to scalar

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\interactive_cursor.pro)


INTERP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    interp

 PURPOSE:    interpolate on a table of up to 5 dimensions

 USEAGE:     result=interp(table,utab,u,[vtab,v,[xtab,x,[ytab,y,[ztab,z]]]])

 INPUT:
   table     table of values depending on upto 5 parameters

   utab      1-d  (monitonically increasing) table of 1st parameter 
   u         array of values of 1st parameter
   vtab      1-d  (monitonically increasing) table of 2nd parameter
   v         array of values of 2nd parameter
   xtab      1-d  (monitonically increasing) table of 3rd parameter
   x         array of values of 3rd parameter
   ytab      1-d  (monitonically increasing) table of 4th parameter
   y         array of values of 4th parameter
   ztab      1-d  (monitonically increasing) table of 5th parameter
   z         array of values of 5th parameter

   NOTE:     the number of input parameters must be appropriate to
             the size of the look-up table.  For example for a 3-d table,
             parameters ytab,y,ztab, and z should not be supplied.

 KEYWORD INPUT:
  GRID       if set the input parameters are used to create a grid of
             parameter values.  In this case the input parameters need not
             be all the same size but should all be vectors.  If GRID is
             not set all input arrays (u,v,x,y,z) and the returned value
             are of the same size and dimensionality.

  MISSING    The value to return for ARRAY elements outside the bounds 
             of TABLE.  If MISSING is not set return value is either
             the nearest value of TABLE or an extrapolated value, depending
             on how CLIP is set. 

  CLIP       If this keyword is set, locations less than the minimum or 
             greater than the maximum corresponding subscript of TABLE
             are set to the nearest element of TABLE.  The effect of 
             MISSING is disabled when CLIP is set.

   i1...i5
   f1...f5   these keywords are used in conjunction with the use_if
             keyword.  If use_if is not set, the i's and f's are
             calculated and returned.  If use_if is set, the i's and
             f's are not calculated but taken from the keywords.
             This is useful when there exists multiple TABLEs based
             on the same dimensions and variables, and one wishes to
             improve the performance.  In this case, the first time
             INTERP is called, the i's and f's are specified in the
             call but use_if is not set.  In subsequent calls, use_if
             is set.

   use_if    keyword to indicate that i's and f's should not be calculated
             but rather are input by user
 
 OUTPUT:
   result    interpolated value

 PROCEDURE:  FINDEX is used to compute the floating point interpolation
             factors into lookup table TABLE. When the dimensionality 
             of TABLE is 3 or less and either CLIP or MISSING is set,
             then IDL library procedure INTERPOLATE is used to perform the
             actual interpolations.  Otherwise the interpolations are
             explicitly carried out as mono-, bi-, tri-, tetra- or
             penta-linear interpolation, depending on the
             dimensionality of TABLE.

 EXAMPLE:

; Here is an example of how to interpolate into a large DISORT
; radiance lookup table to find radiance at given values of optical
; depth, surface albedo, relative azimuth, satellite zenith
; angle and solar zenith angle.

  file='~paul/palmer/runs/0901a.dat'
  readrt20,file,winf,wsup,phidw,topdn,topup,topdir,botdn,botup,botdir,$
                   phi,theta,rad,tau,salb,sza

  phi=phi(*,0,0,0)
  theta=theta(*,0,0,0)
  tauv=alog(1.25^findgen(20)+1.)
  taut=alog(tau+1.)
  sa0=findgen(10)*.1

;   rel azimuth    sat_zen   surface_albedo
      p0=130 &      t0=20 &      s0=60
  buf=interp(rad,phi,p0,theta,t0,taut,tauv,salb,sa0,sza,s0,/grid)
  plot,exp(tauv)-1.,buf(0,0,*,9)
  for i=0,8 do oplot,exp(tauv)-1.,buf(0,0,*,i)

  An example for use_if:

    DISORT is used to build two look up tables, RTM_bb_botdn and RTM_bb_topdn,
    based on the same parameters of tau, sza, wv, and o3.  Given measurements
    of these variables, BOTDN and TOPDN can be interpolated.  However, since
    the measurements are the same, and the LUTs are built similarly, it is
    redundant to calculate the i's and f's twice.

  bb_botdn = interp(RTM_bb_botdn,    $
                    RTM_bb_tau,       all_tau_arr, $
                    RTM_bb_sza,       all_sza_arr, $
                    RTM_bb_wv,        all_wv_arr , $
                    RTM_bb_o3,        all_o3_arr, $
                    i1=i1,f1=f1,i2=i2,f2=f2,i3=i3,f3=f3,i4=i4,f4=f4)
  bb_topdn = interp(RTM_bb_topdn,    $
                    RTM_bb_tau,       all_tau_arr, $
                    RTM_bb_sza,       all_sza_arr, $
                    RTM_bb_wv,        all_wv_arr , $
                    RTM_bb_o3,        all_o3_arr, $
                    i1=i1,f1=f1,i2=i2,f2=f2,i3=i3,f3=f3,i4=i4,f4=f4,/use_if)

  
  author:  Paul Ricchiazzi                            sep93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\interp.pro)


INTERP1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INTERP1
 PURPOSE:
       Linear interpolation.
 CATEGORY:
 CALLING SEQUENCE:
       y2 = interp1(x,y,x2)
 INPUTS:
       x,y = x and y arrays for a function.       in
       x2 = array of desired x values.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y2 = array of interpolated y values.       out
 COMMON BLOCKS:
 NOTES:
       Notes: y2 has the same number of elements as x2.
         Out of range values in x2 are clipped to the range
         of x.  Arrays x and y need not be monotonic or
         single valued.  The output array, y2, has the same
         data type as x2 (not y).
 MODIFICATION HISTORY:
       R. Sterner, 28 Feb, 1985.
       B. L. Gotwols 22-feb-1990 modified to handle out of range.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\interp1.pro)


INTERPX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INTERPX
 PURPOSE:
       Interpolate data with possible gaps and missing (bad) values.
 CATEGORY:
 CALLING SEQUENCE:
       yy = interp1(x,y,xx)
 INPUTS:
       x,y = input points.            in
         x is assumed monotonically increasing.
       xx = desired x values.         in
         xx need not be monotonically increasing.
 KEYWORD PARAMETERS:
       Keywords:
         BAD=b  Values GREATER THAN b are considered missing.
         GAP=g  Gaps in x greater than or equal to this
           are broken by setting the output curve points
           in the gaps to a flag value of 32000 or BAD if given.
         /FIXBAD  means interpolate across bad data between
           closest good points on each side.  Otherwise the
           bad points are flagged with the value specified
           for BAD.
 OUTPUTS:
       yy = interpolated y values.    out
 COMMON BLOCKS:
 NOTES:
       Notes: Flagged values may be used to break a plotted
          curve using MAX_VALUE in the PLOT or OPLOT command:
          plot,x,y,max_value=999
          SLOW for more than a few thousand points.
 MODIFICATION HISTORY:
       R. Sterner, 12 Aug, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\interpx.pro)


INTERPX_DEMO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INTERPX_DEMO
 PURPOSE:
       Demonstrate the use of interpx.
 CATEGORY:
 CALLING SEQUENCE:
       interpx_demo
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: the routine interpx may be used to interpolate
         across bad points and/or data gaps.  Example calls
         are shown by this routine.
 MODIFICATION HISTORY:
       R. Sterner, 7 Sep, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\interpx_demo.pro)


INTERSECT[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INTERSECT
 PURPOSE:
       Return the elements common to two given arrays.
 CATEGORY:
 CALLING SEQUENCE:
       z = intersect(x,y)
 INPUTS:
       x, y = arrays (not necessarily same size).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       z = array of elements in common.            out
 COMMON BLOCKS:
 NOTES:
       Note: if z is a scalar 0 then no elements were
         in common.
 MODIFICATION HISTORY:
       R. Sterner  19 Mar, 1986.
       R. Sterner, 4 Mar, 1991 --- converted to IDL v2.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\intersect.pro)


INTERSECT[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	INTERSECT

 PURPOSE:
	Return the an array that is the intersection of the two input arrays.

 CATEGORY:
	Array manipulation.

 CALLING SEQUENCE:
	x = INTERSECT(array1, array2)

 INPUTS:
  Arrays    The arrays to be scanned.  The type and number of dimensions
            of the array are not important.  

 OPTIONAL INPUTS:
   nodata:  This is the value returned if no value in the both of the
            arrays.  The default is -1.

   xor_flag if this keyword is set, only values are returned that belong
            to one array or the other, but not both,
            i.e., the complement of the set of intersection.
            

 OUTPUTS:
	     result = An array of the values

 EXAMPLE:

     x = [0,2,3,4,6,7,9]
     y = [3,6,10,12,20]

; print intersection of x and y

     print,intersect(x,y)
          3        6

; print xor elements

     print,intersect(x,y,/xor_flag)
          0       2       4       7       9      10      12      20

; print values in x that are not in y        

     xyu=intersect(x,y,/xor_flag) & print,intersect(x,xyu)
          0       2       4       7       9     


 COMMON BLOCKS:
	None.
 
 AUTHOR and DATE:
     Jeff Hicke     12/16/92

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\intersect.pro)


INT_LOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       INT_LOW
 PURPOSE:
       Drop an integer data type to the lowest precision.
 CATEGORY:
 CALLING SEQUENCE:
       out = int_low(in)
 INPUTS:
       in = Input value or array (must be integer).  in
 KEYWORD PARAMETERS:
       Keywords:
         TYPE=v Value to use to determine precision.
           Will set the output precision to the lowest
           possible that will hold max(v).  If TYPE=v is
           not given then max(in) is used.
 OUTPUTS:
       out = Returned value or array.                out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 30

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\int_low.pro)


INV_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        INV_INDEX

 PURPOSE:
        After one or several filter operations with Where, find the
        indices that are not in the index array. For a single call to
        where this is equivalent to using the upcoming COMPLEMENT
        keyword to where. However, this function is still useful to
        invert the index arrays e.g. after a call to ind_comb.

 CATEGORY:
        array index handling

 CALLING SEQUENCE:
        RESULT = INV_INDEX(INDEX,TOTALN)

 INPUTS:
        INDEX : an index array, e.g. previously generated by a
              WHERE command (may be -1)
        TOTALN : the number of elements in the reference data
              set, i.e. totaln = n_elements(index)+n_elements(result)

 KEYWORD PARAMETERS:

 OUTPUTS:
        an integer array with all indices that were NOT in index
        or -1 if index was complete

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        The function returns -1 if one of the following errors occurs:
        - invalid number of arguments
        - index variable is undefined
        - totaln is less than n_elements(index)
        - totaln less or equal 1, i.e. no associated data
        The last error does not produce an error message, since this
        feature was found to be very useful (in EXPLORE, the widget based
        interactive data explorer)

 EXAMPLE:
        data = findgen(50)
        index = where(data ge 25)
        invers = inv_index(index,n_elements(data))
        print,invers

        IDL prints numbers 0 through 24

 MODIFICATION HISTORY:
        mgs, 10 May 1997: VERSION 1.00
        mgs, 18 Aug 1997: - added template and check if n_elements(index) eq 0
        mgs, 05 Apr 1999: - bug fix: needed to make sure result is
                            type long
        mgs, 25 Aug 2000: - changed copyright to open source
                          - changed error handling to message
                          - [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\inv_index.pro)


IREXZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   irexz

 PURPOSE:
   reads a special ENZ file (KFA ICG3 data format)
   dd.mm.yy hh:mm:ss, interval, data, error

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   IREXZ, file, dvalue, ix, iy, text, header, err

 INPUTS:
   file:   filename to be read

 KEYWORD PARAMETERS:
   refdate:    refdate for conversion
   delimiter:  the string between the numbers in a record
               defaults: ';' ',' tab and space are found
               automatically, the first line is analyzed
   fillvalue:  the numeric value for '====' input
               default: -12345.

 OUTPUTS:
   dvalue: matrix of ix * iy double values
   ix:     number of records in dvalue (rows)
   iy:     number of columns
   text:   text array of iy column descriptions
   header: the whole header of the file
   err:    flag indicating error

 SIDE EFFECTS:
   uses the following pro/func which are part of this file
   Function file2strarr, file

 EXAMPLE:

 REVISION HISTORY:
   Written         Theo Brauers, Oct 1997
   Revised         T.B. Nov. 1997, 1.02
                   T.B. 1997-Feb-12 return line# of err

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\irexz.pro)


IRZN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   irzn

 PURPOSE:
   reads a ZEICHN/ENZ file (KFA ICG3 data format)

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   IRZN, file, dvalue, ix, iy, fb, text, header, err

 INPUTS:
   file:   filename to be read

 KEYWORD PARAMETERS:
   high_err :  not set (default)
   low_err  :  not set (default)
   both set :  then (if fb=1) dvalue contains only the exact numbers
               and the arrays high_err and low_err will be returned
   js_time  :  not set (default)
       set  :  then js_time will be returned (if not high_err:one column)
               if high_err set and fb=1 then js_time(ix/3,3)

   errmess  :  returns a error message

   fillvalue:  the numeric value for '====' input
               default: -12345.

 OUTPUTS:
   dvalue:  matrix of ix * iy double values
   ix:      number of records in dvalue (rows)
   iy:      number of columns
   fb:      flag for error bars
   text:    text array of iy column descriptions
   header:  the whole header of the file
   err:     flag indicating error  err=1 : no parameter
                                   err=2 : filesize <0
                                   err=3 : no header found
                                   err=4 : number of columns=0
                                   err=5 : overwriting label
   high_err: upper error
   low_err : lower error
   js      : time in julian seconds (one or three columns)

 SIDE EFFECTS:
    uses the procedure REPL_STR

 EXAMPLE1:
   IRZN, 'test.enz', dvalue, ix, iy, fb, text, header, err,$
           errmess=errmess
   IF err GT 0 THEN print,err,errmess
   print, 'Records= ', ix, '  Columns=', iy

 EXAMPLE2:
   irzn,'t.zus',dvalue,ix,iy,fb,text,header,err,$
          low_err=low_err,high_err=high_err,js_time=js_time

 MODIFICATION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised         T.B. Sep. 1997, 1.01, 1.02
                       T.B. Sep. 1997, file2strarr
                       T.B. Sep. 1997, delimiter find
                       T.B. Nov. 1997, skip blanks in header
                       M.L. Dez. 1997, file I/O, repl_str ,header
                       M.L. Feb. 1998, js_time,high_err,low_err
                       FR   Mar. 1998, strupcase in testz=STRPOS(strupcase(text[i_text]),'TIME/SEC SINCE')
                       FR   Mar. 1998, all for-loops with long integer
                       FR   Mar. 1998, strupcase included in :
                                       it1 = WHERE(STRPOS(strupcase(header), 'ZAHL DER SPALTEN') GT -1, c1)
                                       it2 = WHERE(STRPOS(strupcase(header), 'NUMBER OF COLUMNS') GT -1, c2)
                                        it = WHERE(STRPOS(strupcase(header),'FEHLERBALKEN') GT -1, c)
                                        it = WHERE((STRPOS(STRMID(strupcase(header),0,6),'SPALTE') GT -1) OR $
                                                   (STRPOS(STRMID(strupcase(header),0,6),'COLUMN') GT -1), c)

                       FR 11.11.1998  Zum Suchen der Zeitspalte wird jetzt TIME/SECSINCE mit strcompress(titel,/remove_all) benutzt
                       FR 17.12.1998  text=STRTRIM(text,2) am Ende eingebaut
                       FR 23.02.1999  handling of DAYS SINCE for calculation of JulianSeconds included
                       T.B. 8.8.99    byt EQ 0 error removed
                       FR 11.01.2000  strtrim eingeführt in num = FIX(STRMID(strcompress(s[0],/remove_all),6,10))

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\irzn.pro)


ISALGEBRAIC (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISALGEBRAIC (function)

 PURPOSE:
        Locates the position of algebraic characters in a string
        (e.g. locations that are EITHER digits '.' OR +/- signs).

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISALGEBRAIC( S [, Keywords ] )

 INPUTS:
        S -> The string to be tested.  

 KEYWORD PARAMETERS:

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
            (integer) that contains as many elements as S has 
            characters.  If S is a single character, then RESULT will 
            be scalar. Where RESULT = 1, the corresponding characters 
            in S are algebraic.

 SUBROUTINES:

 REQUIREMENTS:
        None

 NOTES:
        None

 EXAMPLE:
        print, ISALGEBRAIC( '-100;+100' )
            ; prints 1 1 1 1 0 1 1 1 1 

 MODIFICATION HISTORY:
        bmy, 17 Nov 1998: VERSION 1.00
        mgs, 17 Nov 1998: - removed INVERT keyword. It's simply 1-isalgebraic
                          - added test for '.'
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isalgebraic.pro)


ISALNUM (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISALNUM (function)

 PURPOSE:
        IDL analog to the 'isalnum' routine in C.  Locates 
        alphanumeric characters ( A...Z, a...z, 0..9 ) in a string.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISALNUM( S )

 INPUTS:
        S  -> The string to be tested.  

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are alphanumeric

 SUBROUTINES:
        ISALPHA (function)
        ISDIGIT (function)

 REQUIREMENTS:

 NOTES:
        None

 EXAMPLE:
        print, isalnum( 'ABCD0123#' )
            ; prints, 1 1 1 1 1 1 1 1 0

        print, isalnum( '#' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998  - now use BYTE function in where statement
                            instead of hardwired constants
        bmy, 02 Jun 1998  VERSION 1.10
                          - now uses ISALPHA and ISDIGIT

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isalnum.pro)


ISALPHA (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISALPHA (function)

 PURPOSE:
        IDL analog to the 'isalpha' routine in C.  Locates the
        positions of alphabetic characters ( A...Z, a...z ).

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISALPHA( S )

 INPUTS:
        S  -> The string to be tested. 

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are alphabetic.
        
 SUBROUTINES:
        ISUPPER (function)
        ISLOWER (function)

 REQUIREMENTS:
        None

 NOTES:
        None

 EXAMPLE:
        print, isalpha( 'ABcd0123' )
            ; prints, 1 1 1 1 0 0 0 0

        print, isalpha( '#' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 29 May 1998: VERSION 1.00
        bmy, 01 Jun 1998: - now returns 0 for condition FALSE
                          - fixed bug that allowed byte values from
                            91-96 to be treated as letters
        bmy, 02 Jun 1998  - now use BYTE function in where statement
                            instead of hardwired constants
        bmy, 02 Jun 1998  VERSION 1.10
                          - now uses ISUPPER and ISLOWER 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isalpha.pro)


ISARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ISARRAY
 PURPOSE:
       Tests if the argument is an array.
 CATEGORY:
 CALLING SEQUENCE:
       flag = isarray(a)
 INPUTS:
       a = variable to test.                                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       flag = test result: 0 if not array, else non-zero.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner  20 Mar, 1986.
       Checked for undefined variables.  RES 25 Aug, 1989.
       Johns Hopkins Applied Physics Lab.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\isarray.pro)


ISDEFINED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    isdefined

 PURPOSE:
    return 1 if a variable is defined or 0 otherwise. Basically this
    is equivalent to (N_Elements(arg) GT 0), and so this function is
    generally not needed.

 CATEGORY:
    General Programming

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\is_defined.pro)


ISDIGIT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISDIGIT (function)

 PURPOSE:
        IDL analog to the 'isdigit' routine in C.  Locates
        numeric characters ( '0' ... '9') in a string. 

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISDIGIT( S )

 INPUTS:
        S -> The string to be tested.  

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are numeric.

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        None

 EXAMPLE:
        print, isdigit( '3001ABcd' )
            ; prints, 1 1 1 1 0 0 0 0

        print, isdigit( '#' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 29 May 1998: VERSION 1.00
        bmy, 01 Jun 1998: - now returns 0 for condition FALSE
        bmy, 02 Jun 1998  - now use BYTE function in where statement
                            instead of hardwired constants
        bmy, 02 Jun 1998  VERSION 1.10
                          - now can analyze an entire string
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isdigit.pro)


ISGRAPH (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISGRAPH (function)

 PURPOSE:
        IDL analog to the 'isgraph' routine in C.  Locates all
        graphics characters in a string.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISGRAPH( S ) 

 INPUTS:
        S  -> The string to be tested.  

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are graphics characters.

 SUBROUTINES:
        None

 REQUIREMENTS:

 NOTES:
        Graphics characters are printing characters (i.e. they can be
        seen on the screen or on a printout) but EXCLUDE the 
        space ( ' ' ) character.

 EXAMPLE:
        print, isgraph( 'ABCD !#~%' )
            ; prints, 1 1 1 1 0 1 1 1 1

        print, isgraph( string( 9B ) )  ; horizontal tab
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998  - now use BYTE function in where statement
                            instead of hardwired constants
        bmy, 02 Jun 1998  VERSION 1.10
                          - now can analyze an entire string
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isgraph.pro)


ISLEAP (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISLEAP (function)

 PURPOSE:
        Takes one or more year values (integer or long) as argument
        and Returns 1 for each year that is a leap year.

 CATEGORY:
        Calendar routines

 CALLING SEQUENCE:
        result = ISLEAP(year)

 INPUTS:
        YEAR -> A year or an array of years. Must be "4 digit" years.

 KEYWORD PARAMETERS:
        none.

 OUTPUTS:
        An integer value or array with 1 for each year that is
        a leap year.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        For many purposes one should take a look at built-in
        IDL date functions first (version > 5.0).

 EXAMPLE:
        ; Create an array of years from 1980 to 1998
        years = findgen(19) + 1980
        ; Compute the number of days for each year
        ndays = 365 + isleap(years)

 MODIFICATION HISTORY:
        mgs, 02 Oct 1998: VERSION 1.00
        mgs, 25 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isleap.pro)


ISLOWER (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISLOWER (function)

 PURPOSE:
        IDL analog to the 'islower' routine in C.  Locates all 
        lowercase alphabetic characters in a string.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISLOWER( S )

 INPUTS:
        S  -> The string to be tested

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are lowercase alphabetic.

 SUBROUTINES:
        None

 REQUIREMENTS:

 NOTES:
        None

 EXAMPLE:
        print, islower( 'abcdefG' )
            ; prints: 1  1  1  1  1  1  0

        print, islower( 'A' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998: VERSION 1.10
                          - now can analyze entire strings
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\islower.pro)


ISNUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ISNUM
 VERSION:
		4.0
 PURPOSE:
		Checks whether the input is a number.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = ISNUM(X)
 INPUTS:
	X
		Arbitrary, doesn't even have to exist.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	TYPE
		Optional output.  See below.
	/STRICT
		Switch.  If set, unsigned integers are *NOT* considered numbers.
	/UNSIGNED
		Switch.  If set the result is 1 only if X is of any unsigned integer
		type.
	/INTEGER
		Switch.  If set the result is 1 only if X is of any integer type,
		whether signed or unsigned.
	/DOUBLE
		Switch.  If set the result is 1 only if X is DOUBLE or DCOMPLEX.
	/COMPLEX
		Switch.  If set the result is 1 only if X is COMPLEX or DCOMPLEX.
 OUTPUTS:
		Returns 1 if X is number (optionally, satisfying the constraints set
		by the keywords), 0 otherwise.  Output type is byte.
 OPTIONAL OUTPUT PARAMETERS:
	TYPE
		The name of the variable to receive the numeric code of the type of X.
		Included for convenience to save an additional call to TYPE.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Using TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUN-1995 by Mati Meron.
		Modified 5-MAY-1996 by Mati Meron.  Added keywords DOUBLE, COMPLEX and
		TYPE.
		Modified 25-DEC-2000 by Mati Meron.  Added keyword INTEGER.
		Modified 30-JAN-2001 by Mati Meron.  Added recognition of new numeric
		types and the keywords UNSIGNED and STRICT.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\isnum.pro)


ISNUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ISNUMBER
 PURPOSE:
       Determine if a text string is a valid number.
 CATEGORY:
 CALLING SEQUENCE:
       i = isnumber(txt, [x])
 INPUTS:
       txt = text string to test.                      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x = optionaly returned numeric value if valid.  out
       i = test flag:                                  out
           0: not a number.
           1: txt is a long integer.
           2: txt is a float.
           -1: first word of txt is a long integer.
           -2: first word of txt is a float.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  15 Oct, 1986.
       Johns Hopkins Applied Physics Lab.
       R. Sterner, 12 Mar, 1990 --- upgraded.
       Richard Garrett, 14 June, 1992 --- fixed bug in returned float value.
       R. Sterner, 1999 Nov 30 --- Fixed a bug found by Kristian Kjaer, Denmark

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\isnumber.pro)


ISPRINT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISPRINT (function)

 PURPOSE:
        IDL analog to the 'isprint' routine in C.  Returns 1 if
        a character is a printable character (including space).

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISPRINT( S )

 INPUTS:
        S -> The string to be tested.

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are printable.

 SUBROUTINES:
        None

 REQUIREMENTS:

 NOTES:
        Printing characters can be seen on the screen (these exclude
        control characters).

 EXAMPLE:
        print, isprint( '!X3d ' )
            ; prints, 1 1 1 1 0

        print, isprint( string( 9B ) )  ; horizontal tab
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998  - now use BYTE function in where statement
                            instead of hardwired constants
        bmy, 02 Jun 1998: VERSION 1.10
                          - now uses ISGRAPH

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isprint.pro)


ISSPACE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISSPACE (function)

 PURPOSE:
        IDL analog to the 'isspace' routine in C.  Locates 
        white space characters in a string.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISSPACE( S ) 

 INPUTS:
        S  -> The string to be tested.  

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Where RESULT = 1, the corresponding characters in S
                  are numeric.

 SUBROUTINES:
        None

 REQUIREMENTS:

 NOTES:
        None

 EXAMPLE:
        print, isspace( '     ' )
            ; prints, 1 1 1 1 1

        print, isspace( 'A' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998: - now use BYTE function in where statement
                            instead of hardwired constants (where
                            possible)
        bmy, 02 Jun 1998: VERSION 1.10
                          - now can analyze an entire string 
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isspace.pro)


ISUPPER (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ISUPPER (function)

 PURPOSE:
        IDL analog to the 'isupper' routine in C.  Locates all 
        uppercase alphabetic characters in a string.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = ISUPPER( S )

 INPUTS:
        S  -> The string to be tested

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        Result -> The value of the function.  RESULT is an index array
                  that contains as many elements as S has characters. 
                  If S is a single character, then RESULT will be scalar.
                  Uppercase alphabetic characters in S are thus
                  denoted by the condition ( RESULT eq 1 ).

 SUBROUTINES:
        None

 REQUIREMENTS:
        Assumes that the ASCII character set is the character set
        installed on the system.  The byte values will be different
        for other character sets such as EBSDIC.  

 NOTES:
        None

 EXAMPLE:
        print, isupper( 'ABCDEFg' )
            ; prints: 1  1  1  1  1  1  0

        print, isupper( 'a' )
            ; prints 0

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        bmy, 02 Jun 1998: VERSION 1.10
                          - now can analyze entire strings
        mgs, 25 Aug 2000: - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\isupper.pro)


IS_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_array

 PURPOSE:
	Test if variable is of type array

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_array(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type array else it returns 0

 EXAMPLE:
	A = [1, 2, 3]
	PRINT, is_array(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 19.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_array.pro)


IS_BYTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_byte

 PURPOSE:
	Test if variable is of type byte

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_byte(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type byte else it returns 0

 EXAMPLE:
	A = 3b
	PRINT, is_byte(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_byte.pro)


IS_CDOUBLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_cdouble

 PURPOSE:
	Test if variable is of type complex double

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_cdouble(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type complex double else it returns 0

 EXAMPLE:
	The following code doesn't work, I don't know why:
		A = COMPLEX(3.0D00, 2.0D00)
		PRINT, is_cdouble(A)
		-> 0 !!!
		PRINT, SIZE(A) -> 0 6 1 (6 is the type of complex float)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_cdouble.pro)


IS_CFLOAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_cfloat

 PURPOSE:
	Test if variable is of type complex float

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_cfloat(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type complex float else it returns 0

 EXAMPLE:
	A = COMPLEX(3.0, 2.0)
	PRINT, is_cfloat(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_cfloat.pro)


IS_DEFINED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_defined

 PURPOSE:
	Test if variable is defined

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_defined(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is defined else it returns 0

 EXAMPLE:
	A = 3
	PRINT, is_defined(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 20.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_defined.pro)


IS_DIR[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       is_dir

 PURPOSE:
       Test if directory exist

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       Result = is_dir(path)

 INPUTS:
       path: The variable to be tested.

 OUTPUTS:
       This function returns 1 if directory exist else it returns 0

 EXAMPLE:
       dir='C:\temp'
       PRINT, is_dir(dir)
       -> 1

 MODIFICATION HISTORY:
       Written by:     R.Bauer , 26.01.99

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\is_dir.pro)


IS_DIR[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       is_dir

 PURPOSE:
       Test if directory exist

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       Result = is_dir(path)

 INPUTS:
       path: The variable to be tested.

 OUTPUTS:
       This function returns 1 if directory exist else it returns 0

 EXAMPLE:
       dir='C:\temp'
       PRINT, is_dir(dir)
       -> 1

 MODIFICATION HISTORY:
       Written by:     R.Bauer , 26.01.99

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_dir.pro)


IS_DIR_OK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_dir_ok

 PURPOSE:
  Test if variable is a directory without 10b

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
    result=is_dir_ok(path)

 INPUTS:
   path: the pathname to investigate

 PROCEDURE:
   I don't know why in some cases path names have a 10b at the end of their name
   This function helps to identify these paths
   Surprising me is thats if no 10b at the end of the path is adding of 10b to the string will not cause a problem


 EXAMPLES:
 IDL> print,is_dir_ok('/usr/local/icg/icg/idl_source/idl_work/rb_lib') ; I don't know how it happens
       0
 IDL> print,is_dir_ok('/usr/local/icg/icg/idl_source/idl_work/ja_lib')
      1

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-27
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_dir_ok.pro)


IS_DOUBLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_double

 PURPOSE:
	Test if variable is of type double

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_double(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type double else it returns 0

 EXAMPLE:
	A = 3.0D00
	PRINT, is_double(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_double.pro)


IS_ELEMENT_OF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_element_of

 PURPOSE:
	Test if scalar is element of array.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = is_element_of(scalar, array)

 INPUTS:
	scalar, array: scalar will be searched for in array.

 KEYWORD PARAMETERS:
	INDEX = ind: On return ind will hold the indices of array where scalar was found
		IF scalar is not an element of array ind = -1.
	COUNT = cnt: Number of elements of ind. If scalar is not an element of array cnt = 0.

	The following keyword parameters apply only if scalar and array are of type string:

	/IGNORE_CASE: Setting this keyword parameter causes the program to ignore the case
		of scalar and array.
	/PARSE: Setting this keyword parameter causes the program to identify all elements
		of array which start with the string scalar.

 OUTPUTS:
	This function returns true (1) if scalar is an element of array otherwise it
	returns false (0).

 EXAMPLE:
	PRINT, is_element_of('asd', ['qwe', 'vbn', 'asd', 'yxc', 'ASD'], INDEX = ind)
		--> 1
	PRINT, ind
		--> 2

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.06.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_element_of.pro)


IS_ENV_SET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     is_env_set

 PURPOSE:
     Test if variable is set as environment variable

 CATEGORY:
    PROG_TOOLS

 CALLING SEQUENCE:
  result=is_env_set(environment_variable)

 INPUTS:
  environment_variable: string with the name of the environment variable

 OUTPUTS
   result: 1 (true) if the variable is set
           0 (false) if not

 MODIFICATION HISTORY:
       R. Bauer, 1998-Jun-10
   2000-Feb-18 help changed to call_help
   2000-Apr-06 environment variables are handled as strupcase and strlowcase

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_env_set.pro)


IS_ENZ_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_enz_file

 PURPOSE:
   Test if file type is enz

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=is_enz_file(file)

 INPUTS:
   file : the file name of a file

 OUTPUTS:
   If file has more equal as 10 & it is a enz data file

 EXAMPLE:
   print,is_enz_file(popjgr96.cs)
   1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 1999-Oct-4
       2000-02-18 counts of enz & separator changed to 5

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_enz_file.pro)


IS_EQUAL_VALUE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   is_equal_value

 PURPOSE:
   Test if (array) element is equal to value, works with NaN

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result = is_double(array, value)

 INPUTS:
   array: The variable to be tested.
   value: the check variable

 OUTPUTS:
   This function returns 1 or 0

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1999 Jul
   17.02.2000: Removed cause of error message: 'Floating illegal operand'
               which was issued when array included NaN elements and FINITE(check) = 1 (FH)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\is_equal_value.pro)


IS_FINITE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_finite

 PURPOSE:
	Test if a variable is finite

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_finite(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is finite else it returns 0

 EXAMPLE:
	A = 3
	PRINT, is_finite(A)
	-> 1

	A = !VALUES.F_NAN
	PRINT, is_finite(A)
	-> 0

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 14.06.99

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_finite.pro)


IS_FLOAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_float

 PURPOSE:
	Test if variable is of type float

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_float(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type float else it returns 0

 EXAMPLE:
	A = 3.0
	PRINT, is_float(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_float.pro)


IS_ICGSTRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_icgstruct

 PURPOSE:
	Test if structure is an icg-type structure

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_icgstruct(var)

 INPUTS:
	var: The structure to be tested.

 OUTPUTS:
	This function returns 1 if var is an icg-type structure else it returns 0

 PROCEDURE:
	To decide whether a given structure is an icg-like structure
	this routine queries the existence of tag !GLOBAL.

 EXAMPLE:
	a = {!GLOBAL: {PI: {NAME: 'Frank Holland'}, DATASET: {CAMPAIGN: 'BERLIOZ'}}}
	PRINT, is_icgstruct(a)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 29.07.1999
	14.03.2000:	Removed cause of message '% IS_TAG: structure is not defined' if
					input parameter struct is not of type structure.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_icgstruct.pro)


IS_IDL_SOURCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_idl_source

 PURPOSE:
  Test if file is a idl source file

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=is_idl_source(file_name)

 INPUTS:
   file_name: the file name of the idl source file

 OUTPUTS:
   result: 1:   source is given and ok!,
           0:   no source named as the called file name or some errors in the source


 MODIFICATION HISTORY:
       R. Bauer, 1998-Jul-14
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_idl_source.pro)


IS_INTEGER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_integer

 PURPOSE:
	Test if variable is of type integer

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_integer(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type integer else it returns 0

 EXAMPLE:
	A = 3
	PRINT, is_integer(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_integer.pro)


IS_LINK_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   is_link_file

 PURPOSE:
   Test if file is a link

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=is_link_file(file_name)

 INPUTS:
   file_name: The name of the netCDF File

 OUTPUTS:
   This function returns a long or longarray of boolean 1 if the file is linked or 0 if not

 RESTRICTIONS:
  This routine will only work whith unix

 EXAMPLE:
   result=is_link_file('otto.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), Aug, 18 1998
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_link_file.pro)


IS_LONG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_long

 PURPOSE:
	Test if variable is of type long integer

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_long(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type long integer else it returns 0

 EXAMPLE:
	A = 3L
	PRINT, is_long(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_long.pro)


IS_MONOTONICLY_INCREASING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       is_monotonicly_increasing

 PURPOSE:
       Test if a vector is sorted to monotonic increasing order

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       Result = is_monotonicly_increasing(data)

 INPUTS:
       data: The data to test for

 OUTPUTS:
       This function returns 1 if data is in motonic order  else it returns 0

 EXAMPLE:
       A = [1,3,5]
       PRINT, is_monotonicly_increasing(A)
       -> 1

       A = [1,5,3]
       PRINT, is_monotonicly_increasing(A)
       -> 0


 MODIFICATION HISTORY:
       Written by:     R.Bauer 1999-Oct-07

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_monotonicly_increasing.pro)


IS_NASA_AMES_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_nasa_ames_file

 PURPOSE:
   Test if file type is NASA AMES FILE

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   Result=is_nasa_ames_file_file(file)

 INPUTS:
   file : the file name of a file

 OUTPUTS:
   If file has two numbers separated by a space in the first line and the second number is one of
   1001,1010,1020,2010,2110,2160,2310,3010,4010 it returns 1

 PROCEDURE:
  A  NASA AMES File is defined by two numbers of the first line
  The first number is the number of comments and the second is the file identification identifier

 EXAMPLE:
   print,is_nasa_ames_file_file('al970626.ea1')
   1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 2000-Apr-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_nasa_ames_file.pro)


IS_NASA_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_nasa_file

 PURPOSE:
   This function tests if a data file is a NASA Ames file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=is_nasa_file(file_name)

 INPUTS:
   file_name: The name of the file which should be tested for known format


 EXAMPLE:
   Result=is_nasa_file('test.nas')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 2000-Jun-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_nasa_file.pro)


IS_NCDF_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_ncdf_file

 PURPOSE:
   Test if file type is netCDF

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=is_ncdf_file(file)

 INPUTS:
   file : the file name of a file

 OUTPUTS:
   If first three chars of file are CDF then it's a netCDF File

 EXAMPLE:
   print,is_ncdf_file(popjgr96.nc)
   1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1) , 1999-Oct-4

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_ncdf_file.pro)


IS_NCDF_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_ncdf_param

 PURPOSE:
	Test if name is a parameter in a ncdf file

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result = is_ncdf_param(ncdf_file, param_name)

 INPUTS:
	ncdf_file: Name of ncdf file
	param_name: parameter name or array of parameter names

 KEYWORD PARAMETERS:
   ERR: set this keyword to a named variable and it will be set to 1 if an
		 error occured

 OUTPUTS:
	This function returns
		1 - if param_name is defined as a parameter in ncdf_file
		0 - if param_name is NOT defined as a parameter in ncdf_file

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 12.05.98
	28.09.98:	Keyword /ALL included in call to f_names which allows search for
					parameter flag names (e.g. signal@STDEV)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_ncdf_param.pro)


IS_NUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_number

 PURPOSE:
	Test if variable represents a decimal number even if passed in as a string.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_number(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var can be converted into a number else it returns 0.
	Strings are filtered for number-typical characters ('+-.DE')

 EXAMPLE:
	PRINT, is_number('-12.3D+03')		--> 1
	PRINT, is_number('-12.3A+03')		--> 0

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 27.05.98
	22.03.1999:	Strings are handled separately

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_number.pro)


IS_OBJECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_object

 PURPOSE:
	Test if variable is of type object

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_object(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type object else it returns 0

 EXAMPLE:
	A = OBJARR(5)
	PRINT, is_object(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_object.pro)


IS_ODD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_odd

 PURPOSE:
	Test if a number is odd

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_odd(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is odd else it returns 0

 EXAMPLE:
	A = 3
	PRINT, is_odd(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	R.Bauer 1999-Aug-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_odd.pro)


IS_POINTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_pointer

 PURPOSE:
	Test if variable is of type pointer

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_pointer(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type pointer else it returns 0

 EXAMPLE:
	A = PTR_NEW()
	PRINT, is_pointer(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_pointer.pro)


IS_READ_ACCESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     is_read_access

 PURPOSE:
     Test if read access is possible of a file

 CATEGORY:
    PROG_TOOLS

 CALLING SEQUENCE:
  result=is_read_access(path_and_file)

 INPUTS:
  path_and_file: the path_and_file where read access should be tested

 OUTPUTS
   result: 1 read_access true, 0 read_access false

 PROCEDURE:
 The routine file_exist is used to test general if the file is there
 The result of filesize is -1 or 0 if something is wrong with the file

 MODIFICATION HISTORY:
       R. Bauer, 1998-Jun-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_read_access.pro)


IS_SCALAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_scalar

 PURPOSE:
	Test if variable is of type scalar

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_scalar(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type scalar else it returns 0

 EXAMPLE:
	A = 5
	PRINT, is_scalar(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 23.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_scalar.pro)


IS_SELECTED (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        IS_SELECTED (function)

 PURPOSE:
        Return a boolean vector with 1 for each element of VAR
        that is contained in SELECTION. This is a generalization
        of WHERE(VAR eq value) in that value can be an array
        instead of a single value.

 CATEGORY:
        Tools

 CALLING SEQUENCE:
        index = IS_SELECTED(VAR,SELECTION)

 INPUTS:
        VAR -> The data vector

        SELECTION -> A vector with test values. If no selection
            is given, the function returns a vector with all entries
            set to zero.

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        An integer vector of length n_elements(VAR) that contains 
        1 for each element of VAR that has one of the SELECTION values.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        A = [ 1, 1, 1, 2, 2, 3 ]
        B = [ 2, 3 ]
        print,is_selected(A,B)
        ; prints   0 0 0 1 1 1
        print,where( is_selected(A,B) )
        ; prints   3 4 5
        ; (i.e. indices of A that correspond to a value of 2 or 3)
        ; equivalent to:
        print,where(A eq 2 or A eq 3)

 MODIFICATION HISTORY:
        mgs, 19 Aug 1998: VERSION 1.00
        mgs, 25 Aug 2000: - changed copyright to open source
                          - result now long array

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\is_selected.pro)


IS_STRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_string

 PURPOSE:
	Test if variable is of type string

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_string(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type string else it returns 0

 EXAMPLE:
	A = 'Hallo'
	PRINT, is_string(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 19.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_string.pro)


IS_STRUCTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_structure

 PURPOSE:
	Test if variable is of type structure

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = is_structure(var)

 INPUTS:
	var: The variable to be tested.

 OUTPUTS:
	This function returns 1 if var is of type structure else it returns 0

 EXAMPLE:
	A = {q:0, w:'d'}
	PRINT, is_structure(A)
	-> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 19.01.98
	27.01.98: debug statement auskommentiert
	07.09.98: Return statement vereinfacht

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_structure.pro)


IS_TAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  is_tag

 PURPOSE:
   Test if tagname is defined

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=is_tag(structure,tagname)

 INPUTS:
   structure:  the structure
   tagname:    the tagname as string which should be searched in structure

 OUTPUTS:
   Result will be 1 or 0

 KEYWORD PARAMETERS:
   count: if set to a named variable it returns the number of tags equal to tagname
          normally it is 1
   part: if is set strpos is used to find a part of a string

 EXAMPLE:
   print,is_tag(inhalt,'param')
   1

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , Sep. 2 1996
               F.Rohrer (ICG-3), Mai 15 1997 downgrade to idl 3.6.1
               R.Bauer 1998-Jul-05 previously named as find_tag now renamed for better consistens
               R.Bauer 1998-Jul-05 upgraded to idl 5.1
               R.Bauer 1998-Nov-19 goto removed additional test of tag_name is string added
               R.Bauer 1999-Mar-26 keyword part is added
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_tag.pro)


IS_WITHIN_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	is_within_range

 PURPOSE:
	This function determines whether input data are within a certain range or not.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = is_within_range(data, range)

 INPUTS:
	data: scalar or array of data values
	range: 2-element array. range[0] = lower limit, range[1] = upper limit

 KEYWORD PARAMETERS:
	INDEX = ind: On return ind stores the indices of all data elements which are within range.
	COUNT = cnt: On return cnt stores the number of data elements within range.
	/EXCLUDE: Set this keyword to exclude the outer limits of range
				 from the evaluation process.
	/NAN: Set this keyword to cause the routine to check for occurrences
			of the IEEE floating-point value NaN in the input data.
			Elements with the value NaN are treated as missing data.

 OUTPUTS:
	This function returns true (1) or false (0) depending on whether
	data is within range or not. If data is an array of n elements this
	function returns a n-element vector of true and false values.

 EXAMPLE:
	a = [10., 2., 134., 12., 17.]
	range = [10., 30.]
	PRINT, is_within_range(a, range, INDEX = ind, COUNT = cnt)
	--> 	1	0	0	1	1
	PRINT, ind, cnt
	--> 	0		3		4
	--> 	3

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 18.06.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\is_within_range.pro)


IS_WRITE_ACCESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     is_write_access

 PURPOSE:
     Test if write access is possible to a directory

 CATEGORY:
    PROG_TOOLS

 CALLING SEQUENCE:
  result=is_write_access(path)

 INPUTS:
  path: the path where write access should be tested

 OUTPUTS
   result: 1 write_access true, 0 write_access false

 MODIFICATION HISTORY:
       R. Bauer, 1998-Jun-09
       1999-05-27 key stringlength only 8 chars
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\is_write_access.pro)


IWZN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  Iwzn

 PURPOSE:
  writes a ZEICHN/ENZ file (KFA ICG3 data format)


 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   IWZN, file, dvalue, ix, iy, header, err

 INPUTS:
   file:       filename to be written
   dvalue:     matrix of ix * iy double values
   ix:         number of records in dvalue (rows)
   iy:         number of columns
   header:     the whole header of the file (without &&&&&)

 KEYWORD PARAMETER:
   DELIMITER:  the delimeter between the numbers, default delimeter=","
               also possible are one or more blanks, then delimeter="  "
   FLAG:       flag=0 (default)
               flag=1 if numbers have more than 7 digits after the decimal-point
               (see findform.pro for info)

   options for the output format, which suppress calling findform

   ENZ:        if this keyword is set the enz format is used
                   (I10,I6,G13.5,G13.5, ...)
   ZUS:        if this keyword is set the zus format is used
                   (F7.0,F7.0,F9.5,F10.5,G13.5,G13.5, ..)
   FORMAT:     thru this keyword an explicit format can be transferred to the
               printf procedure

 OUTPUTS:
   err:    flag indicating error (ok if 0)


 EXAMPLE:
   IRZN, 'test.enz', dvalue, ix, iy, fb, text, header, err
   IWZN, 'test2.enz', dvalue, ix, iy, header, err
   IWZN, 'test2.enz', dvalue, ix, iy, header, err, /ENZ

 MODIFICATION HISTORY:
   Written     Theo Brauers, sep. 1997
   Revised     oct 1997, T.B.
   Revised     nov 1997, T.B. format
   Revised     Dec 1997, M.L. format
   Revised     Feb 1998, M.L. format for great numbers
                              (more than 7 digits after the decimal_point)
               Mar 1998, F.R.  all for-loops with long integer
               Apr 1998, M.L. Keywords enz,zus for large arrays(>100000 lines)
               Jul 1998, T.B. Keyword FORMAT for explicit formating of output
                              cleaned the header
                              error handling with message
                              format for delimiter "x"


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\iwzn.pro)


IWZN2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   iwzn2

 PURPOSE:
   write a ZEICHN/ENZ file (KFA ICG3 data format)

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   IWZN2, file, dvalue, ix, iy, header, err

 INPUTS:
   file:   filename to be written
   dvalue: matrix of ix * iy double values
   ix:     number of records in dvalue (rows)
   iy:     number of columns
   header: the whole header of the file

 KEYWORD PARAMETERS:
   enz:  format for for 2 first columns set to
       '(F10.0,F6.0)'
   zus:  format for for 4 first columns set to
       '(F7.0,F7.0,F9.5,F10.5)'

 OUTPUTS:
   err:    flag indicating error

 EXAMPLE:
       IRZN, 'test.enz', dvalue, ix, iy, fb, text, header, err
       IWZN3, 'test2.enz', dvalue, ix, iy, header, err, /enz

 REVISION HISTORY:
       Written         Theo Brauers, Sep. 1997
       Revised		oct 1997, T.B.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\iwzn2.pro)


IZOOM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IZOOM
 PURPOSE:
       Zoom an image and display with labeled axes.
 CATEGORY:
 CALLING SEQUENCE:
       izoom, x, y, z
 INPUTS:
       x = 1-d array of x coordinates for every column in z.  in
       y = 1-d array of y coordinates for every row in z.     in
       z = 2-d byte scaled image array.                   in
 KEYWORD PARAMETERS:
       Keywords:
         XRANGE=xran  X range to zoom. (def=all).
         YRANGE=xran  Y range to zoom. (def=all).
           Out of range values are clipped to the valid range.
         /AXES_ONLY plot axes only.
         /INTERP means do bilinear interpolation (else pixel rep).
           No interpolation used for PS plots so /INTERP
           has no effect.
         /JS means x is time in Julian Seconds (seconds after
           2000 Jan 1 0:00).  Gives a date/time axis.
         OFFSET=off  returned time offset when used with /JS.
           Same as for jsplot.
         /CENTER means assume centered pixels.
         Any other keywords are passed on to the plot call used
         to display the axes (like TITLE, CHARSIZE, POSITION, ...).
 OUTPUTS:
 COMMON BLOCKS:
       js_com
 NOTES:
       Notes: By default entire image is displayed.  XRANGE and
         YRANGE display a subset of the image.
         An example use might be: x=array of longitudes,
         y=array of latitudes, z=array of scaled elevations.
         May use movbox to return the data ranges of a selected
         area, then call izoom to zoom it:
           movbox,ix,iy,dx,dy,xran=xran,yran=yran,/noerase
           izoom,x,y,z,xran=xran,yran=yran
 MODIFICATION HISTORY:
       R. Sterner, 3 Dec, 1993
       R. Sterner, 1994 Feb 16 --- Modified to allow !p.multi.
       R. Sterner, 1994 Apr 22 --- Added /JS keyword.
       R. Sterner, 1994 May 17 --- Added OFFSET keyword and js_com.
       R. Sterner, 1994 Jul 20 --- Fixed to allow reverse ranges.
       R. Sterner, 1994 Jul 27 --- Made OFFSET 0 for non-time plots.
       R. Sterner, 1995 Feb 23 --- Fixed minor bug in ranges.
       R. Sterner, 1996 Dec  2 --- Added keyword /CENTER.
       R. Sterner, 2000 Apr 18 --- Added keyword /NODATA.
       R. Sterner, 2000 Apr 20 --- Changed NODATA to /AXES_ONLY.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\izoom.pro)


IZOOM_SUB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IZOOM_SUB
 PURPOSE:
       Zoom part of an image that has scale embedded by put_scale.
 CATEGORY:
 CALLING SEQUENCE:
       izoom_sub
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         SCALE=scale  New scale factor (def=2).
         Other keywords: COLOR=clr, CHARSIZE=csz, XTITLE=ttx,
           YTITLE=tty, XMAR1=xmar1 (left), XMAR2=xmar2 (right),
           YMAR1=ymar1 (bottom), YMAR2=ymar2 (top).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Must have embedded scaling as placed there by
       by the put_scale routine.  Magnifies by pixel replication.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Oct 19

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\izoom_sub.pro)


JAVASCRIPT_FORM_ALPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	javascript_form_alph

 PURPOSE:
   The result of this function is a string containing the javascript code for an alphabetical list

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=javascript_form_alph(file_name,[function_name=function_name])

 INPUTS:
  file_name: file name comparing to html_form_alph

 KEYWORD PARAMETERS:
  function_name: name of the function if not set name it is 'doALPH'

 EXAMPLE:
 put_file,'target_file.html','A-Test D-Test R-Test'

 file_name='target_file.html'
 result=javascript_form_alph(file_name)
 print,result
 

 alph_key=['A','D','R']
 result=html_form_alph(alph_key)
 print, result
 
MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-May-11 1999-Nov-06 help added 2000-Feb-28 getKey added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\javascript_form_alph.pro)


JAVASCRIPT_FORM_DROPLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	javascript_form_droplist

 PURPOSE:
   The result of this function is a string containing the javascript code for an droplist

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=javascript_form_droplist(file_name,[function_name=function_name],[form_name=form_name],[select_name=select_name],[target=target])

 INPUTS:
  file_name: stringarray or string with the names of the file

 KEYWORD PARAMETERS:
  function_name: name of the function if not set name it is 'category_calc'
  form_name:  name of the form if not set name it is 'DROPLIST'
  target: the name of the target
  select_name: the name of the selection if not set name it is 'Ziel'

 EXAMPLE:
 put_file,'target_file.html','A-Test D-Test R-Test'

 file_name='target_file.html'
 result=javascript_form_droplist(file_name)
 print,result
 


 listvalue=['MATH','PLOT','TIME']
 result=html_form_droplist(listvalue)
 print,result
 
MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-May-11 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\javascript_form_droplist.pro)


JAVASCRIPT_FORM_DROPLIST2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	javascript_form_droplist2

 PURPOSE:
   The result of this function is a string containing the javascript code for an droplist specially for two frames

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=javascript_form_droplist2(var_up_array=var_up_array,var_down_array=var_down_Array,[select_name=select_name],[function_name=function_name],[form_name=form_name],[up_target=up_target],[down_target=down_target])

 INPUTS:
  file_name: stringarray or string with the names of the file

 KEYWORD PARAMETERS:
  var_up_array: array of html addresses for the upper frame
  var_down_array: array of html addresses for the lower frame
  function_name: name of the function if not set name it is 'category_calc'
  form_name:  name of the form if not set name it is 'DROPLIST'
  up_target: the name of the upper target
  down_target: the name of the down target

 EXAMPLE:
  def=''
  def=[def,'']
  def=[def,'']
  def=[def,'']
  print,def
     

  put_file,'start.html',def
  put_file,'dummy.html',''

  put_file,'target_up_file.html','

Text defined for upper frame

' put_file,'target_down_file.html','

Text defined for lower frame

' result=javascript_form_droplist2(up_target='upper',down_target='lower',var_up_array=['','target_up_file.html'],var_down_array=['','target_down_file.html'],select_name='DO',function_name='do_selection') put_file,'ja_test.html',result form=html_form_droplist(['','A'],select_name='DO',function_name='do_selection') put_file,'ja_test.html',form,/append print,result print,form form=html_form_list(['','A'],select_name='DO',function_name='do_selection')
MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Feb-02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\javascript_form_droplist2.pro)


JAVASCRIPT_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	javascript_window

 PURPOSE:
   The result of this function is a string containing the javascript code for a new window

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   result=javascript_window(file,[window_name=window_name],[function_name=function_name],[width=width],[height=height],$
          [/scrollbars],[/toolbar],[/location],[/directories],[/status],[/menubar],[/resizable])

 OPTIONAL INPUTS:
  window_name: if arg_present() the name of the window
  function_name: if arg_present() the name of the function
  width: if arg_present() the width of the window
  height: if arg_present() the height of the window

 KEYWORD PRAMETRERS:
 scrollbars:  1 if the the window should have scrollbars
 toolbar:     1 if the the window should have a toolbar
 location:    1 if the the window should have a location
 directories: 1 if the the window should have directories
 status:      1 if the the window should have a statusbar
 menubar:     1 if the the window should have a menubar
 resizable:   1 if the the window should be resizeable

 EXAMPLE:
  result=javascript_window(window_name='example',function_name='w_example',/status)
  print,result
 

 Using in html a line like this one will open the window
 example




 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  1998-May-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\javascript_window.pro)


JBEPOCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   JBEPOCH

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute Julian Day to/from Julian or Besselian Epoch

 CALLING SEQUENCE:
   EPOCH = JBEPOCH(/B, JDAY)   ;; Julian Day to Besselian Epoch
   EPOCH = JBEPOCH(/J, JDAY)   ;; Julian Day to Julian Epoch

   JDAY  = JBEPOCH(/B, EPOCH, /TO_DAY)  ;; Besselian Epoch to Julian Day
   JDAY  = JBEPOCH(/J, EPOCH, /TO_DAY)  ;; Julian Epoch to Julian Day

 DESCRIPTION: 

   The function JBEPOCH computes the Julian or Besselian Epoch year
   number from a given Julian day number.  Epochs of this form are
   often given in the astronomical literature as B1950.0 or J2000.0,
   but they can be different.

   Besselian year numbers are measured in tropical years of about
   365.2422 days.  Julian year numbers are measured in years whose
   lengths are exactly 365.25 days of 86400 second lengths.  The "/J"
   or "/B" keywords identify which year numbering system is being
   used.

   JBEPOCH also computes the inverse transformation, from Julian or
   Besselian epoch to Julian Day, by specifying the /TO_DAY keyword.

   The computational logic is inspired by STARLINK (P.T. Wallace).


 INPUTS:

   EPOCH or JDAY - If TO_DAY is set, Besselian or Julian year number.
                   If TO_DAY is not set, the Julian day number.

 KEYWORDS:

   B - if set, then year numbers (input/output) are expressed in
       Besselian years.

   J - if set, then year numbers (input/output) are expressed in
       Julian years.

   TO_DAY - if set, then convert EJ (assumed to be year number) into
            Julian day number.

   MJD - if set, then Julian days are expressed as "modified" Julian
         Days, or Julian days minus 2400000.5d.


 RETURNS:

   If TO_DAY is set, then returns Julian Days.

   If TO_DAY is not set, then returns year number.
   

 REFERENCES:

   Lieske, J. H. 1979, Astron & Astrophysics, 73, 282

   Wallace, P. T. 1999, SLALIB Software Library (STARLINK)
     http://star-www.st-and.ac.uk/starlink/
     (Routines sla_EPB2D, sla_EPJ2D, sla_EPB and sla_EPJ)

 SEE ALSO:

   JULDAY, CALDAT

 MODIFICATION HISTORY:
   Written, CM, 04 Mar 2002
   Documented, CM, 22 Mar 2002

  $Id: jbepoch.pro,v 1.3 2002/03/22 22:02:02 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\jbepoch.pro)


JD2DATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2DATE
 PURPOSE:
       Convert a Julian Day number to a date string.
 CATEGORY:
 CALLING SEQUENCE:
       date = jd2date(jd)
 INPUTS:
       jd = Julian Day number.       in
 KEYWORD PARAMETERS:
       Keywords:
         FORMAT = format string.  Allows output date to be customized.
            The following substitutions take place in the format string:
         Y$ = 4 digit year.
         y$ = 2 digit year.
         N$ = full month name.
         n$ = 3 letter month name.
         d$ = day of month number.
         W$ = full weekday name.
         w$ = 3 letter week day name.
 OUTPUTS:
       date = returned date string.  out
 COMMON BLOCKS:
 NOTES:
       Notes:
         The default format string is 'd$-n$-Y$' giving 24-Sep-1989
         Example: FORMAT='w$ N$ d$, Y$' would give 'Mon 
 MODIFICATION HISTORY:
       R. Sterner, 27 Feb, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jd2date.pro)


JD2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2JS
 PURPOSE:
       Convert from Julian Day Number to Julian Seconds.
 CATEGORY:
 CALLING SEQUENCE:
       js = jd2js(jd)
 INPUTS:
       jd = Julian Day Number.           in
 KEYWORD PARAMETERS:
 OUTPUTS:
       js = Equivalent Julian Second.    out
 COMMON BLOCKS:
 NOTES:
       Notes: JS are seconds after 2000 Jan 1 0:00.
       >>>==> Julian Day Number starts at noon. Example:
       JD of 2450814 is 1997 Dec 31 12:00:00 Wed.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 13

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jd2js.pro)


JD2MDAYS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2MDAYS
 PURPOSE:
       Convert a range of Julian Days to month start and end JDs.
 CATEGORY:
 CALLING SEQUENCE:
       jd2mdays, jd1, jd2, mjds, mjde
 INPUTS:
       jd1, jd2 = first and last Julian day of a time range.  in
 KEYWORD PARAMETERS:
       Keywords:
         APPROX_MAJOR=amaj Approximate number of days between
           major tick marks.  Used to derive actual # days.
         MAJOR_V=majv  Array of labeled tick mark values in
           Julian Days.
         MINOR_V=majv  Array of minor tick mark values in
           Julian Days.
         FORMAT=frm    Returned suggested format for time labels.
 OUTPUTS:
       mjds = array of Julian days for the first of each      out
         month covered by the range.
       mjde = array of Julian days for the end of each        out
         month covered by the range.
 COMMON BLOCKS:
 NOTES:
       Notes: intended for time axes involving month labels.
         Ex: if jd1 is for 29-Jan-1992 and jd2 is for 13-Jun-1993
         then mjds and mjde each have 18 elements giving the
         Julian day numbers for the start and end of each of the
         18 months from Jan 1992 to Jun 1993 inclusive.
 MODIFICATION HISTORY:
       R. Sterner, 29 Apr, 1993
       R. Sterner, 1994 Mar 30 --- Extended time range upward.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jd2mdays.pro)


JD2STR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2STR
 PURPOSE:
       Find year, month, day strings from Julian Day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd2str, jd, y, m, d
 INPUTS:
       jd = Julian Day number (like 2447000).     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = year string (like "1987").             out
       m = month name string (like "Jul").        out
       d = day of month string (like "23").       out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  17 Nov, 1988.
       Johns Hopkins Applied Physics Lab.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jd2str.pro)


JD2YMD[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2YMD
 PURPOSE:
       Find year, month, day from julian day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd2ymd, jd, y, m, d
 INPUTS:
       jd = Julian day number (like 2447000).     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = year (like 1987).                      out
       m = month number (like 7).                 out
       d = day of month (like 23).                out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  21 Aug, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 30 Apr, 1993 --- cleaned up and allowed arrays.
       Theo Brauers, 21 Sep, 1997 long loop index i

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jd2ymd.pro)


JD2YMD[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JD2YMD
 PURPOSE:
       Find year, month, day from julian day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd2ymd, jd, y, m, d
 INPUTS:
       jd = Julian day number (like 2447000).     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = year (like 1987).                      out
       m = month number (like 7).                 out
       d = day of month (like 23).                out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  21 Aug, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 30 Apr, 1993 --- cleaned up and allowed arrays.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\jd2ymd.pro)


JDSELECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JDSELECT
 PURPOSE:
       Select Julian Day array subset by month or weekday.
 CATEGORY:
 CALLING SEQUENCE:
       jd_out = jdselect(jd_in, list)
 INPUTS:
       jd_in = Array of potential Julian Days.     in
       list = Text array listing desired values.   in
 KEYWORD PARAMETERS:
       Keywords:
         /MONTH means match months in list.
         /DAY   means match weekdays in list.
 OUTPUTS:
       jd_out = Julian Days that match list.       out
 COMMON BLOCKS:
 NOTES:
       Notes: list consists of either a text array of month
         or weekday names, at least 3 characters long.
         Ex: JD2=jdselect(JD1,/mon,['jan','apr','jul','oct'])
 MODIFICATION HISTORY:
       R. Sterner, 20 May, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jdselect.pro)


JPEG2TIFF8

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JPEG2TIFF8
 PURPOSE:
       Convert a JPEG image to an 8 bit TIFF image.
 CATEGORY:
 CALLING SEQUENCE:
       jpeg2tiff8, file
 INPUTS:
       file = JPEG image file name.       in
         Prompted for if not given.
 KEYWORD PARAMETERS:
       Keywords:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Intended to convert 24 bit JPEG images to 8 bit TIFF.
         Output file name is same as input but with *_8.tif as type.
 MODIFICATION HISTORY:
	R. Sterner, 1995 May 19

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jpeg2tiff8.pro)


JPEGSCREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JPEGSCREEN
 PURPOSE:
       Save current screen image and color table to a JPEG file.
 CATEGORY:
 CALLING SEQUENCE:
       jpegscreen, [file]
 INPUTS:
       file = name of JPEG file.   in
 KEYWORD PARAMETERS:
       Keywords:
         QUALITY=q  JPEG quality value (0=bad, 100=best, def=75).
           Low values give better compression but poorer quality.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jan 17
       R. Sterner, 2000 Jun 29 --- Modified for 24 bit color.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jpegscreen.pro)


JPEG_MAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JPEG_MAG
 PURPOSE:
       Change size of a JPEG image.
 CATEGORY:
 CALLING SEQUENCE:
       jpeg_mag, in, out
 INPUTS:
       in = name of input JPEG image.   in
       out = name of output JPEG image. in
         Default is *_.jpg where * is input image name.
 KEYWORD PARAMETERS:
       Keywords:
         MAG=mag  Mag factor, def=1/4.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Meant for reducing JPEG images to thumbnail versions.
 MODIFICATION HISTORY:
       R. Sterner, 1995

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jpeg_mag.pro)


JPLEPHINTERP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   JPLEPHINTERP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Interpolate position and motion of planetary bodies (JPL Ephemeris)

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHINTERP, INFO, RAWDATA, T, X, Y, Z, [VX, VY, VZ, /EARTH, /SUN,
         OBJECTNAME=, CENTER=, TBASE=, POSUNITS=, VELUNITS= ]

 DESCRIPTION:

   JPLEPHINTERP interpolates the JPL DE200 or DE405 planetary
   ephemeris to find the positions and motions of planetary bodies.

   This routine is the second stage of a two-stage process to
   interpolate the JPL ephemeris.  In this first stage, the file is
   opened using JPLEPHREAD, and the relevant portions of the table
   are read and stored into the two variables INFO and RAWDATA.  In
   the second stage, the user actually interpolates the ephemeris for
   the desired bodies and to the desired ephemeris time using
   JPLEPHINTERP.

   The only independent variable which must be specified is T, the
   ephemeris time.  For low to moderate accuracy applications, T is
   simply the conventional calendar date, expressed in Julian days.
   See below for high precision applications.

   Upon output, the position components of the desired body are
   returned in parameters X, Y and Z, and if requested velocity
   components are returned in parameters VX, VY and VZ.  Coordinates
   are referred to the ephemeris's coordinate system: FK5 for
   JPL-DE200 and ICRS for JPL-DE405.  By default, the origin of
   coordinates is the solar system barycenter (SSB), unless another
   origin is selected using the CENTER keyword.

   Users must set the VELOCITY keyword to generate body velocities.
   By default they are not generated.

   Users can select the desired body by using either the EARTH or SUN
   keywords, or the OBJECTNAME keyword.

   By default, positions are returned in units of KM and velocities
   in units of KM/DAY.  However, the output units are selectable by
   setting the POSUNITS and VELUNITS keywords.

 High Precision Applications

   If the required precision is finer than a few hundred meters, the
   user must be aware that the formal definition of the ephemeris
   time is the coordinate time of a clock placed at the solar system
   barycenter (SSB).  If the user's time is measured by a clock
   positioned elsewhere, then various corrections must be applied.
   Usually, the most significant correction is that from the
   geocenter to the SSB (see Fairhead & Bretagnon 1990; Fukushima
   1995).  Not applying this correction creates an error with
   amplitude ~170 nano-light-seconds ( = 50 m) on the earth's
   position.  (see TDB2TDT)

   For high precision, the user should also specify the TBASE
   keyword.  TBASE should be considered a fixed epoch with respect to
   which T is measured; T should be small compared to TBASE.
   Internally, subtraction of large numbers occurs with TBASE first,
   so truncation error is minimized by specifying TBASE.

 Nutations and Librations

   This routine also provides information about earth nutations and
   lunar librations, which are stored in the JPL ephemeris tables.
   The POSUNITS and VELUNITS keywords do not affect these
   computations.

   Lunar librations in the form of three Euler angles are returned in
   X, Y, Z, in units of radians, and their time derivatives are
   returned in VX, VY, and VZ in units of radians per day.

   The earth nutation angles psi (nutation in longitude) and epsilon
   (nutation in obliquity) are returned in X and Y, in units of
   radians.  Their time derivatives are returned in VX and VY
   respectively.  The quantities returned in Z and VZ are undefined.

 Verification

   The precision routine has been verified using JPLEPHTEST, which is
   similar to the original JPL program EPHTEST.  For years 1950 to
   2050, JPLEPHINTERP reproduces the original JPL ephemeris to within
   1.5 centimeters.

 Custom Ephemerides

   It is possible to make custom ephemerides using JPLEPHMAKE, or to
   augmented an existing ephemeris with additional data.  In the
   former case JPLEPHINTERP should automatically choose the correct
   object from the table and interpolate it appropriately.

   For augmented ephemerides, the object can be specified by name,
   which works as expected, or by number, which has a special
   behavior.  For augmented files only, the new objects begin at
   number 100.


 PARAMETERS: 

   INFO - structure returned by JPLEPHREAD.  Users should not modify
          this structure.

   RAWDATA - raw data array returned by JPLEPHREAD.  Users should not
             modify this data array.

   T - ephemeris time(s) of interest.  May be a scalar or vector.
       The actual time is (T+TBASE).

   X, Y, Z - upon return, the x-, y- and z-components of the body
             position are returned in these parameters.  For
             nutations and librations see above.

   VX, VY, VZ - upon return, the x-, y- and z-components of the body
                velocity are returned in these parameters, if the
                VELOCITY keyword is set.  For nutations and
                librations see above.


 KEYWORD PARAMETERS:

   EARTH, SUN - set one of these keywords if the desired body is the
                earth or the sun.  One of EARTH, SUN or OBJECTNAME
                must be specified.

   OBJECTNAME - a scalar string or integer, specifies the planetary
                body of interest.  May take any one of the following
                integer or string values.

                   1 - 'MERCURY'     9 - 'PLUTO'
                   2 - 'VENUS'      10 - 'MOON'  (earth's moon)
                   3 - 'EARTH'      11 - 'SUN'
                   4 - 'MARS'       12 - 'SOLARBARY' (solar system barycenter)
                   5 - 'JUPITER'    13 - 'EARTHBARY' (earth-moon barycenter)
                   6 - 'SATURN'     14 - 'NUTATIONS' (see above)
                   7 - 'URANUS'     15 - 'LIBRATIONS' (see above)
                   8 - 'NEPTUNE' 

                For custom ephemerides, the user should specify the
                object name or number.

                For augmented ephemerides, the user should specify
                the name.  If the number is specified, then numbers
                1-15 have the above meanings, and new objects are
                numbered starting at 100.

   CENTER - a scalar string or integer, specifies the origin of
            coordinates.  See OBJECTNAME for allowed values.
            Default: 12 (Solar system barycenter)

   VELOCITY - if set, body velocities are generated and returned in
              VX, VY and VZ.
              Default: unset (no velocities)

   POSUNITS - a scalar string specifying the desired units for X, Y,
              and Z.  Allowed values:
                 'KM' - kilometers  (default)
                 'CM' - centimeters
                 'AU' - astronomical units
                 'LT-S' - light seconds

   VELUNITS - a scalar string specifying the desired units for VX, VY
              and VZ.  Allowed values:
                 'KM/DAY' - kilometers per day  (default)
                 'KM/S' - kilometers per second
                 'CM/S' - centimeters per second
                 'LT-S/S' - light seconds per second
                 'AU/DAY' - astronomical units per day

   TBASE - a scalar number, specifies a fixed epoch against wich T is
           measured.  The ephemeris time will be (T+TBASE).  Use this
           keyword for maximum precision.


 EXAMPLE:

   Find position of earth at ephemeris time 2451544.5 JD.  Units are
   in Astronomical Units.

   JPLEPHREAD, 'JPLEPH.200', pinfo, pdata, [2451544D, 2451545D]

   JPLEPHINTERP, pinfo, pdata, 2451544.5D, xearth, yearth, zearth, $
                 /EARTH, posunits='AU'
     

 REFERENCES:

   AXBARY, Arnold Rots.
      ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/

   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html
   
   Fairhead, L. & Bretagnon, P. 1990, A&A, 229, 240

   Fukushima, T. 1995, A&A, 294, 895

   Standish, E.M. 1982, "Orientation of the JPL Ephemerides,
      DE200/LE200, to the Dynamical Equinox of J2000", Astronomy &
      Astrophysics, vol. 114, pp. 297-302.

   Standish, E.M.: 1990, "The Observational Basis for JPL's DE200,
      the planetary ephemeris of the Astronomical Almanac", Astronomy
      & Astrophysics, vol. 233, pp. 252-271.    

 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST, TDB2TDT, JPLEPHMAKE
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Corrected bug in name conversion of NUTATIONS and LIBRATIONS, 18
     Oct 2001, CM
   Added code to handle custom-built ephemerides, 04 Mar 2002, CM

  $Id: jplephinterp.pro,v 1.12 2002/03/04 19:42:49 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\jplephinterp.pro)


JPLEPHMAKE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   JPLEPHMAKE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Make a new ephemeris suitable for interpolation by JPLEPHINTERP

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHREAD, INFO, RAW, OBJ, T, CX, CY, CZ, $
               [ POSUNITS=, AUTHOR=, DATE=, OBJECTNAME=, ]
               [ KEYWORDS=, KEYVALUES=, /RESET ]

 DESCRIPTION:

   JPLEPHMAKE is a utility routine which forms an ephemeris table
   suitable for interpolation with JPLEPHINTERP.  This is a way for
   users to make or augment an ephemeris of solar system bodies not
   already present in the JPL planetary ephemeris.  This routine only
   creates new ephemerides in memory.  No facility is provided to
   write to disk.

   The user must have already estimated the Chebyshev polynomial
   coefficients for the body of interest.  One way to do this is with
   CHEBGRID from the Markwardt library.  

   The two options are either to create a new ephemeris or to augment
   an existing one.  Augmentation merely means that new columns are
   added to an existing ephemeris table.  The JPL ephemeris itself
   can be augmented.

   Even when creating a new ephemeris from scratch, passing an
   existing INFO structure based on another epehemeris is strongly
   recommended, because the structure usually contains planetary
   masses, physical constants, etc. which are relevant.



 PARAMETERS: 


   INFO - upon input, an existing INFO structure based on a known
          ephemeris.  Upon output, a modified INFO structure.

          If INFO is undefined upon input, or the RESET keyword is
          set, then the returned INFO is set to a generic header.

   RAW - upon input, an existing set of Chebyshev coefficients.  Upon
         output, the new or augmented set of coefficients.

         If RAW is undefined upon input, or if the RESET keyword is
         set, then the returned RAW variable is initialized to a new
         set of keywords.

   OBJ - scalar string, name of the object.

   T - array of times, in Julian Days (TDB), which refer to the
       *start* epoch of each granule.  [ In the terminology of the
       JPL ephemeris and CHEBGRID, a "granule" is a single
       subinterval over which a Chebyshev polynomial is fitted. ] If
       an existing ephemeris is to be augmented, then T must overlap
       exactly.

   CX, CY, CZ - arrays of Chebyshev polynomial coefficients.



 KEYWORD PARAMETERS:

   POSUNITS - a scalar string, the units of position as fitted by CX,
              CY, and CZ.  Allowed values:
                 'KM' - kilometers  (default)
                 'CM' - centimeters
                 'AU' - astronomical units
                 'LT-S' - light seconds

   NSUBINTERVALS - Number of granules per time sample.
                   Default: 1

   RESET - if set, then a new ephemeris table is created.  Any
           Chebyshev coefficients in RAW are overwritten.

   AUTHOR - a scalar string, an identifier giving the author of the
            new ephemeris.
            Default: ''

   DATE - a scalar string, the creation date of the ephemeris.
          Default: SYSTIME(0)

   KEYWORDS - an optional string array, giving any header keywords to
              be added to the ephemeris (in conjunction with
              KEYVALUES).
              Default: (none)

   KEYVALUES - an optional double array, giving any header values for
               the keywords specified by KEYWORDS.

               Default: (none)


 EXAMPLE:


 REFERENCES:

   JPL Export Ephmeris FTP Site
      ftp://navigator.jpl.nasa.gov/pub/ephem/export/
      (ephemeris files are available here, however, they must be
      converted to FITS format using the "bin2eph" utility found in
      AXBARY)


 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Mar 2002

  $Id: jplephmake.pro,v 1.3 2002/03/25 06:46:02 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\jplephmake.pro)


JPLEPHREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   JPLEPHREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Open and read JPL DE200 or DE405 Ephemeride FITS File

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHREAD, FILENAME, INFO, RAWDATA, JDLIMITS, STATUS=, ERRMSG=

 DESCRIPTION:

   JPLEPHREAD opens and reads the JPL DE200 or DE405 planetary
   ephemerides, as available in FITS format.  The user must have the
   IDL Astronomy Library installed to use this routine.

   This routine is the initialization stage of a two-stage process to
   interpolate the JPL ephemeris.  In this first stage, the file is
   opened, and the relevant portions of the table are read and stored
   into the two variables INFO and RAWDATA.  In the second stage, the
   user actually interpolates the ephemeris for the desired bodies
   and to the desired ephemeris time using JPLEPHINTERP.

   Users must decide ahead of time the approximate dates of interest,
   and pass this range in the JDLIMITS parameter.  Any date covered
   by the ephemeris is valid.

   JPLEPHREAD is able to read files of the following format:
     DE200 - Chebyshev - FITS format - Note 1
     DE405 - Chebyshev - FITS format - Note 1
     DE200 - Taylor    - FITS format - Note 2

   Note 1 - Chebyshev formatted FITS files are available in the
            AXBARY package by Arnold Rots, found here:
              ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/
            or at the Markwardt FTP site:
              ftp://cow.physics.wisc.edu/pub/craigm/bary/

   Note 2 - Taylor-series based ephemerides have been available for
            years in the FTOOLS / LHEASOFT package produced by NASA's
            Goddard Space Flight Center.  The original file is
            de200_new.fits, which covers the years 1959-2000,
            inclusive.  A newer file is named
            de200_1950-2050_v2.fits, and covers the years 1959-2050.
            See Markwardt FTP site for these files.

 PARAMETERS: 

   FILENAME - name of ephemeris file (scalar string).

   INFO - upon completion, information about the ephemeris data is
          returned in this parameter in the form of a structure.
          Users must not modify INFO, although several fields are
          useful and may be accessed read-only:
              TSTART/TSTOP (start and stop time of data in Julian
                            days);
              C (speed of light in km/s);
              DENUM (development ephemeris number [200 or 405])
              AU (1 astronomical unit, in units of light-seconds)

   RAWDATA - upon completion, raw ephemeris data is returned in this
             parameter.  Users are not meant to access this data
             directly, but rather to pass it to JPLEPHINTERP.

   JDLIMITS - a two-element vector (optional), describing the desired
              time range of interest.  The vector should have the
              form [TSTART, TSTOP], where TSTART and TSTOP are the
              beginning and ending times of the range, expressed in
              Julian days.
              Default: entire table is read (note, this can be
              several megabytes)


 KEYWORD PARAMETERS:

   STATUS - upon completion, a value of 1 indicates success, and 0
            indicates failure.

   ERRMSG - upon completion, an error message is returned in this
            keyword.  If there were no errors, then the returned
            value is the empty string, ''.


 EXAMPLE:

   Find position of earth at ephemeris time 2451544.5 JD.  Units are
   in Astronomical Units.

   JPLEPHREAD, 'JPLEPH.200', pinfo, pdata, [2451544D, 2451545D]

   JPLEPHINTERP, pinfo, pdata, 2451544.5D, xearth, yearth, zearth, $
                 /EARTH, posunits='AU'
     

 REFERENCES:

   AXBARY, Arnold Rots.
      ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/

   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html
   
   JPL Export Ephmeris FTP Site
      ftp://navigator.jpl.nasa.gov/pub/ephem/export/
      (ephemeris files are available here, however, they must be
      converted to FITS format using the "bin2eph" utility found in
      AXBARY)

   JPL Export Ephemeris CD-ROM - Ordering Information
      http://www.willbell.com/software/jpl.htm

   Standish, E.M. 1982, "Orientation of the JPL Ephemerides,
      DE200/LE200, to the Dynamical Equinox of J2000", Astronomy &
      Astrophysics, vol. 114, pp. 297-302.

   Standish, E.M.: 1990, "The Observational Basis for JPL's DE200,
      the planetary ephemeris of the Astronomical Almanac", Astronomy
      & Astrophysics, vol. 233, pp. 252-271.    

 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Incorporated changes by W. Landsman, for error handling more
     consistent with IDL Astronomy Library, Oct 2001, WL
   Add ephemeris file keywords to INFO, Jan 2002, CM
   Add fields to INFO to be consistent with JPLEPHMAKE, 04 Mar 2002, CM

  $Id: jplephread.pro,v 1.9 2002/03/04 19:42:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\jplephread.pro)


JPLEPHTEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   JPLEPHTEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Test JPLEPHTEST with JPL test data set

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHTEST, EPHFILE, TESTFILE

 DESCRIPTION:

   JPLEPHTEST tests the JPLEPHINTERP procedure for precision.  In
   order to function, you must have the JPLEPHREAD and JPLEPHINTERP
   procedures, as well as the IDL Astronomy Libary for reading FITS
   files.  In addition, you must have a JPL ephemeris test data set,
   which is available by FTP.

   The procedure opens and reads the test set, which contains
   precomputed data.  Every tenth value is printed on the screen.
   Any deviations that exceed 1.5d-13 AU = 1.5 cm are reported.

   The columns are labelled according to the input file, except for
   the final column, which is the deviation between the input file
   and the computed value.


 PARAMETERS: 

   EPHFILE - a scalar string, specifies the name of the ephemeris
             file, in FITS format.

   TESTFILE - a scalar string, specifies JPL test data set to compare
              against.


 EXAMPLE:

   Test JPL DE200 and DE405 ephemerides.  Assumes files are in the
   current directory.

   JPLEPHTEST, 'JPLEPH.200', 'testpo.200'
   JPLEPHTEST, 'JPLEPH.405', 'testpo.405'
     

 REFERENCES:

   JPL Export Ephmeris FTP Site
      ftp://navigator.jpl.nasa.gov/pub/ephem/export/
      (see test-data/ for test data sets)
   
   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html


 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Removed TRANSREAD, improved output, improved docs, CM, 9 Jul 2001

  $Id: jplephtest.pro,v 1.4 2001/07/20 13:29:53 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\jplephtest.pro)


JS2DMY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2dmy

 PURPOSE:
   This function translates Julian Seconds into dd.mm.yy

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=js2dmy(js)

 INPUTS:
   js: an array or one value of julian Seconds

 OUTPUTS:
   This function returns a string in the form dd.mm.yy

 EXAMPLE:
   result=js2dmy(-823342.d)
   print,result
   22.12.99

 MODIFICATION HISTORY:
   Written by:     Theo Brauers, 1997-Oct-20

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2dmy.pro)


JS2DMYHMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2dmyhms

 PURPOSE:
   This function converts JulianSeconds to date (dd.mm.yyyy) and time (hh:mm:ss)
   works with array input

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result= JS2DMYHMS(Julsec)

 INPUTS:
   Julsec: double

 OUTPUTS:
   Result: string ('d.m.y h:m:s')

 KEYWORD PARAMETERS:
   YEAR4:   4 digit year
   NO_SEC:  ignore the seconds in output
   NOW:    returns actual time instead

 EXAMPLE:
   print, js2dmyhms(1.D, /YEAR4)
       01.01.2000 00:00:01

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1997
   Modified    T.B. 1998-APR-9 scalar output for scalar input !!
   Revised     T.B. Sep 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2dmyhms.pro)


JS2ENZTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       js2enztime

 PURPOSE:
       converts jstime to ENZ since ref date
 	(uses: js2tenz)

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       js= ENZTIME(dvalue, ix, ref)

 INPUTS:
       js:       array of julian sec + intervalls
       ix:       number of records
       ref:      reference date

 OUTPUTS:
       array with time in sec since ref date

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised     T.B. Sep 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2enztime.pro)


JS2HMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2hms

 PURPOSE:
   This function translates Julian Seconds into hh:mm:ss

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=js2hms(js)

 INPUTS:
   js: an array or one value of julian Seconds

 OUTPUTS:
   This function returns a string in the form hh:mm:ss

 EXAMPLE:
   result=js2str(1.d)
   print,result
   00:00:01

 MODIFICATION HISTORY:
   Written by:     Theo Brauers, 1997-Oct-20

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2hms.pro)


JS2INST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2inst

 PURPOSE:
   The function js2inst translates julian seconds to a format like yyyy-mm-dd hh:mm:ss msc
   or to an array of the respectieve long integers

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result = js2inst(js,[/integer],[/char])

 INPUTS:
   js: Julian Seconds
       Julian seconds (not an official unit) serve the
       same purpose as Julian Days, interval computations.
       The zero point is 0:00 1 Jan 2000, so js < 0 before then.
       Julian Seconds are double precision and have a precision
       better than 1 millisecond over a span of +/- 1000 years.

 KEYWORD PARAMETERS:
   integer: The result will be an long int array
   char:    The result will be a string (default)

 OUTPUTS:
   string or array containing the date/time in human readable format


 PROCEDURE:
   using jd2ymd (Ray Sterner Lib)

 EXAMPLE:
   Result=js2inst(-80476127.d )
   or
   Result=js2inst(-80476127.d,/int)

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), Oct. 24 1996
               R.Bauer  Oct 25 1996 keyword char and integer added
               R.Bauer  June 14 1997 default output is like key char
               R.Bauer Aug 26./27. 1997 millisec. now only with 3 signs
               T.Brauers Aug 27 1997 format / simpler code
               R.Bauer Sept 22 Code was to simple error whith formated string
                               exceeds more than 1024 lines
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\js2inst.pro)


JS2JD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JS2JD
 PURPOSE:
       Convert from Julian Seconds to Julian Day Number.
 CATEGORY:
 CALLING SEQUENCE:
       jd = js2jd(js)
 INPUTS:
       js = Equivalent Julian Second.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       jd = Julian Day Number.           out
 COMMON BLOCKS:
 NOTES:
       Notes: JS are seconds after 2000 Jan 1 0:00.
       >>>==> Julian Day Number starts at noon. Example:
       JD of 2450814 is 1997 Dec 31 12:00:00 Wed.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 13

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\js2jd.pro)


JS2STR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	js2str

 PURPOSE:
       This function translates Julian Seconds into the time string hh:mm:ss dd.mm.yyyy ms

 CATEGORY:
	TIME

 CALLING SEQUENCE:
       Result=js2str(js)

 INPUTS:
       js: an array or one value of julian Seconds 

 OUTPUTS:
       This function returns an array of formatted time strings.
       The format is hh:mm:ss dd.mm.yyyy ms .

 EXAMPLE:
       result=js2str(-823342.d)
       help,result
       RESULT          STRING    = Array[1]
       print,result
       11:17:38 22.12.1999 000

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer 1. September 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\js2str.pro)


JS2STRING

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   js2string

 PURPOSE:
   This function converts JulianSeconds to a string, works with array input

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result= JS2STRING(Julsec)

 INPUTS:
   Julsec: double

 OUTPUTS:
   Result: string or string array depending input

 KEYWORD PARAMETERS:
   YEAR2:              2 digit year
   NO_LEADING_ZERO:    no leading zero at all positions
   NOW:                returns actual time instead of input time
   FORMAT:             string to format the output:
                       'ICG' = 'Y-M-D H:M:S MS'
                       'XLS' = 'D.M.Y H:M:S'
                       'M-D'
                       'H:M'
                       'H:M:S'
                       'Y-M-D'
                       'M-D-Y'
                       'YMDHMS'

 EXAMPLE:
   IDL> x= js2string(-12345678D, FORM='y-m-d h:m:s')  & PRINT, x
       1999-08-11 02:38:42
   IDL> x= js2string(-12345678D, FORM='y_m_d_h_m')  & PRINT, x
       1999_08_11_02_38
   IDL> x= js2string(-12345678D,  /STR)  & HELP, x ,/STR
       ** Structure , 8 tags, length=64, refs=1:
       YEAR            STRING    '1999'
       MONTH           STRING    '08'
       DAY             STRING    '11'
       WDAY            STRING    'Wednesday'
       HOUR            STRING    '02'
       MIN             STRING    '38'
       SEC             STRING    '42'
       MSEC            STRING    '000'

  MODIFICATION HISTORY:
   Written     Theo Brauers, Feb 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2string.pro)


JS2TENZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2tenz

 PURPOSE:
   converts jul sec to seconds since ref date
   inverse function to tenz2js

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=JS2TENZ(sec, ref)

 INPUTS:
   sec:    seconds
   ref:    string with ref date dd.mm.yy hh:mm:yy

 OUTPUTS:
   time in julian sec

 EXAMPLE:
       ....................

 REVISION HISTORY:
   Written         Theo Brauers, June 1997
   Corrected       T.B. 1998-Jan-11
   Revised     T.B.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2tenz.pro)


JS2TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2time

 PURPOSE:
   This function converts a time value given in Js into an user defined time format
   It also handels an array of time values

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   x = js2time(t_js [, TIMEFORMAT = tf])

 INPUTS:
   t_js: time in julian seconds, may be an array

 KEYWORD PARAMETERS:
   TIMEFORMAT = tf where tf may be any meaningfull sub string of 'dd-mm-yyyy hh:mm:ss' or 'dd.mm.yyyy hh:mm:ss'
       inserting  between date and time format produces a line break
       the default time format is 'dd-mm-yyyy hh:mm:ss'

 EXAMPLE:
   print, js2time(-54311400.D00, TIMEFORMAT = 'dd.mm.yyyy hh:mm')
   --> 12.04.1998 09:30

 MODIFICATION HISTORY:
   Written by: Frank Holland, 18. May 98.
   28.04.1999: Removed debug command
   21.03.2000: Added date format 'YYYY'
   10.05.2000: Added date format 'MM' (TB)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\js2time.pro)


JS2V

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JS2V
 PURPOSE:
       Read a time (in "Julian seconds") vs value file.
 CATEGORY:
 CALLING SEQUENCE:
       js2v, file, time, data
 INPUTS:
       file = name of file containing time vs value data.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       time = Array of times in "Julian Seconds".           out
         (Seconds since 0:00 1 Jan 2000).
       data = Array of values at those time.                out
 COMMON BLOCKS:
 NOTES:
       Notes: File format: Lines starting with * or ;, and null
         lines are considered comment lines and ignored.
         Data lines have a date/time string followed by a value
         which must be the last item on the line.  Ex:
         Thu Apr  1 09:32:51 1993  23.45
         Date/time strings have Year, Month, Day, and time, with
         the month being a name (at least the first 3 letters).
       
         To interpolate at time t (in Jul. Sec) using these arrays:
         v = interpol(data, time, t)
         PLOT does not work very well with Julian Seconds.
         This is an IDL limitation related to single precision.
         One fix is to plot relative time: plot,ta-ta(0),va
         where ta and va are time and interpolated value arrays.
 MODIFICATION HISTORY:
       R. Sterner, 1 Apr, 1993
	R. Sterner, 28 Apr, 1993 --- changed from a function to a procedure.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\js2v.pro)


JS2WEEKDAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JS2WEEKDAY
 PURPOSE:
       Compute weekday given Julian Second.
 CATEGORY:
 CALLING SEQUENCE:
       wd = js2weekday(js)
 INPUTS:
       js = Julian Second (sec after 0:00 Jan 1 2000).      in
          May be a scalar or array of values.
 KEYWORD PARAMETERS:
       Keywords:
         /NAME  Returned name of weekday instead of
           number: Sunday, Monday, ...
 OUTPUTS:
       wd = Weekday number (Sun=1, Mon=2, ... Sat=7).       out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Dec 31

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\js2weekday.pro)


JS2XLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  js2xls

 PURPOSE:
   This function converts JulianSeconds to EXCEL-time values

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   result=js2xls(js)

 INPUTS:
   js: JulianSeconds, scalar or array

 OUTPUTS:
   result: EXCEL time value

 EXAMPLE:
   result=xls2js(39000)
   print,js2xls(result)
     39000.000

   MODIFICATION HISTORY:
   Written by: Franz Rohrer November 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\js2xls.pro)


JS2YMDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JS2YMDS
 PURPOSE:
       Convert from "Julian Second" to year, month, day, second.
 CATEGORY:
 CALLING SEQUENCE:
       js2ymds, js, y, m, d, s
 INPUTS:
       js = "Julian Second".               in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y,m,d = year, month, day numbers.   out
       s = second into day.                out
 COMMON BLOCKS:
 NOTES:
       Notes: Julian seconds (not an official unit) serve the
         same purpose as Julian Days, interval computations.
         The zero point is 0:00 1 Jan 2000, so js < 0 before then.
         Julian Seconds are double precision and have a precision
         better than 1 millisecond over a span of +/- 1000 years.
	  A precision warning may point to a call to dt_tm_fromjs.
       
       See also ymds2js, dt_tm_tojs, dt_tm_fromjs, jscheck.
 MODIFICATION HISTORY:
       R. Sterner, 2 Sep, 1992
	R. Sterner, 13 Dec, 1992 --- added data type check.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\js2ymds.pro)


JS2ZCNTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       js2zcntime

 PURPOSE:
       converts time info in ZEICHN file to jul sec

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:

 INPUTS:
       dvalue:   array of values (output of IRZN)
       ix:       number of records (output of IRZN)
       fb:       error bar flag (output of IRZN)

 OPTIONAL INPUTS:
       none

 OUTPUTS:
   array with julian seconds

 SIDE EFFECTS:
   none

 RESTRICTIONS:
       None.

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised     T.B. Sep 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2zcntime.pro)


JS2_YYYY_MM_DD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js2_yyyy_mm_dd

 PURPOSE:
   This function converts JulianSeconds into a string yyyy_mm_dd (works with array input)

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result= JS2DMYHMS(Julsec)

 INPUTS:
   Julsec: double scalar or array

 KEYWORD PARAMETERS:
   HOURS:  if set hours will be given '_hh'
   MINUTES:  if set hours will be given '_mm'
   SECONDS:  if set hours will be given '_ss'
   NO_UNDRSCORE: if set no '_' will be printed

 OUTPUTS:
   Result: string ('yyyy_mm_dd')

 EXAMPLE:
   print, js2_yyyy_mm_dd(123456789.D0)
       _2003_11_29

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1997
   Modified    T.B. 1998-APR-9 scalar output for scalar input !!
   Revised     T.B. Sep 1998
   Revised     T.B. Oct 1998 not using format
   Modeified   T.B. Oct 1998 NO_UNDERSDCORE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js2_yyyy_mm_dd.pro)


JSCHECK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JSCHECK
 PURPOSE:
       Check accuracy of "Julian Seconds" over a given time span.
 CATEGORY:
 CALLING SEQUENCE:
       jscheck
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Julian seconds (not an official unit) serve the
         same purpose as Julian Days, interval computations.
         The zero point is 0:00 1 Jan 2000, so js < 0 before then.
         Julian Seconds are double precision and have a precision
         better than 1 millisecond over a span of +/- 1000 years.
       
       See also ymds2js, js2ymds, dt_tm_fromjs, dt_tm_tojs.
 MODIFICATION HISTORY:
       R. Sterner, 3 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jscheck.pro)


JSPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JSPLOT
 PURPOSE:
       Make a time series plot with time in Julian Seconds.
 CATEGORY:
 CALLING SEQUENCE:
       jsplot, js, y
 INPUTS:
       js = Time array in Julian Seconds.   in
       y  = Data to be plotted.             in
 KEYWORD PARAMETERS:
       Keywords:
         GAP=gs  Gap in seconds.  This or greater time difference
           will cause a break in the curve.  If a plot symbol
           is desired use a negative psym number to connect pts.
         CCOLOR=cc     Curve and symbol color (def=same as axes).
         XTITLE=txt    Time axis title text.
         XTICKLEN=xtl  Time axis tick length (fraction of plot).
         XTICKS=n      Suggested number of time axis ticks.
           The actual number of tick marks may be quite different.
         FORMAT=fmt    Set date/time format (see timeaxis,/help).
         LABELOFF=off  Adjust label position (see timeaxis,/help).
         MAJOR=mjr     Major grid linestyle.
         MINOR=mnr     Minor grid linestyle.
         JSMAJOR=jsmajor Returned major time tick positions (JS).
         JSMINOR=jsminor Returned minor time tick positions (JS).
         TRANGE=[js1,js2] Specified time range in JS.
         OFF=off       Returned JS of plot min time. Use to plot
           times in JS: VER, js(0)-off.
         /OVER         Make overplot.  oplot,js-off,y also works
           but will not handle any gaps.
         Any plot keywords will be passed on to the plot call.
         Following related to background sun colors:
         /SUN display day/night/twilight as background colors.
         COLOR=clr     Plot color (set to black by /SUN).
         LONG=lng, LAT=lat = observer location for sun colors.
         ZONE=hrs  Hours ahead of GMT (def=0). Ex: zone=-4 for EDT.
 OUTPUTS:
 COMMON BLOCKS:
       js_com
 NOTES:
       Notes:  Julian seconds are seconds after 0:00 1 Jan 2000.
         See also dt_tm_tojs(), dt_tm_fromjs(), ymds2js(), js2ymds.
 MODIFICATION HISTORY:
       R. Sterner 1994 Mar 30
       R. Sterner, 1994 May 17 --- Added common js_com.
       R. Sterner, 1996 Sep 16 --- Added sun colors.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1998 Feb  5 --- Added XTHICK, YTHICK, CHARTHICK.
       R. Sterner, 1998 Aug 25 --- Fixed bug with the MAX_VALUE keyword.
       R. Sterner, 1999 Sep 23 --- Returned JS for major and minor time ticks.
       R. Sterner, 2000 Jun 23 --- Added LSHIFT to shift time axis labels.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\jsplot.pro)


JS_FILE_TIME[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js_file_time

 PURPOSE:
   This function returns the creation, modification, or access time of a file

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=JS_FILE_TIME(Filename)

 INPUTS:
   Filename:  a string or string array containing filenames to be processed

 KEYWORD PARAMETERS:
   DLL_NAME:  name of the dll containing the code to get the information
   CREATION:  return creation time instead of modification time
   ACCESS:    return access time instead of modification or creation time
   ERR:       set this to a named variable and it will be set to 1 if an
              error occured

 OUTPUTS:
   This function returns the julian second value/array of the requested info
   if an error occures -9.9999D99 is returned

 RESTRICTIONS:
   This routine works under Win32 only.

 PROCEDURE:
   This routine uses the c4idl.dll which was provided by Frank Holland

 EXAMPLE:
   filename=!dir
   string=js2dmyhms(js_file_time(filename, /CREATION))
   print, 'The directory ',dir,' was created on ', string

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-APR-8
   modified by Franz Rohrer, 1998-AUG-13, "if findfile(dll_name) ne '' then begin" + "endif else err=5"
   Modified T.B. 1999 Jul 31 : new ndef avoids error in processing
                               use search file w/ path for dll
   1999-09-28 dll_name for RT changed to dll_name = 'S:\links\idl_source\idl_work\fh_lib\c4idl.dll'
   2000-05-25 : aix, linux implemented
   2000-05-25:  linux call changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\js_file_time.pro)


JS_FILE_TIME[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js_file_time

 PURPOSE:
   This function returns the creation, modification, or access time of a file

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=JS_FILE_TIME(Filename)

 INPUTS:
   Filename:  a string or string array containing filenames to be processed

 KEYWORD PARAMETERS:
   DLL_NAME:  name of the dll containing the code to get the information
   CREATION:  return creation time instead of modification time
   ACCESS:    return access time instead of modification or creation time
   ERR:       set this to a named variable and it will be set to 1 if an
              error occured

 OUTPUTS:
   This function returns the julian second value/array of the requested info
   if an error occures -9.9999D99 is returned

 RESTRICTIONS:
   This routine works under Win32 only.

 PROCEDURE:
   This routine uses the c4idl.dll which was provided by Frank Holland

 EXAMPLE:
   filename=!dir
   string=js2dmyhms(js_file_time(filename, /CREATION))
   print, 'The directory ',dir,' was created on ', string

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-APR-8
   modified by Franz Rohrer, 1998-AUG-13, "if findfile(dll_name) ne '' then begin" + "endif else err=5"
   Modified T.B. 1999 Jul 31 : new ndef avoids error in processing
                               use search file w/ path for dll
   1999-09-28 dll_name for RT changed to dll_name = 'S:\links\idl_source\idl_work\fh_lib\c4idl.dll'
   2000-05-25 : aix, linux implemented
   2000-05-25:  linux call changed
   2000-06-20 : xmess output if dll or library file not found

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js_file_time.pro)


JS_INCMONTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JS_INCMONTH
 PURPOSE:
       Increment JS by one month.
 CATEGORY:
 CALLING SEQUENCE:
       js2 = js_incmonth(js1, [n])
 INPUTS:
       js1 = input Julian Seconds.                   in
       n = optional number to add to month (def=1).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       js2 = output Julian Seconds.  out
 COMMON BLOCKS:
 NOTES:
       Notes: Incrementing JS by one day is easy, just add
         86400D0 for each day.  This routine increments
         by exactly one month, so starting with 2000 May 2 12:46
         gives 2000 Jun 2 12:46
 MODIFICATION HISTORY:
       R. Sterner, 2000 Jun 23

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\js_incmonth.pro)


JS_LAST_STEP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   js_last_step

 PURPOSE:
   calculates the last begin of a time step:
   year, day, month, hour

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result= JS_LAST_STEP(julsec)

 INPUTS:
   julian sec: double (scalar or array)

 OUTPUTS:
   Result:   time in julian seconds

 KEYWORD PARAMETERS:
   STEP:   'HOUR', 'YEAR', 'MONTH', 'DAY'
   NEAREST:    if set the nearest full year, day, ... is searched

 EXAMPLE:
   print, js2string(js_last_step(dmyhms2js('1.2.30 20:15:12'), step='HOUR'))

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1997
   Modified:   T.B.    bug with step='DAY' removed
               T.B. new keyword nearest

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\js_last_step.pro)


JUL2DAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       JUL2DAY

 PURPOSE:
       Convert the inputted Julian day of year to year, month, day.

 CALLING SEQUENCE:
       jul2day,julday,year,mon,day

 INPUTS:
         julday      Julian day, ranges from 1-365(366)
         year

 KEYWORD INPUTS:

 OPTIONAL INPUTS:

 OUTPUTS:
         mon         ranges from 1-12
         day         ranges from 1-31

 OPTIONAL OUTPUTS:
         outyear     output year; if different from input year (when julday
                     > 365/366 or < 1)

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES
         The input variable julday can be zero or negative.  Zero indicates
         the last day of the previous year (12/31), -1 indicates 12/30,
         and so on.

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  10/25/92

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\jul2day.pro)


KERNEL

[Previous Routine] [Next Routine] [List of Routines]
 routine:     kernel
 useage:      kernel(ksize,angle)

 purpose:     create a digital filter to detect image streaks
              oriented at angle ANGLE.  The IDL procedure CONVOL 
              can be used to do the convolutions.
              
 input:
   ksize      frame size of kernel. 
   angle      select for streaks at angle ANGLE 

 EXAMPLE:

 print,kernel(3,0)

  0 0 0
  1 1 1
  0 0 0

 print,kernel(5,45)

 0 0 0 0 1
 0 0 0 1 0
 0 0 1 0 0
 0 1 0 0 0
 1 0 0 0 0

  author:  Paul Ricchiazzi                            oct93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\kernel.pro)


KINDFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	kindfile

 PURPOSE:
   This function finds out on wich datatype a dataset is based on.
   Momentanly defined is: mfd, nasa1001, nasa2160,  netCDF
   With this information it's possible to use the same environment for interpreting
   the data inside the file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=kindfile(file_name)

 INPUTS:
   file_name: The name of the file which should be tested for known format

 OUTPUTS:
   Result is a string whith these names
     'netCDF'
     'NASA 1001'
     'NASA 1010'
     'NASA 2160'
     'mfd'
     'unknown kind'

 EXAMPLE:
   Result=('test.nas')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Jan 1997
               R.Bauer second test for mfd, March 9 1997
 1998-Jan-16 case of 1010
 1999-Oct-04 ENZ added
 1999-Nov-06 help added
 2000-Feb-18 additional NASA Ames File identifier added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\kindfile.pro)


KNMHC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    knmhc

 PURPOSE:
    This function computes reaction rate constants for the reaction
    of several hydrocarbon species and CO with the hydroxyl radical
    OH for a given temperature and pressure. It uses rate constants
    from JPL 1997 and Atkinson et al., 1994.

 CATEGORY:
    Atmospheric Sciences

 USAGE:
    result = knmhc(T,p [,names=])
        with T in K and p in hPa (may be arrays)
        names returns the name of the respective species

 AUTHOR:
    Martin Schultz
    Max-Planck-Institute for Meteorology
    Bundesstr. 55, 20146 Hamburg, Germany
    martin.schultz@dkrz.de

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\knmhc.pro)


KOH_HNO3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   koh_hno3

 PURPOSE:
   This function computes the gas-phase chemical reaction rate
   constant for the reaction of nitric acid (HNO3) with the hydroxyl
   radical (OH) for given temperature and pressure. 

 CATEGORY:
   Atmospheric Sciences

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\koh_hno3.pro)


KOORDIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	koordin

 PURPOSE:
	This function sorts the x and the y values
   It's needed for xcursor

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   result=koordin(x1,x2,y1,y2)

 INPUTS:
	x1:  an value
	x2:  an value
   y1:  an value
   y2:  an value

 OUTPUTS:
   This function returns an array of sorted x and sorted y [x1,x2,y1,y2]
   x1 will be always lower than x2 and y1 will be always lower than y2

 EXAMPLE:
   Result=koordin(10,20,20,10)
   Result = [10,20,10,20]

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), April 6 1996
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\koordin.pro)


KTROE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        KTROE

 PURPOSE:
        This function computes the gas-phase reaction rate
        coefficient for a 3rd order reaction using Troe's formula as
        given in JPL97-4.

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        k=KTROE(T,p,k0300,n,kinf300,m [,keywords])

 INPUTS:
        T --> temperature in K

        p --> pressure in mbars

        k0300, n --> constants to get k0(T)  { see JPL97,table 2 }

        kinf300, m --> constants to get kinf(T)  { see JPL97,table 2 }

 KEYWORD PARAMETERS:
        k0, kinf, fc --> will return individual terms of the Troe expression

 OUTPUTS:
        a rate coefficient

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        no error checking is done except for the correct number of arguments

 EXAMPLE:

 MODIFICATION HISTORY:
        mgs, 20 Mar 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\ktroe.pro)


KURF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       KURF
 PURPOSE:
       Computes kurtosis inside a moving window.
 CATEGORY:
 CALLING SEQUENCE:
       k = kurf(x,w)
 INPUTS:
       x = array of input values.      in
       w = width of window.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       k = resulting kurtosis array.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 23 Aug, 1990.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\kurf.pro)


KURT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       KURT
 PURPOSE:
       Returns the kurtosis of an array (4th moment/2nd moment^2).
 CATEGORY:
 CALLING SEQUENCE:
       k = kurt(a)
 INPUTS:
       a = input array.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       k = kurtosis of a.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\kurt.pro)


K_OH_NO2_BRTA99

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_brta99

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , Brown et al., ChemPhys.Let. 299, 277-287, 1999

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_brta99(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_brta99()
   8.0888365e-012

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_brta99.pro)


K_OH_NO2_DOMA97

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_doma97

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , Donahue et al., JGR 102, 6159-6168, 1997

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_doma97(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_doma97()
   9.1145635e-012

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_doma97.pro)


K_OH_NO2_DRPE99

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_drpe99

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , Dransfield et al., GRL 26, 687-690, 1999

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_drpe99(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_drpe99()
   9.6472660e-012

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_drpe99.pro)


K_OH_NO2_GOSM00

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_GoSm00

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , D.M. Golden and G.P. Smith 2000, J.Phys.Chem. A104, 3991-3997

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_GoSm00(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_GoSm00()
   9.2860818e-012  4.2635081e-012

   MODIFICATION HISTORY:
   Written by: Franz Rohrer June 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_gosm00.pro)


K_OH_NO2_JPL97

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_jpl97

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , JPL97

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_jpl97(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_jpl97()
   8.8381293e-012

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_jpl97.pro)


K_OH_NO2_RADM2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  k_oh_no2_radm2

 PURPOSE:
   This function calculates the reaction constant for OH+NO2-->HNO3 , RADM2

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=k_oh_no2_radm2(temp=temp,p=p)

 INPUTS:

 OUTPUTS:

 EXAMPLE:
   print,k_oh_no2_radm2()
   1.1492343e-011

   MODIFICATION HISTORY:
   Written by: Franz Rohrer March 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\k_oh_no2_radm2.pro)


LABELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LABELS
 VERSION:
		4.0
 PURPOSE:
		Multiple XYOUTS interface.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		LABELS, X, Y, LABS [ ,ALIGN = ALN] [, optional keywords]
 INPUTS:
	X
		The X coordinates of the labels.  Can be given either as a scalar (in
		which case all the labels will have the same x coordinate) or as a
		vector of the same length as the LABS vector.
	Y
		Same as above for the Y coordinates.
	LABS
		A character vector containing the labels to be drawn.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	ALIGN
		The allignment parameter for LABS (see ALIGN graphics keyword in the
		IDL manual.  Can be given as a vector, thus providing individual
		allignment parameter to each string in LABS.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.  See comment in RESTRICTIONS.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		If any of X, Y or ALIGN is given as a scalar variable, it is converted
		to a vector of the same length as LABS.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straigtforward.  Calls DEFAULT from MIDL.
 MODIFICATION HISTORY:
		Created 10-DEC-1991 by Mati Meron.
		Modified 15-DEC-1993.  Incorporated keyword inheritance, allowing for
		using all the XYOUTS keywords.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\labels.pro)


LANGLEY

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  longley

 PURPOSE:  find TOA direct beam flux and atmospheric optical depth using
           the Langley procedure. Additionally, produce Langley scatter
           plot of direct beam flux vs airmass and show fit.

 USEAGE:   langley,sza,flx,flx0,tau,sigma,minmass=minmass,maxmass,
                   view=view,psym=psym,color=color,$
                   overplot=overplot,am=am,pm=pm,hw=hw

 INPUT:    

  sza      solar zenith angle array

  flx      direct normal flux (direct beam irradiance divided by cos(sza))
  
 KEYWORD INPUT:

  am       if set morning hours are used in Langley regression
  pm       if set afternoon hours are used Langley regression

           NOTE: it is assumed that data is organized in
           chronological order so that morning hours are those with
           decreasing sza and afternoon hours are those with
           increasing sza

  minmass  minimum air mass limit.  points with air mass less then 
           MINMASS are not used in regression. (default=2)

  maxmass  maximum air mass limit.  points with air mass greater then 
           MAXMASS are not used in regression. (default=6)
           Default limits are as suggested by Harrison and Michalsky (1994)

  clrfilt  if set values alog(flx)-smooth(alog(flx),n) gt CLRFILT are 
           removed from the regression computation

  view     display scatter plot and fitted regression line

  psym     symbol used for scatter plot

  color    color used for regression line 

  overplot if set, overplot results on existing plot frame

  hw       if set use histogram weighting in regression computation.
           This causes the regression to weigh all increments of air
           mass equally.  Fractional values of HW (between 0 and 1)
           causes the weighting factor to be raised to the HW
           power. In some cases histogram weighting can improve the
           accuracy of retrievals.

 OUTPUT:

  flx0     intensity at zero airmass

  tau      optical depth 

  sigma    standard deviation of log (flx) from fitted line.  This is
           an estimate of the fractional error.  For example sigma=.01
           means the linear regression fits the data to within about 1%.
           see example.

 DISCUSSION:
  use langley procedure to fit direct normal flux by an equation of form

          ln(I(m)) = ln(I(0)) - tau * m
 
  where I(m) is the direct normal flux at airmass m and tau is the 
  optical depth.  Assumes direct beam transmission obeys Beers law.


 EXAMPLE:  

    nn=200 &  doy=281 & lat=35. & lon=0. & time=findrng(7,17,nn)
    zensun,doy,time,lat,lon,sza,az
    szamx=80. & sza=sza(where(sza lt szamx)) & az=az(where(sza lt szamx))
    flx=(100.+randomn(iseed,nn))*exp(-.1*airmass(sza))

    w8x11 & !p.multi=[0,1,3] & set_charsize,1.5
    langley,sza,flx,flx0,tau,sigma,/view,title='Morning, hw=1',/hw,am=az
    langley,sza,flx,flx0,tau,sigma,/view,title='Morning',am=az
    langley,sza,flx,flx0,tau,sigma,/view,title='Afternoon',pm=az
    

 AUTHOR:   Paul Ricchiazzi                        09 Jan 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\langley.pro)


LAPLACIAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LAPLACIAN
 VERSION:
		4.0
 PURPOSE:
		Calculates the Laplacian of a function represented as an array of
		values.  Works for 1-7 dimensions.
 CATEGORY:
		Array Manipulation.
 CALLING SEQUENCE:
		Result = LAPLACIAN( ARR [, DELTA])
 INPUTS:
	ARR
		Array, numeric, number of dimensions can be 1 through 7
 OPTIONAL INPUT PARAMETERS:
	DELTA
		Size of step used to calculate the numeric derivatives.  The approx.
		second partial derivative in the i-th direction is calculated as
		(ARR(...,I + DELTA,...) + ARR(...,I - DELTA,...) - 2*ARR(...,I,...)) $
		/DELTA^2
		The default value of DELTA is 1l.  If provided, it is rounded to a long
		integer on input.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the Laplacian of ARR as an array of the same size as ARR.  If
		ARR is not an array, returns 0.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Due to current limitations of the MAKE_ARRAY system routine, 8
		dimensions are not allowed.
 PROCEDURE:
		Creates an 7-dimensional array, with dummy leading dimensions,
		containing the original array.  Generates the differences using the
		SHIFT system routine and strips the dummy dimensions at the end.
		Uses the functions DEFAULT and FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 15-NOV-1991 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\laplacian.pro)


LASTINDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LASTINDEX
 PURPOSE:
       Returns last index for each dimension of the given array.
 CATEGORY:
 CALLING SEQUENCE:
       lastindex, array, l1, l2, ... l8
 INPUTS:
       array = given array.                          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       l1, l2, ... = last index for each dimension.  out
         Max of 8 dimensions.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 5 Jan, 1990
       R. Sterner, 18 Mar, 1990 --- removed execute (recursion problem).

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lastindex.pro)


LASTPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LASTPLOT
 PURPOSE:
       Backup !p.multi to last plot position.
 CATEGORY:
 CALLING SEQUENCE:
       lastplot
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: needed for !p.multi plots using multiple plot calls.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 16.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lastplot.pro)


LASTPPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LASTPPOS

 PURPOSE:
       get the position of the last frame

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
       pp = LASTPPOS(ppos)

 INPUTS:
       array of positions

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       position of last plot according to !p.multi

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       pp = lastppos(ppos)
       xyoutp, .1, .1, 'text', framepos=pp

 REVISION HISTORY:
       Written         Theo Brauers, Aug 1997
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\lastppos.pro)


LAST_CHAR_CONTLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  last_char_contline

 PURPOSE:
  This functions resolves continuation lines identified
  by the first character or string

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=LAST_CHAR_CONTLINE(str)

 INPUTS:
   str:    string array containing the text

 KEYWORD PARAMETERS:
   CHAR:   this is the continuation line char, last nonspace char
   EXCH:   char will be exchanged with nothing or with char given in exch

 OUTPUTS:
   Result: this function returns a string array where continuation
        lines are merged with the previous line. The size of the
        returned string array is reduced accordingly

 EXAMPLE:
  str=['123$','123', '456']
  print, last_char_contline(str)
  IDL prints:
     123  123
     456

 MODIFICATION HISTORY:
   Written by: Theo Brauers / Franz Rohrer 1997-JAN-28
  Modifications:
       5.3.98 : FR     changed direction of FOR
                       strmid(...) anstelle strpos(...)
       6.3.98 : FR/TB  default exch=''

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\last_char_contline.pro)


LATEXOFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LATEXOFF
 PURPOSE:
       Close the encapsulated Postscript file opened by LATEXON.
 CATEGORY:
 CALLING SEQUENCE:
       latexoff
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       latex_com
 NOTES:
       Notes: keep track of the plot shape listed by latexoff.
         To avoid distortion use this same shape for LaTeX figures.
 MODIFICATION HISTORY:
       R. Sterner, 14 Sep 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\latexoff.pro)


LATEXON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LATEXON
 PURPOSE:
       Generate encapsulated postscript file to include in LaTeX documents.
 CATEGORY:
 CALLING SEQUENCE:
       latexon, file
 INPUTS:
       file = output postscript file (use *.ps).   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       latex_com
 NOTES:
       Notes: See also latexoff, which terminates the postscript
         output and closes the file.
         To create the postscript file:
         (1) Do plot on screen.
         (2) latexon,"outfile.ps"
         (3) Repeat same plot.
         (4) latexoff.  Note plot shape.
         To use the resulting file in a LaTeX document:
         (1) Include at the front of the LaTeX document the file
             IDL_DIR:[LIB]IDLPLT_DVIPS.TEX, which defines the insertplot macro.
         (2) In your LaTeX document use
             \insertplot{file}{caption}{label}{width}{height}
               file = name of file containing the PostScript.
               caption = caption of figure
               label = latex \label{} for figure to be used by \ref{} macro
               width = width of figure in inches.      |  Best to use shape
               height = height of figure, in inches.   |  given by latexoff.
              or \insertimg (same arguments. Use output shape same as image shape).
         (3) LATEXPS the LaTeX document.
 MODIFICATION HISTORY:
       R. Sterner, 14 Sep 1990
       R. Sterner, 11 Oct 1990 --- added plot shape.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\latexon.pro)


LATLON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LATLON

 PURPOSE:
	If the current window has map coordinates (i.e., MAP_SET has been used
	to set up a map projection), LATLON tracks the longitude and latitude 
	of the mouse location and displays them in a separate window. 

	To activate tracking, click on the left mouse button while the cursor 
	is in the plotting window. To stop, position the cursor in the 
	plotting  window and press the right button.

 CATEGORY:
	Mapping.

 CALLING SEQUENCE:
	LATLON 

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Latitude and longitude values are printed in a new window.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A new window is created.

 RESTRICTIONS:
	The window must have map coordinates.

 EXAMPLE:
	Set up a Mercator map projection by entering the following command:
		MAP_SET, /MERCATOR, /GRID, /CONTINENT

	Invoke LATLON by entering:
		LATLON

	A new window labeled "Latitude/Longitude" should appear.  Put the mouse
	cursor in the map window and press the left mouse button to begin
	tracking the position of the cursor.  Press the right mouse button 
	over the map to end LATLON.

 MODIFICATION HISTORY:
	Written by Ann Bateson, June 1990

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\latlonrdpix.pro)


LCT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  lct

 PURPOSE:  try all predefined color tables

 USEAGE:   lct,index

 INPUT:    
   index   if set index specifies the first color table to try

 OUTPUT:
   index   final color table index

 DISCUSSION:
   With each click of the left mouse button a new color table is loaded.
   The MMB scans up the list of color tables and LMB scans down the list.
   The RMB exits the procedure.

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
   Loads new color tables
  
 EXAMPLE:  
   
   tvim,replicate(1,2) # indgen(!p.color),/scale,range=[0,!p.color],/asp & lct

 AUTHOR:   Paul Ricchiazzi                        30 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\lct.pro)


LECTURE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LECTURE
 PURPOSE:
       Select specified lecture notes from a notes file.
 CATEGORY:
 CALLING SEQUENCE:
       lecture, notes, slides, lect
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /NOCOMMENTS doesn't pass comments from slides file'
            on to lecture file.
         /NONUMBERS doesn't pass slide numbers from slides file'
            on to lecture file.
         /ONELINE uses first note line to make a one line listing.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       notes = name of notes file.              in
           File format:  Slide id lines must start in column 1,
           and may contain any number of ids (like Rigel, Beta Ori, ...),
           where ids are delimited by commas.
           Note lines must be indented and there may be any number of such lines.
           Notes continue until next id line.  Comments may occur anywhere and
           are designated by a * in column 1.
           Example notes file:
           *----- catagory xxx  ------------
           id_a_1, [id_a_2, id_a_3, ...]
             notes line 1
             notes line 2
             . . .
           id_b_1, [id_b_2, id_b_3, ...]
             . . .
       slides = name of slides file.            in
           File format: Each line has slide number, space(s),
           slide id.  Slide id is the slide name as listed in the notes file.
           Slides file may contain comments.  Comments have * in column 1 and
           are passed directly into the lecture file unless /NOCOMMENTS are used.
           Slide numbers are also passed into the lecture file unless /NONUMBERS
           is used.  Use /one for one line listing for individual slides.
           Example slides file:
           1  id_a_1, id_a_2, id_a_3
           2  id_b_1 /one
           . . .
       lect = name of resulting lecture file.   in
           Same format as notes file.  Order of notes is that given in the slides file.
           Must use /NONUMBERS keyword to get format identical to notes file.
       Notes: Missing parameters are prompted for.
         Notes file may be re-arranged by creating a slides file with the
         desired order.  Use the keyword /NONUMBERS to suppress the output of slide numbers.
         The resulting lecture file is then the re-arranged notes file.
 MODIFICATION HISTORY:
       R. Sterner, 4 Feb 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lecture.pro)


LEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LEG
 PURPOSE:
       Make a plot legend.
 CATEGORY:
 CALLING SEQUENCE:
       leg
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         LINESTYLE=sty  An array of line styles (def=0).
         THICK=thk      An array of line & sym thicknesses (def=1).
         COLOR=clr      An array of line colors (def=!p.color).
         PSYM=sym       An array of plot symbol codes (def=none).
         SYMSIZE=ssz    An array of symbol sizes (def=1).
         SCOLOR=sclr    An array of symbol colors (def=COLOR).
         NUMBER=nums    Number of symbols per line (def=1).
         /INDENT        Means indent symbols from line ends.
         LABEL=lbl      An array of line labels (def=none).
         FONT=font      Font text (0=hardware, -1=Hershey (def)).
         LSIZE=lsz      Label text size (def=1).
         LCOLOR=lclr    Label color (def=same as line colors).
         TITLE=ttl      Legend title.
         TSIZE=tsz      Title size (def=1).
         TCOLOR=tclr    Title color (def=!p.color).
         POSITION=pos   Legend position in normalized window
           coordinates.  If not given, positioning is interactive.
         OUTPOS=opos    Returned legend position from interactive
           mode. Useful to repeat legend plot non-interactively.
           Also in normalized window coordinates, that is 0 to 1
           from xmin or ymin to xmax or ymax.
         BOX=box        Legend background box parameters.  If not
           given no box is plotted.  May have up to 6 elements:
           [BIC, BOC, BOT, BMX, BMY, BFLAG]
           BIC: Box interior color.  Def=no box.
           BOC: Box outline color.   Def=!p.color.
           BOT: Outline thickness.   Def=1.
           BMX: Box margin in x.     Def=1.
           BMY: Box margin in y.     Def=1.
           BFLAG: Margin units flag. Def unit (BFLAG=0) is 1 legend
             line spacing (in y). 1 means units are norm coord.
        keyword.  Which font is selected by placing a font selection
        string at the start of the first label.  Ex: "!8Label 1"
        gives the Italic font for Hershey.
        Hint: set up array parameters in separate statements.
 OUTPUTS:
 COMMON BLOCKS:
       leg_com
 NOTES:
       Notes: Unless POSITION is given, an interactive box is used
        to position plot legend.  The first line is the top of
        the box, the last is the bottom, and the rest are uniformly
        spaced between.  The last value of short arrays is repeated.
        If given, the box outline color is used as the default.
        Hardware or Hershey fonts are selected using the FONT
 MODIFICATION HISTORY:
       R. Sterner, 26 Jul, 1993
       Dick Jackson (djackson@ibd.nrc.ca), 1994 Aug 2 --- Added FONT keyword
       and symbol thickness.
       R. Sterner, 1994 Nov 18 --- Allowed array of symbol sizes.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\leg.pro)


LEGENDRE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  legendre

 PURPOSE:  compute legendre polynomial

 USEAGE:   result=legendre(n,x)

 INPUT:    
  n        order of polynomial
  x        argument of polynomial


 DISCUSSION:
           use recursion relation to compute legendre polynomial
           for orders greater than 2:

           n*P(n,x)=(2n-1)*x*P(n-1,x)-(n-1)*P(n-2,x)

           P(0,x)=1.  P(1,x)=x

  
 EXAMPLE:  

  x=findrng(-1,1,10000)
  f=legendre(20,x)
  plot,x,f

; find phase function for a given set of legendre moments

   awk='/pmaer/,/eof/ { gsub(/pmaer=/,"",$0); print $0}'
  readbuf,'/home/paul/arm/iop_97/mie/mieout_1.0_1.33_0.00',b,awk=awk,nc=40
  x=findrng(-1,1,10000)
p=[1,reform(b(0,*))]&f=0&for i=0,20 do f=f+.5*(2*i+1)*p(i)*legendre(i,x)&plot_io,x,f

; find zeroes of legendre polynomial

    r=roots(f,0.) & xxx=interpolate(x,r) & fff=interpolate(f,r)
    oplot,xxx,fff,psym=2
    print,xxx

; print zeroes of rescaled legendre polynomial n=10,20,2

    for n=10,20,2 do begin & f=legendre(n,x) & r=roots(f,0.) & print,n,min(abs(cos(!dtor*39.)-(interpolate(x,r)+1.)/2.)) & endfor

 AUTHOR:   Paul Ricchiazzi                        06 Apr 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\legendre.pro)


LEGENDRE_POL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LEGENDRE_POL
 VERSION:
		4.0
 PURPOSE:
		Calculates Legendre polynomials Pl and associated polynomials Plm.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = LEGENDRE_POL( X, L [, M])
 INPUTS:
	X
		Numeric, absolute values must be <= 1, otherwise arbitrary.
	L
		Nonnegative scalar, rounded to integer on input.  Defaults to 0
 OPTIONAL INPUT PARAMETERS:
	M
		Nonnegative scalar, rounded to integer on input.  Defaults to 0.  Must
		be <= L.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the values of the Legendre polynomial P(l,x) or (when M is not
		zero) of the associated Legendre polynomial P(l,m,x).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other then the restrictions on X, L and M as mentioned above.
 PROCEDURE:
		Using the recurrence relation from Numerical Recipies, Sec. 6.6.
		Calling CAST, DEFAULT, and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 20-DEC-1994 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\legendre_pol.pro)


LEGEND[1]

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE: legend

 PURPOSE: draws a plot legend 

 USEAGE:  legend,labels,pos=pos,linestyle=linestyle,psym=psym,clrbox=clrbox,$
                 color=color,thick=thick,fg_color=fg_color,bg_color=bg_color,$
                 box=box,numsym=numsym,ystretch=ystretch,silent=silent,$
                 center=center,fill=fill,right=right,norm=norm,spos=spos,$
                 charsize=charsize
               
 INPUT:

 labels	
     an array of labels (required). Elements of LABELS which do not
     begin with the characters ".l",".f",".c", or ".r" are treated as
     legend labels.  These elements are drawn to the right of a line
     or symbol of given LINESTYLE, PSYM, COLOR or THICK type. The
     total number of labels in LABELS (i.e., not counting legend
     titles) should correspond to the number of elements in those
     input parameters.
     
     If any of the label strings start with the characters
     ".l",".L",".f",".c", or ".r" that element of the LABELS array is
     treated as a legend title.  Legend titles appear as left
     justified (".l"), left justified in label field (".L"), filled
     (".f") centered (".c") or right justified (".r") strings in the
     legend box and do not correspond to elements of LINESTYLE, PSYM,
     COLOR or THICK.  Null strings ("") or blank strings (" ") are
     also treated as legend titles. Lines or symbols are not drawn to
     the right of legend titles.
     
     If none of the keywords, LINESTYPE, PSYM, COLOR or THICK are
     set, then all elements of LABELS will be treated as legend
     titles and will be left justified unless prepended by ".f", ".c"
     or ".r".  or unless one of the keywords keywords "center",
     "fill" "right" are set.  These keywords set the default, string
     justification but may always be overridden by one of the
     justification flags.
     
     Consider,
     
            labels=['.ctitle','1','2','.lsecond title,'a','b']
            linestyle= [1,2,3,4]
     
     In this example LABELS contains 4 legend labels and 2 legend
     titles. The correspondence with the linestyle input parameter is
     as follows:
     
                      labels(1) <==> linestyle(0)
                      labels(2) <==> linestyle(1)
                      labels(4) <==> linestyle(2)
                      labels(5) <==> linestyle(3)
     
     To simplify input, LABELS may also be specified as a single
     string with the different LABEL elements separated by
     backslashes (\) (E.g., labels='.cCloud height\\1\2\3\4\5'

 KEYWORD INPUT:

 pos
     position and size of legend area in normalized data 
     coordinates.  Format of this four element vector is
     [x0,y0,x1,y1] where x0,y0 is the position of lower
     left corner and x1,y1 is the position of the upper
     right corner.  For example pos=[.5,.5,.9,.9] specifies
     a legend in the upper right quadrant of the data 
     window.  If the POS parameter is not set or if POS is
     set to zero, then the CURBOX procedure is called to
     set the legend position interactively.  
     
     NOTE: the value of POS can be retrieved by setting POS
     to a named variable which has an initial value of zero.

 linestyle   
     an array of linestyle types, one for each label in LABELS

 psym	
     an array of symbol types, one for each label in LABELS. 
     PSYM can be either a integer or string array.  If PSYM is a
     string array then the library routine USERSYMBOL is used to
     create the symbols.  In this case if the symbol specifier is
     appended with '_f' then a filled symbol will be generated

 clrbox
     if set, a color-filled box appears to the left of each legend
     label.  The number of boxes drawn can be changed with NUMSYM.
     If clrbox is set to 2, a color-filled circle appears to the left
     of each legend label.

 color       
     an array of color indices, one for each label in LABELS.
     Any elements of COLOR set to -1 causes the default color,
     !P.COLOR, to be used.

 thick       
     an array of line thicknesses, one for each label in LABELS
     (default=!p.thick)

 numsym      
     number of symbol nodes used to indicate linestyle or symbol
     type.  The length of the line is measured in units of LENFAC
     character widths so that the length of the line
     = LENFAC*(NUMSYM-1) * X_CHARSIZE
     (default=2 when linestyle, color or thick set, otherwise default=1)

 lenfac
     factor which controls length of line between symbols (see numsym)
     (default=5)

 fg_color    
     color of box and legend titles (default=!P.COLOR)

 bg_color    
     background color. Setting BG_COLOR erases the area covered by
     the legend (filling it with color BG_COLOR) prior to writing the
     legend.  If both BG_COLOR and !p.color are zero then the
     background color is reset to 255 to gaurantee a readability.
               
 box         
     if set draw a box around the legend text

 silent      
     if not set, print box position string to the terminal
     and show popup help on the CURBOX cursor routine
     
     silent=1 don't print position string
     
     silent=2 don't print position string, don't show help widget

 center
     if set, default action is to center legend labels

 fill
    if set, default action is to fill legend labels

 right
    if set, default action is to right justify labels

 norm
    if set, normalized coordinates are used to specify POS both
    on input and printed output.  This option allows placement
    of the legend outside of a plot region. 

 ystretch    
     factor by which to increase vertical spacing of legend 
     entries. This parameter is particularly useful when used
     with the SPOS keyword.  (default = 1)  
     
     NOTE: the aspect ratio of the legend box can be
     modified on the fly by pushing the cursor box against
     one of the window boundaries and pressing the middle
     button.  

 spos
    string value which specifies legend position to one of a set of
    standard positions.  if spos is set, it supercedes the value of pos

                'bl' = bottom left
                'br' = bottom right
                'tl' = top left
                'tr' = top right
                'top'= top center
                'bot'= bottom center

 charsize
    character size used when legend position specified with SPOS.  
    CHARSIZE has no effect when POS is used to set position.

 OUTPUT:       none

 PROCEDURE:
    When called without the POS keyword, the legend position and size
    is set with the CURBOX routine.  The legend is positioned by
    dragging the box where you want the legend to appear.  The size
    of the legend area can be decreased/increased by the left/middle
    mouse buttons.  When the right mouse button is pressed the legend
    is drawn and a numerical positioning string giving the current
    value of the POS keyword is written to the terminal (nothing
    printed if SILENT is set).  You can run LEGEND in batch mode by
    pasting this value of POS into the LEGEND command line.  The best
    way to get good-looking legends on your hardcopies is to size
    your graphics window to the approximate shape of the output
    media.  For example a plot which is to be printed in landscape
    mode should be previewed on a window which is approximately 1.4
    times as wide as it is tall.

    NOTE:    The values returned for the POS keyword are based on a
    computation of the length of the text strings in your legend.  If
    you change the contents of the legend titles or if you change the
    default text font, you must rerun LEGEND in interactive mode to
    determine new values for the POS paramter.
                     


; EXAMPLE       interactive mode (put the box anywhere you want and press
;               the right mouse button)

   dcolors
   plot,6*randf(20,3),/nodata 
   for i=1,6 do oplot,i*randf(20,3),li=i-1,color=i
   lb='.cFirst bunch\\First\Second\Third\\.cSecond bunch\\forth\fifth\sixth'
   legend,lb,li=[0,1,2,3,4,5],/box,bg=0,color=[1,2,3,4,5,6]

; EXAMPLE       interactive mode. retrieve the value of POS for later calls:

   !p.multi=[0,1,2]
   plot,[0,.4],yrange=[0,1],li=0 & oplot,[0,.6],li=2 & oplot,[0,.9],li=3
   legpos=0
   lb=['.cLegend Demo','','one','two','three']
   legend,lb,pos=legpos,li=[0,2,3]
   plot,[0,.4],yrange=[0,1],li=0 & oplot,[0,.6],li=2 & oplot,[0,.9],li=3
   legend,lb,pos=legpos,li=[0,2,3]
   !p.multi=0


; EXAMPLE       use fill mode to print a figure caption

  w11x8
  !p.multi=[0,1,2]
  plot,dist(20)
  t=$
   'When called without the POS keyword, the legend position and size is\'+$
   'set with the CURBOX routine.  The legend is positioned by dragging the\'+$
   'box where you want the legend to appear.  The size of the legend area\'+$
   'can be decreased/increased by the left/middle mouse buttons.  When the\'+$
   'right mouse button is pressed the legend is drawn and a numerical\'+$
   'positioning string giving the current value of the POS keyword is\'+$
   'written to the terminal (nothing printed if SILENT is set).'

   legend,t,bg=0,pos=[0.00,-0.52,0.47,-0.18]         ; default left justified
   legend,t,bg=0,/right,pos=[0.53,-0.52,1.00,-0.18]  ; right justified
   legend,t,bg=0,/center,pos=[0.27,-1.00,0.74,-0.66] ; centered

; NOTE: procedure PFILL provides more elaborate text formatting capability
   
; EXAMPLE       batch mode:

   plot,[-50,50],[0,1.5],/nodata & x=findgen(101)-50.
   li=indgen(6) & pos=[0.66,0.54,0.91,0.89] 
   for i=0,5 do oplot,x,1./(1.+(x/(i+2))^2),li=li(i) 
   labels='.cPlot Key\\First\Second\Third\Fourth\Fifth\Sixth'
   legend,' ',bg=80,pos=pos+.02,/box
   legend,labels,li=li,pos=pos,bg=40,/box
                
; EXAMPLE       batch mode with symbols generated by USERSYMBOL:

   plot,[-50,50],[0,1.5],/nodata & x=findgen(101)-50.
   psym=['TRIANGLE','DIAMOND','PENTAGON','CIRCLE','SQUARE','SPADE']
   pos=[0.66,0.54,0.91,0.89] 
   for i=0,5 do begin &$
     usersymbol,psym(i) &$
     oplot,x,1./(1.+(x/(i+2))^2),psym=8,symsize=2 &$
   endfor
   labels='.cPlot Key\\First\Second\Third\Fourth\Fifth\Sixth'
   legend,' ',bg=4,pos=pos+.02,/box
   legend,labels,psym=psym,pos=pos,bg=10,/box
                

  author:  Paul Ricchiazzi                            4dec92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS
 15dec92: added legend titles, and CHARSIZE parameter
 11jan93: added numsym parameter
 20jan93: added thick parameter
  2feb93: fixed positioning bug  legend titles
 25mar93: removed the NOBOX option, now you set BOX to get a box
 29mar93: added the bg_color option to blank out legend area before writing
  8apr93: use CURBOX for cursor control and LENSTR for exact string size
 27apr93: improved alignment symbol and label (ylab=yy-.3*charsize*cnvrty)
  9jun93: center legend labels when legend titles are longer (see dxcen)
 17jun93: added ystretch option to increase vertical spacing
 17jun93: default line thickness read from !p.thick
 30sep93: .l implied when LINESTYLE, PSYM, COLOR, THICK  not set. see NOLINES
 28Jun94: LABELS is now normal input param, not a keyword.
 28Jun94: legend "titles" don't correspond to LINESTYLE, PSYM, COLOR, THICK
          vector elements; no need to put in dummy values. see examples
 18Aug94: added USYM option
 28Jun95: added the .f format option
  8Sep95: added CLRBOX option
  5oct95: added charsize adjustment for Y axis
   sep96: added spos keyword, numsym default = 1 unless linestyle or color set
   nov96: CLRBOX=2 yields filled circles instead of boxes

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\legend.pro)


LEGEND[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
         LEGEND

 PURPOSE:
 
         Add to a plot a legend containing lines and plotting symbols,
         enclosed in a box.

 CALLING SEQUENCE:

        LEGEND,LABELS
 
 INPUTS:
        LABELS - n-element string array of labels.
 
 KEYWORD PARAMETERS:

       POSITION - an integer, specifying the location of the legend box:
 
                  0: no legend is drawn.
                  1: below plot, left
                  2: below plot, center
                  3: below plot, right
                  4: lower left
                  5: lower center
                  6: lower right
                  7: middle left
                  8: middle center
                  9: middle right
                  10: upper left
                  11: upper center
                  12: upper right
         
                  if not specified, default position=10

        COLOR - n-element array of colors. default is !p.color
        
        LINESTYLE - n-element array of linestyles. if ommited, only
                    symbols are plotted.
                    
        THICK - n-element array of thicknesses. default is !p.thick
        
        PSYM - n-element array of psym values. if positive, only
               symbols are plotted.
               
        SYMSIZE - n-element array of symsize values. default is !p.symsize
        
        SYMBOLS - array of 'symbol' specifiers: each element of
                  psym which is equal to 8 (user-defined symbol)
                  must have a corresponding value for 'symbol' to be 
                  used by the procedure SYMBOLS.  
                  Examples:	psym=[8,8,8,8],symbols=[1,2,20,30]
                                psym=[1,2,8,8],symbols=[1,2]
                                
        CHARSIZE - scalar specifiying the size of the text.
        
        TITLE - scalar string specifying legend title
        
        T_COLOR - scalar specifying the color index of the title.
        
        NOLINES - set to inhibit drawing lines and symbols; just draw
                  labels in color.
                  
        SYM_ONLY - set to inhibit drawing lines; just draw symbols.
        
        NOBOX - set to inhibit drawing a box around the legend
        
        LINEWIDTH - width in character units. default = 4.

        BOXPADX - padding in character units, between text and box in
                  x. default=2.0
        BOXPADY - padding in character units, between text and box in
                  y. default=0.5
                  
        FONT - Set to an integer from 3 to 20, corresponding to the
               Hershey vector font sets, referring to the font used
               to display the text.  If a font other than !3 is used
               in the text string, then FONT should be set
               accordingly. (Any font commands embedded in the text
               string are ignored.)

        BOXFUDGEX - A scaling factor, used to fudge the width of the
                    box surrounding the text.  Default=1.0.

 RESTRICTIONS:
 
       When specifying a position of 1,2 or 3, you'll need
       to (a) use the same charsize value for the plot and
       for the legend, and (b) draw the plot with an extra
       ymargin(0).  i.e., set ymargin(0)=7+n_elements(text_array)


 MODIFICATION HISTORY:
 
        David L. Windt, Bell Labs, March 1997
        windt@bell-labs.com
        
       October, 1997, dlw:

       Now using the TEXT_WIDTH function, in order to do a somewhat
       better job of drawing the box around the text.

       NONPRINTER_SCALE keyword parameter is now obsolete.

       BOXFUDGEX keyword parameter added.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\legend.pro)


LEGEND_REORG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	legend_reorg

 PURPOSE:
   This function is used to reorganize plot.legend which was altered by xp_legend

 CATEGORY:
   PLOT/PLOTXY

 CALLING SEQUENCE:
   result=legend_reorg(plot,names,order)

 INPUTS:
	plot: The by pl_init defined plot Structure
   names: the altered names in the original order
   order: the new order of all elements of plot.legend

 OUTPUTS:
	This function returns the array plot.legend

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-May-31
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\legend_reorg.pro)


LENSTR

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:         lenstr
 USEAGE:          result=lenstr(str)

 input:
  str             a single string or string array.
 
 output:
  result          length of the string(s) in normalized units
                  the number of elements of RESULT matches the number of 
                  elements of STRING. 

 procedure:
                  This function returns the physical length of the
                  string on the output device, not the number of
                  characters.  This is done by first switching to 'X'
                  and writing the string(s) with XYOUTS in graphics
                  mode 5, which disables display to the screen but
                  does not interfere with operation of XYOUTS.  The
                  WIDTH keyword parameter of XYOUTS is used to
                  retrieve the physical length of the string(s).

  author:  Paul Ricchiazzi                            7apr93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\lenstr.pro)


LESE_ICG2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	lese_icg2

 PURPOSE:
	This is an example for reading files from W. Paetz

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   lese_icg2,[inhalt=inhalt]

 OPTIONAL OUTPUTS:
   inhalt: the structure INHALT may be useful for debuging

 EXAMPLE:
   lese_icg2

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1996

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\lese_icg2.pro)


LESE_MAARTEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	lese_maarten

 PURPOSE:
	to translate maartens trajectory files to netCDF

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   lese_maarten,[inhalt=inhalt]

 OPTIONAL OUTPUTS:
   inhalt: the structure INHALT may be useful for debuging

 EXAMPLE:
   lese_maarten

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1996

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\lese_maarten.pro)


LESE_MAARTEN96

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	lese_maarten96

 PURPOSE:
	to translate maartens trajectory files to netCDF

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   lese_maarten96,]inhalt=inhalt]

 OPTIONAL OUTPUTS:
   inhalt: the structure INHALT may be useful for debuging

 EXAMPLE:
   lese_maarten

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1996

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\lese_maarten96.pro)


LESS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    less

 PURPOSE:    print interactively selected portions of arrays or vectors

 USEAGE:     less,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,index=index

             

 INPUT:      
  p1,p2,...  a set of vector quantities to print. all vectors must
             be of the same length



 KEYWORD INPUT:

   index     if set, the array indicies of the first parameter, p1,
             are printed.  This only has effect when p1 has dimension
             greater than two.  Indicies for array dimensions greater
             than 5 are not printed. This option disables the 2-D display
             mode.
             

 DISCUSSION:
             When the size of the array is greater than can be viewed
             in one display screen, LESS enters an interactive mode
             which allows the user to page through the array(s). Many
             of the movement commands are similar to the unix command
             "less".  While in the interactive display mode type "h"
             to get a listing of accepted interactive commands.

             If only one input parameter is specified, LESS will
             display it as 2-D table with the values of the first
             index shown across the screen and the values of the
             second index shown down the screen.  The number of rows
             and columns are chosen to fit the screen.  Up to 5
             dimensions can be accomodated.  Movement in the 3rd,4th,
             and 5th is accomplished by entering index values while
             in display mode.

 EXAMPLE:

    x=sqrt(findgen(20)+23)
    y=sin(.1*x)

    less,x,y                                            ; 
    less,x,y,x+y,x-y,x*y,(x+y)*(x-y),x/y
    less,rebin(x,4,5),y,/index

    less,dist(20,500)

  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\less.pro)


LETTER

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  letter

 PURPOSE:  write a letter for figure numbering

 USEAGE:   letter,x,y,charsize=charsize,font=font

 INPUT:    
   x       subnormal coordinates of letter (default = .05)
   y       subnormal coordinates of letter (default = .95)

 KEYWORD INPUT:
 charsize  character size (size is halved if more than 2 plots are
           ganged in either horizontal or vertical)

  font     vector drawn font (default = 17)
     

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

   

 AUTHOR:   Paul Ricchiazzi                        13 Oct 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\letter.pro)


LGRADIENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LGRADIENT
 PURPOSE:
       Create a floating array with a linear gradient.
 CATEGORY:
 CALLING SEQUENCE:
       g = lgradient( nx, ny, ang, dst)
 INPUTS:
       nx, ny = array size in pixels.                  in
       ang = angle of gradient (deg CCW from x axis).  in
       dst = distance where gradient equals +/-1.      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       g = Returned floating array with gradient.      out
 COMMON BLOCKS:
 NOTES:
       Notes: returned array is 0 at center and increases
       to 1 at distance dst in direction ang, -1 at same
       distance in opposite direction.  Intended for detrending:
       new = old*(1+g) or new = old*(1+g*weight)
 MODIFICATION HISTORY:
       R. Sterner, 1999 Nov 3

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lgradient.pro)


LINCAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINCAL
 PURPOSE:
       Plot a multimonth linear calendar on one page.
 CATEGORY:
 CALLING SEQUENCE:
       lincal, dates
 INPUTS:
       dates = string array of dates.   in
         Ex: dates=['dec 1995','jan 1996','feb 1996']
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=title  Optional main title.
         /HARD        Make hard copy.
         /NODAYS      Suppress day of the week.
         CHARSIZE=csz Character size (def=1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 20

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lincal.pro)


LINCROSS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LINCROSS
 VERSION:
		4.0
 PURPOSE:
		Finds the crossing point of two line segments or lines, in 2D.
 CATEGORY:
		Geometry.
 CALLING SEQUENCE:
		Result = LINCROSS( FIR, SEC [,LINES = LIN] [,CROSS = CRP])
 INPUTS:
	FIR
		First line/line_segment provided as a (2,2) array.  Two possible forms:
			1)	Segment:  Endpoints given by 2D vectors FIR(*,0) and FIR(*,1).
			2)  Line: Point on the line given by FIR(*,0), line direction by
				FIR(*,1).
		Whether FIR is interpreted as a line or a segment depends on the
		value provided to LINES.  Default interpretation is segment.
	SEC
		Same as FIR, for the second line/line _segment.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	LINES
		Numeric code specifying whether FIR and SEC should be considered lines
		or segments.  Possible values are

		LINES			FIR			SEC

		0 or
		undefined		segment		segment
		1				line		segment
		2				segment		line
		3				line		line
	CROSS
		Optional output, see below.
 OUTPUTS:
		Returns 1b if a crossing exists, 0b otherwise.  For lines a crossing
		always exists, unless they happen to be parallel.
 OPTIONAL OUTPUT PARAMETERS:
	CROSS
		The name of a variable to receive the coordinates of the crossing point
		as a 2D vector (X_cross,Y_cross).  If no crossing exists, both values
		are set to the square root of the maximal floating value (machine
		dependent).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls DEFAULT, FPU_FIX and SOLVE_LINSYS from MIDL.
 MODIFICATION HISTORY:
		Created 10-NOV-1997 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\lincross.pro)


LINEPTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINEPTS
 PURPOSE:
       Gives pixel coordinates of points along a line segment.
 CATEGORY:
 CALLING SEQUENCE:
       linepts, ix1, iy1, ix2, iy2, x, y
 INPUTS:
       ix1, iy1 = Coordinates of point 1.         in
       ix2, iy2 = Coordinates of point 2.         in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x, y = arrays of coordinates along line.   out
 COMMON BLOCKS:
 NOTES:
       Note: points 1 and 2 are scalars.
 MODIFICATION HISTORY:
       R. Sterner,  9 May, 1986.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\linepts.pro)


LINFILL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINFILL
 PURPOSE:
       Fill gaps in array data using linear interpolation.
 CATEGORY:
 CALLING SEQUENCE:
       LINFILL,A,I1,I2
 INPUTS:
       A = array to operate on.                         in
       I1 = index in A of last good value before gap.   in
       I2 = index in A of first good value after gap.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       A = updated array.                               out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  6 Mar, 1985.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\linfill.pro)


LINFIT_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LINFIT_MM
 VERSION:
		4.3
 PURPOSE:
		Linear fitting with an arbitrary number of parameters.
 CATEGORY:
		Mathematical Function.
 CALLING SEQUENCE:
		Result = LINFIT_MM( X, Y [,W] [, keywords])
 INPUTS:
	X
		Numeric vector.  X coordinates of the data.
	Y
		Numeric vector.  Y coordinates of the data.  Same length as X.
 OPTIONAL INPUT PARAMETERS:
	W
		Numeric scalar or vector.  Weight parameter(s).  If given as scalar,
		the scalar weight is applied to all the points.  If given as vector,
		must be same length as X.  Default is constant weight (1).
 KEYWORD PARAMETERS:
	ORDER
		Specifies the order of the fit, i.e. one less than the number of free
		parameters (or base functions).  If not given, the order will be read
		from the number of entries in the BASE variable (see below).  If both
		ORDER and BASE are specified, the higher one will determine the order.
		Finally, if neither is specified, ORDER is set to 1 (meaning linear fit)
	RESIDUAL
		Optional output, see below.
	ERROR
		Optional output, see below.
	BASE
		Character array containing names of base functions.  Any blank entry
		will be replaced by a power of X.  For example, if the third entry
		(i = 2) is blank (or null string) the third base function will be X^2.
	PARAMS
		Array containing optional parameters (one per function) to be used in
		the function calls.
	PARMASK
		Parameter mask, specifies which of the parameters are to be used.  A
		nonzero entry means USE, zero means DON'T USE.  Default is USE for all
		existing parameters.
	FACTOR
		Optional factor function, i.e. a function multiplying all the base
		functions.  If given as a character value, the value is taken to
		represent the function name.  If given as a number, the common factor
		used is X^FACTOR.
	FPOWER
		If given as a numeric value and a function name is provided in FACTOR,
		the function is raised to the power of FPOWER.
	FPARAM
		Used to pass an optional parameter to a function specified in FACTOR,
		in the same way that PARAMS passes parameters to the base functions.
 OUTPUTS:
		Returns a vector containing the fit coefficients.
 OPTIONAL OUTPUT PARAMETERS:
	RESIDUAL
		The name of the variable to receive the residual Chi-Square value,
		normalized to the number of degrees of freedom.  If the number of
		points is <= the number of parameters, such calculation is impossible,
		of course, and RESIDUAL returns machine maximum.
	ERROR
		The name of the variable to receive the statistical errors of the fit
		cofficients.  Returns a vector of same length as the output vector.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Standard linear optimization, using a Singular Value Decomposition
		procedure to solve the linear system.  Uses DEFAULT, FPU_FIX, ISNUM,
		SOLVE_LINSYS and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 1-JUN-93 by Mati Meron.
		Renamed from LINFIT to M_LINFIT to avoid clashes with an IDL library
		routine bearing the same name.
		Modified 20-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to LINFIT_MM.
		Modified 30-MAY-2000, to enable handling the case of
		N_points = N_parameters (i.e. Degrees_of_freedom = 0).
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 25-OCT-2001 by Mati Meron.  Added keyword ERROR.
		Modified 20-NOV-2001 by Mati Meron.  Added keywords FACTOR, FPOWER
		and FPARAM.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\linfit_mm.pro)


LINI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINI
 PURPOSE:
       Interactive line.
 CATEGORY:
 CALLING SEQUENCE:
       lini, a, b
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Use data coordinates (default).
         /DEVICE Use device coordinates.
         /NORMAL Use normalized coordinates.
         THICKNESS=thk  Line thickness.
         LINESTYLE=sty  Line style.
         /AZIMUTH  display angle from Y axis clockwise,
           else angle from X axis CCW.
         /NOHELP means do not display help box.
         /AXFIX means fix initial pt A x value.
         /AYFIX means fix initial pt A y value.
         /BXFIX means fix initial pt B x value.
         /BYFIX means fix initial pt B y value.
         MAG=mag  Magnification window mag value (def=4).
         /FILL  means use filled symbol for active endpoint marker.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: XOR plot mode is used to display line.
         Line parameters are displayed.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 22

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lini.pro)


LINKEDLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   LINKEDLIST

 FILENAME:
   linkedlist__define.pro

 PURPOSE:
   The purpose of this program is to implement a list that
   is linked in both the forward and backward directions. There
   is no restriction as to what can be stored in a linked list
   node. The linked list is implemented as an object.

 AUTHOR:
   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:
   General programming.

 CALLING SEQUENCE:
   mylist = Obj_New('LINKEDLIST', item)

 OPTIONAL INPUTS:
   item: The first item added to the list. Items can be any
     valid IDL variable type.

 COMMON BLOCKS:
   Are you kidding?!

 RESTRICTIONS:
   Be sure to destroy the LINKEDLIST object when you are finished
   with it: Obj_Destroy, mylist

   Node index numbers start at 0 and go to n-1, where n is the
   number of items in the list.

 PUBLIC METHODS:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 PRO LINKEDLIST::ADD, item, index, AFTER=after, BEFORE=before

   The ADD method adds a data item to the list.

   Parameters:

   item: The data item to be added to the list. Required.

   index: The location in the list where the data item is
     to be added. If neither the AFTER or BEFORE keyword is
     set, the item is added AFTER the item at the index location.
     If index is missing, the index points to the last item in
     the list. Optional.

   Keywords:

   AFTER: If this keyword is set, the item is added after the
     item at the current index.

   BEFORE: If this keyword is set, the item is added before the
     item at the current index.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 PRO LINKEDLIST::DELETE, index, ALL=all

   The DELETE method deletes an item from the list.

   Parameters:

   index: The location in the list where the data item is
     to be delete. If index is missing, the index points to
     the last item in the list. Optional.

   Keywords:

   ALL: If this keyword is set, all items in the list are deleted.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 FUNCTION LINKEDLIST::GET_COUNT

   The GET_COUNT method returns the number of items in the list.

   Return Value: The number of items stored in the linked list.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


 FUNCTION LINKEDLIST::GET_ITEM, index

   The GET_ITEM_PTR method returns a pointer to the specified data
   item from the list.

   Parameters:

   index: The location in the list from which the data item is
     to be retrieved. If not present, the last item in the list
     is retrieved. Optional.

   Keywords:

   DEREFERENCE: Set this keyword to return the thing the pointer
      points to (i.e., the item itself.)

   Return Value: A pointer to the specified data item stored
     in the list. IF DEREFERENCE is set, the data item itself
     is returned.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 FUNCTION LINKEDLIST::GET_NODE, index

   The GET_NODE method returns a pointer to the specified node
   from the list.

   Parameters:

   index: The location in the list from which the data node is
     to be retrieved. If not present, the last node in the list
     is retrieved. The node is a structure with three fields:
     Previous is a pointer to the previous node in the list.
     Next is a pointer to the next node in the list. A null pointer
     in the previous field indicates the first node on the list. A
     null pointer in the next field indicates the last node on the
     list. The item field is a pointer to the item stored in the
     node. Optional.

   Return Value: A pointer to the specified node structure in
     the linked list.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 PRO LINKEDLIST::HELP, PRINT=print

 The HELP method performs a HELP command on each item
 in the linked list.

   Keywords:

    PRINT: If this keyword is set, the PRINT command is used
      instead of the HELP command on the items in the list.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 PRO LINKEDLIST::MOVE_NODE, nodeIndex, location, BEFORE=before

   The MOVE_NODE method moves a list node from one location to another.

   Parameters:

   nodeIndex: The location in the list of the node you are moving.
     Required.

   location: The location (index) you are moving the node to. If
     location is missing, the location points to the node at the
     end of the list.

   Keywords:

    BEFORE: If this keyword is set, the node is added to the
      list before the location node. Otherwise, it is added after
      the location node.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 PRO LINKEDLIST::REPLACE_ITEM, Index, NewItem

	Use this method to replace any item in the list with any other value.
	This allows the caller to change an item without stepping through the
	process of deleting an item then adding a new one.

  Parameters:
		Index:  The location of the node you are replacing

		NewItem:  Any value of any data type.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


 EXAMPLE:

   mylist = Obj_New("LINKEDLIST", 5)
   mylist->Add, 10
   mylist->Add, 7.5, 1, /Before
   mylist->Add, 12.5
   mylist->Replace_Item, 1, 'Bob'
   mylist->Help
   mylist->Delete
   mylist->Help, /Print

 MODIFICATION HISTORY:
   Written by: David Fanning, 25 August 98.
   25 August 99. Fixed several errors in various methods dealing with
       moving nodes from one place to another. DWF.
   13 June 2001. DWF. Added DEREFERENCE to the GET_ITEM method to
       return the item itself, instead of the pointer to the item.
	 27 June 2001  BT Added REPLACE_ITEM method.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\linkedlist__define.pro)


LINKFPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINKFPOS

 PURPOSE:
       get an new position linked to a given position

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
       pos = getfposcm(pos1, xoff=100, yoff=100)

 INPUTS:
       pos in ormal coordinates
       lower left x, lower left y, upper right x, upper right y... in cm

 OPTIONAL INPUTS:
       xoffset     % (default = 0)
       yoffset     % (default = 0)
       xscale      % (default = 100)
       yscale      % (default = 100)
       default is same position, same size

 OUTPUTS:
       pos:    updated position

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\linkfpos.pro)


LINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LINT
 PURPOSE:
       Find the intersection of two lines in the XY plane.
 CATEGORY:
 CALLING SEQUENCE:
       lint, a, b, c, d, i
 INPUTS:
       a, b = Points on line 1.          in
       c, d = Points on line 2.          in
 KEYWORD PARAMETERS:
       Keywords:
         FLAG=f  Returned flag:
           0 means no intersections (lines parallel).
           1 means one intersection.
           2 means all points intersect (lines coincide).
         /COND print condition number for linear system.
 OUTPUTS:
       i1, i2 = Returned intersection.   out
         Both i1 and i2 should be the same.
 COMMON BLOCKS:
 NOTES:
       Notes: Each point has the form [x,y].
 MODIFICATION HISTORY:
       R. Sterner, 1998 Feb 4

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lint.pro)


LINTERP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    linterp

 PURPOSE:    extend IDL's interpolate procedure to handle up
             to 8 dimensions

 USEAGE:     result=linterp(table,f1,f2,f3,f4,f5,f6,f7,f8)

 INPUT:
   tab       table of values depending on upto 8 parameters

   f1,f2..   floating index parameters. 

   NOTE:     the number of input parameters must be appropriate to
             the size of the look-up table.  For example for a 3-d table,
             specify f1,f2,f3

 KEYWORD INPUT:
  GRID       if set the input parameters are used to create a grid of
             parameter values.  In this case the input parameters
             need not be all the same size.  If GRID is not set all
             input arrays (f1,f2...) and the returned value are of
             the same size and dimensionality.  If GRID is set the
             f parameters may be scalars or vectors, but not arrays.

  CLIP       If this keyword is set, locations less than the minimum or 
             greater than the maximum corresponding subscript of TABLE
             are set to the nearest element of TABLE.  The effect of 
             MISSING is disabled when CLIP is set.

 
 OUTPUT:
   result    interpolated value


 EXAMPLE:

  tab=findgen(5,5,5,5)

  print,linterp(tab,1.2,3.2,1.1,2.2)
  
  author:  Paul Ricchiazzi                            sep93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\linterp.pro)


LISTRUNS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LISTRUNS
 PURPOSE:
       Make a list of runs of consecutive integers.
 CATEGORY:
 CALLING SEQUENCE:
       listruns, w, txt
 INPUTS:
       w = array of integers (indices).           in
 KEYWORD PARAMETERS:
       Keywords:
         /list means display list on screen.
         WIDTH=wd set string array width (def=40).
 OUTPUTS:
       txt = text string array with runs listed.  out
 COMMON BLOCKS:
 NOTES:
       Notes:
         Each run is listed in the form b:e:s where b is the
         run beginning value, e is the run ending value,
         and s is the run step size.  If s = 1 it is not listed.
         Isolated indices are listed by themselves.
	  Inverse of CONVERT_IND.
 MODIFICATION HISTORY:
       R. Sterner, 15 Jul, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\listruns.pro)


LITMSOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   LITMSOL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Solve the light-time equation between two moving bodies

 MAJOR TOPICS:
   Geometry, Physics

 CALLING SEQUENCE:
   LITMSOL, T1, X1, Y1, Z1, T2, INFO2, RAW2, OBJ2, INFOSUN, RAWSUN, $
            /RECEIVER, TBASE=, TOLERANCE=, POSUNITS=, MAXITER=, $
            /NO_SHAPIRO

 DESCRIPTION:

  The procedure LITMSOL solves the light time equation between two
  moving bodies in the solar system.  Given the time and position of
  reception or transmission of a photon, this equation determines the
  time of transmission or reception at the other solar system body.
  Since both bodies may be moving, the equation must be solved
  iteratively.

  The trajectories of solar system bodies must be described by either
  a JPL ephemeris, or by a JPL-like ephemeris generated by
  JPLEPHMAKE.  This routine calls JPLEPHINTERP.

  The user specifies the known time and position of interaction as
  T1, X1, Y1 and Z1, in units of POSUNITS.  The time of interaction
  at the other body -- the solution to the light time equation -- is
  returned as T2.  If the photon was *received* at time T1, then the
  RECEIVER keyword should be set (in which case the transmission must
  have occurred in the past).

  Since the solution is iterative, the user may specify a solution
  tolerance, and a maximum number of iterations.

  If users wish to include the Shapiro time delay, which has a
  maximum amplitude of approximately 250 usec, they must specify the
  ephemeris of the Sun (INFOSUN, RAWSUN).  The Shapiro delay is the
  extra general relativistic delay caused by the Sun's potential.


 INPUTS:

   T1 - epoch of interaction, in Julian days, in the TDB timescale.
        (scalar or vector)

   X1, Y1, Z1 - coordinates of interaction, referred to the solar
                system barycenter, in J2000 coordinates.  Units are
                described by POSUNITS. (scalar or vector)

   INFO2, RAW2 - ephemeris of other solar system body, returned by
                 JPLEPHREAD or JPLEPHMAKE.

   INFOSUN, RAWSUN - ephemeris of at least the Sun, as returned by
                     JPLEPHREAD.  Only used of NO_SHAPIRO is not set.


 OUTPUTS:

   T2 - upon output, epoch of interaction at the second solar system
        body, in Julian days, in the TDB timescale.


 KEYWORD PARAMETERS:

   RECEIVER - if set, then the epoch T1 is a reception of a photon.
              Otherwise T1 is the epoch of transmission of a photon.

   TBASE - a fixed epoch time (Julian days) to be added to each value
           of T1.  Since subtraction of large numbers occurs with
           TBASE first, the greatest precision is achieved when TBASE
           is expressed as a nearby julian epoch, T1 is expressed
           as a small offset from the fixed epoch.  
           Default: 0

   POSUNITS - the units for positions, one of 'CM', 'KM', 'LT-S' or
              'AU'.
              Default: 'CM'

   TOLERANCE - the solution tolerance, expressed in POSUNITS.
               Default: 1000 CM

   MAXITER - maximum number of solution iterations to be taken.
             Default: 5

   NO_SHAPIRO - if set, then the Shapiro delay will not be accounted
                for.  If NO_SHAPIRO is set, then INFOSUN and RAWSUN
                do not need to be supplied.


 EXAMPLE:



 SEE ALSO:

   JPLEPHREAD, JPLEPHINTERP


 MODIFICATION HISTORY:
   Written, 6 May 2002, CM
   Documented, 12 May 2002, CM

  $Id: litmsol.pro,v 1.2 2002/05/13 06:46:41 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\litmsol.pro)


LITTLE_ENDIAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   little_endian

 PURPOSE:
   This functions tests the system architecture and returns 1 if your
   system is little_endian and 0 if it is big_endian. This
   information is useful if you need to open binary data files
   created on a different machine (see swap_endian keyword to the
   open procedure).

 CATEGORY:
    File I/O

 AUTHOR:
    Robert Mallozzi.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\little_endian.pro)


LL2RB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LL2RB
 PURPOSE:
       From latitude, longitude compute range, bearing.
 CATEGORY:
 CALLING SEQUENCE:
       ll2rb, lng0, lat0, lng1, lat1, dist, azi
 INPUTS:
       lng0, lat0 = long, lat of reference point (deg).    in
       lng1, lat1 = long, lat of point of interest (deg).  in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means range is in degrees instead of radians.
 OUTPUTS:
       dist = range to point point of interest (radians).  out
       azi = azimuth to point of interest (degrees).       out
 COMMON BLOCKS:
 NOTES:
       Notes: A unit sphere is assumed, thus dist is in radians
         so to get actual distance multiply dist by radius.
         Useful constants:
         Radius of Earth (mean) = 6371.23 km = 3958.899 miles.
         (Must first convert to radians if using /DEGREES).
 MODIFICATION HISTORY:
       R. Sterner, 13 Feb,1991

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ll2rb.pro)


LMST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LMST
 PURPOSE:
       Give local mean sidereal time.
 CATEGORY:
 CALLING SEQUENCE:
       st = lmst( jd, ut, long)
 INPUTS:
       jd = Julian Day (starting at noon).         in
       ut = Universal time as fraction of day.     in
       long = observer longitude (deg, East is +). in
 KEYWORD PARAMETERS:
 OUTPUTS:
       st = sidereal time as fraction of day.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  16 Sep, 1986.
       R. Sterner, 15 Jan, 1991 --- converted to V2.
       R. Sterner, 2000 Jul 28 --- Fixed date error in comment.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\lmst.pro)


LNGAMMA_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		LNGAMMA_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates the natural log of the gamma function.  Replacement for the
		IDL LNGAMMA function which accepts only real input.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = LNGAMMA_MM (X, A [,EPS ] [,/COMPLEMENTARY ])
 INPUTS:
	X
		Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the natural logarithm of the gamma function of X.  Output type
		and form are identical to those of the input (but output type is never
		lower than FLOAT).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The real part of X should be positive.
 PROCEDURE:
		Uses a continued fraction expansion.  Calls CAST, CONFRAC, DEFAULT,
		TOLER and TYPE, from MIDL.
 MODIFICATION HISTORY:
		Created 30-MAR-1996 by Mati Meron as M_LNGAMMA.
		Renamed 25-SEP-1999 by Mati Meron, to LNGAMMA_MM.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\lngamma_mm.pro)


LOADDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LOADDATA

 PURPOSE:
       The purpose of this function is to read a selection of standard
       data sets that are found in the normal IDL distribution in the
       subdirectory $IDL_DIR/examples/data. At least 17 data sets are
       available in all categories of data. The user selects one of the
       possible data sets with the mouse.

 CATEGORY:
       File I/O.

 CALLING SEQUENCE:

       If calling from the IDL command line:

          data = LoadData()

       If calling from within a widget program:

          data = LoadData(Cancel=cancelled, Group_Leader=event.top)

       If you know which data set you want, you can load it directly:

          data = LoadData(7)

 OPTIONAL INPUTS:
       selection : The number of the data selection. Values start at 1,
           and go up to the number of data sets available (currently 17).

 KEYWORD PARAMETERS:
       CANCEL : An output keyword that is 1 of the use clicked the CANCEL
           button and 0 otherwise.

              data = Loaddata(Cancel=cancelled)
              IF cancelled THEN RETURN

        GROUP_LEADER: The group leader of the widget. This keyword
           is required if you wish LOADDATA to be a modal widget program.
           (Which you *always* do when calling it from a widget program.)

        IMAGES: Set this keyword if you only want to select 2D image
           data sets. Note that the selection number does *not* change
           just because fewer data sets are available in the selection
           widget.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To load the world elevation data set:

       image = LoadData(7)

 MODIFICATION HISTORY:
       Written by:  David Fanning, 5 March 1999.
       Added some additonal random data capability. 29 April 99. DWF
       Added IMAGES keyword. 31 March 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\loaddata.pro)


LOCATE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     locate
 
 USEAGE:      locate,lat,lon,alat,alon,x,y

 PURPOSE:     
    This routine is used by COASTLINE to find the array indices 
    of a given geographical point within irregular latitude and
    longitude arrays.  Given the coordinate arrays alat(i,j) and
    alon(i,j), LOCATE finds the "floating point" indices x,y such
    that,

            interpolate(alat,x,y)=lat 
            interpolate(alon,x,y)=lon 

    Stated more abstractly, LOCATE solves two simultaneous non-linear
    equations of the form
    
            f(x,y)=u
            g(x,y)=v
    
    where the functions f and g are actually arrays of values
    indexed by x and y.
              
 INPUT:
    lat       a vector of geographic latitudes 
    lon       a vector of geographic longitudes
    alat      array of image latitudes 
    alon      array of image longitudes
 OUTPUT:
    x,y       "floating point" array indicies such that 

                  lat=interpolate(alat,x,y)

                  lon=interpolate(alon,x,y)

 EXAMPLE:

 c=(cmplxgen(100,100)+complex(20,20))/50 & c=c+c^2+c^3
 alon=imaginary(c) & alat=float(c)
 !p.multi=[0,1,2]
 xo=fix(54+(20+25*(findgen(21) mod 2))*cos(2*!pi*findgen(21)/20))
 yo=fix(54+(20+25*(findgen(21) mod 2))*sin(2*!pi*findgen(21)/20))
 lon=alon(xo,yo)       & lat=alat(xo,yo)
 plot,alon,alat,/noda,ytit='latitude',xtit='longitude',/xstyle,/ystyle
 oplot,alon,alat,psym=3
 oplot,lon,lat,psym=-4
 delvar,x,y
 locate,lat,lon,alat,alon,x,y
 contour,alat,levels=contlev(alat,maxlev=30),/follow,c_color=150
 contour,alon,levels=contlev(alon,maxlev=30),/follow,/over,c_color=80
 oplot,x,y,psym=-4
 table,lat,interpolate(alat,x,y),lon,interpolate(alon,x,y),x,xo,y,yo


 DISCUSSION:
    LOCATE uses Newton-Raphson iteration of the linearized equations
    for latitude and longitude.  The equation is itereated repeatedly
    only for those elements of the input vectors which have not
    satisfied the convergence criterion, 

             (lat-alati)^2+(lon-aloni)^2 lt (.001)^2

    where alati and aloni are the values of ALAT and ALON interpolated
    to the current estimates of X and Y.  This procedure will probably
    fail if the gradients of ALAT and ALON arrays do not form linearly
    independent vector fields.  You have trouble if somewhere in
    the grid grad(ALAT) is proportional to grad(alon)

 AUTHOR:      Paul Ricchiazzi             oct92 
              Earth Space Research Group, UCSB
 

 REVISIONS:
 27oct92   Provide default initial guesses for x and y. This allows the
           user to call LOCATE without pre-defining x and y.
 12jun95   allow LOCATE to accept a vectors of LAT-LON points, improves speed
           
           

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\locate.pro)


LOCMAX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LOCMAX
 PURPOSE:
       Find local maxima in an image.
 CATEGORY:
 CALLING SEQUENCE:
       locmax, img
 INPUTS:
       img = image to process.               in
 KEYWORD PARAMETERS:
       Keywords:
         MASK=m returns a mask image with 1 at all
           local maxima and 0 elsewhere.
         WHERE=w returns 1-d indices of all local maxima.
           -1 if no local maxima.
         VALUES=v returns values of img at all local maxima.
         VALUE_IMAGE=vimg use vimg to determine values.
           Instead of img.
         IX=ix returns x index of all local maxima.
         IY=iy returns y index of all local maxima.
         /SORT sorts local maxima by descending image values.
         /NOEDGE ingores any maxima at image edges.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: All output is through keywords.
         Ignores plateaus.  May not work for
         all edge points.
 MODIFICATION HISTORY:
       R. Sterner, 17 Aug, 1990
       R. Sterner, 27 Aug, 1990 --- added value_image.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\locmax.pro)


LOGLEVELS (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        LOGLEVELS (function)

 PURPOSE:
        Compute default values for logarithmic axis labeling
        or contour levels. For a range from 1 to 100 these 
        would be 1., 2., 5., 10., 20., 50., 100.
        If the range spans more than (usually) 3 decades, only 
        decadal values will be returned unless the /FINE keyword 
        is set. This function was mainly written to overcome IDL's
        weakness to consider only decadal values as major intervals
        in log plots.

 CATEGORY:
        General Graphics

 CALLING SEQUENCE:
        result = LOGLEVELS([range | MIN=min,MAX=max] [,/FINE] [,COARSE=dec])

 INPUTS:
        RANGE -> A 2-element vector with the minimum and maximum 
            value to be returned. Only levels _within_ this range
            will be returned. If RANGE contains only one element,
            this is interpreted as MAX and MIN will be assumed as
            3 decades smaller. RANGE superseeds the MIN and MAX 
            keywords. Note that RANGE must be positive definite
            but can be given in descending order in which case
            the labels will be reversed.

 KEYWORD PARAMETERS:
        MIN, MAX -> alternative way of specifying a RANGE. If only 
            one keyword is given, the other one is computed as
            3 decades smaller/larger than the given parameter.
            RANGE superseeds MIN and MAX.

        /FINE -> always return finer levels (1,2,5,...) 

        COARSE -> the maximum number of decades for which LOGLEVELS
            shall return fine labels. Default is 3. (non-integer 
            values are possible).

 OUTPUTS:
        A vector with "round" logarithmic values within the given 
        range. The original (or modified) RANGE will be returned
        unchanged if RANGE does not span at least one label interval.
        The result will always contain at least two elements.


 SUBROUTINES:
        none

 REQUIREMENTS:
        none

 NOTES:
        If COARSE is lt 0, the nearest decades will be returned 
        instead. The result will always have at least two elements.
        If COARSE forces decades, the result values may be out-of-
        range if RANGE spans less than a decade.
        
        Caution with type conversion from FLOAT to DOUBLE !!

 EXAMPLE:
        range = [ min(data), max(data) ]
        c_level = LOGLEVELS(range)
        contour,...,c_level=c_level
        

 MODIFICATION HISTORY:
        mgs, 17 Mar 1999: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\loglevels.pro)


LOGLUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LOGLUT
 PURPOSE:
       Return a log lookup table useful for scaling images.
 CATEGORY:
 CALLING SEQUENCE:
       lut = loglut(lo,hi)
 INPUTS:
       lo = image value to map to 0.        in
       hi = image value to map to 255.      in
         where lo GE 0, hi GT lo.
 KEYWORD PARAMETERS:
       Keywords:
         EXPONENT=ex Controls curvature of transformation (def=1).
           Use values in the range -15 to 15, 0 gives a straight
           line, <0 negative curvature.
         GLO=glo Min color to use: image value lo maps to glo.
           Default is 0.
         GHI=ghi Max color to use: image value hi maps to ghi.
           Default is top available color.
         /REVERSE means reverse color table.
         /ROUND means round lookup table values to nearest integer.
 OUTPUTS:
       lut = resulting lookup table.        out
 COMMON BLOCKS:
 NOTES:
       Note: image values beyond given lo and hi get clipped.
         Ex: let A be a 16 bit image with values ranging from
         850 to 12000.  Assume the image values from 900 to
         2000 are to be scaled to 0 to 255 using a log curve.
         lut = loglut(900,2000,exp=1.5)  ; Set up table.
         b = lut(a)                      ; Do scaling.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Nov 6
       R. Sterner, 1998 Nov 10 --- Added /TOP.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\loglut.pro)


LOOP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        LOOP

 PURPOSE:
        This routine provides a wrapper for function calls that accept
        only scalars so that they can operate on arrays. Note that
        IDL has changed more and more functions over the years to
        accept array arguments. So, hopefully, this routine will
        become obsolete some day.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        result = LOOP(name,arg,p1,p2,p3,p4)

 INPUTS:
        NAME --> the name of the function (string)

        ARG --> the argument (array)

        P1 .. P4 --> optional function parameters 

 KEYWORD PARAMETERS:
        unfortunately none. Would be nice if _EXTRA would work.

 OUTPUTS:
        a result *vector* with the same number of elements as arg.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        a=[0.05,0.01,0.001]
        print,loop("chisqr_cvf",a,17)
 
        IDL prints:
        27.5871      33.4087      40.7903

 MODIFICATION HISTORY:
        mgs, 05 Dec 1997: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source
                          - now using long as loop variable
                          - [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\loop.pro)


LOOPIND

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  loopind

 PURPOSE:  evaluate a sequence of nested indicies

 USEAGE:   loopind,ii,n1,i1,n2,i2,n3,i3,n4,i4,n5,i5,n6,i6

 INPUT:    
   n1      number of elements in first dimension
   n2      number of elements in second dimension

   etc

 keyword input:
   ind     one dimensional index.  If this keyword is set, evaluate
           i1,i2... only for the elements contained in IND
 OUTPUT:
   i1      index for first dimension
   i2      index for second dimension
   etc
  
 EXAMPLE:  

  loopind,4,i1,5,i2,2,i3
  f=randomn(iseed,4,5,2)
  table,i1,i2,i3,f

 AUTHOR:   Paul Ricchiazzi                        22 Sep 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\loopind.pro)


LS[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LS
 PURPOSE:
       Scale image between percentiles 1 and 99 (or specified percentiles).
 CATEGORY:
 CALLING SEQUENCE:
       out = ls(in, [l, u, alo, ahi])
 INPUTS:
       in = input image.                           in
       l = lower percentile to ignore (def = 1).   in
       u = upper percentile to ignore (def = 1).   in
 KEYWORD PARAMETERS:
       Keywords:
         SCALE_ON=arr  Array to determine on.  If not given
           then input image in is used.
         TOP=t  Max byte value for scaling (def=!d.table_size-1).
         /QUIET  Inhibit scaling message.
         /NOSCALE  Do not actually scale the data (returns 0).
 OUTPUTS:
       alo = value scaled to 0.                    out
       ahi = value scaled to 255.                  out
       out = scaled image.                         out
 COMMON BLOCKS:
 NOTES:
       Notes: Uses cumulative histogram.
 MODIFICATION HISTORY:
       R. Sterner. 7 Oct, 1987.
       RES 5 Aug, 1988 --- added lower and upper limits.
       R. Sterner, 1995 Dec 15 --- Added SCALE_ON keyword.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1999 Sep 15 --- Added /NOSCALE.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ls.pro)


LS[2]

[Previous Routine] [Next Routine] [List of Routines]
 routine    ls
 useage:    ls
            ls,filt
 input:
   filt     a valid unix filename specification or wild card (not required)

 purpose    print files in current working directory
  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ls.pro)


LUA2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	lua2ncdf

 PURPOSE:
	translate data fetched from LUA (Landesumweltamt) from ICG-2 format
       to netCDF

 CATEGORY:
	DATAFILES/FILTER

 CALLING SEQUENCE:
       LUA2NCDF, infile, outfile, year, [/help]

 INPUTS:
	infile:  Filename of the LUA-file that is to be translated
       outfile: Filename of the converted netCDF-file
       year:    year of LUA-measurements (the year is not saved in the
                ICG-2-format)

 KEYWORD PARAMETERS:
   help:      print out an online help message
	
 EXAMPLE:
       lua2ncdf,"/home/ich212/IDL_TEST/Eifel96", $
                "/home/ich212/IDL_TEST/Eifel96.nc", 96

 MODIFICATION HISTORY:
 	Written by:	S. Jansen, August, 25, 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\sj_lib\lua2ncdf.pro)


MAGCRS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAGCRS
 PURPOSE:
       Show a magnified window around given point and wait for a cursor change.
 CATEGORY:
 CALLING SEQUENCE:
       magcrs, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /INITIALIZE  Must be done before using or after a
           color table change.  Must be done for each different
           window that uses magcrs.
         STATE=state  Structure with state information.
           Returned for /INIT.  Must give for each call.
           Allows multiple mag cursors for multiple windows.
         MAG=m    Mag factor (def=10).  On /INIT only.
         SIZE=s   Mag window size (def=200).  On /INIT only.
         WINDOW=win Specified mag window, else make one.
           Specified window must be expected size.  On /INIT only.
         /NOCURSOR means given x,y are dev coord, do not call
           cursor.  Returned x,y are /DATA by default.
         /DATA    Work in data coordinates (default).
         /DEVICE  Work in device coordinates.
         /NORMAL  Work in normalized coordinates.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Operates like CURSOR,X,Y,/CHANGE, that is
         after each move or a button up or down.  Check !mouse
         to find which button was last clicked.
         When finished with mag window remove it:
           wdelete,st.win
         Sets starting point and cursor to given x,y.
         WINDOW keyword allows use in a draw widget. Use /NOCURSOR.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 26
       R. Sterner, 1998 Apr 10 --- Added WINDOW keyword, allows use in widget.
       Also added NOCURSOR keyword.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\magcrs.pro)


MAKEI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEI
 PURPOSE:
       Make a long array with given start and end values and step size.
 CATEGORY:
 CALLING SEQUENCE:
       in = makei(lo, hi, step)
 INPUTS:
       lo, hi = array start and end values.       in
       step = distance beteen values.             in
 KEYWORD PARAMETERS:
 OUTPUTS:
       in = resulting index array.                out
 COMMON BLOCKS:
 NOTES:
       Note: good for subsampling an array.
 MODIFICATION HISTORY:
       Ray Sterner,  14 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makei.pro)


MAKELABELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKELABELS
 PURPOSE:
       Make an array of tick mark labels.
 CATEGORY:
 CALLING SEQUENCE:
       lbl = makelabels(value_array, ndec)
 INPUTS:
       value_array = Array of values.		in
       ndec = Number of decimal places to use.	in
 KEYWORD PARAMETERS:
 OUTPUTS:
       lbl = String array of labels.		out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 7 Nov, 1988.
       R. Sterner, 26 Feb, 1991 --- Renamed from make_labels.pro
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makelabels.pro)


MAKEMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEMS
 PURPOSE:
       Make array of values from start to end with a max step size.
 CATEGORY:
 CALLING SEQUENCE:
       a = makems(start,stop,maxstep)
 INPUTS:
       start = starting value.         in
       stop = ending value.            in
       maxstep = max step size to use. in
 KEYWORD PARAMETERS:
 OUTPUTS:
       a = returned array of values.   out
 COMMON BLOCKS:
 NOTES:
       Notes: example: print,makems(0,360000,100000) gives
         0      100000      200000      300000      360000
 MODIFICATION HISTORY:
       R. Sterner, 1997 Apr 15

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makems.pro)


MAKEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEN
 PURPOSE:
       Make an array of N values, linear between two given limits.
 CATEGORY:
 CALLING SEQUENCE:
       x = makex( first, last, num)
 INPUTS:
       first, last = array start and end values.          in
       num = number of values from first to last.         in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x = array of values.                               out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  26 Sep, 1984.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\maken.pro)


MAKENLOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKENLOG
 PURPOSE:
       Make array of N values, logarithmic between two given limits.
 CATEGORY:
 CALLING SEQUENCE:
       x = makenlog( first, last, num)
 INPUTS:
       first, last = array start and end values.          in
       num = number of values from first to last.         in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x = array of logarithmically spaced values.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  4 Sep, 1992, original by Bruce Gotwols.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makenlog.pro)


MAKENXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKENXY
 PURPOSE:
       Make 2-d x and y coordinate arrays of specified dimensions.
 CATEGORY:
 CALLING SEQUENCE:
       makenxy, x1, x2, nx, y1, y2, ny, xarray, yarray
 INPUTS:
       x1 = min x coordinate in output rectangular array.  in
       x2 = max x coordinate in output rectangular array.  in
       nx = Number of steps in x.                          in
       y1 = min y coordinate in output rectangular array.  in
       y2 = max y coordinate in output rectangular array.  in
       ny = Number of steps in y.                          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       xarray, yarray = resulting rectangular arrays.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jul 11

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makenxy.pro)


MAKES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKES
 PURPOSE:
       Make a string array of integers from lo to hi by step.
 CATEGORY:
 CALLING SEQUENCE:
       s = makes(lo, hi, step)
 INPUTS:
       lo, hi = array start and end values.       in
       step = distance beteen values.             in
         Sign of step determines order of result.
 KEYWORD PARAMETERS:
       Keywords:
         DIGITS=d  Number of digits in result.
           Forces leading zeros if needed.
 OUTPUTS:
       s = resulting string array.                out
 COMMON BLOCKS:
 NOTES:
       Note: no leading or trailing spaces, useful for
         generating file names with embedded numbers.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Feb 22
       R. Sterner, 1995 Aug 14 --- Added DIGITS keyword.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makes.pro)


MAKEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEV
 PURPOSE:
       Make simulated 3-d data.  Useful for software development.
 CATEGORY:
 CALLING SEQUENCE:
       data = makev( nx, ny, nz, [w, m, sd, seed])
 INPUTS:
       nx, ny, nz = size of 3-d array to make.                 in
       w = smoothing window size (def=5% of (nx*ny*nz)^(1/3.)) in
       m = mean (def = 100).                                   in
       sd = standard deviation (def = 40% of mean).            in
       seed = random number seed.                              in
 KEYWORD PARAMETERS:
 OUTPUTS:
       data = resulting data array (def = undef).              out
 COMMON BLOCKS:
       makev_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  2 Jun, 1993.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makev.pro)


MAKEVLT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEVLT
 PURPOSE:
       Generate and load a random color table (CT).
 CATEGORY:
 CALLING SEQUENCE:
       makevlt
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         RED=r     Returned red array.                  out
         GREEN=g   Returned green array.                out
         BLUE=b    Returned blue array.                 out
         SMOOTH=w  smoothing window width (def = 31).   in
         SDEV=s    standard deviation (def = 64).       in
         /WHITE forces top color to be white.
         WHITE=N forces color N to be white.
         /RAMP make a table that goes from dark to light.
         /SAWTOOTH make a CT where colors ramp from dark to light. 8 teeth.
         SAWTOOTH=N  A sawtooth CT with each tooth being N values long.
         /NOLOAD inhibits CT load.
         /GETSEED returns the random number seed use to make
            the last CT.  The call is: makevlt, seed, /GETSEED
         SEED=value sets the color table seed (can use to remake a CT).
         /RANDOM  A completely random CT but with 0=black, 255=white.
         BRIGHT=nb  Bright line table: all black but nb (def=20) bright lines
 OUTPUTS:
 COMMON BLOCKS:
       makevlt_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  20 May, 1986.
       R. Sterner, 12 Feb, 1993 --- Added /BRIGHT
       R. Sterner, 1994 Feb 22 --- Modified to match new makey.
       R. Sterner, 1994 Sep 27 --- Fixed color clipping problem.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makevlt.pro)


MAKEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEX
 PURPOSE:
       Make an array with specified start, end and step values.
 CATEGORY:
 CALLING SEQUENCE:
       x = makex(first, last, step)
 INPUTS:
       first, last = array start and end values.     in
       step = step size between values.              in
 KEYWORD PARAMETERS:
 OUTPUTS:
       x = resulting array.                          out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  7 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.
       Added FIX 20 Dec, 1984 to avoid roundoff error.
       changed it to LONG 8 Mar, 1985 to avoid integer overflows.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makex.pro)


MAKEXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEXY
 PURPOSE:
       Make 2-d X & Y coord. arrays, useful for functions of x,y.
 CATEGORY:
 CALLING SEQUENCE:
       MAKEXY, x1, x2, dx, y1, y2, dy, xarray, yarray
 INPUTS:
       x1 = min x coordinate in output rectangular array.  in
       x2 = max x coordinate in output rectangular array.  in
       dx = step size in x.                                in
       y1 = min y coordinate in output rectangular array.  in
       y2 = max y coordinate in output rectangular array.  in
       dy = step size in y.                                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       xarray, yarray = resulting rectangular arrays.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  15 May, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 30 Aug 89 --- converted to SUN.
	R. Sterner, 27 Mar, 1992 --- switched from CONGRID to REBIN.
	  On VAX improved speed by about 5 times.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makexy.pro)


MAKEY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEY
 PURPOSE:
       Make simulated data.  Useful for software development.
 CATEGORY:
 CALLING SEQUENCE:
       data = makey( n, w)
 INPUTS:
       n = number of data values to make.                in
       w = smoothing window size (def = 5% of n).        in
 KEYWORD PARAMETERS:
       Keywords:
         /PERIODIC   forces data to match at ends.  Will not work
           for smoothing windows much more than about 30% of n.
         SEED=s      Set random seed for repeatable results.
         LASTSEED=s  returns last random seed used.
 OUTPUTS:
       data = resulting data array (def = undef).        out
 COMMON BLOCKS:
       makey_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  2 Apr, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 21 Nov, 1988 --- added SEED.
       R. Sterner, 2 Feb, 1990 --- added periodic.
       R. Sterner, 29 Jan, 1991 --- renamed from makedata.pro.
       R. Sterner, 24 Sep, 1992 --- Added /NORMALIZE.
       R. Sterner, 1994 Feb 22 --- Greatly simplified.  Always normalize.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makey.pro)


MAKEZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKEZ
 PURPOSE:
       Make simulated 2-d data.  Useful for software development.
 CATEGORY:
 CALLING SEQUENCE:
       data = makez( nx, ny, w)
 INPUTS:
       nx, ny = size of 2-d array to make.                   in
       w = smoothing window size (def = 5% of sqrt(nx*ny)).  in
 KEYWORD PARAMETERS:
       Keywords:
         /PERIODIC   forces data to match at ends.  Will not work
           for smoothing windows much more than about 30% of n.
         SEED=s      Set random seed for repeatable results.
         LASTSEED=s  returns last random seed used.
 OUTPUTS:
       data = resulting data array (def = undef).            out
 COMMON BLOCKS:
       makez_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  29 Nov, 1986.
       R. Sterner,  1994 Feb 22 --- Rewrote from new makey.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\makez.pro)


MAKE_BAT_SEARCH_DEPENDENCY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   make_bat_search_dependency

 PURPOSE:
   This procedure will write a batch-file used by search_dependency

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   make_bat_search_dependency

 KEYWORD PARAMETERS:
   Keywords:
      batfile: name of batch-file, including absolute path
      savfile: name of sav-file  , including absolute path

 EXAMPLE:
   make_bat_search_dependency

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_bat_search_dependency.pro)


MAKE_BMP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	make_bmp

 PURPOSE:
   This routine makes a screen dump into a bmp file

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   make_bmp,name

 INPUTS:
   name: the name for the bmp file

 EXAMPLE:
   make_bmp,'test'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Franz Rohrer, Nov. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_bmp.pro)


MAKE_ENZ_HEADER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   make_enz_header
 PURPOSE:
   This function forms an enz-header from a stringvector with column-names
 CATEGORY:
   DATAFILES/ZCHN
 CALLING SEQUENCE:
   header=make_enz_header(text)
 INPUTS:
   text: stringvector with column-names
 OUTPUTS:
   header: enz-header
 EXAMPLE:
   text  =['A','B','C']
   header=['PI=Klein Doofie',make_enz_header(text)]
   print,header
    PI=Klein Doofie COLUMN 1=A COLUMN 2=B COLUMN 3=C NUMBER OF COLUMNS=3
 MODIFICATION HISTORY:
 	Written by:	F. Rohrer (ICG-3), 1998-Nov-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_enz_header.pro)


MAKE_EPSFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	make_epsfile

 PURPOSE:
  This procedure creates from a given plotscript defined bei the ICG Plotstructure a postscript file

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   make_epsfile,file,[epsfile_name]

 INPUTS:
   file: the name of the idl script

 OPTIONAL INPUTS:
  epsfile_name: the name of the output eps file

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-21
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\make_epsfile.pro)


MAKE_FILE_SAVINFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   make_file_savinfo

 PURPOSE:
   creates a structure of file infos and writes it to a sav-file

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   make_file_savinfo, filename,filetype=filetype

 INPUTS:
   filename     : the name of the data file

 KEYWORD PARAMETERS:
       filetype=
                'enz' : if it is an enz-file
                'zus' : if it is a  zus-file
                'nc'  : if it is a   nc-file
       filetype can be omitted if the suffix of the file name is equal filetype
       fill_value: fill_value for irzn
       nocache   : to supress generation of *.sav-file

 OUTPUTS:
    the structure file_contents is written to a sav-file :filename+.savinfo

 EXAMPLE:
    make_file_savinfo,'/home3/ich388/IDL/enzlesen/t.enz'
  or
    make_file_savinfo,'/home3/ich388/IDL/enzlesen/test2.nc'
  or
    make_file_savinfo,'/home3/ich388/IDL/enzlesen/d170698.nox',filetype='nc'

    RESTORE,'/home3/ich388/IDL/enzlesen/t.enz.savinfo'
    and then for example
    PRINT,file_contents.filename

 MODIFICATION HISTORY:
   Written by:     Marsy Lisken  June 1998
    corrected:               28.7.98; 26.8.098
    Modified:   25.9.1998 by FR : fill_value,nocache included

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_file_savinfo.pro)


MAKE_GIF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	make_gif

 PURPOSE:
   This routine makes a screen dump into a gif file

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   make_gif,name

 INPUTS:
   name: the name for the gif file

 EXAMPLE:
   make_gif,'test'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5 1997
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\make_gif.pro)


MAKE_GIF_WITH_COLOR_BAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  make_gif_with_color_bar

 PURPOSE:
 make_gif_with_color_bar

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
  make_gif_with_color_bar,f,path=path

 OPTIONAL INPUTS:
  f    : name of routine to load a color table
  path : directory for the gif-image
         default: directory of the source code of make_gif_with_color_bar

  The routine f will be executed, color indices 25-224 drawn to a color bar
  and saved to a gif-File named path+'f.pro.gif'

 EXAMPLE:
  make_gif_with_color_bar,'ct_blue'

 MODIFICATION HISTORY:
       Written by:     franz Rohrer, 20.06.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_gif_with_color_bar.pro)


MAKE_GRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		MAKE_GRID
 VERSION:
		4.0
 PURPOSE:
		Generates a 1-6 dimensional grid of points within a specified range.
 CATEGORY:
		Array manipulation.
 CALLING SEQUENCE:
		Result = MAKE_GRID( SPAN, [ NPOINTS] [keywords])
 INPUTS:
	SPAN
		A (2,N) numeric array, where N <= 6 is the number of grid dimensions.
		The pair of entries in SPAN(*,i) represents the coordinate minimum and
		maximum in the i-th dimension of the grid.
 OPTIONAL INPUT PARAMETERS:
	NPOINTS
		A numeric vector containing the number of points along each dimension.
		If not provided, the same number of points will be assigned to each
		dimension.  This default number depends on the number of dimensions, as
		follows:
			dimensions	|	points per dimension
				1 				2^20
				2				2^10
				3				2^6
				4				2^4
				5				2^3
				6				2^3
		If NPOINTS has less entries then the number of dimensions, the missing
		entries will be assigned the value of the last existing one.  If some
		of the entries (but not the first) are 0 or 1, they'll be replaced by
		the value of the preceding non-zero entry.

		The meaning of NPOINTS changes if the optional keyword STEPSIZE is set.
		In this case the entries in NPOINTS represent the step sizes along each
		dimension (if not provided, stepsizes are set so as to yield the
		default number of points per dimension as mentioned above).  If some of
		the step sizes are bigger then the corresponding spans, they will be
		adjusted to the span size.  Again, If some of the entries (but not the
		first) are 0 or missing, they'll be replaced by the value of the
		preceding non-zero entry.

		Comment:  A NPOINTS entry of 1 is allowed if /STEPSIZE isn't set and
		the corresponding minimum and maximum in SPAN are the same.
 KEYWORD PARAMETERS:
	/STEPSIZE
		Switch.  Specifies that the entries in NPOINTS are to be treated as
		step sizes.
	DIMVEC
		Optional output, see below.
	FUNARR
		Optional output, see below.
 OUTPUTS:
		Returns an array with the dimensions (NDIM,NPOINTS(0),...) where NDIM
		is the number of dimensions of the grid, such that Result(*,i0,i1,...)
		is a vector containing the cartesian coordinates of the point at
		location (i0,i1,...) within the grid.  The output type is FLOAT (or
		DOUBLE if SPAN is of type DOUBLE).
 OPTIONAL OUTPUT PARAMETERS:
	DIMVEC
		The name of the variable to receive the vector (NPOINTS(0),
		NPOINTS(1),...), containing the number of points along each dimension
		in the result.
	FUNARR
		The name of the variable to receive a blank array of dimensions
		(NPOINTS(0),NPOINTS(1),...).  This array can be used to receive the
		values of a function evaluated over the grid.  The output type is FLOAT
		(or DOUBLE if SPAN is of type DOUBLE).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The number of dimensions must not exceed 6.
 PROCEDURE:
		Straightforward.  Uses CAST, DEFAULT, FPU_FIX and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JAN-1992 by Mati Meron.
		Modified 15-AUG-1994 by Mati Meron.  Added the STEPSIZE option.  Also,
		from now on, if SPAN is of type DOUBLE, the outputs are of type DOUBLE.
		Modified 20-JAN-1997 by Mati Meron to allow for a single point along
		dimension with a zero span.
		Modified 15-SEP-1998 by Mati Meron.  Added keyword DIMVEC to return the
		number of points used along each dimension (especially useful with the
		/STEP option.  Also added underflow filtering.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\make_grid.pro)


MAKE_ICONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	make_icons

 PURPOSE:
  This procedure creates from a given plotscript defined bei the ICG Plotstructure a small gif icon.

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   make_icons,file,[outpath=outpath],[group=group]

 INPUTS:
   file: the name of the idl script

 OPTIONAL INPUTS:
   group: the group leader of a widget

 OPTIONAL INPUTS:
   outpath; the path where the gif's should be stored

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Mar-08
   1998-04-02 multiple files are possible by now
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\make_icons.pro)


MAKE_PSFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	make_psfile

 PURPOSE:
  This procedure creates from a given plotscript defined bei the ICG Plotstructure a postscript file

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   make_psfile,file,[psfile_name]

 INPUTS:
   file: the name of the idl script

 OPTIONAL INPUTS:
  psfile_name: the name of the output eps file

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-21
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\make_psfile.pro)


MAKE_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		MAKE_RANGE
 VERSION:
		4.2
 PURPOSE:
		Generates a range for operations on 1D arrays.
 CATEGORY:
		Programming utility.
 CALLING SEQUENCE:
		Result = MAKE_RANGE( RAN [, DEFAULT = DEF])
 INPUTS:
	RAN
		Numeric scalar or vector, must be of one of the integer types.  May not
		be given, but only if DEFAULT (see below) is provided.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	DEFAULT
		A default value(s) to be used if RAN is not provided.
	NERAN
		Optional output, see below.
 OUTPUTS:
		Depending on the input.  The possibilities are:

		1)	RAN is a scalar.  In this case the output is simply RAN.
		2)	RAN is a 1-element vector.  In this case the output is
			LINDGEN(RAN + 1) i.e. the vector [0, 1,... ,RAN].
		3)	RAN is a 2-element vector.  In this case the output is the vector
			[min(RAN), min(RAN) + 1, ... , max(RAN)].
		4)	RAN is a multielement vector.  In this case the output is RAN,
			sorted into order and with repeated elements (if any) removed.

		In all cases the output is converted to type LONG.
 OPTIONAL OUTPUT PARAMETERS:
	NERAN
		Returns the number of elements of the result (i.e. N_ELEMENTS(result)).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		RAN must be of one of the integer types.
 PROCEDURE:
		Straightforward.  Calls DEFAULT, ISNUM and SORPURGE from MIDL.
 MODIFICATION HISTORY:
		Created 10-FEB-2002 by Mati Meron.
		Modified 10-JUL-2002 by Mati Meron.  Added keyword NERAN.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\make_range.pro)


MAKE_RULER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKE_RULER
 PURPOSE:
       Plot linear scales on the laser printer.
 CATEGORY:
 CALLING SEQUENCE:
       make_ruler, file
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         PRINTER = postscript printer number (1=def or 2).
         /LIST to list control file lines as processed.
         /NOPLOT means just generate idl.ps but do not print it.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes:
         Control file format:
         * in column 1 for comment lines.
         CF = conversion_factor cm per UNIT
           Set a conv. fact. & unit name. Ex CF = 2.54 cm per inch.
           Must be number of cm per unit. Used for LENGTH & TICS.
           Default is cm.
         LENGTH = len
           Set ruler length in UNITS.
         XY = x, y
           Set ruler left side in cm from origin and draw line.
           Must do LENGTH before XY.
         LABELS = L1, L2, dL, y, s
           Sets up labels to be used on next TICS command.
           L1, L2, dL = label start, stop, step values.
           y = label position in cm above ruler line.
           s = label size.
         The following coord. are relative to ruler's left side.
         TICS = x1, x2, dx, dy
           Draws tic marks.
           x1, x2, and dx are tic x start, stop and step in UNITS.
           dy is tic length in cm.  (Do labels first if labeled).
         TEXT = x, y, j, s, text string
           x,y = text position in cm relative to XY position.
           J = justification: L = left, C = centered, R = right.
           text string = text to print.
         TYPE = text string
           text string = message to display on terminal screen.
 MODIFICATION HISTORY:
       R. Sterner. 12 Sep, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\make_ruler.pro)


MAKE_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAKE_SCALE
 PURPOSE:
       Plot circular scales on the laser printer.
 CATEGORY:
 CALLING SEQUENCE:
       make_scale, file
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         PRINTER = postscript printer number (1=def or 2).
         /LIST to list control files lines as processed.
         XOFFSET=xn.  Scale center X shift in norm. coord.
         YOFFSET=yn.  Scale center Y shift in norm. coord.
           View page in portrait mode, +x to right, +y up.
         FACTOR=fact  Scale all radii by given factor (def=1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes:
         Control file format:
         * in column 1 for comment lines.
         A = a1, a2
           Defines start and stop angles (deg) for arcs.
           Not needed for circles.
           a1, a2 = arc start & stop angles (deg) CCW from X axis.
         R = r1, r2, r3, ..., rn
           Draws arcs or circles of specified radius.
           r1, r2, ... = list of radii (cm) to plot.
         TICS = a1, a2, da,r1, r2
           Draws tic marks.
           a1, a2, da = tic angle start, stop, step (degrees).
           r1, r2 = tic start, stop radii.
         LABELS = L1, L2, dL, r, s, flg
           Sets up labels to be used on next TICS command.
           L1, L2, dL = label start, stop, step values.
           r = label radial position (cm), s = label size.
           flg = 0: to be read from outside the circle (def),
                 1: to be read from inside the circle.
         TEXT = r, a, flag, size, text
           r = radius of text bottom in cm.
           a = start angle of text in degrees CCW from X axis.
           flag = 0 to read CW, 1 to read CCW.
           size = text size.
           text = text string to write.
 MODIFICATION HISTORY:
       R. Sterner. 15 July, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.
       R. Sterner, 17 Aug, 1993 --- Added keyword FACTOR=f.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\make_scale.pro)


MAKE_SELECTION (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        MAKE_SELECTION (function)

 PURPOSE:
        This function returns the indices of strings or other data
        types in a "selected" array that match the entries in a
        "selection" array. A typical application is the extraction of
        specific variables from a data file or structure, where the
        Where function would require a loop.

 CATEGORY:
        Data Handling

 CALLING SEQUENCE:
        index = MAKE_SELECTION(NAMES,SELNAMES [,keywords])

 INPUTS:
        NAMES -> A list or array of values to choose from 

        SELNAMES -> A list of selected values

 KEYWORD PARAMETERS:
        ONLY_VALID -> Return only indices of found values. Values not
            found are skipped. Default is to return 1 index value for
            each SELNAME, which is -1 if SELNAME is not contained in 
            NAMES. If ONLY_VALID is set, the -1 values will be deleted,
            and a value of -1 indicates that no SELNAME has been found
            at all.

        REQUIRED -> Normally, MAKE_SELECTION will return indices for
            all values that are found, setting the indices for values
            that are not in the NAMES array to -1. Set this keyword
            to return with -1 as soon as a selected value is not found.

        QUIET -> Suppress printing of the error message if a
            selected value is not found (the error condition will
            still be set).

 OUTPUTS:
        A (long) array with indices to reference the selected values
        in the NAMES array.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        If the NAMES array contains multiple entries of the same value,
        only the index to the first entry will be returned.

        A selection can contain multiple instances of the same value.
        The index array will contain one entry per selected item
        (See example below)

 EXAMPLE:
        names = [ 'Alfred','Anton','Peter','John','Mary']
        index = MAKE_SELECTION(names,['Peter','Mary'])
        print,index
        ; prints  2  4

        vals = indgen(20)
        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9])
        print,index
        ; prints  9  -1  8  7  7  8  9

        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID)
        print,index
        ; prints  9  8  7  7  8  9

        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED)
        print,index
        ; prints  -1


 MODIFICATION HISTORY:
        mgs, 28 Aug 1998: VERSION 1.00
        mgs, 29 Aug 1998: - changed behaviour and added ONLY_VALID
                            keyword
        mgs, 26 Aug 2000: - changed copyright to open source
                          - loop variable now long

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\make_selection.pro)


MAKE_TREE_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   make_tree_info

 PURPOSE:
   writes directory tables to html files and (dir2htmlfile)
   makes the html-file of the directory tree (tree2htmlfile)

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   Result=MAKE_TREE_INFO(dirname)

 INPUTS:
   path : directory name to be searched for subdirectories and files

 KEYWORD PARAMETERS:
   DIR2HTMLFILE: a name for the html files which contain the directory tables (default: 'dir2html.html')
   HTMLFILE    : name of the html-file wwhich contains the directory tree (default:'tree.html')
   LEVEL       : the number of directory levels to be searched for
                 (default=-1 all levels)
   EXCLUDE : string array of file search patterns to be excluded
   INCLUDE : string array of file search patterns to be included (only these files will be taken)
   _EXTRA  : BORDER=border (default) ,CAPTION=dirpath (default), see array2htmltable for details
             TITLE=directory name (default),  see html_header for details

 OUTPUTS:
   This function prints the names of the htmlfiles with path (output of dir2htmlfile)
   and returns the name of the html-file with directory tree

 EXAMPLE:
     y = make_tree_info( '\RSI\IDL51\')
     x = make_tree_info( '/home3/ich388/IDL/' $
	    , HTMLFILE='a.html', /FIXED, /SMALL, ALIGN=0.5 )

 MODIFICATION HISTORY:
   Written by:        Marsy Lisken  august 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\make_tree_info.pro)


MANDELBROT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MANDELBROT
 PURPOSE:
       Compute Mandelbrot images
 CATEGORY:
 CALLING SEQUENCE:
       Menu driven.
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 May, 1990
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\mandelbrot.pro)


MAP_CITIES

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  map_cities

 PURPOSE:  plot city locations and print city names form cities.dat database

 USEAGE:   map_cities

 INPUT:    none

 KEYWORD INPUT:
   file    
     city data base file, each record contains tab delimited values
     of latitude, longitude and city_name.
;
   charsize
     character size (a multiplier of !p.charsize)

   color
     color used to draw city mark and name

 OUTPUT: none

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  
;
   dcolors
   map_set3,0,-94.8814,/cyl,/cont,limit=[16.75,-130.05,56.95,-59.71],$
            /usa,s_color=4
   
   map_cities,color=1

 AUTHOR:   Paul Ricchiazzi                        25 Apr 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_cities.pro)


MAP_CONTINENTS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       map_continents2

 PURPOSE:

 this map_continents2 will do a correction for the hires maps
OLD PURPOSE: The MAP_CONTINENTS procedure draws continental boundaries, filled continents, political boundaries, coastlines, and/or rivers, over an existing map projection established by MAP_SET. Outlines can be drawn in low or high-resolution (if the optional high-resolution CIA World Map database is installed). If MAP_CONTINENTS is called without any keywords, it draws low-resolution, unfilled continent outlines. MAP_SET must be called before MAP_CONTINENTS to establish the projection type, the center of the projection, polar rotation and geographic limits. Keywords not recognized are passed along in _EXTRA to PLOTS and/or POLYFILL depending on options requested. CATEGORY: PLOT CALLING SEQUENCE: MAP_CONTINENTS2 INPUTS: NONE INPUT KEYWORD PARAMETERS: COASTS -- Set this keyword to draw coastlines, islands, and lakes instead of the default continent outlines. Note that if you are using the low-resolution map database (if the HIRES keyword is not set), many islands are drawn even when COASTS is not set. If you are using the hi gh-resolution map database (if the HIRES keyword is set), no islands are drawn unless COASTS is set. COLOR -- The color index of the lines being drawn. COUNTRIES -- Set this keyword to draw political boundaries as of 1993. _EXTRA -- Other keywords passed along to PLOTS/POLYFILL depending on options selected. Note that command line keywords (like MLINETHICK) will take precedence over options specified with _EXTRA or their natural names (like THICK). FILL_CONTINENTS -- Set this keyword to 1 to fill continent boundaries with a solid color. The color is set by the COLOR keyword. Set this keyword to 2 to fill continent boundaries with a line fill. For line filling, the COLOR, MLINESTYLE, MLINETHICK, ORIENTATION, and SPACING keywords can be used to control the type of line fill. Any option valid for polyfill can also be used (i.e. PATTERN). HIRES -- Set this keyword to use high-resolution map data instead of the default low-resolution data. This option is only available if you have installed the optional high-resolution map datasets. If the high-resolution data is not available, a warning is printed and the low-resolution data is used instead. This keyword can be used in conjunction with the COASTS, COUNTRIES, FILL_CONTINENTS, and RIVERS keywords. MLINESTYLE -- The line style of the boundaries being drawn. The default is solid lines. MLINETHICK -- The thickness of the boundary or fill lines. The default thickness is 1. ORIENTATION -- Set this keyword to the counterclockwise angle in degrees from horizontal that the line fill should be drawn. The default is 0. This keyword only has effect if the FILL_CONTINENTS keyword is set to 2. RIVERS -- Set this keyword to draw rivers. SPACING -- Set this keyword to the spacing, in centimeters, for a line fill. This keyword only has effect if the FILL_CONTINENTS keyword is set to 2. The default is 0.5 centimeters. USA -- Set this keyword to draw borders for each state in the United States in addition to continental boundaries. OUTPUT KEYWORD PARAMETERS: NONE OUTPUTS: Draws continents, etc. over the current map display. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: See DESCRIPTION. DESCRIPTION: See PURPOSE. EXAMPLES: Draw Low-Resolution continents, with high resolution political boundaries. MAP_SET MAP_CONTINENTS MAP_CONTINENTS,/hires,/countries DEVELOPMENT NOTES: This version uses !type=3 and uses the NEW (IDL5) map software. requires map_struct_append in map_set.pro MODIFICATION HISTORY: SVP, 11/96 ; Added header template.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\map_continents2.pro)


MAP_FILL

[Previous Routine] [Next Routine] [List of Routines]
 routine:   map_fill

 useage:    map_fill
            map_fill,ccolor=ccolor,fcolor=fcolor,mapfile=mapfile

 input:     none required

 DISCUSSION:
            MAP_FILL has two main purposes.  In batch mode MAP_FILL
            reads the map save file, MAPFILE (defaulted to
            coastline) produced by the MAP_SET3 SAVE option.  It
            plots continental coastlines and fill regions over an
            existing map plotting region.  

            In interactive mode MAP_FILL is used to fixup the saved
            map boundary file produced by MAP_SET3 SAVE option.
            Coastline segments which do not produce nice closed
            polygonal regions are manipulated with a set of line
            segment editing commands.  MAP_FILL first draws the map
            coastline using different colors to indicate distinct
            coastline segments.  The map segments are adjusted
            so that a given land/ocean area is properly enclosed by a
            closed polygon.  MAP_FILL provides 7 menu options to
            allow map segment editing:

 JOIN       Join together several colored line segments which together
            form a continuous coastline. see example 1

 SPLIT      Divide a closed polygonal region into two parts using
            mouse to trace a path connecting one part of the coastal
            segment to another point on the same segment.

 DELETE     Remove a line segment 

 FILL       Preview filled regions. Temporarilly fill map polygons.

 REVERT     Abandon current edits, revert back to original map data
            or to the last SAVEd version.

 SAVE       Replace contents of MAPFILE with current screen.

 SAVE_AS    Save current screen to a file name _n where the
            root bane is MAPFILE and n is a number between 0 and 9
            selected by the user.  Use this command together with
            SAVE and REVERT to save different regions to different
            files.
            

 KEYWORD INPUT:
   
   mapfile  name of input file (defaults to coastline).
            This file may be overwritten by a "SAVE" while in
            interactive mode.

   ccolor   color of continental outlines. if this parameter is set
            map_fill operates in non-interactive mode, reading the
            input MAPFILE and oploting map outlines.  If FCOLOR is set
            but CCOLOR is not, only region fill is produced. 

   fcolor   color used to fill continental outlines. if this
            parameter is set MAP_FILL operates in non-interactive
            mode.  Filling outlines are read from MAPFILE. If CCOLOR
            is set but FCOLOR is not, only map outlines will be
            oploted

 EXAMPLE

; fill antarctic Anvers island with color

 limit=[-70,-74,-62,-58]        ; antarctic penninsula
 
 map_set3,0,0,/cont,limit=limit,/cyl,/save
 map_fill,fcolor=100

; notice that the antarctic penninsula is not properly filled

 map_fill          ; 1. click "JOIN"  
                   ; 2. gather together all segments which make up a 
                   ;    a continuous stretch of coastline. The LMB blinks
                   ;    the coastline segment without capturing it. The
                   ;    MMB adds the selected segment to the last segment.
                   ;    The RMB stops the gathering process.
                   ; 3. click "SAVE" to save your edits
                   ; 4. click "DONE" to quit
                   ; 
                   ;    now view the finished map:


 map_set3,0,0,limit=limit,/cyl
 map_fill,ccolor=190,fcolor=100


; fill in south coast map

 limit=[33,-120,35,-118]  ; channel islands
 map_set3,0,0,limit=limit,/cyl,/save,/cont
 map_fill,fcolor=100

; notice that land areas are not POLYFILLed correctly

 map_fill           ; 1. click "CIRCUIT"
                    ; 2. use mouse to trace a closed path connecting NW and 
                    ;    SE ends.  Close the circuit outside (up and around)
                    ;    the rectangular viewing area. (Each LMB click adds
                    ;    a segment to the path).
                    ; 3. click "SAVE"
                    ; 4. click "DONE"
                    ; 
                    
; after you're done try map_fill again, try the fixed up coastline
; file with a different map projection:


; here is an example with the channel islands
 limit=[31,-122,36,-115] ; channel islands
 map_set3,0,-120,limit=limit,/orth,/save,/cont
 map_fill

 map_set3,0,-120,limit=limit,/orth,/cont
 map_fill,cc=200,fc=100,file='coastline_0'
 map_fill,cc=200,fc=0,file='coastline_1'
 
 map_set3,0,0,/cont,/save
 map_fill

; you can make arbitririly shaped masking regions with 
; the following commands


  plot,[0,10],[0,10],/nodata
  openw,lu,/get_lun,'coastline',/xdr,/stream
  writeu,lu,!y.crange([0,1]),!x.crange([0,1])

  trace,xv,yv &  writeu,lu,n_elements(xv) & writeu,lu,transpose([[xv],[yv]])

  free_lun,lu


  LIMITATIONS:

       MAP_FILL will not fill map regions which contain the north
       or south pole.

       MAP_FILL may not work on X-terminals.  It uses the IDL routine
       POLYFILL, which in turn calls an Xwindow system procedure for
       filling polygons.  Though the Xwindow fill routine is
       accessible to any xterminal, the procedure may demand more
       local memory than your terminal has. Unfortunately, running
       out of video memory also crashes your IDL session.  The
       solution is to run your application on a workstation.



 AUTHOR:   Paul Ricchiazzi                        01 Mar 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_fill.pro)


MAP_LABELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        MAP_LABELS

 PURPOSE:
        Constructs map labels from numerical values, in either
        numerical format (e.g. "-90", "0", "90" ), or in
        directional format ( e.g. "90S, "0", "90N" ).

 CATEGORY:
        Tools

 CALLING SEQUENCE:
        MAP_LABELS, LatLabel, LonLabel [ , Keywords ]

 INPUTS:
        None

 KEYWORD PARAMETERS:
        LATRANGE, LONRANGE -> The range of latitudes (longitudes)
            for the map or plot area.

        LATS, LONS  -> Returns to the calling program the array of
            latitudes (longitudes) used to construct the map labels.

        DLAT, DLON -> Returns to the calling program the latitude
            (longitude) interval between grid lines.

        /MAPGRID -> If set, will assume that latitude and longitude
            labels are for grid lines on a world map.  Also compute
            normal coordinates which can be used for placing the
            labels next to the map.

        NORMLATS -> 2D Array containing normal X and Y
            coordinates for placing latitude labels outside map
            boundaries.  These are computed only if /MAPGRID is set.

        NORMLONS -> 2D-Array containing normal X and Y
            coordinates for placing latitude labels outside map
            boundaries.  These are computed only if /MAPGRID is set.

     Keywords Passed to CONSTRUCT_MAP_LABELS:
     ========================================
        FORMAT -> Format descriptor string used in converting the
            values from DATA into string representation.  The
            default value is '(i10)'.

        /NUMERIC -> If set, will return latitude or longitude
            labels in numerical format (e.g. "-90", "0", "+90").
            If not set, will return latitude or longitude labels
            in directional format (e.g. "90S, "0", "90N")

        /NODEGREE -> If set, will prevent the raised degree symbol
            from being appended to MAPLABEL.  Default is to add the
            raised degree symbol to MAPLABEL.

 OUTPUTS:
        LATLABEL -> String array of latitude labels

        LONLABEL -> String array of longitude labels

 SUBROUTINES:
        Internal Subroutines:
        ---------------------
        CONSTRUCT_MAP_LABELS (function)
        GET_GRIDSPACING (function)

        External Subroutines:
        ---------------------
        STRREPL (function)

 REQUIREMENTS:
        None

 NOTES:
        (1) LATLABEL and LONLABEL are in the range of -180..180 degrees.

        (2) We should at some point allow the user to supply individual values
            that override the default spacing.

 EXAMPLE:
        (1) For use in conjunction with the PLOT command...

         MAP_LABELS, YTickName, XTickName,           $    ; call MAP_LABELS
            LatRange=[ -90,90], LonRange=[-180,180], $    ; to get the
            Lats=Lats,          Lons=XTickV,         $    ; lat and lon
            _EXTRA=e                                      ; tick labels

         PLOT, XArr, YArr, XTickV=XTickV,            $    ; call PLOT,
             XTickName=XTickName,                    $    ; using the
             XTicks=N_Elements( XTickV )-1,          $    ; labels as
             _EXTRA=e                                     ; tick names


        (2) For use in conjunction with MAP_SET and MAP_GRID

        Limit    = [ -90, -180, 90, 180 ]                 ; set up the
        MAP_SET, Limit=Limit, _EXTRA=e                    ; world map

        LatRange = [ Limit[0], Limit[2] ]                 ; define lat and
        LonRange = [ Limit[1], Limit[3] ]                 ; lon ranges

        MAP_LABELS, LatLabel,    LonLabel,            $   ; call MAP_LABELS
           Lats=Lats,            LatRange=LatRange,   $   ; to return
           Lons=Lons,            LonRange=LonRange,   $   ; the lat/lon
           NormLats=NormLats,    NormLons=NormLons,   $   ; values, labels
           /MapGrid,             _EXTRA=e                 ; normal coordinates

      Map_Grid, Lats=Lats, Lons=Lons, _EXTRA=e
            ; Plots the grid lines on the map

      XYOutS, NormLats[0,*], NormLats[1,*], LatLabel, Align=1.0, /Normal
            ; Plots latitude labels using normal coordinates

      XYOutS, NormLons[0,*], NormLons[1,*], LonLabel, Align=0.5, /Normal
            ; Plots longitude labels using normal coordinates

 MODIFICATION HISTORY:
        mgs, 19 Feb 1999: VERSION 1.00
        bmy, 26 Feg 1999: VERSION 1.10
                          - now works for maps that are smaller
                            than global size.
        bmy, 04 Mar 1999: VERSION 1.11
                          - added DEBUG keyword for output
                          - now computes NORM_XLAT correctly for
                            grids that are centered on -180 degrees
        mgs, 17 Mar 1999: - cleaned up
                          - replaced Norm[XY]... by two dimensional
                            NormLons and NormLats
                          - Longitude conversion now done in CONSTRUCT_...
                          - calls MAP_SET if /MAPGRID is set and no
                            map has been established.
        bmy, 25 Mar 1999: - double default DLON if more than 2 plots
                            per page
        mgs, 23 Apr 1999: - bug fix for LON labels in Pacific mode
        mgs & bmy, 03 Jun 1999: - fix for Pacific ranges in GET_GRIDSPACING

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\map_labels.pro)


MAP_LAMBERT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    map_lambert

 PURPOSE:    transformation into lambert azimuthal map projection

 USEAGE:     map_lambert,lat0,lon0,lat,lon,u,v

 INPUT:
   lat0      latitude of tangent point
   lon0      longitude of tangent point
   lat       array of latitudes
   lon       array of longitues

 OUTPUT:
   u         horizontal projection coordinates (km)
   v         vertical projection coordinates (km)

 EXAMPLE:    
             lat=[ 23.5837576, 22.4793919, 46.7048989, 48.4030555]
             lon=[ -119.9722899, -75.4163527, -65.3946489, -128.5300591]
             map_lambert,45,-100,lat,lon,u,v
             print,u,v

 REVISIONS:

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_lambert.pro)


MAP_LIMIT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  map_limit

 PURPOSE:  set map_limit

 USEAGE:   map_limit

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

  limit=map_limit()
  loadct,5
  map_set3,/cont,/pol,/riv,/us,/grid,r_color=50,p_color=150,$
     c_color=200,limit=limit,lores=0

 AUTHOR:   Paul Ricchiazzi                        02 Feb 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_limit.pro)


MAP_PUT_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAP_PUT_SCALE
 PURPOSE:
       Embed map coordinates info in image.
 CATEGORY:
 CALLING SEQUENCE:
       map_put_scale
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         NOBORDER=nb  Indicate if /NOBORDER keyword was used
            in map_set.  Tries to guess if not given.
            Guess is pretty good, but must give for /MILLER
            if /NOBORDER and /HORIZON used. Maybe other cases.
         LIMIT=lim  Given limit (needed for Satellite proj).
         SC_STR=sc_str  Scaling string, send or return.
         /NOEMBED means just return the string (SC_STR).
         /EMBED means embed given scaling string (SC_STR).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Must use after a map_set command, before any other
         commands that change cordinates (like plot).
         Needs 307 pixels along the image bottom.
         Allows an image of a map to be loaded later and have
         data overplotted or positions read.
         See also map_set_scale which sets up map coordinate
         system using this embedded info.
         If an image is remapped onto map it may confuse this
         routine.  May grab scaling string first using SC_STR
         and /NOEMBED, do the remapping, then add the string
         using SC_STR and /EMBED.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Mar 20
       R. Sterner, 1999 Aug 30 --- Revised.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\map_put_scale.pro)


MAP_SET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      map_set
 PURPOSE:
        The procedure map_set establishes
        the axis type and coordinate conversion mechanism
        for mapping  points on the earth's surface, expressed
        in latitude and longitude, to points on a plane, according
        to one of ten possible map projections. The user may 
        may select the map projection, the map center, polar rotation
        and geographical limits.

        The user may request map_set to plot the
        graticule and continental boundaries by setting
        the keywords Grid and Continent.

 CATEGORY:
           Mapping
 CALLING SEQUENCE:
                 map_set2, p0lat, p0lon, rot, proj = proj,           $
                    Query = interg,                                  $
              	     CYLINDRICAL = cyl,      MERCATOR = merc,         $
   	             MOLLWEIDE = moll,       STEREOGRAPHIC = stereo,  $
                    ORTHOGRAPHIC = ortho,   Conic = cone,            $
   	             LAMBERT = lamb,         GNOMIC = gnom,           $
                    AZIMUTHAL = azim,       SATELLITE = satel,       $
                    SINUSOIDAL = sinu,      AITOFF  = aitoff,        $
                    latdel = latdel, londel = londel, limit = limit, $
                    Sat_p = Sat_p, $
                     title = title, noborder = noborder, $
                    noerase = noerase, label = label,                $
                    glinestyle = glinestyle, glinethick=glinethick,  $
                    mlinestyle=mlinestyle, mlinethick=mlinethick,    $
                    color = color, con_color = con_color,            $
		     riv_color = riv_color, bdy_color = bdy_color,    $
		     continents=continent, grid = grid,               $
                    lonlab = lonlab, latlab = latlab,                $
                    lonalign = lonalign, latalign = latalign,        $
                    charsize = charsize

 OPTIONAL INPUT:
               P0lat--- For all but Lambert's conformal conic projection
                        with two standard parallels, P0lat should be set
                        to the latitude of the point on the earth's surface
                        to be mapped to the center of the projection plane.
                        If the projection type is sinusoidal, P0lat must be
                        0. -90 <= P0lat <= 90. If P0lat is not set, the
                        default value is 0. If the user has selected
                        Lambert's conformal conic projection with two
                        standard parallels, P0lat should be set to the
                        latitude in degrees of one of the parallels.
                        If not both P0lat and P0lon are defined, P0lat is
                        20 by default.

               P0lon--- For all but Lambert's conformal conic projection with
                        two standard parallels, P0lon should be set
                        by the user to the longitude of the point on the
                        earth's surface to be mapped to the center of
                        the map projection. -180 <= P0lon <= 180. If P0lon
                        is not set, the default value is zero.

              Rot-----  The user should set the argument Rot to the angle
                        through which the North direction should be
                        rotated around the line L between the earth's center
                        and the point (P0lat, P0lon). Rot is measured in 
                        degrees with the positive direction being clockwise
                         rotation around L. Default value is 0.

 KEYWORDS:

         Advance       = if set, advance to the next frame when there
                         are multiple plots on the screen.
         Azimuthal     = azimuthal equidistant projection
         Conic         = Conic projection
         Cylindrical   = cylindrcal equidistant projection
         Gnomic        = gnomonic projection
         Lambert       = Lambert's equal area projection
         Mercator      = Mercator's projection
         Mollweide     = Mollweide type projection
         Orthographic  = Orthographic projection
	  Satellite	= Satellite (General perspective) projection
         Sinusoidal    = sinsoidal projection
         Stereographic = stereographic projection
         Aitoff        = Aitoff's projection
         charsize      = size of characters in labels.
         Color         = color of the map boundaries

	  con_color	= color of continental boundaries.

	  riv_color = color of rivers.
	  bdy_color = color of political boundaries.
         Continents    = flag to signal that continental boundaries
                         should be drawn.         
         Glinestyle    = linestyle of gridlines. (default = 1 = dotted)
         Glinethick    = thickness of gridlines. (default = 1 = normal)
         Grid          = flag to signal that gridlines should be drawn.
         Label         = flag to signal labeling of parallels and 
                         meridians in the grid.

         latalign     = the aligment of the text baseline for
                        latitude labels. A value of 0.0 left justifies
                        the label, 1.0 right justifies it and
                         0.5 centers. The default value is .5.
                         
         Latdel        = if set, spacing of parallels drawn on grid. 
			  Default is 10 <  (latmin - latmax) / 10).
         LatLab       =  if set, longitude at which to place latitude
                         labels. Default is longitude of center.
         Limit         =  A four or eight element vector.
			  If a four element vector, [latmin, lonmin, latmax,
                          lonmax] specifying the boundaries of the region
                          to be mapped. (latmin, lonmin) and (latmax,
                          lonmax) are the latitudes and longitudes of
                           two diagonal points on the boundary with
                           latmin < latmax and lonmin  continental lat-lon points are saved 
                                   to file coastline.dat.  
                         save=2 => read map coordinates from file
                                   coastline.dat.  For small area maps
                                   this is much faster than reading from
                                   the world map database.

	T3D 		= 1 to use the existing 3D transformation, 0 
			  or omitted for normal.

       Title           = Title of plot to be centered over plot window.

       XMargin         = if set, a two element vector that specifies
                         in character units the vertical margin between
                         the map and the screen border.

       YMargin         = if set, a two element vector that specifies
                         in character units the horizontal margin between
                         the map and the screen border.

       Usa             = If set draw the state boundries

 EXAMPLE

;
; display data defined on a regular LAT-LON grid onto a given map 
; projection.  USE MAP_SET and MAP_IMAGE to create the map projection
; and to warp the image.  Then use BOXPOS to position the TVIM frame
; to correctly register the map and image

 IMAGE = sin(!pi*findrng(0,24,200))#sin(!pi*findrng(0,12,200))
 !p.multi=[0,1,2]
 map_set,45,0,/ortho,/advance,pos=boxpos(/aspect)
 newimage=map_image(image,/bilin,latmin=-90,latmax=90,lonmin=-180,lonmax=180)
 tvim,newimage,title='Warped data',pos=boxpos(/get),/scale
 map_set,45,0,/ortho,pos=boxpos(/get),/grid,/cont,/noerase ; draw map
 tvim,image,xrange=[-180,180],yrange=[-90,90],/scale, $
     title='Unwarped data',xtitle='Longitude',ytitle='Latitude'
 map_set,0,0,/cyl,pos=boxpos(/get),/grid,/cont,/noerase ; draw map

; In the next example MAP_FILL is used to mask out land areas. Note,
; however, that MAP_FILL doesn't always fill land areas so neatly.
; MAP_SET2 is used with /SAVE to create a file containing the continental 
; boundary lat-lon coordinates in the current working directory.  Then 
; MAP_FILL is called to color-fill the land areas.

 image=randata(256,256,s=2.5)
 tvim,image
 map_set2,-64,-64,limit=[-65.1,-64.5,-64,-62],/ortho,$
           pos=boxpos(/get),/noerase,/grid,/save,/cont
 map_fill,c_color=200,f_color=100
;
; map of channel islands with continental regions filled in

 map_set2,35,-120,/cont,limit=[33,-120,35,-118],/ortho,/save,con_color=100
 map_fill,f_color=100
;
; NOTE: In this example the continental boundaries don't form nice
; closed regions which POLYFILL can fill.  Use MAP_FILL in interactive
; mode to fix up the map segments to allow proper POLYFILLing.


 Modification history:
			Written, Ann Bateson, 1991
	SMR, 10-'91	Added a check for additional satelite parameters
			   when /SATELITE is set.
       UCSB, ESRG,5-92 Added USA flag to check and map state boundries
	DMS,  6-92	Fixed bug that incorrectly printed grid values with
				small lat/lon ranges.
	DMS, 8-92	Added 8 element lat/lon keyword, fixed problems
				with Satellite, conics with 1 std parallel,
				smaller and/or wierd maps
       PJR, 5-95       put in SAVE keyword and cleaned some code

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_set2.pro)


MAP_SET3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      map_set3
 PURPOSE:
        The procedure map_set3 establishes the axis type and
        coordinate conversion mechanism for mapping points on the
        earth's surface, expressed in latitude and longitude, to
        points on a plane, according to one of ten possible map
        projections. The user may may select the map projection, the
        map center, polar rotation and geographical limits.

        The user may request map_set3 to plot the graticule and
        continental boundaries by setting the keywords Grid and
        Continent.

 CATEGORY:
           Mapping
 CALLING SEQUENCE:
   map_set3, p0lat, p0lon, rot,                      PROJ=proj,             $
       QUERY=interg,          CYLINDRICAL=cyl,       MERCATOR=merc,         $
       MOLLWEIDE=moll,        STEREOGRAPHIC=stereo,  ORTHOGRAPHIC=ortho,    $
       CONIC=cone,            LAMBERT=lamb,          GNOMIC=gnom,           $
       AZIMUTHAL=azim,        SATELLITE=satel,       SINUSOIDAL=sinu,       $
       AITOFF=aitoff,         LATDEL=latdel,         LONDEL=londel,         $
       LIMIT=limit,           SAT_P=sat_p,           TITLE=title,           $
       NOBORDER=noborder,     NOERASE=noerase,       LABEL=label,           $
       GLINESTYLE=glinestyle, GLINETHICK=glinethick, MLINESTYLE=mlinestyle, $
       MLINETHICK=mlinethick, P_COLOR=p_color,       COLOR=color,           $
       C_COLOR=c_color,       R_COLOR=r_color,       S_COLOR=s_color,       $
       CONTINENTS=continent,  GRID=grid,             XMARGIN=xmargin,       $
       YMARGIN=ymargin,       LONLAB=lonlab,         LATLAB=latlab,         $
       LONALIGN=lonalign,     LATALIGN=latalign,     CHARSIZE=charsize,     $
       ADVANCE=advance,       USA=usa,               T3D=t3d,               $
       POSITION=position,     RIVERS=rivers,         POLITICAL=political,   $ 
       SAVE=save,             LORES=lores

 OPTIONAL INPUT:
   p0lat
     For all but Lambert's conformal conic projection with two
     standard parallels, P0lat should be set to the latitude of the
     point on the earth's surface to be mapped to the center of the
     projection plane.  If the projection type is sinusoidal, P0lat
     must be 0. -90 <= P0lat <= 90. If P0lat is not set, the default
     value is 0. If the user has selected Lambert's conformal conic
     projection with two standard parallels, P0lat should be set to
     the latitude in degrees of one of the parallels.  If not both
     P0lat and P0lon are defined, P0lat is 20 by default.

   p0lon
     For all but Lambert's conformal conic projection with two
     standard parallels, P0lon should be set by the user to the
     longitude of the point on the earth's surface to be mapped to
     the center of the map projection. -180 <= P0lon <= 180. If P0lon
     is not set, the default value is zero.

   rot
     The user should set the argument Rot to the angle through which
     the North direction should be rotated around the line L between
     the earth's center and the point (P0lat, P0lon). Rot is measured
     in degrees with the positive direction being clockwise rotation
     around L. Default value is 0.

 KEYWORDS:

   advance         if set, advance to the next frame when there
                   are multiple plots on the screen.

   aitoff          aitoff's projection

   azimuthal       azimuthal equidistant projection

   conic           conic projection

   cylindrical     cylindrcal equidistant projection

   gnomic          gnomonic projection

   lambert         lambert's equal area projection

   mercator        mercator's projection

   mollweide       mollweide type projection

   orthographic    orthographic projection

   satellite       satellite (general perspective) projection

   sinusoidal      sinsoidal projection

   stereographic   stereographic projection

   charsize        size of characters in labels.

   color           color of the map frame

   c_color         color of continental boundaries.

   r_color         color of rivers.

   p_color         color of political boundaries.

   continents      if set, draw continental boundaries

   glinestyle      linestyle of gridlines. (default = 1 = dotted)

   glinethick      thickness of gridlines. (default = 1 = normal)

   grid            if set, draw gridlines 

   label           if set, label parallels and meridians

   latalign        the aligment of the text baseline for
                   latitude labels. a value of 0.0 left justifies
                   the label, 1.0 right justifies it and
                   0.5 centers. the default value is .5.

   latdel          if set, spacing of parallels drawn on grid. 
                   default is 10 <  (latmin - latmax) / 10).

   latlab          if set, longitude at which to place latitude
                   labels. default is longitude of center.

   limit           a four or eight element vector.  if a four element
                   vector, [latmin, lonmin, latmax, lonmax]
                   specifying the boundaries of the region to be
                   mapped. (latmin, lonmin) and (latmax, lonmax) are
                   the latitudes and longitudes of two diagonal
                   points on the boundary with latmin < latmax and
                   lonmin  continental lat-lon points are saved to
                   file "coastline" for postprocessing by procedure
                   map_fill.

   lores           if set, use low resolution map data when lores=1
                   and the high resolution data set when lores=0 if
                   lores is not set, then the low resolution data set
                   is used when the map dimensions exceed about 3000 km
                   otherwise the high resolution data set is used.

                   NOTE: the high resolution database may take a factor
                   ten times longer to plot than the lo-res version.

   t3d             1 to use the existing 3d transformation, 0 or
                   omitted for normal.

   title           title of plot to be centered over plot window.

   xmargin         if set, a two element vector that specifies in
                   character units the vertical margin between the
                   map and the screen border.

   ymargin         if set, a two element vector that specifies in
                   character units the horizontal margin between the
                   map and the screen border.

   position        a one or four element array.  if pos has four elements
                   they specify the xmin,ymin,xmax,ymax, normalized
                   coordinates of the map frame.  If pos has just one
                   element then the map frame will match the last specified
                   plot window, i.e., pos=[!x.window(0),!y.window(0),
                   !x.window(1),!y.window(1)]
                   

   usa             if set draw the state boundries

   rivers          if set draw rivers

   political       if set draw political boundaries


 SIDE EFFECTS:
       writes to file "coastline" in current working directory when
       keyword parameter SAVE is set.

       changes the some of the values in structures !map, !x and !y

 EXAMPLE

;
; display data defined on a regular LAT-LON grid onto a given map 
; projection.  USE MAP_SET3 and MAP_IMAGE to create the map projection
; and to warp the image.  Then use BOXPOS to position the TVIM frame
; to correctly register the map and image

 IMAGE = sin(!pi*findrng(0,24,200))#sin(!pi*findrng(0,12,200))
 !p.multi=[0,1,2]
 map_set3,45,0,/ortho,/advance,pos=boxpos(/aspect)
 newimage=map_image(image,/bilin,latmin=-90,latmax=90,lonmin=-180,lonmax=180)
 tvim,newimage,title='Warped data',pos=boxpos(/get),/scale
 map_set3,45,0,/ortho,pos=boxpos(/get),/grid,/cont,/noerase ; draw map
 tvim,image,xrange=[-180,180],yrange=[-90,90],/scale, $
     title='Unwarped data',xtitle='Longitude',ytitle='Latitude'
 map_set3,0,0,/cyl,pos=boxpos(/get),/grid,/cont,/noerase ; draw map

; In the next example MAP_FILL is used to mask out land areas. Note,
; however, that MAP_FILL doesn't always fill land areas so neatly.
; MAP_SET3 is used with /SAVE to create a file containing the continental 
; boundary lat-lon coordinates in the current working directory.  Then 
; MAP_FILL is called to color-fill the land areas.

 image=randata(32,32,s=2.5)
 tvim,image,/interp
 map_set3,-64,-64,limit=[-65.1,-64.5,-64,-62],/ortho,$
           pos=boxpos(/get),/noerase,/grid,/save,/cont
 map_fill,c_color=200,f_color=100
;
; map of channel islands with continental regions filled in

 map_set3,35,-120,/cont,limit=[33,-120,35,-118],/ortho,/save,c_color=100
 map_fill,f_color=100
;
; NOTE: In this example the continental boundaries don't form nice
; closed regions which POLYFILL can fill.  Use MAP_FILL in interactive
; mode (no arguments) to fix up the map segments to allow proper
; POLYFILLing.


 Modification history:
			Written, Ann Bateson, 1991
	SMR, 10-'91	Added a check for additional satelite parameters
			   when /SATELITE is set.
       UCSB, ESRG,5-92 Added USA flag to check and map state boundries
	DMS,  6-92	Fixed bug that incorrectly printed grid values with
				small lat/lon ranges.
	DMS, 8-92	Added 8 element lat/lon keyword, fixed problems
				with Satellite, conics with 1 std parallel,
				smaller and/or wierd maps
       PJR, 5-95       put in SAVE keyword and cleaned some code
       PJR, 9-95       installed new data format for map databases, new
                       format allows much more rapid execution for small
                       area maps.
       PJR, 2-96       installed lores flag 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\map_set3.pro)


MAP_SET_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAP_SET_SCALE
 PURPOSE:
       Set map scaling from info embedded in a map image.
 CATEGORY:
 CALLING SEQUENCE:
       No args.
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /LIST  List values.
         LAT=lat, LON=lon, ANG=ang  returned lat,long,ang.
         POSITION=pos  returned position.
         LIMIT=lim     returned LIMIT.
         Screen window position values returned:
           IX1=ix1,IX2=ix2,IY1=iy1,IY2=iy2,IDX=idx,IDY=idy
         PIX=pix map scale in pixels/degree (only if /ISO used).
         IMAGE=img  Give image array instead of reading it from
           the display.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Uses info embedded on bottom image line by
       map_put_scale, if available.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 31
       R. Sterner, 2000 Jun 29 --- Added IMAGE=img keyword.

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\map_set_scale.pro)


MARK_PLOTREGION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   mark_plotregion

 PURPOSE:
   This procedure will plot a box marking the plot region

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   mark_plotregion

 EXAMPLE:
   mark_plotregion

 MODIFICATION HISTORY:
   Written by Franz Rohrer Apr 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\mark_plotregion.pro)


MASS2VOLFLOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mass2volflow

 PURPOSE:
	This function calculates the gas volume flow from the mass flow, temperature, and pressure.

 CATEGORY:
	PHYSCHEM

 CALLING SEQUENCE:
	result = mass2volflow(mass_flow, temp, pres)

 INPUTS:
	mass_flow: gas mass flow (e.g. as provided by a mass flow controller)
	temp: gas temperature in K (scalar or array, if array then with the same number of elements as mass_flow)
	pres: gas pressure in mbar (scalar or array, if array then with the same number of elements as mass_flow)

 KEYWORD PARAMETERS:
	REF_TEMP = ref_temp: Reference temperature (in K) for flow controller calibration.
		(default: 273.15K)
	REF_PRES = ref_pres: Reference pressure (in mbar) for flow controller calibration.
		(default: 1013.25mbar)
	THRESHOLD = threshold: Lower limit of meaningful mass flow (given in mass flow units)
		If provided any mass flow data below this value are set to 0.0.

 OUTPUTS:
	This function returns the gas volume flow.

 PROCEDURE:
	The volume flow is calculated according to the following equation:

                         temp       ref_pres
	vol_flow = mass_flow * -------- * --------
                         ref_temp   pres

 EXAMPLE:
	PRINT, mass2volflow(5.0, 298.0, 1020.0) --> 5.41878

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 17.03.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\mass2volflow.pro)


MATCHDELIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MATCHDELIM
 PURPOSE:
        Match open/close delimiters in a string.
 CATEGORY:
        text/strings
 CALLING SEQUENCE:
        position = matchdelim( strn, [openpos])
 INPUTS:
        strn        -- a string containing an open                 in
                       delimiter (e.g. '{') in which you 
                       want to find the matching closing  
                       delimiter (e.g. '}')
 KEYWORD PARAMETERS:
        OPEN_DELIM  -- A single character containing the opening   in
                       delimiter (e.g. '(').  Default is '{'
        CLOSE_DELIM -- A single character containing the closing   in
                       delimiter (e.g. ')').  Default is '}'
 OUTPUTS:
        position -- returns the position in strn of the            out
                    closing delimiter, -1 if no closing found.
        openpos  -- Set to a named variable to receive the         out
                    position of the first opening delimiter.
                    Optional.
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
        - Any pair of (nonidentical) characters can be used as
          delimiters. 
 EXAMPLE:
        matchdelim('{one{two}}three') returns 9, the character just
        before 'three'.  
 MODIFICATION HISTORY:
       $Id: matchdelim.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
       $Log: matchdelim.pro,v $
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Removed restriction that open delim must be first char.  Added argument
       to allow for return of position of open delim.

       Revision 1.1  1996/01/31 18:41:06  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\matchdelim.pro)


MATRIX_FUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		MATRIX_FUN
 VERSION:
		4.2
 PURPOSE:
		Calculating an arbitrary function of a symmetric matrix.
 CATEGORY:
		Matrix function.
 CALLING SEQUENCE:
	Result = MATRIX_FUN( ARR, FUN [, EPS, PARAMS = PARS])
 INPUTS:
	ARR
		A numeric, real, symmetric matrix (i.e. a square array).
	FUN
		Character value representing an existing IDL function.  The function
		must comply with the IDL standard of being able to accept an array
		input and return an array output.  The calling sequence for the
		function must be either
			Result = FUN(x)
		or
			Result = FUN(x, extra)
		where X is the variable and EXTRA may be any single entity (scalar,
		array, structure etc.) used to pass additional parameters to the
		function.
 OPTIONAL INPUT PARAMETERS:
	EPS
		Smallness parameter, defining maximal allowed relative deviation of ARR
		from symmetricity.  Default value provided by the EPS field in IDL's
		MACHAR
 KEYWORD PARAMETERS:
	PARAMS
		An arbitrary value or variable which is passed to the function FUN.
 OUTPUTS:
		Returns FUN(ARR) where FUN is the provided function.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than possible restriction of the specific FUN used.
 PROCEDURE:
		Diagonalizes ARR, performs the operation implied by FUN on the
		diagonal elements, then transforms back to the original base.  Calls
		CAST, DEFAULT, FPU_FIX, ISNUM, TOLER and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 20-OCT-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\matrix_fun.pro)


MCALCX2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   mcalcx2

 PURPOSE:
   This function calculates the prod, sum, diff, .... of an array
   with an scalar or array or an unary function excluding the
   missing values

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = MCALCX2(array)

 INPUTS:
   array: data field

 OPTIONAL INPUTS:
   x2:    operand to be used in a binary operation

 Keyword PARAMETERS:
   MISSING:    missing value to be ignored
   OPERATOR:   string containing a math operator:
           '+', '-', '/', '*', 'log', 'exp', '1/', 'sin', 'cos'

 OUTPUTS:
   array of the same size as the input array containing
   the calculated data or a number depends on operator

 EXAMPLE:
   a = findgen(5)
   a[3] = -12345.
   b = findgen(5)
   b[2] = -12345.
   print, a, mcalcx(a, 5, missing=-12345., operator='*')
   print, a, mcalcx(a, b, missing=-12345., operator='+')
   print, a, mcalcx(a, missing=-12345.,operator='sum')

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised         T.B. Oct 1997
       Modified        T.B. Aug 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\mcalcx2.pro)


MCHOLDC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MCHOLDC

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Modified Cholesky Factorization of a Symmetric Matrix

 MAJOR TOPICS:
   Linear Systems

 CALLING SEQUENCE:
   MCHOLDC, A, D, E [, /OUTFULL, /SPARSE, /PIVOT, TAU=TAU, $
                      PERMUTE=PERMUTE, INVPERMUTE=INVPERMUTE ]

 DESCRIPTION:

  Given a symmetric matrix A, the MCHOLDC procedure computes the
  factorization:

     A + E   =   TRANSPOSE(U) ## D ## U

  where A is the original matrix (optionally permuted if the PIVOT
  keyword is set), U is an upper triangular matrix, D is a diagonal
  matrix, and E is a diagonal error matrix.

  The standard Cholesky factorization is only defined for a positive
  definite symmetric matrix.  If the input matrix is positive
  definite then the error term E will be zero upon output.  The user
  may in fact test the positive-definiteness of their matrix by
  factoring it and testing that all terms in E are zero.

  If A is *not* positive definite, then the standard Cholesky
  factorization is undefined.  In that case we adopt the "modified"
  factorization strategy of Gill, Murray and Wright (p. 108), which
  involves adding a diagonal error term to A in order to enforce
  positive-definiteness.  The approach is optimal in the sense that
  it attempts to minimize E, and thus disturbing A as little as
  possible.  For optimization problems, this approximate
  factorization can be used to find a direction of descent even when
  the curvature is not positive definite.

  The upper triangle of A is modified in place.  By default, the
  lower triangle is left unchanged, and the matrices D and E are
  actually returned as vectors containing only the diagonal terms.
  However, if the keyword OUTFULL is set then full matrices are
  returned.  This is useful when matrix multiplication will be
  performed at the next step.

  The modified Cholesky factorization is most stable when pivoting is
  performed.  If the keyword PIVOT is set, then pivoting is performed
  to place the diagonal terms with the largest amplitude in the next
  row.  The permutation vectors returned in PERMUTE and INVPERMUTE
  can be used to apply and reverse the pivoting.
    [ i.e.,  (U(PP,*))(*,PP) applies the permutation and
             (U(IPP,*))(*,IPP) reverses it, where PP and IPP are the
             permutation and inverse permutation vectors. ]

  If the matrix to be factored is very sparse, then setting the
  SPARSE keyword may improve the speed of the computations.  SPARSE
  is more costly on a dense matrix, but only grows as N^2, where as
  the standard computation grows as N^3, where N is the rank of the
  matrix.

  If the CHOLSOL keyword is set, then the output is slightly
  modified.  The returned matrix A that is returned is structured so
  that it is compatible with the CHOLSOL built-in IDL routine.  This
  involves converting A to being upper to lower triangular, and
  multiplying by SQRT(D).  Users must be sure to check that all
  elements of E are zero before using CHOLSOL.

 PARAMETERS:

   A - upon input, a symmetric NxN matrix to be factored.
       Upon output, the upper triangle of the matrix is modified to
       contain the factorization.

   D - upon output, the diagonal matrix D.

   E - upon output, the diagonal error matrix E.

 KEYWORD PARAMETERS:

   OUTFULL - if set, then A, D and E will be modified to be full IDL
             matrices than can be matrix-multiplied.  By default,
             only the upper triangle of A is modified, and D and E
             are returned as vectors.

   PIVOT - if set, then diagonal elements of A are pivoted into place
           and operated on, in decrease order of their amplitude.
           The permutation vectors are returned in the PERMUTE and
           INVPERMUTE keywords.

   PERMUTE - upon return, the permutation vector which converts a
             vector into permuted form.

   INVPERMUTE - upon return, the inverse permutation vector which
                converts a vector from permuted form back into
                standard form.

   SPARSE - if set, then operations optimized for sparse matrices are
            employed.  For large but very sparse matrices, this can
            save a significant amount of computation time.

   CHOLSOL - if set, then A and D are returned, suitable for input to
             the built-in IDL routine CHOLSOL.  CHOLSOL is mutually
             exclusive with the FULL keyword.

   TAU - if set, then use the Tau factor as described in the
         "unconventional" modified Cholesky factorization, as
         described by Xie & Schlick.
         Default: the unconventional technique is not used.

 EXAMPLE:

   Example 1
   ---------
   a = randomn(seed, 5,5)    ;; Generate a random matrix
   a = 0.5*(transpose(a)+a)  ;; Symmetrize it

   a1 = a                    ;; Make a copy
   mcholdc, a1, d, e, /full  ;; Factorize it
   print, max(abs(e))        ;; This matrix is not positive definite

   diff = transpose(a1) ## d ## a1 - e - a
                             ;; Test the factorization by inverting
                             ;; it and subtracting A
   print, max(abs(diff))     ;; Differences are small

   Example 2
   ---------
   Solving a problem with MCHOLDC and CHOLSOL

   a = [[6E,15,55],[15E,55,225],[55E,225,979]]
   b = [9.5E,50,237]

   mcholdc, a, d, e, /cholsol  ;; Factorize matrix, compatible w/ CHOLSOL
   if total(abs(e)) NE 0 then $
      message, 'ERROR: Matrix A is not positive definite'

   x = cholsol(a, d, b)        ;; Solve with CHOLSOL
   print, x
        -0.500001    -0.999999     0.500000
   which is within 1e-6 of the true solution.


 REFERENCES:

   Gill, P. E., Murray, W., & Wright, M. H. 1981
     *Practical Optimization*, Academic Press
   Schlick, T. & Fogelson, A., "TNPACK - A Truncated Newton
     Minimization Package for Large- Scale Problems: I. Algorithm and
     Usage," 1992, ACM TOMS, v. 18, p. 46-70.  (Alg. 702)
   Xie, D. & Schlick, T., "Remark on Algorithm 702 - The Updated
     Truncated Newton Minimization Package," 1999, ACM TOMS, v. 25,
     p. 108-122.

 MODIFICATION HISTORY:
   Written, CM, Apr 2001
   Added CHOLSOL keyword, CM, 15 Feb 2002

  $Id: mcholdc.pro,v 1.5 2002/02/25 19:33:44 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mcholdc.pro)


MCOMPUTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MCOMPUTE
 PURPOSE:
       Compute mandelbrot set images.
 CATEGORY:
 CALLING SEQUENCE:
       mcompute, region, out
 INPUTS:
       region = region in the complex plane to process.       in
         region = [x1,x2,nx,y1,y2,ny] where
           x1,x2,nx = min,max, number in real direction,
           y1,y2,ny = min,max, number in imaginary direction.
 KEYWORD PARAMETERS:
       Keywords:
         /SHOW  shows progress of computation on screen.
         LAST=max.  Set upper limit to # of iterations (def = 100).
 OUTPUTS:
       out = resulting mandelbrot set image.                  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 19 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\mcompute.pro)


MEAN[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MEAN
 PURPOSE:
       Returns the mean of an array.
 CATEGORY:
 CALLING SEQUENCE:
       m = mean(a)
 INPUTS:
       a = input array.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       m = array mean.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner,  11 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\mean.pro)


MEAN[2]

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:                mean

 AUTHOR:                 Terry Figel, ESRG, UCSB 2-21-93

 CALLING SEQUENCE:        mean,var

 INPUT:   
              var         an array

 PURPOSE:                 return the mean of var

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mean.pro)


MEAN_DC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		mean_dc

 PURPOSE:
		This function returns the mean diurnal cycle of time dependent data.

 CATEGORY:
		TIME

 CALLING SEQUENCE:
		result = mean_dc(time, data)

 INPUTS:
		time: Time vector in Js.
		data: Data vector.

 KEYWORD PARAMETERS:
		TIME_STEP = ts: averaging time window in seconds (default: 3600D0).
		FIRST_DAY = fd: dd.mm.yy - Date of first day to be considered
			(default: first day in data set).
		LAST_DAY = ld: dd.mm.yy - Date of last day to be considered
			(default: last day in data set).
		/EXCLUDE: If set the specified time range will be excluded.
		MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
		/MAKE_PLOT: If set the result of the time-averaging process is plotted.
		_EXTRA = e: Any valid plot_2c keyword parameters can be passed into the
			plot_2c procedure.

 OUTPUTS:
		This function returns a structure of arrays where the
		array dimension n is equal to the number of time bins in the mean diurnal cycle.
		For each bin the start time and the statistical parameters mean, stdev, sterr,
		n, and median are returned (tag names: time, mean, stdev, sterr, n, median).
		The time step is returned as well (tag name: time_step).
		If a quantity is not defined (e.g. stdev for only one point in the bin),
		the value !VALUES.F_NAN is returned.

 EXAMPLE:
		a = DINDGEN(100)
		t = a * 3600.D
		result = mean_dc(t, a, /MAKE_PLOT)

		--> a time axis plot should appear

		HELP, result, /STR

		** Structure <185d010>, 9 tags, length=872, refs=1:
		   TIME            DOUBLE    Array[24]
		   MEAN            FLOAT     Array[24]
		   STDEV           FLOAT     Array[24]
		   STERR           FLOAT     Array[24]
		   N               LONG      Array[24]
		   MEDIAN          FLOAT     Array[24]
		   MIN             FLOAT     Array[24]
		   MAX             FLOAT     Array[24]
		   TIME_STEP       DOUBLE           3600.0000

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.06.1999
	14.06.1999:	Added keyword parameter MISSING_VALUE = miss_value.
	21.02.2000:	Bug removed with xerr in plot.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\mean_dc.pro)


MEAN_FR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  mean_fr

 PURPOSE:
   This function calculates average, standard deviation and number of samples of a data-vector

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   b=mean_fr(a)

 INPUTS:
   a : vector of datapoints

 OUTPUTS:
   b(0) : average    b(1) : rms stdev     b(2) : number of data points

 EXAMPLE:
   a=findgen(100)
   b=mean_fr(a)

 MODIFICATION HISTORY:
  Written by: F.Rohrer Dec 1997
  Modified by FR : 5.3.1999 : double precision for loop index i

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\mean_fr.pro)


MEAN_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mean_time

 PURPOSE:
   This function will build the mean of two arrays

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result=mean_time(array1,array2)

 INPUTS:
   array1: an array of values
   array2: an array of values

 OUTPUTS:
   This function build the mean of two arrays

 EXAMPLE:
   Result=mean_time(3.,5.)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997 March 15
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\mean_time.pro)


MENUW

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    menuw 

 PURPOSE:    create a menu widget and return a selection

 USEAGE:     w=menuw(choices,title=title,group=group,$
                     font=font,ysize=ysize,done=done)

             result=menuw(w) 

             while menus(w,ii) do (something that depends on ii)

 PROCEDURE:
             The value returned from MENUW is either a widget id or a
             selection index, depending on the variable type of its
             first argument.  If the argument is a string array then
             MENUW sets up a menu, based on an IDL list widget, and
             returns a structure of widget identifiers of the
             component widgets.  If the argument is a structure then
             MENUW returns the index of the selected menu choice.

             Set up the widget with          w=MENUW(choices)
             Return choices with             result=MENUW(w)
             where 
                choices = a string array of menu choices 
                w       = a structure variable containing the widget id.
                result  = index of the selected menu choice 

 INPUT:
  choices    string array containing choices
  w          widget id (returned by setup call to MENUW)
  

 KEYWORD INPUT:
  title      title of the widget

  prompt     string array of prompt message. each element of string
             array appears on a new line.

  ysize      the number of lines to show in the list widget.  If the
             number of choices is greater than ysize the list widget
             creates a vertical slider to allow the user to scan all
             selections.

  font       String specifying font type. If omitted use the default
             fixed width font:
             "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1"

  done       if set, a "DONE" button is created.  If a "DONE" button
             is not present the MENUW widget is destroyed the first
             time result=MENUW(w) is executed.

 OUTPUT, SETUP MODE:

  w          widget indentifier used in subsequent calls to MENUW
             When multiple copies of the MENUW widget exist, a call to
             to MENUW(w) will interact only with the widget which
             set W.

 OUTPUT, SELECTION MODE:

  selection  If selection parameter is included in parameter list it
             will contain the index of the selection and the function
             return value will be set to -1 or 1 depending on whether
             the DONE button was/was_not pressed.  When used in a
             while loop (see examples), the last selected value is
             available even after DONE is pressed.  If the SELECTION
             parameter is not in the argument list the function
             return value will be set to....

  result     if the DONE button is pressed =>  -1
             otherwise the index of the list widget 
             (0 -- n_elements(choices)-1)


 EXAMPLES:

; use MENUW in one-shot mode

       items=findfile('/home/paul/idl/esrg/t*.pro')
       prompt='choose a file to display'
       print,items(menuw(menuw(items,prompt=prompt)))


; use MENUW to make a sequence of menu selections

       items=findfile('/home/paul/idl/esrg/t*.pro')
       prompt='choose a file to display'
       w2=menuw(items,prompt=prompt,/done)
       k=menuw(w2) 
       while k ne -1 do begin & print,items(k) & k=menuw(w2) & end

       while menuw(w2,k) do print,items(k)
       print,items(k)


  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\menuw.pro)


MENUWS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    menuws

 PURPOSE:    create a multiple value menu widget and return a selections

 USEAGE:     w=menuws(choices,title=title,group=group,$
                     font=font,ysize=ysize)

 INPUT:
  choices    string array containing choices

 KEYWORD INPUT:
  title      title of the widget

  prompt     string array of prompt message. each element of string
             array appears on a new line.

  ysize      the number of lines to show in the list widget.  If the
             number of choices is greater than ysize the list widget
             creates a vertical slider to allow the user to scan all
             selections.  

  font       String specifying font type. If omitted use the default
             fixed width font:
             "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1"


 OUTPUT

  result     the indecies of the selected items.  (-1 if no selections)

 EXAMPLES:


; use MENUWS to make a sequence of menu selections

       f=findfile('/home/paul/idl/esrg/[r-z]*.pro')
       table,f(menuws(f))

 DISCUSSION:
       MENUWS calls MENUW to do the widget setup and selection of
       individual items.  MENUWS keeps track of which items have been
       selected and updates the item labels to graphically indicate
       active selections. When the operator makes a selection by
       clicking with the LMB, the entire selection list is rewritten to
       the menu widget.  Selected items are indicated with an
       asterisk (*) prefix.  Selected items may be de-selected by
       clicking on them again with the LMB.  The list of selected
       items is not locked in until the operator hits the DONE button.

 BUGS:
       Because MENUWS uses WIDGET_CONTROL to update the item list
       there is a problem which only occurs when the the list is long
       and you are selecting something near the bottom of the
       scrolled list.  In this case, when WIDGET_CONTROL re-writes
       the item list the widget display jumps up to the top of the
       list.  This is disturbing but not disasterous: the selection
       is recorded even though you have to scroll back down to see
       it. The only fix I know is to make sure YSIZE is greater than
       or equal to the number of menu items.  Right now YSIZE is 
       defaulted to the min of the number of menu items and 60, which
       is as many items as will fit on my screen when using the
       default font.

  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\menuws.pro)


METH_ADJUST_PLOT_NUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	meth_adjust_plot_number

 PURPOSE:
	This procedure adjusts the plot number of the defined plot structure

 CATEGORY:
	PLOT/PLOT2D

 CALLING SEQUENCE:
   meth_adjust_plot_number,plot

 INPUTS:
	plot: The by pl_init defined structure

 OUTPUTS:
	plot: The by pl_init defined structure

 EXAMPLE:
   meth_adjust_plot_number,plot

 MODIFICATION HISTORY:
 	Written by:	R. Bauer (ICG-1) March, 18, 1998
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\meth_adjust_plot_number.pro)


MFD2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mfd2ncdf

 PURPOSE:
   This procedure translates mfd Files to netCDF

 CATEGORY:
    DATAFILES/FILTER

 CALLING SEQUENCE:
   mfd2ncdf,file=file,[inhalt=inhalt],[/xp]

 INPUTS:
   file: the file name of the mfd_file

 KEYWORD PARAMETERS:
   xp: launch pickfile to choose a file

 OUTPUTS:
   a netCDF File

 OPTIONAL OUTPUTS:
   inhalt: useful for debuging

 EXAMPLE:
   mfd2ncdf,file='test.mfd'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), March 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\mfd2ncdf.pro)


MFD_GET2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mfd_get2

 PURPOSE:
   Reads the old icg-1 data format header into the structure inhalt

 CATEGORY:
   DATAFILES/MFD

  CALLING SEQUENCE:
  mfd_get2, File_op, Keywrd,start_time,End_time,Time_step,Pi,organ,experi,campaign,flightday,lampent,flightnum,[inhalt=inhalt],[file=file],[/xp]

  INPUTS:
  File_op:    the filename

  OPTIONAL INPUTS
  file:  the same as file_op

 KEYWORD PARAMETERS:
   xp:   simple choose a file by pickfile()

 OUTPUTS:
   keywrd:     the short_names
   start_time: the time of the first data point
   end_time:   the time of the last data point
   time_step:  the step in seconds
   Pi:         principal investigator of the dataset
   organ:      the Pi's organisation
   experi:     the name of the experiment
   campaign:   the name of the campaign
   flightday:  the flightday
   lampent:    the lamp which was used by fish
   flightnum:  the flightnumber

 OPTIONAL OUTPUTS:
   inhalt: the structure inhalt

 EXAMPLE:
   mfd_get,file='data.mfd',inhalt=data

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Feb. 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\mfd_get2.pro)


MFD_READ2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mfd_read2

 PURPOSE:
   This procedure reads the data of the old icg-1 mfd data format

 CATEGORY:
   DATAFILES/MFD

 CALLING SEQUENCE:
   mfd_read2,File_op,keywrd,header,data,l_index,label,ames,no_data,missing_v,time,start,gul,form,$
             ,[/XP],[inhalt=inhalt],[file=file],[name=name]

 INPUTS:
   File_op: the file_name of the file
   keywrd:  the short_name of the parameter you want to read

 OPTIONAL INPUTS:
   file:  same as file_op
   name:  same as keywrd

 KEYWORD PARAMETERS:
   xp:   launch pickfile to choose a file

 OUTPUTS:
   header:     the float array field which some header informations
   data:       the data
   l_index:    the last index of the data
   label:      a lable for a plot
   ames:       comments
   no_data:    the no_data indicator
   missing_v:  the missing value
   time:       the time
   start:      the start time
   gul:        the valid index field
   form:       the format specifier of the numbers

 OPTIONAL OUTPUTS:
   inhalt:  the structure INHALT


 EXAMPLE:
   mfd_read2,file='test.mfd',name='HONO2',inhalt=HNO3

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Feb. 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\mfd_read2.pro)


MFINDFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        MFINDFILE

 PURPOSE:
        find all the files that match a given specification.
        On our system, the IDL findfile function does not
        work correctly!!

 CATEGORY:
        System routines

 CALLING SEQUENCE:
        listing = MFINDFILE(filemask)

 INPUTS:
        FILEMASK -> a path and filename specification to look
           for.

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        A string list containing all the files that match the 
        specification.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        Spawns a unix ls -1 command !

 EXAMPLE:
        list = mfindfile('~mgs/terra/chem1d/code/*.f')

        ; returns all fortran files in Martin's chem1d directory.

 MODIFICATION HISTORY:
        mgs, 14 Sep 1998: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\mfindfile.pro)


MGS_LEGEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        MGS_LEGEND

 PURPOSE:
        This procedure adds a legend to a plot. Although I now tend
        to prefer the ESRG library routine legend.pro, there may
        still be applications for this routine, therefore I am not
        considering it obsolete. 
        Note that this routine has been renamed from the original
        legend.pro.

 CATEGORY:
        General Graphics

 CALLING SEQUENCE:
        MGS_LEGEND, [several keywords]

 INPUTS:

 KEYWORD PARAMETERS:
        HALIGN, VALIGN -> horizontal and vertical alignment of legend 
             with respect to plot window. Ranges from 0 to 1, and is 
             interpreted "dynamically": e.g. a value of 0.3 places 30%
             of the box left (below) 0.3*plotwindow size.
             Defaults are 0.98 and 0.03, i.e. the lower right corner.

        WIDTH -> width of the legend box. This parameter is defaulted
             to 40% of the plot area or may be adjusted to hold the
             longest LABEL string if CHARSIZE is given. If WIDTH is
             specified, it is used to determine the CHARSIZE. However,
             if both are given, they are both used and may lead to
             ugly results.

        POSITION -> a four element vector that gives complete control
             over the position of the legend box. Normally, you don't need
             this keyword, but it may be handy in a multi-plot situation
             where you want to place a legend independently of any 
             individual plotting area. It can also be convenient if you
             want to place legends interactively: simply call a rubberband
             program that returns the region coordinates in normalized
             units, and pass this vector to the LEGEND program.

        PLOTPOSITION -> 4 element vector that specifies the plotting area.
             Default is taken from !P.POSITION if set, otherwise 
             [0.2,0.1,0.9,0.9] is used as default. As noted above, sizing
             and positioning of the legend box is with respect to the
             plot position unless POSITION is specified.

        SYMBOL -> a vector (or one integer) containing symbol numbers to
             plot. -1 can be used to skip one entry. These values are
             arguments to the SYM() function. If you like to label plain 
             IDL symbols, use the PSYM keyword instead.
 
        PSYM -> same as symbol, but passes its values directly to psym
             in the plots command, i.e. produces generic IDL symbols.

        SYMSIZE -> symbol size. Normally, this value is adjusted auto-
             matically to match the character size. 
        
        COLOR -> a number or vector of color values for the symbols. 
             One entry is used per symbol. If only one entry is provided,
             all symbols are plotted in the same color. Default is
             the value of !P.color.

        LINE -> a vector with linestyles. Symbols and lines can be used
             together. Entries with -1 are skipped.

        LCOLOR -> color values for the lines. Default is to use the
             same color as for the symbols.

        THICK -> line thickness

        LABEL -> a string array containing the legend text lines. One
             line should correspond to one symbol. If you have a two line
             entry, you can either pas it as two lines or use the '!C'
             carriage return command. In both cases you have to set the 
             SYMBOL and LINE values that correspond to the second line to
             -1 in order to skip the symbol for it. If you use '!C', your
             next LABEL should be blank.

        TEXTCOLOR -> A color value for the label and title output.
             Default is the value of !P.color.

        TITLE -> a title string for the legend. 

        CHARSIZE -> character size for all labelling. Default is to 
             determine the character size automatically so that the largest
             LABEL and TITLE fit into the legend box. On the other hand you
             can specify CHARSIZE and have the legend size itself. 

        SPACING -> spacing between legend lines. Default is 2, lower values
             produce narrower spacing and may be useful for extensive 
             legends. You can set the IDL default line spacing by setting
             SPACING to float(!D.Y_CH_SIZE)/!D.X_CH_SIZE.

        NLINES -> number of lines the legend box shall hold. Normally,
             this value is determined automatically from the maximum number
             of entries in SYMBOL, PSYM, LINE, and LABEL. It may however
             be useful to set NLINES manually if you want to ADD extra
             curve identifiers lateron (see ADD keyword), or if your
             last LABEL is a multi line entry (using the '!C' character).

        FRAME -> draw a frame around the legend box. The value of FRAME
             is equal to the color index that will be used to draw the
             FRAME (hence /FRAME draws a black frame with MYCT).

        BOXCOLOR -> a background fill color for the legend box. Default is
             the value of !P.background.If you specify a negative
             number, no background box is drawn and your legend  
             may interfere with part of the plot.

        ADD -> set this keyword to add one or more entries to an existing 
             legend. All positioning and size keywords are ignored in this
             case, and the new entries are appended at the bottom. You 
             should use the NLINES keyword in the first call to legend in
             order to properly size your legend box, or (if you draw
             no FRAME and have a neutral BOXCOLOR) you can set VALIGN to 
             e.g. 0.98 to start from the top of the plotting area. 
             Technical NOTE: adding entries to an existing legend is 
             most flexible with the use of the LEGSTRU keyword which will
             return a structure with all necessary parameters to continue
             labelling at the next call. It is also accomplished by means 
             of a common block to facilitate its use. In this case, you can
             only continue the legend you last worked on. 

        LEGSTRU -> a named variable that will contain information to
             continue labelling with the /ADD keyword. Needs to be passed
             back into LEGEND if it shall be used. Otherwise, information
             is taken from a common block.

 OUTPUTS:

 SUBROUTINES:
        DRAWLEGSYM : plots a single plot symbol and line.

 REQUIREMENTS:
        LEGEND uses the STR_SIZE function by David Fanning 
        and FORMSTRLEN to determine "true" size of label strings.
        If ADD keyword is used, you also need CHKSTRU.

        A plot must have been produced prior to calling LEGEND

 NOTES:
        A few color statements require MYCT in the present form
        of this program. See definitions of variables Black and
        White at the beginning of the program.

 EXAMPLES:
   ; plot a simple data curve
   plot,findgen(60),sin(findgen(60)*!pi/15.),color=1

   ; simplest call: produces legend at lower right corner
   mgs_legend,symbol=[1,2,3],label=['Curve A','Curve B','Curve C']

   ; place legend at center of x and at top of y, don't draw a
   ; background box, write the labels with charsize 1.2  and size the 
   ; legend box automatically
   mgs_legend,symbol=[4,5,6],label=['Curve D','Curve E','Curve F'], $
          halign=0.5,valign=0.98,boxcolor=-1,charsize=1.2

   ; Draw a legend on a yellow background. It has 6 entries but leaves 
   ; room for 2 more lines which will be filled later. Use different
   ; colors for symbols and lines. Symbols and lines are alternating.
   ; Draw a frame around legend and add a title.
   mgs_legend,symbol=[1,-1,6,-1,2,-1],line=[-1,0,-1,2,-1,3], $
         color=[1,1,2,2,3,3],lcolor=[1,1,2,2,3,3], $
         label=['PEM-West A','model','PEM-West B','model', $
                'TRACE-A','model'],nlines=8,frame=1,boxcolor=5, $
         title='GTE missions',halign=0.1,valign=0.06,charsize=1.2
 
   ; Now add two extra entries to the last legend
   ; (This will use the structure stored in the common block)
   mgs_legend,symbol=[4,-1],line=[-1,4],color=4,lcolor=4, $
          label=['PEM-Tropics A','model'],/ADD

   ; To make use of the more flexible "widget-proof" structure, simply
   ; add legstru=legstru to the last two calls.

   ; produce an inset plot positioned via !p.position and add a legend
   !p.position = [0.6,0.5,0.93,0.93] 
   rectangle,!p.position,xbox,ybox    ; get rectangle coordinates
   polyfill,xbox,ybox,/norm,color=0   ; clear rectangle
   plot,findgen(60),sin(findgen(60)*!pi/15.),color=1,/noerase
   mgs_legend,symbol=[1,2,3],label=['Curve A','Curve B','Curve C']
   !p.position = 0                    ; reset !p.position

   ; The same effect can be reached by passing the position=[..] parameter
   ; to the plot command and the same vector as PLOTPOSITION to mgs_legend.

 MODIFICATION HISTORY:
        mgs, 23 Jun 1998: VERSION 1.00
        mgs, 24 Jun 1998: - now uses !X.Window and !Y.Window to get
               default size of the plotting window (thanks DWF)
        mgs, 25 Jun 1998: - added THICK keyword
        mgs, 27 Oct 1998: - more room for lines
                          - now uses formstrlen instead of strlen
        mgs, 28 Nov 1998: - box width not incremented by 1 if plotmode=0
        mgs, 25 Jun 1999: - added TEXTCOLOR keyword
        mgs, 26 Aug 2000: - changed copyright to open source
                          - changed name to mgs_legend
                          - changed default colors 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\mgs_legend.pro)


MIDV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MIDV
 PURPOSE:
       Return value midway between array extremes.
 CATEGORY:
 CALLING SEQUENCE:
       vmd = midv(a)
 INPUTS:
       a = array.                      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       vmd = (min(a)+max(a))/2.        out
       
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 Aug, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\midv.pro)


MID_CYCLES2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mid_cycles2ncdf

 PURPOSE:
   will translate mid cycle data form the balzers Mass spectrometer into a netCDF File

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   mid_cycles2ncdf,filename,[pi_name=pi_name]

 INPUTS:
   filename: The filename of the ascii file which should be translated

 OPTIONAL INPUTS:
   pi_name: if you are not the PI Fred Stroh please enter your name

 EXAMPLES:
  mid_cycles2ncdf,'cl22.mid'

 MODIFICATION HISTORY:
 	Written by:	R. Bauer , 1998-Sep-22
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\mid_cycles2ncdf.pro)


MINDEX

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  mindex

 PURPOSE:  given a one dimensional index, ii, and a vector, nn, giving the 
           size of each dimension in an array, output the array indices matching
           the values of ii.  See example. 

 USEAGE:   mindex,ii,nn,i1,i2,i3,i4,i5

 INPUT:    
  ii       one dimensional index
  nn       vector array of array dimensions, array with up to 6 dimensions are allowed

 KEYWORD INPUT:

 OUTPUT:
   i1,i2.. array indices 

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        10 Feb 99
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mindex.pro)


MIN_CURVE_SURF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MIN_CURVE_SURF

 PURPOSE:
	Interpolate a regular or irregularly gridded set of points
	with a minimum curvature spline surface.
 CATEGORY:
	Interpolation, Surface Fitting
 CALLING SEQUENCE:
	Result = min_curve_surf(z [, x, y])
 INPUTS:
	X, Y, Z = arrays containing the x, y, and z locations of the
		data points on the surface.  Need not necessarily be
		regularly gridded.  For regularly gridded input data,
		X and Y are not used, the grid spacing is specified
		via the XGRID or XVALUES, and YGRID or YVALUES,
		keywords, and Z must be a two dimensional array.
		For irregular grids, all three parameters must be present
		and have the same number of elements.
 KEYWORD PARAMETERS:
  Input grid description:
	REGULAR = if set, the Z parameter is a two dimensional array,
		of dimensions (N,M), containing measurements over a
		regular grid.  If any of XGRID, YGRID, XVALUES, YVALUES
		are specified, REGULAR is implied.  REGULAR is also
		implied if there is only one parameter, Z.  If REGULAR is
		set, and no grid (_VALUE or _GRID) specifications are present,
		the respective grid is set to (0, 1, 2, ...).
	XGRID = contains a two element array, [xstart, xspacing],
		defining the input grid in the X direction.  Do not specify
		both XGRID and XVALUES.
	XVALUES = if present, Xvalues(i) contains the X location
		of Z(i,j).  Xvalues must be dimensioned with N elements.
	YGRID, YVALUES = same meaning as XGRID, XVALUES except for the
		Y locations of the input points.
  Output grid description:

	GS =  spacing of output grid.
		If present, GS a two-element vector 
	        [XS, YS], where XS is the horizontal spacing between 
        	grid points and YS is the vertical spacing. The 
        	default is based on the extents of X and Y. If the 
        	grid starts at X value Xmin and ends at Xmax, then the 
        	default horizontal spacing is  (Xmax - Xmin)/(NX-1).
	        YS is computed in the same way. The default grid
		size, if neither NX or NY are specified, is 26 by 26.
	BOUNDS = a four element array containing the grid limits in X and
		Y of the output grid:  [ Xmin, Ymin, Xmax, Ymax].
		If not specified, the grid limits are set to the extend
		of X and Y.
	NX = Output grid size in the X direction.  Default = 26, need
		not be specified if the size can be inferred by
		GS and BOUNDS.
	NY = Output grid size in the Y direction.  See NX.
	XOUT = a vector containing the output grid X values.  If this
		parameter is supplied, GS, BOUNDS, and NX are ignored
		for the X output grid.  Use this parameter to specify
		irregular spaced output grids.
	YOUT = a vector containing the output grid in the Y direction.
		If this	parameter is supplied, GS, BOUNDS, and NY are 
		ignored	for the Y output grid.
	XPOUT, YPOUT = arrays containing X and Y values for the output
		points.  With these keywords, the output grid need not
		be regular, and all other output grid parameters are
		ignored.  XPOUT and YPOUT must have the same number of
		points, which is also the number of points returned in
		the result.
 OUTPUTS:
	A two dimensional floating point array containing the interpolated
	surface, sampled at the grid points.
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	Limited by the single precision floating point accuracy of the
	machine.
		SAMPLE EXECUTION TIMES  (measured on a Sun IPX)
	# of input points	# of output points	Seconds
	16			676			0.19
	32			676			0.42
	64			676			1.27
	128			676			4.84
	256			676			24.6
	64			256			1.12
	64			1024			1.50
	64			4096			1.97
	64			16384			3.32

 PROCEDURE:
	A minimum curvature spline surface is fitted to the data points
	described by X,Y, and Z.  The basis function:
		C(x0,x1, y0,y1) = d^2 log(d),
	where d is the distance between (x0,y0), (x1,y1), is used,
	as described by Franke, R., Smooth interpolation of scattered
	data by local thin plate splines: Computers Math With Applic.,
	v.8, no. 4, p. 273-281, 1982.  For N data points, a system of N+3 
	simultaneous equations are solved for the coefficients of the 
	surface.  For any interpolation point, the interpolated value
	is:
	  F(x,y) = b(0) + b(1)*x + b(2)*y + Sum(a(i)*C(X(i),x,Y(i),y))

 EXAMPLE:  IRREGULARLY GRIDDED CASES
	Make a random set of points that lie on a gaussian:
	n = 15		;# random points
	x = RANDOMU(seed, n)
	y = RANDOMU(seed, n)
	z = exp(-2 * ((x-.5)^2 + (y-.5)^2))  ;The gaussian

 get a 26 by 26 grid over the rectangle bounding x and y:
	r = min_curve_surf(z, x, y)	;Get the surface.
 Or: get a surface over the unit square, with spacing of 0.05:
	r = min_curve_surf(z, x, y, GS=[0.05, 0.05], BOUNDS=[0,0,1,1])
 Or: get a 10 by 10 surface over the rectangle bounding x and y:
	r = min_curve_surf(z, x, y, NX=10, NY=10)

		REGULARLY GRIDDED CASES
	z = randomu(seed, 5, 6)		;Make some random data
		interpolate to a 26 x 26 grid:
	CONTOUR, min_curve_surf(z, /REGULAR)

 MODIFICATION HISTORY:
	DMS, RSI, March, 1993.  Written.
	DMS, RSI, July, 1993.   Added XOUT and YOUT.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\min_curve_surf.pro)


MK_HTML_HELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MK_HTML_HELP

 PURPOSE:
	Given a list of IDL procedure files (.PRO), VMS text library 
       files (.TLB), or directories that contain such files, this procedure 
       generates a file in the HTML format that contains the documentation 
       for those routines that contain a DOC_LIBRARY style documentation 
       template.  The output file is compatible with World Wide Web browsers.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	MK_HTML_HELP, Sources, Outfile

 INPUTS:
     Sources:  A string or string array containing the name(s) of the
		.pro or .tlb files (or the names of directories containing 
               such files) for which help is desired.  If a source file is 
               a VMS text library, it must include the .TLB file extension.  
               If a source file is an IDL procedure, it must include the .PRO
               file extension.  All other source files are assumed to be
               directories.
     Outfile:	The name of the output file which will be generated.

 KEYWORDS:
     TITLE:	If present, a string which supplies the name that
		should appear as the Document Title for the help.
     VERBOSE:	Normally, MK_HTML_HELP does its work silently.
		Setting this keyword to a non-zero value causes the procedure
		to issue informational messages that indicate what it
		is currently doing. !QUIET must be 0 for these messages
               to appear.
     STRICT:   If this keyword is set to a non-zero value, MK_HTML_HELP will 
               adhere strictly to the HTML format by scanning the 
               the document headers for characters that are reserved in 
               HTML (<,>,&,").  These are then converted to the appropriate 
               HTML syntax in the output file. By default, this keyword
               is set to zero (to allow for faster processing).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A help file with the name given by the Outfile argument is
	created.

 RESTRICTIONS:
	The following rules must be followed in formatting the .pro
	files that are to be searched.
		(a) The first line of the documentation block contains
		    only the characters ";+", starting in column 1.
               (b) There must be a line which contains the string "NAME:",
                   which is immediately followed by a line containing the
                   name of the procedure or function being described in
                   that documentation block.  If this NAME field is not
                   present, the name of the source file will be used.
		(c) The last line of the documentation block contains
		    only the characters ";-", starting in column 1.
		(d) Every other line in the documentation block contains
		    a ";" in column 1.

       Note that a single .pro file can contain multiple procedures and/or
       functions, each with their own documentation blocks. If it is desired
       to have "invisible" routines in a file, i.e. routines which are only
       for internal use and should not appear in the help file, simply leave
       out the ";+" and ";-" lines in the documentation block for those
       routines.

	No reformatting of the documentation is done.

 MODIFICATION HISTORY:
       July 5, 1995, DD, RSI. Original version.
       July 13, 1995, Mark Rivers, University of Chicago. Added support for
               multiple source directories and multiple documentation
               headers per .pro file.
       July 17, 1995, DD, RSI. Added code to alphabetize the subjects;
               At the end of each description block in the HTML file,
               added a reference to the source .pro file.
       July 18, 1995, DD, RSI. Added STRICT keyword to handle angle brackets.
       July 19, 1995, DD, RSI. Updated STRICT to handle & and ".
               Changed calling sequence to accept .pro filenames, .tlb
               text librarie names, and/or directory names.
               Added code to set default subject to name of file if NAME
               field is not present in the doc header.
       May 22, 1997, D. L. Windt, Bell Labs (windt@bell-labs.com)
               Modified to allow for a blank line between
               the NAME: string and the procedure name in the header.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\mk_html_help.pro)


MK_HTML_HELPARG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MK_HTML_HELPARG

 PURPOSE:
	Given a list of IDL procedure files (.PRO), VMS text library 
       files (.TLB), or directories that contain such files, this procedure 
       generates a file in the HTML format that contains the documentation 
       for those routines that contain a DOC_LIBRARY style documentation 
       template.  The output file is compatible with World Wide Web browsers.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	MK_HTML_HELPARG, Sources, Outfile

 INPUTS:
     Sources:  A string or string array containing the name(s) of the
		.pro or .tlb files (or the names of directories containing 
               such files) for which help is desired.  If a source file is 
               a VMS text library, it must include the .TLB file extension.  
               If a source file is an IDL procedure, it must include the .PRO
               file extension.  All other source files are assumed to be
               directories.
     Outfile:	The name of the output file which will be generated.

 KEYWORDS:
     TITLE:	If present, a string which supplies the name that
		should appear as the Document Title for the help.
     VERBOSE:	Normally, MK_HTML_HELPARG does its work silently.
		Setting this keyword to a non-zero value causes the procedure
		to issue informational messages that indicate what it
		is currently doing. !QUIET must be 0 for these messages
               to appear.
     STRICT:   If this keyword is set to a non-zero value, MK_HTML_HELPARG will 
               adhere strictly to the HTML format by scanning the 
               the document headers for characters that are reserved in 
               HTML (<,>,&,").  These are then converted to the appropriate 
               HTML syntax in the output file. By default, this keyword
               is set to zero (to allow for faster processing).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A help file with the name given by the Outfile argument is
	created.

 RESTRICTIONS:
	The following rules must be followed in formatting the .pro
	files that are to be searched.
		(a) The first line of the documentation block contains
		    only the characters ";+", starting in column 1.
		(aa) The first line of the argument block contains
		    only the characters ";*", starting in column 1.
               (b) In the document block, 
		    there must be a line which contains the string "NAME:",
                   which is immediately followed by a line containing the
                   name of the procedure or function being described in
                   that documentation block.  If this NAME field is not
                   present, the name of the source file will be used.
               (bb) In the argument block, the FIRST line following the ";*"
		    must contains the string "pro ", or "function ", 
                   which is immediately followed by a "word" containing the
                   name of the procedure or function being described in
                   that documentation block.  
		(c) The last line of the documentation block contains
		    only the characters ";-", starting in column 1.
		(cc) The last line of the argument block contains
		    only the characters ";/", starting in column 1.
		(d) Every other line in the documentation block contains
		    a ";" in column 1.
		(dd) Every other line in the argument block contains
		    whatever it wants. Usually, the arguments,
		    keywords and documenting comments. 

       Note that a single .pro file can contain multiple procedures and/or
       functions, each with their own documentation blocks. If it is desired
       to have "invisible" routines in a file, i.e. routines which are only
       for internal use and should not appear in the help file, simply leave
       out the ";+", ";-", ";*", and ";/" lines in the documentation block 
	for those routines.

	No reformatting of the documentation is done.

 MODIFICATION HISTORY:
       July 5, 1995, DD, RSI. Original version.
       July 13, 1995, Mark Rivers, University of Chicago. Added support for
               multiple source directories and multiple documentation
               headers per .pro file.
       July 17, 1995, DD, RSI. Added code to alphabetize the subjects;
               At the end of each description block in the HTML file,
               added a reference to the source .pro file.
       July 18, 1995, DD, RSI. Added STRICT keyword to handle angle brackets.
       July 19, 1995, DD, RSI. Updated STRICT to handle & and ".
               Changed calling sequence to accept .pro filenames, .tlb
               text librarie names, and/or directory names.
               Added code to set default subject to name of file if NAME
               field is not present in the doc header.
 	May 9, 2003. Tanya Riseman, NIST.
 	  copied $Id: MK_HTML_HELP.pro,v 1.18 2002/07/23 17:30:28 scottm Exp $
	  Added searches for ";*" and ";/" around each function, procedure 
	  and method's argument and keyword list. In between, all lines
	  are copied as is.
	  

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\mk_html_helparg.pro)


MODCT

[Previous Routine] [Next Routine] [List of Routines]
 name:
	modct

 purpose:
	modify the image display color tables so the full range 
	runs from one color index to another.

 category:
	image processing, point operations.

 calling sequence:
	modct, ct, low=low, high=high, gamma=gamma, ct=ct,bar=bar

 input:
      ct       color table index.  if not supplied current color table
               is modified.

 keyword inputs:
	low:	starting point of color range interpolation
               as a fraction of the current color table. 
               use keyword clrbar to see current table.
               default=0

	high:	ending point of color range interpolation as
               a fraction of current color table.
               default=1. if high

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\modct.pro)


MODE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MODE

 PURPOSE:
       Return the mode of an array.

 CALLING SEQUENCE:
       mod = mode(x)

 INPUTS:
       array    the array of interest

 OPTIONAL INPUTS:
       binsz    if set, the size of the histogram bins.  Default = 1

 OUTPUTS:
       The value of the array where the maximum number of elements of 
       array are located given the bin size.

 PROCEDURE
       Uses histogram, stolen code from histo.pro

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     11/21/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mode.pro)


MODTRNS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    modtrns

 PURPOSE:    extract transmission from modtran tape8, display transmission
             plots

 USEAGE:     modtrns,buf,archive=archive,file=file,xrange=xrange,$
                     title=title,sort=sort

 KEYWORD INPUT:
   file      input file name (defaults to "tape8")

   archive   archive data set name, if this keyword is present and both 
             FILE and BUF are not set, input is read from specified
             modtran data set which has been previously benn saved
             in machine independent XDL format.  IF either BUF or
             FILE are set, the data in FILE or BUF are written to
             ARCHIVE.


   title     string which specifies title of transmission plot

   xrange    wavelength range (defaults to wavelength range of modtran run)

   sort      if set, plot four most opaque species in order of
             increasing band opacity.  Otherwise order is
             (total,h2o,co2,o3,o2, ch4+n2o+co+no2+so2+nh3+no)

 INPUT/OUTPUT:
   buf       modtran transmission data fltarr(12,*)

              0  wavenumber
              1  H2O
              2  O3
              3  CO2
              4  CO
              5  CH4
              6  N2O
              7  O2
              8  NH3
              9  NO
             10  NO2
             11  SO2
                  
 DISCUSSION

     if none of BUF, FILE and ARCHIVE are specified MODTRNS opens and
     reads /home/paul/idl/esrg/modsaw.xdr

 EXAMPLE:

;;   read default archive file and plot 

    modtrns

;;   read tape8 and make plot

    modtrns,buf,title='Subarctic Winter Atmosphere',file='tape8'

;;   save this run in an XDR archive to expedite data retrievals for
;;   other IDL sessions.  

    modtrns,buf,archive='~/yourdirectory/modsaw.xdr'

;;  retrieve an archived run (this archive file really exists, so try it)

    delvar,buf
    modtrns,buf,archive='/home/paul/idl/esrg/modsaw.xdr'

;;   Here, the ZOOMBAR command is used in a WHILE loop to zoom in on 
;;   a region of interest. Use previously retrieved value of buf to 
;;   quicken plots.  Window 0 is used to show whole wavelength range
;;   while window 2 shows the zoomed in region.

    delvar,buf
    window,2,xs=600,ys=900 & window,0,xs=600,ys=900
    modtrns,buf & xs=!x & r=0
    while zoombar(r,/mess,init=r) do begin &$
      wset,2 & modtrns,buf,xrange=r & !x=xs & wset,0 & end

 REVISIONS:

  author:  Paul Ricchiazzi                            feb95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\modtrns.pro)


MON2STR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MON2STR

 PURPOSE:
       Return a string containing a month's name.

 CALLING SEQUENCE:
       mon_name = mon2str(1)

 INPUTS:
       mon      month desired. NOTE:  mon is 1-based (e.g., January = 1)

 OPTIONAL INPUTS:
       type     string defining type of string desired:
                   undefined:   full string, first letter capitalized
                                e.g., 'December'
                   'short':     abbreviated string, uncapitalized; three
                                letter abbreviations except September
                                e.g., 'dec', 'sept'
                'capshort':     abbreviated string, capitalized; three
                                letter abbreviations e.g., 'Dec', 'Sep'

 OUTPUTS:
       An string is returned.

 EXAMPLE:
      print,mon2str(12)
      December

      print,mon2str(12,'short')
      dec

      print,mon2str(9,'short')
      sept

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/03/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mon2str.pro)


MONTH2NUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	month2number

 PURPOSE:
   This function translates month names to their equivalent numbers, eg. May is 05

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   result=month2number(month_name)

 INPUTS:
	month_name: A string or array of month names

 OUTPUTS:
 The result is a string or array of month numbers

 RESTRICTIONS:
    momentanly only english monthnames are supported

 EXAMPLE:
 PRINT,month2number('May')
  '05'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-Nov-24
   1999-Nov-06 help added
   1999-Dec-14 months in german added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\month2number.pro)


MONTHDAYS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MONTHDAYS
 PURPOSE:
       Given a year and month returns number of days in that month.
 CATEGORY:
 CALLING SEQUENCE:
       days = monthdays(yr,mon)
 INPUTS:
       yr = year (like 1988).                     in
       mon = month number (like 11 = Nov).        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       days = number of days in month (like 30).  out
 COMMON BLOCKS:
 NOTES:
       Notes: If mon is 0 then return array of
       month days for entire year.
 MODIFICATION HISTORY:
       R. Sterner,  14 Aug, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\monthdays.pro)


MONTHNAMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MONTHNAMES
 PURPOSE:
       Returns a string array of month names.
 CATEGORY:
 CALLING SEQUENCE:
       mnam = monthnames()
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       mnam = string array of 13 items:     out
         ['Error','January',...'December']
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Sep, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\monthnames.pro)


MONTHNUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MONTHNUM
 PURPOSE:
       Return month number given name.
 CATEGORY:
 CALLING SEQUENCE:
       num = monthnum(name)
 INPUTS:
       name = month name (at least 3 characters).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       num = month number (Jan=1, Feb=2, ...).     out
         -1 means invalid input month name.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 2

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\monthnum.pro)


MORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MORE
 PURPOSE:
       Display a text array using the MORE method.
 CATEGORY:
 CALLING SEQUENCE:
       more, txtarr
 INPUTS:
       txtarr = string array to display.  in
 KEYWORD PARAMETERS:
       Keywords:
         /NUMBERS display all array elements and index numbers.
         NUMBERS=lo  display numbered array elements starting at
           element number lo.
         NUMBERS=[lo,hi] display requested array elements
           and index numbers.
         FORMAT=fmt  specify format string (def=A).
           Useful for listing numeric arrays, ex:
           more,a,form='f8.3'  or  more,a,form='3x,f8.3'
       LINES=n  Printout will pause after displaying n lines (def=15).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: After n lines output will pause
        until user presses SPACE to continue.
 MODIFICATION HISTORY:
       R. Sterner, 26 Feb, 1992
       Jayant Murthy murthy@pha.jhu.edu 31 Oct 92 --- added FORMAT keyword.
       R. Sterner, 29 Apr, 1993 --- changed for loop to long int.
       R. Sterner, 1994 Nov 29 --- Allowed specified index range.
       R. Sterner, 1998 Jan 15 --- Dropped use of terminal output from filepath.
       Also improved output.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\more.pro)


MOREFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOREFILE
 PURPOSE:
       Display a specified text file using more.
 CATEGORY:
 CALLING SEQUENCE:
       morefile, file
 INPUTS:
       file = full name of text file to display.  in
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  error flag: 0=OK, 1=error.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: useful as an optional user procedure in
         the procedure TXTGETFILE.
 MODIFICATION HISTORY:
       R. Sterner, 21 Jan, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\morefile.pro)


MOVBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOVBOX
 PURPOSE:
       Interactive box on image diaply.
 CATEGORY:
 CALLING SEQUENCE:
       movbox, x, y, dx, dy, code
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         XRANGE=xran Return X range of selected box.
         YRANGE=xran Return Y range of selected box.
           Returned ranges are [0,0] if data coordinates have not
           been established (no plot done yet).
         COLOR=clr,  box color.  -2 for dotted box.
         DXMIN=dxmn  Set minimum allowed x size in pixels.
         DYMIN=dymn  Set minimum allowed y size in pixels.
         /NOERASE prevents last box from being erased on entry.
         /EXITERASE erases box on alternate exit.
         /POSITION lists box position after each change.
           POSITION=n gives screen line for box listing (top=1).
         /YREVERSE means y is 0 at top of screen.
         XFACTOR=xf conversion factor from device coordinates
           to scaled x coordinates.
         YFACTOR=yf conversion factor from device coordinates
           to scaled y coordinates.
         TITLE=txt title for box position listing.
         /EXITLIST lists box position on exit.
         /COMMANDS lists box commands on entry.
         /LOCKSIZE locks box size to entry size.
         XSIZE=factor. Mouse changes Y size only.
           Xsize = factor*Ysize.
         YSIZE=factor. Mouse changes X size only.
           Ysize = factor*Xsize.
         /NOMENU just does an alternate exit for middle button.
         /OPTIONS puts a box on the image that says options.
           If mouse wiggled inside this box options menu pops up.
         X_OPTION=x  device X coordinate for options box (def=0).
         Y_OPTION=y  device Y coordinate for options box (def=0).
 OUTPUTS:
       code = exit code. (2=alternate, 4=normal exit)      out
 COMMON BLOCKS:
 NOTES:
       Notes:
         Commands:
           Left button:   Toggle bewteen move box and change size.
           Middle button: Option menu or alternate exit.
           Right button:  Normal exit (erases box).
         Y reversal and coordinate scaling only apply to
         box position and size listing.  MOVBOX is still called
         and still exits with actual device coordinates.
 MODIFICATION HISTORY:
       R. Sterner 25 July, 1989
       R. Sterner, 6 Jun, 1990 --- added menu.
       R. Sterner, 13 June, 1990 --- added /nomenu
       R. Sterner, Oct, 1991 --- fixed for DOS.
       R. Sterner, 16 Mar, 1992 --- upgraded coordinate listing.
       R. Sterner, 18 Feb, 1993 --- Added b=a(x1:x2,y1:y2) listing.
       R. Sterner,  3 Dec, 1993 --- Added XRANGE and YRANGE keywords.
       R. Sterner,  7 Dec, 1993 --- Added DXMIN, DYMIN keywords.
       R. Sterner, 1994 Nov 27 --- switched !err to !mouse.button.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\movbox.pro)


MOVCROSS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOVCROSS
 PURPOSE:
       Interactive cross-hair on a plot.
 CATEGORY:
 CALLING SEQUENCE:
       movcross, [x, y]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c set color of line.
         LINESTYLE=s line style.
 OUTPUTS:
       x = data X coordinate of cross-hair.      out
       y = data Y coordinate of cross-hair.      out
 COMMON BLOCKS:
 NOTES:
       Note: Works in data coordinates so must make a plot first.
 MODIFICATION HISTORY:
       R. Sterner, 1 Feb, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\movcross.pro)


MOVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOVE
 PURPOSE:
       Graphics move to a point.
 CATEGORY:
 CALLING SEQUENCE:
       move, x, y
 INPUTS:
       x,y = scalar coordinates of point to move to.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       move_com
 NOTES:
       Note: see draw.
 MODIFICATION HISTORY:
       R. Sterner, 22 Jan, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\move.pro)


MOVLABELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOVLABELS
 PURPOSE:
       Interactively position labels and list xyouts statement.
 CATEGORY:
 CALLING SEQUENCE:
       movlabels, x, y, lab
 INPUTS:
       x, y = Array of initial label origin points.   in
       lab = Array of labels to position.             in
 KEYWORD PARAMETERS:
       Keywords:
         INFLAG=iflg Initial label flags: 0=off, 1=on (def=all off).
         X_ORIG=x0, Y_ORIG=y0 Label origin points (def=x,y).
           This is where the origin point returns after label
           is dropped.  Default is entry label position.
         /DATA use data coordinates (def).
         /DEVICE use device coordinates.
         /NORMAL use normalized coordinates.
         RADIUS=r  Click radius (pixels) to pick up a label (def=5).
         CHARSIZE=csz  Array of character sizes.
         FONT=fnt      Array of fonts.
         LX=x2, LY=y2  Output label positions.
         FLAG=flg      Label on/off flag (0=off, 1=on).
 OUTPUTS:
 COMMON BLOCKS:
       movlabels_com
 NOTES:
       Notes: click mouse button for options (right button exits).
         May change text size and angle.
         May list xyouts call to plot text in current position.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Apr 12

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\movlabels.pro)


MOVTXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOVTXT
 PURPOSE:
       Interactively position text and list xyouts statement.
 CATEGORY:
 CALLING SEQUENCE:
       movtxt, txt
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA use data coordinates (def).
         /DEVICE use device coordinates.
         /NORMAL use normalized coordinates.
 OUTPUTS:
 COMMON BLOCKS:
       movtxt_com
 NOTES:
       Notes: click mouse button for options (right button exits).
         May change text size and angle.
         May list xyouts call to plot text in current position.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Nov 1.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\movtxt.pro)


MOYENVERT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MOYENVERT

 PURPOSE:
       Return the an array that is the "vertical" average of a stack of
       arrays.

 CATEGORY:
       Array manipulation.

 CALLING SEQUENCE:
       moyenvert, tab, moy, stdv, nb

 INPUTS:
       tab     the array to be averaged

 OPTIONAL INPUTS:
       quiet   don't print messages
       nodata  use this value when searching for nodata values

 OUTPUTS:
       moy    average of tab through third dimension
       stdv   standard deviation
       nb     number of values used in average at each pixel

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Didier Jourdan     Earth Space Research Group, UCSB  12/03/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\moyenvert.pro)


MPCHILIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPCHILIM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute confidence limits for chi-square statistic

 MAJOR TOPICS:
   Curve and Surface Fitting, Statistics

 CALLING SEQUENCE:
   DELCHI = MPCHILIM(PROB, DOF, [/SIGMA, /CLEVEL, /SLEVEL ])

 DESCRIPTION:

  The function MPCHILIM() computes confidence limits of the
  chi-square statistic for a desired probability level.  The returned
  values, DELCHI, are the limiting chi-squared values: a chi-squared
  value of greater than DELCHI will occur by chance with probability
  PROB:

    P_CHI(CHI > DELCHI; DOF) = PROB

  In specifying the probability level the user has three choices:

    * give the confidence level (default);

    * give the significance level (i.e., 1 - confidence level) and
      pass the /SLEVEL keyword; OR

    * give the "sigma" of the probability (i.e., compute the
      probability based on the normal distribution) and pass the
      /SIGMA keyword.

  Note that /SLEVEL, /CLEVEL and /SIGMA are mutually exclusive.

 INPUTS:

   PROB - scalar or vector number, giving the desired probability
          level as described above.

   DOF - scalar or vector number, giving the number of degrees of
         freedom in the chi-square distribution.

 RETURNS:

  Returns a scalar or vector of chi-square confidence limits.

 KEYWORD PARAMETERS:

   SLEVEL - if set, then PROB describes the significance level.

   CLEVEL - if set, then PROB describes the confidence level
            (default).

   SIGMA - if set, then PROB is the number of "sigma" away from the
           mean in the normal distribution.

 EXAMPLES:

   print, mpchilim(0.99d, 2d, /clevel)

   Print the 99% confidence limit for a chi-squared of 2 degrees of
   freedom.

   print, mpchilim(5d, 2d, /sigma)

   Print the "5 sigma" confidence limit for a chi-squared of 2
   degrees of freedom.  Here "5 sigma" indicates the gaussian
   probability of a 5 sigma event or greater. 
       P_GAUSS(5D) = 1D - 5.7330314e-07

 REFERENCES:

   Algorithms taken from CEPHES special function library, by Stephen
   Moshier. (http://www.netlib.org/cephes/)

 MODIFICATION HISTORY:
   Completed, 1999, CM
   Documented, 16 Nov 2001, CM
   Reduced obtrusiveness of common block and math error handling, 18
     Nov 2001, CM

  $Id: mpchilim.pro,v 1.4 2001/11/18 12:59:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpchilim.pro)


MPCHITEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPCHITEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute the probability of a given chi-squared value

 MAJOR TOPICS:
   Curve and Surface Fitting, Statistics

 CALLING SEQUENCE:
   PROB = MPCHITEST(CHI, DOF, [/SIGMA, /CLEVEL, /SLEVEL ])

 DESCRIPTION:

  The function MPCHITEST() computes the probability for a value drawn
  from the chi-square distribution to equal or exceed the given value
  CHI.  This can be used for confidence testing of a measured value
  obeying the chi-squared distribution.

    P_CHI(X > CHI; DOF) = PROB

  In specifying the returned probability level the user has three
  choices:

    * return the confidence level when the /CLEVEL keyword is passed;
      OR

    * return the significance level (i.e., 1 - confidence level) when
      the /SLEVEL keyword is passed (default); OR

    * return the "sigma" of the probability (i.e., compute the
      probability based on the normal distribution) when the /SIGMA
      keyword is passed.

  Note that /SLEVEL, /CLEVEL and /SIGMA are mutually exclusive.

 INPUTS:

   CHI - chi-squared value to be tested.

   DOF - scalar or vector number, giving the number of degrees of
         freedom in the chi-square distribution.

 RETURNS:

  Returns a scalar or vector of probabilities, as described above,
  and according to the /SLEVEL, /CLEVEL and /SIGMA keywords.

 KEYWORD PARAMETERS:

   SLEVEL - if set, then PROB describes the significance level
            (default).

   CLEVEL - if set, then PROB describes the confidence level.

   SIGMA - if set, then PROB is the number of "sigma" away from the
           mean in the normal distribution.

 EXAMPLES:

   print, mpchitest(1300d,1252d)

   Print the probability for a chi-squared value with 1252 degrees of
   freedom to exceed a value of 1300, as a confidence level.

 REFERENCES:

   Algorithms taken from CEPHES special function library, by Stephen
   Moshier. (http://www.netlib.org/cephes/)

 MODIFICATION HISTORY:
   Completed, 1999, CM
   Documented, 16 Nov 2001, CM
   Reduced obtrusiveness of common block and math error handling, 18
     Nov 2001, CM

  $Id: mpchitest.pro,v 1.5 2001/11/18 12:59:16 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpchitest.pro)


MPCURVEFIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPCURVEFIT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform Levenberg-Marquardt least-squares fit (replaces CURVEFIT)

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   YFIT = MPCURVEFIT(X, Y, WEIGHTS, P, [SIGMA,] FUNCTION_NAME=FUNC, 
                     FUNCTARGS=functargs, ITMAX=itmax, PARINFO=parinfo,
                     FTOL=ftol, XTOL=xtol, GTOL=gtol, 
                     ITERPROC=iterproc, ITERARGS=iterargs,
                     NPRINT=nprint, QUIET=quiet, NOCOVAR=nocovar, 
                     NFEV=nfev, ITER=iter, ERRMSG=errmsg,
                     CHISQ=chisq, COVAR=covar, STATUS=status)

 DESCRIPTION:

  MPCURVEFIT fits a user-supplied model -- in the form of an IDL
  function -- to a set of user-supplied data.  MPCURVEFIT calls
  MPFIT, the MINPACK-1 least-squares minimizer, to do the main
  work.

  Given the data and their uncertainties, MPCURVEFIT finds the best
  set of model parameters which match the data (in a least-squares
  sense) and returns them in the parameter P.  

  MPCURVEFIT returns the best fit function.
  
  The user must supply the following items:
   - An array of independent variable values ("X").
   - An array of "measured" *dependent* variable values ("Y").
   - An array of weighting values ("WEIGHTS").
   - The name of an IDL function which computes Y given X ("FUNC").
   - Starting guesses for all of the parameters ("P").

  There are very few restrictions placed on X, Y or FUNCT.  Simply
  put, FUNCT must map the "X" values into "Y" values given the
  model parameters.  The "X" values may represent any independent
  variable (not just Cartesian X), and indeed may be multidimensional
  themselves.  For example, in the application of image fitting, X
  may be a 2xN array of image positions.

  MPCURVEFIT carefully avoids passing large arrays where possible to
  improve performance.

  See below for an example of usage.
   
 USER FUNCTION

  The user must define a function which returns the model value.  For
  applications which use finite-difference derivatives -- the default
  -- the user function should be declared in the following way:

    PRO MYFUNCT, X, P, YMOD
     ; The independent variable is X
     ; Parameter values are passed in "P"
     YMOD = ... computed model values at X ...
    END

  The returned array YMOD must have the same dimensions and type as
  the "measured" Y values.

  User functions may also indicate a fatal error condition
  using the ERROR_CODE common block variable, as described
  below under the MPFIT_ERROR common block definition.

  See the discussion under "ANALYTIC DERIVATIVES" and AUTODERIVATIVE
  in MPFIT.PRO if you wish to compute the derivatives for yourself.
  AUTODERIVATIVE is accepted and passed directly to MPFIT.  The user
  function must accept one additional parameter, DP, which contains
  the derivative of the user function with respect to each parameter
  at each data point, as described in MPFIT.PRO.

 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of MPFIT can be modified with respect to each
  parameter to be fitted.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to MPFIT.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              MPFIT, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of MPFIT does not use this tag in any
                way.  However, the default ITERPROC will print the
                parameter name if available.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .MPMINSTEP - the minimum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will be changed by multiples of this value.  The
                  actual step is computed as:

                     DELTA1 = MPMINSTEP*ROUND(DELTA0/MPMINSTEP)

                  where DELTA0 and DELTA1 are the estimated parameter
                  changes before and after this constraint is
                  applied.  Note that this constraint should be used
                  with care since it may cause non-converging,
                  oscillating solutions.

                  A value of 0 indicates no minimum.  Default: 0.

     .MPMAXSTEP - the maximum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will never be changed by more than this value.

                  A value of 0 indicates no maximum.  Default: 0.
  
     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]
  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP".
  Therefore programmers are urged to avoid using tags starting with
  the same letters; otherwise they are free to include their own
  fields within the PARINFO structure, and they will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.

 INPUTS:
   FUNCT - a string variable containing the name of an IDL function.
             This function computes the "model" Y values given the
             X values and model parameters, as described above.

   X - Array of independent variable values.

   Y - Array of "measured" dependent variable values.  Y should have
       the same data type as X.  The function FUNCT should map
       X->Y.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Y-FUNCT(X,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Y     - Poisson weighting (counting statistics)
                1D       - Unweighted

   P - An array of starting values for each of the parameters of the
       model.  The number of parameters should be fewer than the
       number of measurements.  Also, the parameters should have the
       same data type as the measurements (double is preferred).

       Upon successful completion the new parameter values are
       returned in P.

       If both START_PARAMS and PARINFO are passed, then the starting
       *value* is taken from START_PARAMS, but the *constraints* are
       taken from PARINFO.
 
   SIGMA - The formal 1-sigma errors in each parameter, computed from
           the covariance matrix.  If a parameter is held fixed, or
           if it touches a boundary, then the error is reported as
           zero.

           If the fit is unweighted (i.e. no errors were given, or
           the weights were uniformly set to unity), then SIGMA will
           probably not represent the true parameter uncertainties.

           *If* you can assume that the true reduced chi-squared
           value is unity -- meaning that the fit is implicitly
           assumed to be of good quality -- then the estimated
           parameter uncertainties can be computed by scaling SIGMA
           by the measured chi-squared value.

              DOF     = N_ELEMENTS(X) - N_ELEMENTS(P) ; deg of freedom
              CSIGMA  = SIGMA * SQRT(CHISQ / DOF)     ; scaled uncertainties

 RETURNS:

   Returns the array containing the best-fitting function.

 KEYWORD PARAMETERS:

   CHISQ - the value of the summed squared residuals for the
           returned parameter values.

   COVAR - the covariance matrix for the set of parameters returned
           by MPFIT.  The matrix is NxN where N is the number of
           parameters.  The square root of the diagonal elements
           gives the formal 1-sigma statistical errors on the
           parameters IF errors were treated "properly" in MYFUNC.
           Parameter errors are also returned in PERROR.

           To compute the correlation matrix, PCOR, use this:
           IDL> PCOR = COV * 0
           IDL> FOR i = 0, n-1 DO FOR j = 0, n-1 DO $
                PCOR(i,j) = COV(i,j)/sqrt(COV(i,i)*COV(j,j))

           If NOCOVAR is set or MPFIT terminated abnormally, then
           COVAR is set to a scalar with value !VALUES.D_NAN.

   ERRMSG - a string error or warning message is returned.

   FTOL - a nonnegative input variable. Termination occurs when both
          the actual and predicted relative reductions in the sum of
          squares are at most FTOL (and STATUS is accordingly set to
          1 or 3).  Therefore, FTOL measures the relative error
          desired in the sum of squares.  Default: 1D-10

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by FUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.

               By default, no extra parameters are passed to the
               user-supplied function.

   GTOL - a nonnegative input variable. Termination occurs when the
          cosine of the angle between fvec and any column of the
          jacobian is at most GTOL in absolute value (and STATUS is
          accordingly set to 4). Therefore, GTOL measures the
          orthogonality desired between the function vector and the
          columns of the jacobian.  Default: 1D-10

   ITER - the number of iterations completed.

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the MPFIT routine.  It should be declared
              in the following way:

              PRO ITERPROC, FUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, ...
                ; perform custom iteration update
              END
         
              ITERPROC must either accept all three keyword
              parameters (FUNCTARGS, PARINFO and QUIET), or at least
              accept them via the _EXTRA keyword.
          
              FUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to FUNCT.  FNORM should be the
              chi-squared value.  QUIET is set when no textual output
              should be printed.  See below for documentation of
              PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value (see
              MPFIT_ERROR common block below).  In principle,
              ITERPROC should probably not modify the parameter
              values, because it may interfere with the algorithm's
              stability.  In practice it is allowed.

              Default: an internal routine is used to print the
                       parameter values.

   ITMAX - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and MPFIT returns.
             Default: 200 iterations

   NFEV - the number of FUNCT function evaluations performed.

   NOCOVAR - set this keyword to prevent the calculation of the
             covariance matrix before returning (see COVAR)

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  Note that
            several Levenberg-Marquardt attempts can be made in a
            single iteration.
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never 
             modified during a call to MPFIT.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   QUIET - set this keyword when no textual output should be printed
           by MPFIT

   STATUS - an integer status code is returned.  All values other
            than zero can represent success.  It can have one of the
            following values:

	   0  improper input parameters.
         
	   1  both actual and predicted relative reductions
	      in the sum of squares are at most FTOL.
         
	   2  relative error between two consecutive iterates
	      is at most XTOL
         
	   3  conditions for STATUS = 1 and STATUS = 2 both hold.
         
	   4  the cosine of the angle between fvec and any
	      column of the jacobian is at most GTOL in
	      absolute value.
         
	   5  the maximum number of iterations has been reached
         
	   6  FTOL is too small. no further reduction in
	      the sum of squares is possible.
         
	   7  XTOL is too small. no further improvement in
	      the approximate solution x is possible.
         
	   8  GTOL is too small. fvec is orthogonal to the
	      columns of the jacobian to machine precision.

   XTOL - a nonnegative input variable. Termination occurs when the
          relative error between two consecutive iterates is at most
          XTOL (and STATUS is accordingly set to 2 or 3).  Therefore,
          XTOL measures the relative error desired in the approximate
          solution.  Default: 1D-10


 EXAMPLE:

   ; First, generate some synthetic data
   npts = 200
   x  = dindgen(npts) * 0.1 - 10.                  ; Independent variable 
   yi = gauss1(x, [2.2D, 1.4, 3000.])              ; "Ideal" Y variable
   y  = yi + randomn(seed, npts) * sqrt(1000. + yi); Measured, w/ noise
   sy = sqrt(1000.D + y)                           ; Poisson errors

   ; Now fit a Gaussian to see how well we can recover
   p0 = [1.D, 1., 1000.]                           ; Initial guess
   yfit = mpcurvefit(x, y, 1/sy^2, p0, $
                   FUNCTION_NAME='GAUSS1P')        ; Fit a function
   print, p

   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then the same function is fitted to the
   data to see how close we can get.  GAUSS1 and GAUSS1P are
   available from the same web page.


 COMMON BLOCKS:

   COMMON MPFIT_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, MPFIT checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  By default the value of ERROR_CODE is
     zero, indicating a successful function/procedure call.

 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:
   Translated from MPFITFUN, 25 Sep 1999, CM
   Alphabetized documented keywords, 02 Oct 1999, CM
   Added QUERY keyword and query checking of MPFIT, 29 Oct 1999, CM
   Check to be sure that X and Y are present, 02 Nov 1999, CM
   Documented SIGMA for unweighted fits, 03 Nov 1999, CM
   Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Propagated improvements from MPFIT, 17 Dec 2000, CM
   Corrected behavior of NODERIVATIVE, 13 May 2002, CM

  $Id: mpcurvefit.pro,v 1.3 2002/05/13 16:17:07 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpcurvefit.pro)


MPFIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFIT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform Levenberg-Marquardt least-squares minimization (MINPACK-1)

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   parms = MPFIT(MYFUNCT, start_parms, FUNCTARGS=fcnargs, NFEV=nfev,
                 MAXITER=maxiter, ERRMSG=errmsg, NPRINT=nprint, QUIET=quiet, 
                 FTOL=ftol, XTOL=xtol, GTOL=gtol, NITER=niter, 
                 STATUS=status, ITERPROC=iterproc, ITERARGS=iterargs,
                 COVAR=covar, PERROR=perror, BESTNORM=bestnorm,
                 PARINFO=parinfo)

 DESCRIPTION:

  MPFIT uses the Levenberg-Marquardt technique to solve the
  least-squares problem.  In its typical use, MPFIT will be used to
  fit a user-supplied function (the "model") to user-supplied data
  points (the "data") by adjusting a set of parameters.  MPFIT is
  based upon MINPACK-1 (LMDIF.F) by More' and collaborators.

  For example, a researcher may think that a set of observed data
  points is best modelled with a Gaussian curve.  A Gaussian curve is
  parameterized by its mean, standard deviation and normalization.
  MPFIT will, within certain constraints, find the set of parameters
  which best fits the data.  The fit is "best" in the least-squares
  sense; that is, the sum of the weighted squared differences between
  the model and data is minimized.

  The Levenberg-Marquardt technique is a particular strategy for
  iteratively searching for the best fit.  This particular
  implementation is drawn from MINPACK-1 (see NETLIB), and seems to
  be more robust than routines provided with IDL.  This version
  allows upper and lower bounding constraints to be placed on each
  parameter, or the parameter can be held fixed.

  The IDL user-supplied function should return an array of weighted
  deviations between model and data.  In a typical scientific problem
  the residuals should be weighted so that each deviate has a
  gaussian sigma of 1.0.  If X represents values of the independent
  variable, Y represents a measurement for each value of X, and ERR
  represents the error in the measurements, then the deviates could
  be calculated as follows:

    DEVIATES = (Y - F(X)) / ERR

  where F is the analytical function representing the model.  You are
  recommended to use the convenience functions MPFITFUN and
  MPFITEXPR, which are driver functions that calculate the deviates
  for you.  If ERR are the 1-sigma uncertainties in Y, then

    TOTAL( DEVIATES^2 ) 

  will be the total chi-squared value.  MPFIT will minimize the
  chi-square value.  The values of X, Y and ERR are passed through
  MPFIT to the user-supplied function via the FUNCTARGS keyword.

  Simple constraints can be placed on parameter values by using the
  PARINFO keyword to MPFIT.  See below for a description of this
  keyword.

  MPFIT does not perform more general optimization tasks.  See TNMIN
  instead.  MPFIT is customized, based on MINPACK-1, to the
  least-squares minimization problem.

 USER FUNCTION

  The user must define a function which returns the appropriate
  values as specified above.  The function should return the weighted
  deviations between the model and the data.  For applications which
  use finite-difference derivatives -- the default -- the user
  function should be declared in the following way:

    FUNCTION MYFUNCT, p, X=x, Y=y, ERR=err
     ; Parameter values are passed in "p"
     model = F(x, p)
     return, (y-model)/err
    END

  See below for applications with analytical derivatives.

  The keyword parameters X, Y, and ERR in the example above are
  suggestive but not required.  Any parameters can be passed to
  MYFUNCT by using the FUNCTARGS keyword to MPFIT.  Use MPFITFUN and
  MPFITEXPR if you need ideas on how to do that.  The function *must*
  accept a parameter list, P.
  
  In general there are no restrictions on the number of dimensions in
  X, Y or ERR.  However the deviates *must* be returned in a
  one-dimensional array, and must have the same type (float or
  double) as the input arrays.

  User functions may also indicate a fatal error condition using the
  ERROR_CODE common block variable, as described below under the
  MPFIT_ERROR common block definition (by setting ERROR_CODE to a
  number between -15 and -1).

 ANALYTIC DERIVATIVES
 
  In the search for the best-fit solution, MPFIT by default
  calculates derivatives numerically via a finite difference
  approximation.  The user-supplied function need not calculate the
  derivatives explicitly.  However, if you desire to compute them
  analytically, then the AUTODERIVATIVE=0 keyword must be passed.  As
  a practical matter, it is often sufficient and even faster to allow
  MPFIT to calculate the derivatives numerically, and so
  AUTODERIVATIVE=0 is not necessary.

  Also, the user function must be declared with one additional
  parameter, as follows:

    FUNCTION MYFUNCT, p, dp, X=x, Y=y, ERR=err
     model = F(x, p)
     
     if n_params() GT 1 then begin
       ; Compute derivatives
       dp = make_array(n_elements(x), n_elements(p), value=x(0)*0)
       for i = 0, n_elements(p)-1 do $
         dp(*,i) = FGRAD(x, p, i)
     endif
    
     return, (y-model)/err
    END

  where FGRAD(x, p, i) is a user function which must compute the
  derivative of the model with respect to parameter P(i) at X.  When
  finite differencing is used for computing derivatives (ie, when
  AUTODERIVATIVE=1), the parameter DP is not passed.  Therefore
  functions can use N_PARAMS() to indicate whether they must compute
  the derivatives or not.

  Derivatives should be returned in the DP array. DP should be an m x
  n array, where m is the number of data points and n is the number
  of parameters.  dp(i,j) is the derivative at the ith point with
  respect to the jth parameter.  
  
  The derivatives with respect to fixed parameters are ignored; zero
  is an appropriate value to insert for those derivatives.  Upon
  input to the user function, DP is set to a vector with the same
  length as P, with a value of 1 for a parameter which is free, and a
  value of zero for a parameter which is fixed (and hence no
  derivative needs to be calculated).  This input vector may be
  overwritten as needed.

  If the data is higher than one dimensional, then the *last*
  dimension should be the parameter dimension.  Example: fitting a
  50x50 image, "dp" should be 50x50xNPAR.
  
 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of MPFIT can be modified with respect to each
  parameter to be fitted.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to MPFIT.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              MPFIT, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of MPFIT does not use this tag in any
                way.  However, the default ITERPROC will print the
                parameter name if available.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.
             This value is superceded by the RELSTEP value.

     .RELSTEP - the *relative* step size to be used in calculating
                the numerical derivatives.  This number is the
                fractional size of the step, compared to the
                parameter value.  This value supercedes the STEP
                setting.  If the parameter is zero, then a default
                step size is chosen.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .MPMAXSTEP - the maximum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will never be changed by more than this value in
                  one iteration.

                  A value of 0 indicates no maximum.  Default: 0.
  
     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]

     .MPPRINT - if set to 1, then the default ITERPROC will print the
                parameter value.  If set to 0, the parameter value
                will not be printed.  This tag can be used to
                selectively print only a few parameter values out of
                many.  Default: 1 (all parameters printed)

  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP".
  Therefore programmers are urged to avoid using tags starting with
  the same letters; otherwise they are free to include their own
  fields within the PARINFO structure, and they will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.


 HARD-TO-COMPUTE FUNCTIONS: "EXTERNAL" EVALUATION

  The normal mode of operation for MPFIT is for the user to pass a
  function name, and MPFIT will call the user function multiple times
  as it iterates toward a solution.

  Some user functions are particularly hard to compute using the
  standard model of MPFIT.  Usually these are functions that depend
  on a large amount of external data, and so it is not feasible, or
  at least highly impractical, to have MPFIT call it.  In those cases
  it may be possible to use the "(EXTERNAL)" evaluation option.

  In this case the user is responsible for making all function *and
  derivative* evaluations.  The function and Jacobian data are passed
  in through the EXTERNAL_FVEC and EXTERNAL_FJAC keywords,
  respectively.  The user indicates the selection of this option by
  specifying a function name (MYFUNCT) of "(EXTERNAL)".  No
  user-function calls are made when EXTERNAL evaluation is being
  used.

  At the end of each iteration, control returns to the user, who must
  reevaluate the function at its new parameter values.  Users should
  check the return value of the STATUS keyword, where a value of 9
  indicates the user should supply more data for the next iteration,
  and re-call MPFIT.  The user may refrain from calling MPFIT
  further; as usual, STATUS will indicate when the solution has
  converged and no more iterations are required.

  Because MPFIT must maintain its own data structures between calls,
  the user must also pass a named variable to the EXTERNAL_STATE
  keyword.  This variable must be maintained by the user, but not
  changed, throughout the fitting process.  When no more iterations
  are desired, the named variable may be discarded.


 INPUTS:
   MYFUNCT - a string variable containing the name of the function to
             be minimized.  The function should return the weighted
             deviations between the model and the data, as described
             above.

             For EXTERNAL evaluation of functions, this parameter
             should be set to a value of "(EXTERNAL)".

   START_PARAMS - An array of starting values for each of the
                  parameters of the model.  The number of parameters
                  should be fewer than the number of measurements.
                  Also, the parameters should have the same data type
                  as the measurements (double is preferred).

                  This parameter is optional if the PARINFO keyword
                  is used (but see PARINFO).  The PARINFO keyword
                  provides a mechanism to fix or constrain individual
                  parameters.  If both START_PARAMS and PARINFO are
                  passed, then the starting *value* is taken from
                  START_PARAMS, but the *constraints* are taken from
                  PARINFO.
 
 RETURNS:

   Returns the array of best-fit parameters.


 KEYWORD PARAMETERS:

   AUTODERIVATIVE - If this is set, derivatives of the function will
                    be computed automatically via a finite
                    differencing procedure.  If not set, then MYFUNCT
                    must provide the (analytical) derivatives.
                    Default: set (=1) 
                    NOTE: to supply your own analytical derivatives,
                      explicitly pass AUTODERIVATIVE=0

   BESTNORM - the value of the summed squared residuals for the
              returned parameter values.

   COVAR - the covariance matrix for the set of parameters returned
           by MPFIT.  The matrix is NxN where N is the number of
           parameters.  The square root of the diagonal elements
           gives the formal 1-sigma statistical errors on the
           parameters IF errors were treated "properly" in MYFUNC.
           Parameter errors are also returned in PERROR.

           To compute the correlation matrix, PCOR, use this example:
           IDL> PCOR = COV * 0
           IDL> FOR i = 0, n-1 DO FOR j = 0, n-1 DO $
                PCOR(i,j) = COV(i,j)/sqrt(COV(i,i)*COV(j,j))

           If NOCOVAR is set or MPFIT terminated abnormally, then
           COVAR is set to a scalar with value !VALUES.D_NAN.

   DOF - number of degrees of freedom, computed as
             DOF = N_ELEMENTS(DEVIATES) - NFREE
         Note that this doesn't account for pegged parameters (see
         NPEGGED).

   ERRMSG - a string error or warning message is returned.

   EXTERNAL_FVEC - upon input, the function values, evaluated at
                   START_PARAMS.  This should be an M-vector, where M
                   is the number of data points.

   EXTERNAL_FJAC - upon input, the Jacobian array of partial
                   derivative values.  This should be a M x N array,
                   where M is the number of data points and N is the
                   number of parameters.  NOTE: that all FIXED or
                   TIED parameters must *not* be included in this
                   array.

   EXTERNAL_STATE - a named variable to store MPFIT-related state
                    information between iterations (used in input and
                    output to MPFIT).  The user must not manipulate
                    or discard this data until the final iteration is
                    performed.

   FASTNORM - set this keyword to select a faster algorithm to
              compute sum-of-square values internally.  For systems
              with large numbers of data points, the standard
              algorithm can become prohibitively slow because it
              cannot be vectorized well.  By setting this keyword,
              MPFIT will run faster, but it will be more prone to
              floating point overflows and underflows.  Thus, setting
              this keyword may sacrifice some stability in the
              fitting process.
              
   FTOL - a nonnegative input variable. Termination occurs when both
          the actual and predicted relative reductions in the sum of
          squares are at most FTOL (and STATUS is accordingly set to
          1 or 3).  Therefore, FTOL measures the relative error
          desired in the sum of squares.  Default: 1D-10

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by MYFUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.

               Consider the following example:
                if FUNCTARGS = { XVAL:[1.D,2,3], YVAL:[1.D,4,9],
                                 ERRVAL:[1.D,1,1] }
                then the user supplied function should be declared
                like this:
                FUNCTION MYFUNCT, P, XVAL=x, YVAL=y, ERRVAL=err

               By default, no extra parameters are passed to the
               user-supplied function, but your function should
               accept *at least* one keyword parameter.  [ This is to
               accomodate a limitation in IDL's _EXTRA
               parameter-passing mechanism. ]

   GTOL - a nonnegative input variable. Termination occurs when the
          cosine of the angle between fvec and any column of the
          jacobian is at most GTOL in absolute value (and STATUS is
          accordingly set to 4). Therefore, GTOL measures the
          orthogonality desired between the function vector and the
          columns of the jacobian.  Default: 1D-10

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the MPFIT routine.  ITERPROC is always
              called in the final iteration.  It should be declared
              in the following way:

              PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, DOF=dof, ...
                ; perform custom iteration update
              END
         
              ITERPROC must either accept all three keyword
              parameters (FUNCTARGS, PARINFO and QUIET), or at least
              accept them via the _EXTRA keyword.
          
              MYFUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to MYFUNCT.  FNORM should be the chi-squared
              value.  QUIET is set when no textual output should be
              printed.  DOF is the number of degrees of freedom,
              normally the number of points less the number of free
              parameters.  See below for documentation of PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value
              between -15 and -1 (see MPFIT_ERROR common block
              below).  In principle, ITERPROC should probably not
              modify the parameter values, because it may interfere
              with the algorithm's stability.  In practice it is
              allowed.

              Default: an internal routine is used to print the
                       parameter values.

   ITERSTOP - Set this keyword if you wish to be able to stop the
              fitting by hitting the predefined ITERKEYSTOP key on
              the keyboard.  This only works if you use the default
              ITERPROC.

   ITERKEYSTOP - A keyboard key which will halt the fit (and if
                 ITERSTOP is set and the default ITERPROC is used).
                 ITERSTOPKEY may either be a one-character string
                 with the desired key, or a scalar integer giving the
                 ASCII code of the desired key.  
                 Default: 7b (control-g)

                 NOTE: the default value of ASCI 7 (control-G) cannot
                 be read in some windowing environments, so you must
                 change to a printable character like 'q'.

   MAXITER - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and MPFIT returns.
             Default: 200 iterations

   NFEV - the number of MYFUNCT function evaluations performed.

   NFREE - the number of free parameters in the fit.  This includes
           parameters which are not FIXED and not TIED, but it does
           include parameters which are pegged at LIMITS.

   NITER - the number of iterations completed.

   NOCOVAR - set this keyword to prevent the calculation of the
             covariance matrix before returning (see COVAR)

   NPEGGED - the number of free parameters which are pegged at a
             LIMIT.

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  Be aware
            that several Levenberg-Marquardt attempts can be made in
            a single iteration.  Also, the ITERPROC is *always*
            called for the final iteration, regardless of the
            iteration number.
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never 
             modified during a call to MPFIT.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   PERROR - The formal 1-sigma errors in each parameter, computed
            from the covariance matrix.  If a parameter is held
            fixed, or if it touches a boundary, then the error is
            reported as zero.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

            *If* you can assume that the true reduced chi-squared
            value is unity -- meaning that the fit is implicitly
            assumed to be of good quality -- then the estimated
            parameter uncertainties can be computed by scaling PERROR
            by the measured chi-squared value.

              DOF     = N_ELEMENTS(X) - N_ELEMENTS(PARMS) ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - set this keyword when no textual output should be printed
           by MPFIT

   RESDAMP - a scalar number, indicating the cut-off value of
             residuals where "damping" will occur.  Residuals with
             magnitudes greater than this number will be replaced by
             their logarithm.  This partially mitigates the so-called
             large residual problem inherent in least-squares solvers
             (as for the test problem CURVI, http://www.maxthis.com/-
             curviex.htm).  A value of 0 indicates no damping.
             Default: 0

             Note: RESDAMP doesn't work with AUTODERIV=0

   STATUS - an integer status code is returned.  All values greater
            than zero can represent success (however STATUS EQ 5 may
            indicate failure to converge).  It can have one of the
            following values:

        -16  a parameter or function value has become infinite or an
             undefined number.  This is usually a consequence of
             numerical overflow in the user's model function, which
             must be avoided.

        -15 to -1 
             these are error codes that either MYFUNCT or ITERPROC
             may return to terminate the fitting process (see
             description of MPFIT_ERROR common below).  If either
             MYFUNCT or ITERPROC set ERROR_CODE to a negative number,
             then that number is returned in STATUS.  Values from -15
             to -1 are reserved for the user functions and will not
             clash with MPFIT.

	   0  improper input parameters.
         
	   1  both actual and predicted relative reductions
	      in the sum of squares are at most FTOL.
         
	   2  relative error between two consecutive iterates
	      is at most XTOL
         
	   3  conditions for STATUS = 1 and STATUS = 2 both hold.
         
	   4  the cosine of the angle between fvec and any
	      column of the jacobian is at most GTOL in
	      absolute value.
         
	   5  the maximum number of iterations has been reached
         
	   6  FTOL is too small. no further reduction in
	      the sum of squares is possible.
         
	   7  XTOL is too small. no further improvement in
	      the approximate solution x is possible.
         
	   8  GTOL is too small. fvec is orthogonal to the
	      columns of the jacobian to machine precision.

          9  A successful single iteration has been completed, and
             the user must supply another "EXTERNAL" evaluation of
             the function and its derivatives.  This status indicator
             is neither an error nor a convergence indicator.

   XTOL - a nonnegative input variable. Termination occurs when the
          relative error between two consecutive iterates is at most
          XTOL (and STATUS is accordingly set to 2 or 3).  Therefore,
          XTOL measures the relative error desired in the approximate
          solution.  Default: 1D-10


 EXAMPLE:

   p0 = [5.7D, 2.2, 500., 1.5, 2000.]
   fa = {X:x, Y:y, ERR:err}
   p = mpfit('MYFUNCT', p0, functargs=fa)

   Minimizes sum of squares of MYFUNCT.  MYFUNCT is called with the X,
   Y, and ERR keyword parameters that are given by FUNCTARGS.  The
   resulting parameter values are returned in p.


 COMMON BLOCKS:

   COMMON MPFIT_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, MPFIT checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  This value is also returned in the
     STATUS keyword: values of -1 through -15 are reserved error
     codes for the user routines.  By default the value of ERROR_CODE
     is zero, indicating a successful function/procedure call.

   COMMON MPFIT_PROFILE
   COMMON MPFIT_MACHAR
   COMMON MPFIT_CONFIG

     These are undocumented common blocks are used internally by
     MPFIT and may change in future implementations.

 THEORY OF OPERATION:

   There are many specific strategies for function minimization.  One
   very popular technique is to use function gradient information to
   realize the local structure of the function.  Near a local minimum
   the function value can be taylor expanded about x0 as follows:

      f(x) = f(x0) + f'(x0) . (x-x0) + (1/2) (x-x0) . f''(x0) . (x-x0)
             -----   ---------------   -------------------------------  (1)
     Order    0th          1st                      2nd

   Here f'(x) is the gradient vector of f at x, and f''(x) is the
   Hessian matrix of second derivatives of f at x.  The vector x is
   the set of function parameters, not the measured data vector.  One
   can find the minimum of f, f(xm) using Newton's method, and
   arrives at the following linear equation:

      f''(x0) . (xm-x0) = - f'(x0)                            (2)

   If an inverse can be found for f''(x0) then one can solve for
   (xm-x0), the step vector from the current position x0 to the new
   projected minimum.  Here the problem has been linearized (ie, the
   gradient information is known to first order).  f''(x0) is
   symmetric n x n matrix, and should be positive definite.

   The Levenberg - Marquardt technique is a variation on this theme.
   It adds an additional diagonal term to the equation which may aid the
   convergence properties:

      (f''(x0) + nu I) . (xm-x0) = -f'(x0)                  (2a)

   where I is the identity matrix.  When nu is large, the overall
   matrix is diagonally dominant, and the iterations follow steepest
   descent.  When nu is small, the iterations are quadratically
   convergent.

   In principle, if f''(x0) and f'(x0) are known then xm-x0 can be
   determined.  However the Hessian matrix is often difficult or
   impossible to compute.  The gradient f'(x0) may be easier to
   compute, if even by finite difference techniques.  So-called
   quasi-Newton techniques attempt to successively estimate f''(x0)
   by building up gradient information as the iterations proceed.

   In the least squares problem there are further simplifications
   which assist in solving eqn (2).  The function to be minimized is
   a sum of squares:

       f = Sum(hi^2)                                         (3)

   where hi is the ith residual out of m residuals as described
   above.  This can be substituted back into eqn (2) after computing
   the derivatives:

       f'  = 2 Sum(hi  hi')     
       f'' = 2 Sum(hi' hj') + 2 Sum(hi hi'')                (4)

   If one assumes that the parameters are already close enough to a
   minimum, then one typically finds that the second term in f'' is
   negligible [or, in any case, is too difficult to compute].  Thus,
   equation (2) can be solved, at least approximately, using only
   gradient information.

   In matrix notation, the combination of eqns (2) and (4) becomes:

        hT' . h' . dx = - hT' . h                          (5)

   Where h is the residual vector (length m), hT is its transpose, h'
   is the Jacobian matrix (dimensions n x m), and dx is (xm-x0).  The
   user function supplies the residual vector h, and in some cases h'
   when it is not found by finite differences (see MPFIT_FDJAC2,
   which finds h and hT').  Even if dx is not the best absolute step
   to take, it does provide a good estimate of the best *direction*,
   so often a line minimization will occur along the dx vector
   direction.

   The method of solution employed by MINPACK is to form the Q . R
   factorization of h', where Q is an orthogonal matrix such that QT .
   Q = I, and R is upper right triangular.  Using h' = Q . R and the
   ortogonality of Q, eqn (5) becomes

        (RT . QT) . (Q . R) . dx = - (RT . QT) . h
                     RT . R . dx = - RT . QT . h         (6)
                          R . dx = - QT . h

   where the last statement follows because R is upper triangular.
   Here, R, QT and h are known so this is a matter of solving for dx.
   The routine MPFIT_QRFAC provides the QR factorization of h, with
   pivoting, and MPFIT_QRSOLV provides the solution for dx.
   
 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.
   More', Jorge J., "The Levenberg-Marquardt Algorithm:
     Implementation and Theory," in *Numerical Analysis*, ed. Watson,
     G. A., Lecture Notes in Mathematics 630, Springer-Verlag, 1977.

 MODIFICATION HISTORY:
   Translated from MINPACK-1 in FORTRAN, Apr-Jul 1998, CM
   Fixed bug in parameter limits (x vs xnew), 04 Aug 1998, CM
   Added PERROR keyword, 04 Aug 1998, CM
   Added COVAR keyword, 20 Aug 1998, CM
   Added NITER output keyword, 05 Oct 1998
      D.L Windt, Bell Labs, windt@bell-labs.com;
   Made each PARINFO component optional, 05 Oct 1998 CM
   Analytical derivatives allowed via AUTODERIVATIVE keyword, 09 Nov 1998
   Parameter values can be tied to others, 09 Nov 1998
   Fixed small bugs (Wayne Landsman), 24 Nov 1998
   Added better exception error reporting, 24 Nov 1998 CM
   Cosmetic documentation changes, 02 Jan 1999 CM
   Changed definition of ITERPROC to be consistent with TNMIN, 19 Jan 1999 CM
   Fixed bug when AUTDERIVATIVE=0.  Incorrect sign, 02 Feb 1999 CM
   Added keyboard stop to MPFIT_DEFITER, 28 Feb 1999 CM
   Cosmetic documentation changes, 14 May 1999 CM
   IDL optimizations for speed & FASTNORM keyword, 15 May 1999 CM
   Tried a faster version of mpfit_enorm, 30 May 1999 CM
   Changed web address to cow.physics.wisc.edu, 14 Jun 1999 CM
   Found malformation of FDJAC in MPFIT for 1 parm, 03 Aug 1999 CM
   Factored out user-function call into MPFIT_CALL.  It is possible,
     but currently disabled, to call procedures.  The calling format
     is similar to CURVEFIT, 25 Sep 1999, CM
   Slightly changed mpfit_tie to be less intrusive, 25 Sep 1999, CM
   Fixed some bugs associated with tied parameters in mpfit_fdjac, 25
     Sep 1999, CM
   Reordered documentation; now alphabetical, 02 Oct 1999, CM
   Added QUERY keyword for more robust error detection in drivers, 29
     Oct 1999, CM
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Split out MPFIT_RESETPROF to aid in profiling, 03 Nov 1999, CM
   Some profiling and speed optimization, 03 Nov 1999, CM
     Worst offenders, in order: fdjac2, qrfac, qrsolv, enorm.
     fdjac2 depends on user function, qrfac and enorm seem to be
     fully optimized.  qrsolv probably could be tweaked a little, but
     is still <10% of total compute time.
   Made sure that !err was set to 0 in MPFIT_DEFITER, 10 Jan 2000, CM
   Fixed small inconsistency in setting of QANYLIM, 28 Jan 2000, CM
   Added PARINFO field RELSTEP, 28 Jan 2000, CM
   Converted to MPFIT_ERROR common block for indicating error
     conditions, 28 Jan 2000, CM
   Corrected scope of MPFIT_ERROR common block, CM, 07 Mar 2000
   Minor speed improvement in MPFIT_ENORM, CM 26 Mar 2000
   Corrected case where ITERPROC changed parameter values and
     parameter values were TIED, CM 26 Mar 2000
   Changed MPFIT_CALL to modify NFEV automatically, and to support
     user procedures more, CM 26 Mar 2000
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Catch zero value of zero a(j,lj) in MPFIT_QRFAC, 20 Jul 2000, CM
      (thanks to David Schlegel )
   MPFIT_SETMACHAR is called only once at init; only one common block
     is created (MPFIT_MACHAR); it is now a structure; removed almost
     all CHECK_MATH calls for compatibility with IDL5 and !EXCEPT;
     profiling data is now in a structure too; noted some
     mathematical discrepancies in Linux IDL5.0, 17 Nov 2000, CM
   Some significant changes.  New PARINFO fields: MPSIDE, MPMINSTEP,
     MPMAXSTEP.  Improved documentation.  Now PTIED constraints are
     maintained in the MPCONFIG common block.  A new procedure to
     parse PARINFO fields.  FDJAC2 now computes a larger variety of
     one-sided and two-sided finite difference derivatives.  NFEV is
     stored in the MPCONFIG common now.  17 Dec 2000, CM
   Added check that PARINFO and XALL have same size, 29 Dec 2000 CM
   Don't call function in TERMINATE when there is an error, 05 Jan
     2000
   Check for float vs. double discrepancies; corrected implementation
     of MIN/MAXSTEP, which I still am not sure of, but now at least
     the correct behavior occurs *without* it, CM 08 Jan 2001
   Added SCALE_FCN keyword, to allow for scaling, as for the CASH
     statistic; added documentation about the theory of operation,
     and under the QR factorization; slowly I'm beginning to
     understand the bowels of this algorithm, CM 10 Jan 2001
   Remove MPMINSTEP field of PARINFO, for now at least, CM 11 Jan
     2001
   Added RESDAMP keyword, CM, 14 Jan 2001
   Tried to improve the DAMP handling a little, CM, 13 Mar 2001
   Corrected .PARNAME behavior in _DEFITER, CM, 19 Mar 2001
   Added checks for parameter and function overflow; a new STATUS
     value to reflect this; STATUS values of -15 to -1 are reserved
     for user function errors, CM, 03 Apr 2001
   DAMP keyword is now a TANH, CM, 03 Apr 2001
   Added more error checking of float vs. double, CM, 07 Apr 2001
   Fixed bug in handling of parameter lower limits; moved overflow
     checking to end of loop, CM, 20 Apr 2001
   Failure using GOTO, TERMINATE more graceful if FNORM1 not defined,
     CM, 13 Aug 2001
   Add MPPRINT tag to PARINFO, CM, 19 Nov 2001
   Add DOF keyword to DEFITER procedure, and print degrees of
     freedom, CM, 28 Nov 2001
   Add check to be sure MYFUNCT is a scalar string, CM, 14 Jan 2002
   Addition of EXTERNAL_FJAC, EXTERNAL_FVEC keywords; ability to save
     fitter's state from one call to the next; allow '(EXTERNAL)'
     function name, which implies that user will supply function and
     Jacobian at each iteration, CM, 10 Mar 2002
   Documented EXTERNAL evaluation code, CM, 10 Mar 2002
   Corrected signficant bug in the way that the STEP parameter, and
     FIXED parameters interacted (Thanks Andrew Steffl), CM, 02 Apr
     2002
   Allow COVAR and PERROR keywords to be computed, even in case of
     '(EXTERNAL)' function, 26 May 2002
   Add NFREE and NPEGGED keywords; compute NPEGGED; compute DOF using
     NFREE instead of n_elements(X), thanks to Kristian Kjaer, CM 11
     Sep 2002
   Hopefully PERROR is all positive now, CM 13 Sep 2002
   Documented RELSTEP field of PARINFO (!!), CM, 25 Oct 2002
   Error checking to detect missing start pars, CM 12 Apr 2003
   Add DOF keyword to return degrees of freedom, CM, 30 June 2003
   Always call ITERPROC in the final iteration; add ITERKEYSTOP
     keyword, CM, 30 June 2003

  $Id: mpfit.pro,v 1.28 2003/07/01 00:36:38 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfit.pro)


MPFIT2DFUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFIT2DFUN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform Levenberg-Marquardt least-squares fit to a 2-D IDL function

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   parms = MPFIT2DFUN(MYFUNCT, X, Y, Z, ERR, start_parms, ...)

 DESCRIPTION:

  MPFIT2DFUN fits a user-supplied model -- in the form of an IDL
  function -- to a set of user-supplied data.  MPFIT2DFUN calls
  MPFIT, the MINPACK-1 least-squares minimizer, to do the main
  work.  MPFIT2DFUN is a specialized version for two-dimensional 
  data.

  Given the data and their uncertainties, MPFIT2DFUN finds the best set
  of model parameters which match the data (in a least-squares
  sense) and returns them in an array.
  
  The user must supply the following items:
   - Two arrays of independent variable values ("X", "Y").
   - An array of "measured" *dependent* variable values ("Z").
   - An array of "measured" 1-sigma uncertainty values ("ERR").
   - The name of an IDL function which computes Z given (X,Y) ("MYFUNCT").
   - Starting guesses for all of the parameters ("START_PARAMS").

  There are very few restrictions placed on X, Y, Z, or MYFUNCT.
  Simply put, MYFUNCT must map the (X,Y) values into Z values given
  the model parameters.  The (X,Y) values are usually the independent
  X and Y coordinate positions in the two dimensional plane, but need
  not be.

  MPFIT2DFUN carefully avoids passing large arrays where possible to
  improve performance.

  See below for an example of usage.
   
 USER FUNCTION

  The user must define a function which returns the model value.  For
  applications which use finite-difference derivatives -- the default
  -- the user function should be declared in the following way:

    FUNCTION MYFUNCT, X, Y, P
     ; The independent variables are X and Y
     ; Parameter values are passed in "P"
     ZMOD = ... computed model values at (X,Y) ...
     return, ZMOD
    END

  The returned array YMOD must have the same dimensions and type as
  the "measured" Z values.

  User functions may also indicate a fatal error condition
  using the ERROR_CODE common block variable, as described
  below under the MPFIT_ERROR common block definition.

  See the discussion under "ANALYTIC DERIVATIVES" and AUTODERIVATIVE
  in MPFIT.PRO if you wish to compute the derivatives for yourself.
  AUTODERIVATIVE is accepted and passed directly to MPFIT.  The user
  function must accept one additional parameter, DP, which contains
  the derivative of the user function with respect to each parameter
  at each data point, as described in MPFIT.PRO.

 CREATING APPROPRIATELY DIMENSIONED INDEPENDENT VARIABLES

  The user must supply appropriate independent variables to
  MPFIT2DFUN.  For image fitting applications, this variable should
  be two-dimensional *arrays* describing the X and Y positions of
  every *pixel*.  [ Thus any two dimensional sampling is permitted,
  including irregular sampling. ]
  
  If the sampling is regular, then the x coordinates are the same for
  each row, and the y coordinates are the same for each column.  Call
  the x-row and y-column coordinates XR and YC respectively.  You can
  then compute X and Y as follows:
  
      X = XR # (YC*0 + 1)             eqn. 1
      Y = (XR*0 + 1) # YC             eqn. 2
  
  For example, if XR and YC have the following values:
  
    XR = [  1, 2, 3, 4, 5,]  ;; X positions of one row of pixels
    YC = [ 15,16,17 ]        ;; Y positions of one column of
                                pixels
  
  Then using equations 1 and 2 above will give these values to X and
  Y:
  
     X :  1  2  3  4  5       ;; X positions of all pixels
          1  2  3  4  5
          1  2  3  4  5
  
     Y : 15 15 15 15 15       ;; Y positions of all pixels
         16 16 16 16 16
         17 17 17 17 17
  
  Using the above technique is suggested, but *not* required.  You
  can do anything you wish with the X and Y values.  This technique
  only makes it easier to compute your model function values.

 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of MPFIT can be modified with respect to each
  parameter to be fitted.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to MPFIT.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              MPFIT, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of MPFIT does not use this tag in any
                way.  However, the default ITERPROC will print the
                parameter name if available.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .MPMINSTEP - the minimum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will be changed by multiples of this value.  The
                  actual step is computed as:

                     DELTA1 = MPMINSTEP*ROUND(DELTA0/MPMINSTEP)

                  where DELTA0 and DELTA1 are the estimated parameter
                  changes before and after this constraint is
                  applied.  Note that this constraint should be used
                  with care since it may cause non-converging,
                  oscillating solutions.

                  A value of 0 indicates no minimum.  Default: 0.

     .MPMAXSTEP - the maximum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will never be changed by more than this value.

                  A value of 0 indicates no maximum.  Default: 0.
  
     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]
  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP".
  Therefore programmers are urged to avoid using tags starting with
  the same letters; otherwise they are free to include their own
  fields within the PARINFO structure, and they will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.

 INPUTS:
   MYFUNCT - a string variable containing the name of an IDL
             function.  This function computes the "model" Z values
             given the X,Y values and model parameters, as described above.

   X - Array of "X" independent variable values, as described above.
       These values are passed directly to the fitting function
       unmodified.

   Y - Array of "Y" independent variable values, as described
       above. X and Y should have the same data type.

   Z - Array of "measured" dependent variable values.  Z should have
       the same data type as X and Y.  The function MYFUNCT should
       map (X,Y)->Z.

   ERR - Array of "measured" 1-sigma uncertainties.  ERR should have
         the same data type as Z.  ERR is ignored if the WEIGHTS
         keyword is specified.

   START_PARAMS - An array of starting values for each of the
                  parameters of the model.  The number of parameters
                  should be fewer than the number of measurements.
                  Also, the parameters should have the same data type
                  as the measurements (double is preferred).

                  This parameter is optional if the PARINFO keyword
                  is used (see MPFIT).  The PARINFO keyword provides
                  a mechanism to fix or constrain individual
                  parameters.  If both START_PARAMS and PARINFO are
                  passed, then the starting *value* is taken from
                  START_PARAMS, but the *constraints* are taken from
                  PARINFO.
 
 RETURNS:

   Returns the array of best-fit parameters.

 KEYWORD PARAMETERS:

   BESTNORM - the value of the summed squared residuals for the
              returned parameter values.

   COVAR - the covariance matrix for the set of parameters returned
           by MPFIT.  The matrix is NxN where N is the number of
           parameters.  The square root of the diagonal elements
           gives the formal 1-sigma statistical errors on the
           parameters IF errors were treated "properly" in MYFUNC.
           Parameter errors are also returned in PERROR.

           To compute the correlation matrix, PCOR, use this:
           IDL> PCOR = COV * 0
           IDL> FOR i = 0, n-1 DO FOR j = 0, n-1 DO $
                PCOR(i,j) = COV(i,j)/sqrt(COV(i,i)*COV(j,j))

           If NOCOVAR is set or MPFIT terminated abnormally, then
           COVAR is set to a scalar with value !VALUES.D_NAN.

   ERRMSG - a string error or warning message is returned.

   FTOL - a nonnegative input variable. Termination occurs when both
          the actual and predicted relative reductions in the sum of
          squares are at most FTOL (and STATUS is accordingly set to
          1 or 3).  Therefore, FTOL measures the relative error
          desired in the sum of squares.  Default: 1D-10

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by MYFUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.

               By default, no extra parameters are passed to the
               user-supplied function.

   GTOL - a nonnegative input variable. Termination occurs when the
          cosine of the angle between fvec and any column of the
          jacobian is at most GTOL in absolute value (and STATUS is
          accordingly set to 4). Therefore, GTOL measures the
          orthogonality desired between the function vector and the
          columns of the jacobian.  Default: 1D-10

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the MPFIT routine.  It should be declared
              in the following way:

              PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, ...
                ; perform custom iteration update
              END
         
              ITERPROC must either accept all three keyword
              parameters (FUNCTARGS, PARINFO and QUIET), or at least
              accept them via the _EXTRA keyword.
          
              MYFUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to MYFUNCT.  FNORM should be the
              chi-squared value.  QUIET is set when no textual output
              should be printed.  See below for documentation of
              PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value (see
              MPFIT_ERROR common block below).  In principle,
              ITERPROC should probably not modify the parameter
              values, because it may interfere with the algorithm's
              stability.  In practice it is allowed.

              Default: an internal routine is used to print the
                       parameter values.

   MAXITER - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and MPFIT returns.
             Default: 200 iterations

   NFEV - the number of MYFUNCT function evaluations performed.

   NITER - the number of iterations completed.

   NOCOVAR - set this keyword to prevent the calculation of the
             covariance matrix before returning (see COVAR)

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  Note that
            several Levenberg-Marquardt attempts can be made in a
            single iteration.
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never 
             modified during a call to MPFIT.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   PERROR - The formal 1-sigma errors in each parameter, computed
            from the covariance matrix.  If a parameter is held
            fixed, or if it touches a boundary, then the error is
            reported as zero.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  *If* you can assume that the true reduced
            chi-squared value is unity -- meaning that the fit is
            implicitly assumed to be of good quality -- then the
            estimated parameter uncertainties can be computed by
            scaling PERROR by the measured chi-squared value.

              DOF     = N_ELEMENTS(Z) - N_ELEMENTS(PARMS) ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - set this keyword when no textual output should be printed
           by MPFIT

   STATUS - an integer status code is returned.  All values other
            than zero can represent success.  It can have one of the
            following values:

	   0  improper input parameters.
         
	   1  both actual and predicted relative reductions
	      in the sum of squares are at most FTOL.
         
	   2  relative error between two consecutive iterates
	      is at most XTOL
         
	   3  conditions for STATUS = 1 and STATUS = 2 both hold.
         
	   4  the cosine of the angle between fvec and any
	      column of the jacobian is at most GTOL in
	      absolute value.
         
	   5  the maximum number of iterations has been reached
         
	   6  FTOL is too small. no further reduction in
	      the sum of squares is possible.
         
	   7  XTOL is too small. no further improvement in
	      the approximate solution x is possible.
         
	   8  GTOL is too small. fvec is orthogonal to the
	      columns of the jacobian to machine precision.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Z-MYFUNCT(X,Y,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Z     - Poisson weighting (counting statistics)
                1D       - Unweighted

   XTOL - a nonnegative input variable. Termination occurs when the
          relative error between two consecutive iterates is at most
          XTOL (and STATUS is accordingly set to 2 or 3).  Therefore,
          XTOL measures the relative error desired in the approximate
          solution.  Default: 1D-10

   YFIT - the best-fit model function, as returned by MYFUNCT.

 EXAMPLE:

   p  = [2.2D, -0.7D, 1.4D, 3000.D]
   x  = (dindgen(200)*0.1 - 10.) # (dblarr(200) + 1)
   y  = (dblarr(200) + 1) # (dindgen(200)*0.1 - 10.)
   zi = gauss2(x, y, p)
   sz = sqrt(zi)
   z  = zi + randomn(seed, 200, 200) * sz

   p0 = [0D, 0D, 1D, 10D]
   p = mpfit2dfun('GAUSS2', x, y, z, sz, p0)
   
   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then the same function (but different
   starting parameters) is fitted to the data to see how close we can
   get.

   It is especially worthy to notice that the X and Y values are
   created as full images, so that a coordinate is attached to each
   pixel independently.  This is the format that GAUSS2 accepts, and
   the easiest for you to use in your own functions.


 COMMON BLOCKS:

   COMMON MPFIT_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, MPFIT checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  By default the value of ERROR_CODE is
     zero, indicating a successful function/procedure call.


 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:
   Written, transformed from MPFITFUN, 26 Sep 1999, CM
   Alphabetized documented keywords, 02 Oct 1999, CM
   Added example, 02 Oct 1999, CM
   Tried to clarify definitions of X and Y, 29 Oct 1999, CM
   Added QUERY keyword and query checking of MPFIT, 29 Oct 1999, CM
   Check to be sure that X, Y and Z are present, 02 Nov 1999, CM
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Propagated improvements from MPFIT, 17 Dec 2000, CM

  $Id: mpfit2dfun.pro,v 1.2 2000/12/18 07:00:15 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfit2dfun.pro)


MPFIT2DPEAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFIT2DPEAK

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Fit a gaussian, lorentzian or Moffat model to data

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   yfit = MPFIT2DPEAK(Z, A [, X, Y, /TILT ...] )

 DESCRIPTION:

   MPFIT2DPEAK fits a gaussian, lorentzian or Moffat model using the
   non-linear least squares fitter MPFIT.  MPFIT2DPEAK is meant to be
   a drop-in replacement for IDL's GAUSS2DFIT function (and requires
   MPFIT and MPFIT2DFUN).

   The choice of the fitting function is determined by the keywords
   GAUSSIAN, LORENTZIAN and MOFFAT.  By default the gaussian model
   function is used.  [ The Moffat function is a modified Lorentzian
   with variable power law index. ]  The two-dimensional peak has
   independent semimajor and semiminor axes, with an optional
   rotation term activated by setting the TILT keyword.  The baseline
   is assumed to be a constant.

      GAUSSIAN      A(0) + A(1)*exp(-0.5*u)
      LORENTZIAN    A(0) + A(1)/(u + 1)
      MOFFAT        A(0) + A(1)/(u + 1)^A(7)

      u = ( (x-A(4))/A(2) )^2 + ( (y-A(5))/A(3) )^2

         where x and y are cartesian coordinates in rotated
         coordinate system if TILT keyword is set.

   The returned parameter array elements have the following meanings:

      A(0)   Constant baseline level
      A(1)   Peak value
      A(2)   Peak half-width (x) -- gaussian sigma or half-width at half-max
      A(3)   Peak half-width (y) -- gaussian sigma or half-width at half-max
      A(4)   Peak centroid (x)
      A(5)   Peak centroid (y)
      A(6)   Rotation angle (radians) if TILT keyword set
      A(7)   Moffat power law index if MOFFAT keyword set

   By default the initial starting values for the parameters A are
   estimated from the data.  However, explicit starting values can be
   supplied using the ESTIMATES keyword.  Also, error or weighting
   values can optionally be provided; otherwise the fit is
   unweighted.

 RESTRICTIONS:

   If no starting parameter ESTIMATES are provided, then MPFIT2DPEAK
   attempts to estimate them from the data.  This is not a perfect
   science; however, the author believes that the technique
   implemented here is more robust than the one used in IDL's
   GAUSS2DFIT.  The author has tested cases of strong peaks, noisy
   peaks and broad peaks, all with success.


 INPUTS:

   Z - Two dimensional array of "measured" dependent variable values.
       Z should be of the same type and dimension as (X # Y).

   X - Optional vector of x positions for a single row of Z.

          X(i) should provide the x position of Z(i,*)

       Default: X values are integer increments from 0 to NX-1

   Y - Optional vector of y positions for a single column of Z.

          Y(j) should provide the j position of Z(*,j)

       Default: Y values are integer increments from 0 to NY-1

 OUTPUTS:
   A - Upon return, an array of best fit parameter values.  See the
       table above for the meanings of each parameter element.


 RETURNS:

   Returns the best fitting model function as a 2D array.

 KEYWORDS:

   ** NOTE ** Additional keywords such as PARINFO, BESTNORM, and
              STATUS are accepted by MPFIT2DPEAK but not documented
              here.  Please see the documentation for MPFIT for the
              description of these advanced options.

   ERROR - upon input, the measured 1-sigma uncertainties in the "Z"
           values.  If no ERROR or WEIGHTS are given, then the fit is
           unweighted.

   ESTIMATES - Array of starting values for each parameter of the
               model.
               Default: parameter values are estimated from data.

   GAUSSIAN - if set, fit a gaussian model function.  The Default.
   LORENTZIAN - if set, fit a lorentzian model function.
   MOFFAT - if set, fit a Moffat model function.

   NEGATIVE - if set, and ESTIMATES is not provided, then MPFIT2DPEAK
              will assume that a negative peak is present -- a
              valley.  Specifying this keyword is not normally
              required, since MPFIT2DPEAK can determine this
              automatically.

   PERROR - upon return, the 1-sigma uncertainties of the parameter
            values A.  These values are only meaningful if the ERRORS
            or WEIGHTS keywords are specified properly.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

            *If* you can assume that the true reduced chi-squared
            value is unity -- meaning that the fit is implicitly
            assumed to be of good quality -- then the estimated
            parameter uncertainties can be computed by scaling PERROR
            by the measured chi-squared value.

              DOF     = N_ELEMENTS(Z) - N_ELEMENTS(A)   ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - if set then diagnostic fitting messages are suppressed.
           Default: QUIET=1 (i.e., no diagnostics)

   CIRCULAR - if set, then the peak profile is assumed to be
              azimuthally symmetric.  When set, the parameters A(2)
              and A(3) will be identical and the TILT keyword will
              have no effect.

   TILT - if set, then the major and minor axes of the peak profile
          are allowed to rotate with respect to the image axes.
          Parameter A(6) will be set to the clockwise rotation angle
          of the A(2) axis in radians.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Z-MYFUNCT(X,Y,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Y     - Poisson weighting (counting statistics)
                1D       - Unweighted

             The ERROR keyword takes precedence over any WEIGHTS
             keyword values.  If no ERROR or WEIGHTS are given, then
             the fit is unweighted.


 EXAMPLE:

 ; Construct a sample gaussian surface in range [-5,5] centered at [2,-3]
   x = findgen(100)*0.1 - 5. & y = x
   xx = x # (y*0 + 1)
   yy = (x*0 + 1) # y
   rr = sqrt((xx-2.)^2 + (yy+3.)^2)

 ; Gaussian surface with sigma=0.5, peak value of 3, noise with sigma=0.2
   z = 3.*exp(-(rr/0.5)^2) + randomn(seed,100,100)*.2

 ; Fit gaussian parameters A
   zfit = mpfit2dpeak(z, a, x, y)

 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:

   New algorithm for estimating starting values, CM, 31 Oct 1999
   Documented, 02 Nov 1999
   Small documentation fixes, 02 Nov 1999
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Small cosmetic changes, 21 Sep 2000, CM
   Corrected bug introduced by cosmetic changes, 11 Oct 2000, CM :-)
   Added POSITIVE keyword, 17 Nov 2000, CM
   Removed TILT in common, in favor of FUNCTARGS approach, 23 Nov
     2000, CM
   Added SYMMETRIC keyword, documentation for TILT, and an example,
     24 Nov 2000, CM
   Changed SYMMETRIC to CIRCULAR, 17 Dec 2000, CM

  $Id: mpfit2dpeak.pro,v 1.2 2000/12/18 07:00:15 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfit2dpeak.pro)


MPFITELLIPSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFITELLIPSE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Approximate fit to points forming an ellipse

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   parms = MPFITELLIPSE(X, Y, start_parms, [/TILT, WEIGHTS=wts, ...])

 DESCRIPTION:

   MPFITELLIPSE fits a closed elliptical or circular curve to a two
   dimensional set of data points.  The user specifies the X and Y
   positions of the points, and an optional set of weights.  The
   ellipse may also be tilted at an arbitrary angle.

   The best fitting ellipse parameters are returned from by
   MPFITELLIPSE as a vector, whose values are:

      P(0)   Ellipse semi axis 1
      P(1)   Ellipse semi axis 2   ( = P(0) if CIRCLE keyword set)
      P(2)   Ellipse center - x value
      P(3)   Ellipse center - y value
      P(4)   Ellipse rotation angle (radians) if TILT keyword set

   The user may specify an initial set of trial parameters, but by
   default MPFITELLIPSE will estimate the parameters automatically.

   Users should be aware that in the presence of large amounts of
   noise, namely when the measurement error becomes significant
   compared to the ellipse axis length, then the estimated parameters
   become unreliable.  Generally speaking the computed axes will
   overestimate the true axes.  For example when (SIGMA_R/R) becomes
   0.5, the radius of the ellipse is overestimated by about 40%.

   Users can weight their data as they see appropriate.  However, the
   following prescription for the weighting appears to be the correct
   one, and produces values comparable to the typical chi-squared
   value.

     WEIGHTS = 0.75/(SIGMA_X^2 + SIGMA_Y^2)

   where SIGMA_X and SIGMA_Y are the measurement error vectors in the
   X and Y directions respectively.  However, it should be pointed
   out that this weighting is only appropriate for a set of points
   whose measurement errors are comparable.  If a more robust
   estimation of the parameter values is needed, the so-called
   orthogonal distance regression package should be used (ODRPACK,
   available in FORTRAN at www.netlib.org).

 INPUTS:

   X - measured X positions of the points in the ellipse.
   Y - measured Y positions of the points in the ellipse.

   START_PARAMS - an array of starting values for the ellipse
                  parameters, as described above.  This parameter is
                  optional; if not specified by the user, then the
                  ellipse parameters are estimated automatically from
                  the properties of the data.

 RETURNS:

   Returns the best fitting model ellipse parameters.

 KEYWORDS:

   ** NOTE ** Additional keywords such as PARINFO, BESTNORM, and
              STATUS are accepted by MPFITELLIPSE but not documented
              here.  Please see the documentation for MPFIT for the
              description of these advanced options.

   PERROR - upon return, the 1-sigma uncertainties of the returned
            ellipse parameter values.  These values are only
            meaningful if the WEIGHTS keyword is specified properly.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

   QUIET - if set then diagnostic fitting messages are suppressed.
           Default: QUIET=1 (i.e., no diagnostics)

   CIRCULAR - if set, then the curve is assumed to be a circle
              instead of ellipse.  When set, the parameters P(0) and
              P(1) will be identical and the TILT keyword will have
              no effect.

   TILT - if set, then the major and minor axes of the ellipse
          are allowed to rotate with respect to the data axes.
          Parameter P(4) will be set to the clockwise rotation angle
          of the P(0) axis in radians.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Z-MYFUNCT(X,Y,P))^2 * ABS(WEIGHTS)^2 )

             Users may wish to follow the guidelines for WEIGHTS
             described above.


 EXAMPLE:

 ; Construct a set of points on an ellipse, with some noise
   ph0 = 2*!pi*randomu(seed,50)
   x =  50. + 32.*cos(ph0) + 4.0*randomn(seed, 50)
   y = -75. + 65.*sin(ph0) + 0.1*randomn(seed, 50)

 ; Compute weights function
   weights = 0.75/(4.0^2 + 0.1^2)

 ; Fit ellipse and plot result
   p = mpfitellipse(x, y)
   plot, x, y, psym=1
   phi = dindgen(101)*2D*!dpi/100
   oplot, p(2)+p(0)*cos(phi), p(3)+p(1)*sin(phi)

 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:

   Ported from MPFIT2DPEAK, 17 Dec 2000, CM
   More documentation, 11 Jan 2001, CM
   Example corrected, 18 Nov 2001, CM

  $Id: mpfitellipse.pro,v 1.5 2001/11/18 13:06:52 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfitellipse.pro)


MPFITEXPR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFITEXPR

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform Levenberg-Marquardt least-squares fit to arbitrary expression

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   MYFUNCT = 'X*(1-X)+3'
   parms = MPFITEXPR(MYFUNCT, XVAL, YVAL, ERR, start_parms, ...)

 DESCRIPTION:

  MPFITEXPR fits a user-supplied model -- in the form of an arbitrary IDL
  expression -- to a set of user-supplied data.  MPFITEXPR calls
  MPFIT, the MINPACK-1 least-squares minimizer, to do the main
  work.

  Given the data and their uncertainties, MPFITEXPR finds the best set
  of model parameters which match the data (in a least-squares
  sense) and returns them in an array.
  
  The user must supply the following items:
   - An array of independent variable values ("X").
   - An array of "measured" *dependent* variable values ("Y").
   - An array of "measured" 1-sigma uncertainty values ("ERR").
   - A text IDL expression which computes Y given X.
   - Starting guesses for all of the parameters ("START_PARAMS").

  There are very few restrictions placed on X, Y or the expression of
  the model.  Simply put, the expression must map the "X" values into
  "Y" values given the model parameters.  The "X" values may
  represent any independent variable (not just Cartesian X), and
  indeed may be multidimensional themselves.  For example, in the
  application of image fitting, X may be a 2xN array of image
  positions.

  Some rules must be obeyed in constructing the expression.  First,
  the independent variable name *MUST* be "X" in the expression,
  regardless of the name of the variable being passed to MPFITEXPR.
  This is demonstrated in the above calling sequence, where the X
  variable passed in is called "XVAL" but the expression still refers
  to "X".  Second, parameter values must be referred to as an array
  named "P".

  If you do not pass in starting values for the model parameters,
  MPFITEXPR will attempt to determine the number of parameters you
  intend to have (it does this by looking for references to the array
  variable named "P").  When no starting values are passed in, the
  values are assumed to start at zero.

  MPFITEXPR carefully avoids passing large arrays where possible to
  improve performance.

  See below for an example of usage.

 EVALUATING EXPRESSIONS

  This source module also provides a function called MPEVALEXPR.  You
  can use this function to evaluate your expression, given a list of
  parameters.  This is one of the easier ways to compute the model
  once the best-fit parameters have been found.  Here is an example:

       YMOD = MPEVALEXPR(MYFUNCT, XVAL, PARMS)

  where MYFUNCT is the expression (see MYFUNCT below), XVAL is the
  list of "X" values, and PARMS is an array of parameters.  The
  returned array YMOD contains the expression MYFUNCT evaluated at
  each point in XVAL.

 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of MPFIT can be modified with respect to each
  parameter to be fitted.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to MPFIT.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              MPFIT, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of MPFIT does not use this tag in any
                way.  However, the default ITERPROC will print the
                parameter name if available.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .MPMINSTEP - the minimum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will be changed by multiples of this value.  The
                  actual step is computed as:

                     DELTA1 = MPMINSTEP*ROUND(DELTA0/MPMINSTEP)

                  where DELTA0 and DELTA1 are the estimated parameter
                  changes before and after this constraint is
                  applied.  Note that this constraint should be used
                  with care since it may cause non-converging,
                  oscillating solutions.

                  A value of 0 indicates no minimum.  Default: 0.

     .MPMAXSTEP - the maximum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will never be changed by more than this value.

                  A value of 0 indicates no maximum.  Default: 0.
  
     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]
  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP".
  Therefore programmers are urged to avoid using tags starting with
  the same letters; otherwise they are free to include their own
  fields within the PARINFO structure, and they will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.

 INPUTS:
   MYFUNCT - a string variable containing an IDL expression.  The
             only restriction is that the independent variable *must*
             be referred to as "X" and model parameters *must* be
             referred to as an array called "P".  Do not use symbol
             names beginning with the underscore, "_".

             The expression should calculate "model" Y values given
             the X values and model parameters.  Using the vector
             notation of IDL, this can be quite easy to do.  If your
             expression gets complicated, you may wish to make an IDL
             function which will improve performance and readibility.

             The resulting array should be of the same size and
             dimensions as the "measured" Y values.

   X - Array of independent variable values.

   Y - Array of "measured" dependent variable values.  Y should have
       the same data type as X.  The function MYFUNCT should map
       X->Y.

   ERR - Array of "measured" 1-sigma uncertainties.  ERR should have
         the same data type as Y.  ERR is ignored if the WEIGHTS
         keyword is specified.

   START_PARAMS - An array of starting values for each of the
                  parameters of the model.  The number of parameters
                  should be fewer than the number of measurements.
                  Also, the parameters should have the same data type
                  as the measurements (double is preferred).

                  This parameter is optional if the PARINFO keyword
                  is used (see MPFIT).  The PARINFO keyword provides
                  a mechanism to fix or constrain individual
                  parameters.  If both START_PARAMS and PARINFO are
                  passed, then the starting *value* is taken from
                  START_PARAMS, but the *constraints* are taken from
                  PARINFO.

                  If no parameters are given, then MPFITEXPR attempts
                  to determine the number of parameters by scanning
                  the expression.  Parameters determined this way are
                  initialized to zero.  This technique is not fully
                  reliable, so users are advised to pass explicit
                  parameter starting values.
 

 RETURNS:

   Returns the array of best-fit parameters.


 KEYWORD PARAMETERS:

   BESTNORM - the value of the summed squared residuals for the
              returned parameter values.

   COVAR - the covariance matrix for the set of parameters returned
           by MPFIT.  The matrix is NxN where N is the number of
           parameters.  The square root of the diagonal elements
           gives the formal 1-sigma statistical errors on the
           parameters IF errors were treated "properly" in MYFUNC.
           Parameter errors are also returned in PERROR.

           To compute the correlation matrix, PCOR, use this:
           IDL> PCOR = COV * 0
           IDL> FOR i = 0, n-1 DO FOR j = 0, n-1 DO $
                PCOR(i,j) = COV(i,j)/sqrt(COV(i,i)*COV(j,j))

           If NOCOVAR is set or MPFIT terminated abnormally, then
           COVAR is set to a scalar with value !VALUES.D_NAN.

   ERRMSG - a string error or warning message is returned.

   FTOL - a nonnegative input variable. Termination occurs when both
          the actual and predicted relative reductions in the sum of
          squares are at most FTOL (and STATUS is accordingly set to
          1 or 3).  Therefore, FTOL measures the relative error
          desired in the sum of squares.  Default: 1D-10

   GTOL - a nonnegative input variable. Termination occurs when the
          cosine of the angle between fvec and any column of the
          jacobian is at most GTOL in absolute value (and STATUS is
          accordingly set to 4). Therefore, GTOL measures the
          orthogonality desired between the function vector and the
          columns of the jacobian.  Default: 1D-10

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the MPFIT routine.  It should be declared
              in the following way:

              PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, ...
                ; perform custom iteration update
              END
         
              ITERPROC must either accept all three keyword
              parameters (FUNCTARGS, PARINFO and QUIET), or at least
              accept them via the _EXTRA keyword.
          
              MYFUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to MYFUNCT.  FNORM should be the
              chi-squared value.  QUIET is set when no textual output
              should be printed.  See below for documentation of
              PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value (see
              MPFIT_ERROR common block below).  In principle,
              ITERPROC should probably not modify the parameter
              values, because it may interfere with the algorithm's
              stability.  In practice it is allowed.

              Default: an internal routine is used to print the
                       parameter values.

   MAXITER - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and MPFIT returns.
             Default: 200 iterations

   NFEV - the number of MYFUNCT function evaluations performed.

   NITER - the number of iterations completed.

   NOCOVAR - set this keyword to prevent the calculation of the
             covariance matrix before returning (see COVAR)

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  Note that
            several Levenberg-Marquardt attempts can be made in a
            single iteration.
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never 
             modified during a call to MPFIT.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   PERROR - The formal 1-sigma errors in each parameter, computed
            from the covariance matrix.  If a parameter is held
            fixed, or if it touches a boundary, then the error is
            reported as zero.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

            *If* you can assume that the true reduced chi-squared
            value is unity -- meaning that the fit is implicitly
            assumed to be of good quality -- then the estimated
            parameter uncertainties can be computed by scaling PERROR
            by the measured chi-squared value.

              DOF     = N_ELEMENTS(X) - N_ELEMENTS(PARMS) ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - set this keyword when no textual output should be printed
           by MPFIT

   STATUS - an integer status code is returned.  All values other
            than zero can represent success.  It can have one of the
            following values:

	   0  improper input parameters.
         
	   1  both actual and predicted relative reductions
	      in the sum of squares are at most FTOL.
         
	   2  relative error between two consecutive iterates
	      is at most XTOL
         
	   3  conditions for STATUS = 1 and STATUS = 2 both hold.
         
	   4  the cosine of the angle between fvec and any
	      column of the jacobian is at most GTOL in
	      absolute value.
         
	   5  the maximum number of iterations has been reached
         
	   6  FTOL is too small. no further reduction in
	      the sum of squares is possible.
         
	   7  XTOL is too small. no further improvement in
	      the approximate solution x is possible.
         
	   8  GTOL is too small. fvec is orthogonal to the
	      columns of the jacobian to machine precision.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Y-MYFUNCT(X,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Y     - Poisson weighting (counting statistics)
                1D       - Unweighted

   XTOL - a nonnegative input variable. Termination occurs when the
          relative error between two consecutive iterates is at most
          XTOL (and STATUS is accordingly set to 2 or 3).  Therefore,
          XTOL measures the relative error desired in the approximate
          solution.  Default: 1D-10

   YFIT - the best-fit model function, as returned by MYFUNCT.


 EXAMPLE:

   ; First, generate some synthetic data
   x  = dindgen(200) * 0.1 - 10.                   ; Independent variable 
   yi = gauss1(x, [2.2D, 1.4, 3000.]) + 1000       ; "Ideal" Y variable
   y  = yi + randomn(seed, 200) * sqrt(yi)         ; Measured, w/ noise
   sy = sqrt(y)                                    ; Poisson errors

   ; Now fit a Gaussian to see how well we can recover
   expr = 'P(0) + GAUSS1(X, P(1:3))'               ; fitting function
   p0 = [800.D, 1.D, 1., 500.]                     ; Initial guess
   p = mpfitexpr(expr, x, y, sy, p0)               ; Fit the expression
   print, p

   plot, x, y                                      ; Plot data
   oplot, x, mpevalexpr(expr, x, p)                ; Plot model

   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then a model consisting of a constant
   plus Gaussian is fit to the data.


 COMMON BLOCKS:

   COMMON MPFIT_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, MPFIT checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  By default the value of ERROR_CODE is
     zero, indicating a successful function/procedure call.


 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:
   Written, Apr-Jul 1998, CM
   Added PERROR keyword, 04 Aug 1998, CM
   Added COVAR keyword, 20 Aug 1998, CM
   Added NITER output keyword, 05 Oct 1998
      D.L Windt, Bell Labs, windt@bell-labs.com;
   Added ability to return model function in YFIT, 09 Nov 1998
   Parameter values can be tied to others, 09 Nov 1998
   Added MPEVALEXPR utility function, 09 Dec 1998
   Cosmetic documentation updates, 16 Apr 1999, CM
   More cosmetic documentation updates, 14 May 1999, CM
   Made sure to update STATUS value, 25 Sep 1999, CM
   Added WEIGHTS keyword, 25 Sep 1999, CM
   Changed from handles to common blocks, 25 Sep 1999, CM
     - commons seem much cleaner and more logical in this case.
   Alphabetized documented keywords, 02 Oct 1999, CM
   Added QUERY keyword and query checking of MPFIT, 29 Oct 1999, CM
   Check to be sure that X and Y are present, 02 Nov 1999, CM
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Removed ITERPROC='' when quiet EQ 1, 10 Jan 2000, CM
   Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
   Updated the EXAMPLE, 26 Mar 2000, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Propagated improvements from MPFIT, 17 Dec 2000, CM
   Correct reference to _WTS in MPFITEXPR_EVAL, 25 May 2001, CM
      (thanks to Mark Fardal)

  $Id: mpfitexpr.pro,v 1.4 2001/05/25 04:34:23 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfitexpr.pro)


MPFITFUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFITFUN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Perform Levenberg-Marquardt least-squares fit to IDL function

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   parms = MPFITFUN(MYFUNCT, X, Y, ERR, start_params, ...)

 DESCRIPTION:

  MPFITFUN fits a user-supplied model -- in the form of an IDL
  function -- to a set of user-supplied data.  MPFITFUN calls
  MPFIT, the MINPACK-1 least-squares minimizer, to do the main
  work.

  Given the data and their uncertainties, MPFITFUN finds the best set
  of model parameters which match the data (in a least-squares
  sense) and returns them in an array.
  
  The user must supply the following items:
   - An array of independent variable values ("X").
   - An array of "measured" *dependent* variable values ("Y").
   - An array of "measured" 1-sigma uncertainty values ("ERR").
   - The name of an IDL function which computes Y given X ("MYFUNCT").
   - Starting guesses for all of the parameters ("START_PARAMS").

  There are very few restrictions placed on X, Y or MYFUNCT.  Simply
  put, MYFUNCT must map the "X" values into "Y" values given the
  model parameters.  The "X" values may represent any independent
  variable (not just Cartesian X), and indeed may be multidimensional
  themselves.  For example, in the application of image fitting, X
  may be a 2xN array of image positions.

  MPFITFUN carefully avoids passing large arrays where possible to
  improve performance.

  See below for an example of usage.

 USER FUNCTION

  The user must define a function which returns the model value.  For
  applications which use finite-difference derivatives -- the default
  -- the user function should be declared in the following way:

    FUNCTION MYFUNCT, X, P
     ; The independent variable is X
     ; Parameter values are passed in "P"
     YMOD = ... computed model values at X ...
     return, YMOD
    END

  The returned array YMOD must have the same dimensions and type as
  the "measured" Y values.

  User functions may also indicate a fatal error condition
  using the ERROR_CODE common block variable, as described
  below under the MPFIT_ERROR common block definition.

  See the discussion under "ANALYTIC DERIVATIVES" and AUTODERIVATIVE
  in MPFIT.PRO if you wish to compute the derivatives for yourself.
  AUTODERIVATIVE is accepted by MPFITFUN and passed directly to
  MPFIT.  The user function must accept one additional parameter, DP,
  which contains the derivative of the user function with respect to
  each parameter at each data point, as described in MPFIT.PRO.

 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of MPFIT can be modified with respect to each
  parameter to be fitted.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to MPFIT.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              MPFIT, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of MPFIT does not use this tag in any
                way.  However, the default ITERPROC will print the
                parameter name if available.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .MPMINSTEP - the minimum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will be changed by multiples of this value.  The
                  actual step is computed as:

                     DELTA1 = MPMINSTEP*ROUND(DELTA0/MPMINSTEP)

                  where DELTA0 and DELTA1 are the estimated parameter
                  changes before and after this constraint is
                  applied.  Note that this constraint should be used
                  with care since it may cause non-converging,
                  oscillating solutions.

                  A value of 0 indicates no minimum.  Default: 0.

     .MPMAXSTEP - the maximum change to be made in the parameter
                  value.  During the fitting process, the parameter
                  will never be changed by more than this value.

                  A value of 0 indicates no maximum.  Default: 0.
  
     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]
  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP".
  Therefore programmers are urged to avoid using tags starting with
  the same letters; otherwise they are free to include their own
  fields within the PARINFO structure, and they will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.

 INPUTS:
   MYFUNCT - a string variable containing the name of an IDL function.
             This function computes the "model" Y values given the
             X values and model parameters, as desribed above.

   X - Array of independent variable values.

   Y - Array of "measured" dependent variable values.  Y should have
       the same data type as X.  The function MYFUNCT should map
       X->Y.

   ERR - Array of "measured" 1-sigma uncertainties.  ERR should have
         the same data type as Y.  ERR is ignored if the WEIGHTS
         keyword is specified.

   START_PARAMS - An array of starting values for each of the
                  parameters of the model.  The number of parameters
                  should be fewer than the number of measurements.
                  Also, the parameters should have the same data type
                  as the measurements (double is preferred).

                  This parameter is optional if the PARINFO keyword
                  is used (see MPFIT).  The PARINFO keyword provides
                  a mechanism to fix or constrain individual
                  parameters.  If both START_PARAMS and PARINFO are
                  passed, then the starting *value* is taken from
                  START_PARAMS, but the *constraints* are taken from
                  PARINFO.
 

 RETURNS:

   Returns the array of best-fit parameters.


 KEYWORD PARAMETERS:

   BESTNORM - the value of the summed squared residuals for the
              returned parameter values.

   COVAR - the covariance matrix for the set of parameters returned
           by MPFIT.  The matrix is NxN where N is the number of
           parameters.  The square root of the diagonal elements
           gives the formal 1-sigma statistical errors on the
           parameters IF errors were treated "properly" in MYFUNC.
           Parameter errors are also returned in PERROR.

           To compute the correlation matrix, PCOR, use this:
           IDL> PCOR = COV * 0
           IDL> FOR i = 0, n-1 DO FOR j = 0, n-1 DO $
                PCOR(i,j) = COV(i,j)/sqrt(COV(i,i)*COV(j,j))

           If NOCOVAR is set or MPFIT terminated abnormally, then
           COVAR is set to a scalar with value !VALUES.D_NAN.

   ERRMSG - a string error or warning message is returned.

   CASH - when set, the fit statistic is changed to a derivative of
          the CASH statistic.  The model function must be strictly
          positive.

   FTOL - a nonnegative input variable. Termination occurs when both
          the actual and predicted relative reductions in the sum of
          squares are at most FTOL (and STATUS is accordingly set to
          1 or 3).  Therefore, FTOL measures the relative error
          desired in the sum of squares.  Default: 1D-10

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by MYFUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.

               By default, no extra parameters are passed to the
               user-supplied function.

   GTOL - a nonnegative input variable. Termination occurs when the
          cosine of the angle between fvec and any column of the
          jacobian is at most GTOL in absolute value (and STATUS is
          accordingly set to 4). Therefore, GTOL measures the
          orthogonality desired between the function vector and the
          columns of the jacobian.  Default: 1D-10

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the MPFIT routine.  It should be declared
              in the following way:

              PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, ...
                ; perform custom iteration update
              END
         
              ITERPROC must either accept all three keyword
              parameters (FUNCTARGS, PARINFO and QUIET), or at least
              accept them via the _EXTRA keyword.
          
              MYFUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to MYFUNCT.  FNORM should be the
              chi-squared value.  QUIET is set when no textual output
              should be printed.  See below for documentation of
              PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value (see
              MPFIT_ERROR common block below).  In principle,
              ITERPROC should probably not modify the parameter
              values, because it may interfere with the algorithm's
              stability.  In practice it is allowed.

              Default: an internal routine is used to print the
                       parameter values.

   MAXITER - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and MPFIT returns.
             Default: 200 iterations

   NFEV - the number of MYFUNCT function evaluations performed.

   NFREE - the number of free parameters in the fit.  This includes
           parameters which are not FIXED and not TIED, but it does
           include parameters which are pegged at LIMITS.

   NITER - the number of iterations completed.

   NOCOVAR - set this keyword to prevent the calculation of the
             covariance matrix before returning (see COVAR)

   NPEGGED - the number of free parameters which are pegged at a
             LIMIT.

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  Note that
            several Levenberg-Marquardt attempts can be made in a
            single iteration.
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never 
             modified during a call to MPFIT.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   PERROR - The formal 1-sigma errors in each parameter, computed
            from the covariance matrix.  If a parameter is held
            fixed, or if it touches a boundary, then the error is
            reported as zero.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

            *If* you can assume that the true reduced chi-squared
            value is unity -- meaning that the fit is implicitly
            assumed to be of good quality -- then the estimated
            parameter uncertainties can be computed by scaling PERROR
            by the measured chi-squared value.

              DOF     = N_ELEMENTS(X) - N_ELEMENTS(PARMS) ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - set this keyword when no textual output should be printed
           by MPFIT

   STATUS - an integer status code is returned.  All values other
            than zero can represent success.  It can have one of the
            following values:

	   0  improper input parameters.
         
	   1  both actual and predicted relative reductions
	      in the sum of squares are at most FTOL.
         
	   2  relative error between two consecutive iterates
	      is at most XTOL
         
	   3  conditions for STATUS = 1 and STATUS = 2 both hold.
         
	   4  the cosine of the angle between fvec and any
	      column of the jacobian is at most GTOL in
	      absolute value.
         
	   5  the maximum number of iterations has been reached
         
	   6  FTOL is too small. no further reduction in
	      the sum of squares is possible.
         
	   7  XTOL is too small. no further improvement in
	      the approximate solution x is possible.
         
	   8  GTOL is too small. fvec is orthogonal to the
	      columns of the jacobian to machine precision.

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Y-MYFUNCT(X,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Y     - Poisson weighting (counting statistics)
                1D       - Unweighted

   XTOL - a nonnegative input variable. Termination occurs when the
          relative error between two consecutive iterates is at most
          XTOL (and STATUS is accordingly set to 2 or 3).  Therefore,
          XTOL measures the relative error desired in the approximate
          solution.  Default: 1D-10

   YFIT - the best-fit model function, as returned by MYFUNCT.

   
 EXAMPLE:

   ; First, generate some synthetic data
   npts = 200
   x  = dindgen(npts) * 0.1 - 10.                  ; Independent variable 
   yi = gauss1(x, [2.2D, 1.4, 3000.])              ; "Ideal" Y variable
   y  = yi + randomn(seed, npts) * sqrt(1000. + yi); Measured, w/ noise
   sy = sqrt(1000.D + y)                           ; Poisson errors

   ; Now fit a Gaussian to see how well we can recover
   p0 = [1.D, 1., 1000.]                   ; Initial guess (cent, width, area)
   p = mpfitfun('GAUSS1', x, y, sy, p0)    ; Fit a function
   print, p

   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then the same function is fitted to the
   data (with different starting parameters) to see how close we can
   get.


 COMMON BLOCKS:

   COMMON MPFIT_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, MPFIT checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  By default the value of ERROR_CODE is
     zero, indicating a successful function/procedure call.

 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:
   Written, Apr-Jul 1998, CM
   Added PERROR keyword, 04 Aug 1998, CM
   Added COVAR keyword, 20 Aug 1998, CM
   Added ITER output keyword, 05 Oct 1998
      D.L Windt, Bell Labs, windt@bell-labs.com;
   Added ability to return model function in YFIT, 09 Nov 1998
   Analytical derivatives allowed via AUTODERIVATIVE keyword, 09 Nov 1998
   Parameter values can be tied to others, 09 Nov 1998
   Cosmetic documentation updates, 16 Apr 1999, CM
   More cosmetic documentation updates, 14 May 1999, CM
   Made sure to update STATUS, 25 Sep 1999, CM
   Added WEIGHTS keyword, 25 Sep 1999, CM
   Changed from handles to common blocks, 25 Sep 1999, CM
     - commons seem much cleaner and more logical in this case.
   Alphabetized documented keywords, 02 Oct 1999, CM
   Added QUERY keyword and query checking of MPFIT, 29 Oct 1999, CM
   Corrected EXAMPLE (offset of 1000), 30 Oct 1999, CM
   Check to be sure that X and Y are present, 02 Nov 1999, CM
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
   Corrected errors in EXAMPLE, 26 Mar 2000, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Propagated improvements from MPFIT, 17 Dec 2000, CM
   Added CASH statistic, 10 Jan 2001
   Added NFREE and NPEGGED keywords, 11 Sep 2002, CM

  $Id: mpfitfun.pro,v 1.4 2002/09/12 03:21:13 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfitfun.pro)


MPFITPEAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFITPEAK

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Fit a gaussian, lorentzian or Moffat model to data

 MAJOR TOPICS:
   Curve and Surface Fitting

 CALLING SEQUENCE:
   yfit = MPFITPEAK(X, Y, A, NTERMS=nterms, ...)

 DESCRIPTION:

   MPFITPEAK fits a gaussian, lorentzian or Moffat model using the
   non-linear least squares fitter MPFIT.  MPFITPEAK is meant to be a
   drop-in replacement for IDL's GAUSSFIT function (and requires
   MPFIT and MPFITFUN).

   The choice of the fitting function is determined by the keywords
   GAUSSIAN, LORENTZIAN and MOFFAT.  By default the gaussian model
   function is used.  [ The Moffat function is a modified Lorentzian
   with variable power law index. (Moffat, A. F. J. 1969, Astronomy &
   Astrophysics, v. 3, p. 455-461) ]

   The functional form of the baseline is determined by NTERMS and
   the function to be fitted.  NTERMS represents the total number of
   parameters, A, to be fitted.  The functional forms and the
   meanings of the parameters are described in this table:

                 GAUSSIAN#          Lorentzian#         Moffat#

   Model     A(0)*exp(-0.5*u^2)   A(0)/(u^2 + 1)   A(0)/(u^2 + 1)^A(3)

   A(0)         Peak Value          Peak Value        Peak Value
   A(1)        Peak Centroid       Peak Centroid     Peak Centroid
   A(2)       Gaussian Sigma           HWHM%             HWHM%
   A(3)         + A(3)    *          + A(3)   *      Moffat Index
   A(4)         + A(4)*x  *          + A(4)*x *         + A(4)   *
   A(5)                                                 + A(5)*x *

   Notes: # u = (x - A(1))/A(2)
          % Half-width at half maximum
          * Optional depending on NTERMS

   By default the initial starting values for the parameters A are
   estimated from the data.  However, explicit starting values can be
   supplied using the ESTIMATES keyword.  Also, error or weighting
   values can optionally be provided; otherwise the fit is
   unweighted.

   MPFITPEAK fits the peak value of the curve.  The area under a
   gaussian peak is A(0)*A(2)*SQRT(2*!DPI); the area under a
   lorentzian peak is A(0)*A(2)*!DPI.

 RESTRICTIONS:

   If no starting parameter ESTIMATES are provided, then MPFITPEAK
   attempts to estimate them from the data.  This is not a perfect
   science; however, the author believes that the technique
   implemented here is more robust than the one used in IDL's
   GAUSSFIT.  The author has tested cases of strong peaks, noisy
   peaks and broad peaks, all with success.

   Users should be aware that if the baseline term contains a strong
   linear component then the automatic estimation may fail.  For
   automatic estimation to work the peak amplitude should dominate
   over the the maximum baseline.

 INPUTS:
   X - Array of independent variable values, whose values should
       monotonically increase.

   Y - Array of "measured" dependent variable values.  Y should have
       the same data type and dimension as X.


 OUTPUTS:
   A - Upon return, an array of NTERMS best fit parameter values.
       See the table above for the meanings of each parameter
       element.


 RETURNS:

   Returns the best fitting model function.

 KEYWORDS:

   ** NOTE ** Additional keywords such as PARINFO, BESTNORM, and
              STATUS are accepted by MPFITPEAK but not documented
              here.  Please see the documentation for MPFIT for the
              description of these advanced options.

   ERROR - upon input, the measured 1-sigma uncertainties in the "Y"
           values.  If no ERROR or WEIGHTS are given, then the fit is
           unweighted.

   ESTIMATES - Array of starting values for each parameter of the
               model.  The number of parameters should at least be
               three (four for Moffat), and if less than NTERMS, will
               be extended with zeroes.
               Default: parameter values are estimated from data.

   GAUSSIAN - if set, fit a gaussian model function.  The Default.
   LORENTZIAN - if set, fit a lorentzian model function.
   MOFFAT - if set, fit a Moffat model function.

   NEGATIVE / POSITIVE - if set, and ESTIMATES is not provided, then
                         MPFITPEAK will assume that a
                         negative/positive peak is present.
                         Default: determined automatically

   NTERMS - An integer describing the number of fitting terms.
            NTERMS must have a minimum value, but can optionally be
            larger depending on the desired baseline.  

            For gaussian and lorentzian models, NTERMS must be three
            (zero baseline), four (constant baseline) or five (linear
            baseline).  Default: 4

            For the Moffat model, NTERMS must be four (zero
            baseline), five (constant baseline), or six (linear
            baseline).  Default: 5

   PERROR - upon return, the 1-sigma uncertainties of the parameter
            values A.  These values are only meaningful if the ERRORS
            or WEIGHTS keywords are specified properly.

            If the fit is unweighted (i.e. no errors were given, or
            the weights were uniformly set to unity), then PERROR
            will probably not represent the true parameter
            uncertainties.  

            *If* you can assume that the true reduced chi-squared
            value is unity -- meaning that the fit is implicitly
            assumed to be of good quality -- then the estimated
            parameter uncertainties can be computed by scaling PERROR
            by the measured chi-squared value.

              DOF     = N_ELEMENTS(X) - N_ELEMENTS(PARMS) ; deg of freedom
              PCERROR = PERROR * SQRT(BESTNORM / DOF)   ; scaled uncertainties

   QUIET - if set then diagnostic fitting messages are suppressed.
           Default: QUIET=1 (i.e., no diagnostics)

   WEIGHTS - Array of weights to be used in calculating the
             chi-squared value.  If WEIGHTS is specified then the ERR
             parameter is ignored.  The chi-squared value is computed
             as follows:

                CHISQ = TOTAL( (Y-MYFUNCT(X,P))^2 * ABS(WEIGHTS) )

             Here are common values of WEIGHTS:

                1D/ERR^2 - Normal weighting (ERR is the measurement error)
                1D/Y     - Poisson weighting (counting statistics)
                1D       - Unweighted

             The ERROR keyword takes precedence over any WEIGHTS
             keyword values.  If no ERROR or WEIGHTS are given, then
             the fit is unweighted.


 EXAMPLE:

   ; First, generate some synthetic data
   npts = 200
   x  = dindgen(npts) * 0.1 - 10.                  ; Independent variable 
   yi = gauss1(x, [2.2D, 1.4, 3000.]) + 1000       ; "Ideal" Y variable
   y  = yi + randomn(seed, npts) * sqrt(1000. + yi); Measured, w/ noise
   sy = sqrt(1000.D + y)                           ; Poisson errors

   ; Now fit a Gaussian to see how well we can recover the original
   yfit = mpfitpeak(x, y, a, error=sy)
   print, p

   Generates a synthetic data set with a Gaussian peak, and Poisson
   statistical uncertainty.  Then the same function is fitted to the
   data.

 REFERENCES:

   MINPACK-1, Jorge More', available from netlib (www.netlib.org).
   "Optimization Software Guide," Jorge More' and Stephen Wright, 
     SIAM, *Frontiers in Applied Mathematics*, Number 14.

 MODIFICATION HISTORY:

   New algorithm for estimating starting values, CM, 31 Oct 1999
   Documented, 02 Nov 1999
   Small documentation fixes, 02 Nov 1999
   Slight correction to calculation of dx, CM, 02 Nov 1999
   Documented PERROR for unweighted fits, 03 Nov 1999, CM
   Copying permission terms have been liberalized, 26 Mar 2000, CM
   Change requirements on # elements in X and Y, 20 Jul 2000, CM
      (thanks to David Schlegel )
   Added documentation on area under curve, 29 Aug 2000, CM
   Added POSITIVE and NEGATIVE keywords, 17 Nov 2000, CM
   Added reference to Moffat paper, 10 Jan 2001, CM
   Added usage message, 26 Jul 2001, CM
   Documentation clarification, 05 Sep 2001, CM

  $Id: mpfitpeak.pro,v 1.5 2001/09/18 00:12:39 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpfitpeak.pro)


MPFTEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPFTEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute the probability of a given F value

 MAJOR TOPICS:
   Curve and Surface Fitting, Statistics

 CALLING SEQUENCE:
   PROB = MPFTEST(F, DOF1, DOF2, [/SIGMA, /CLEVEL, /SLEVEL ])

 DESCRIPTION:

  The function MPFTEST() computes the probability for a value drawn
  from the F-distribution to equal or exceed the given value of F.
  This can be used for confidence testing of a measured value obeying
  the F-distribution (i.e., for testing the ratio of variances, or
  equivalently for the addition of parameters to a fitted model).

    P_F(X > F; DOF1, DOF2) = PROB

  In specifying the returned probability level the user has three
  choices:

    * return the confidence level when the /CLEVEL keyword is passed;
      OR

    * return the significance level (i.e., 1 - confidence level) when
      the /SLEVEL keyword is passed (default); OR

    * return the "sigma" of the probability (i.e., compute the
      probability based on the normal distribution) when the /SIGMA
      keyword is passed.

  Note that /SLEVEL, /CLEVEL and /SIGMA are mutually exclusive.

  For the ratio of variance test, the two variances, VAR1 and VAR2,
  should be distributed according to the chi-squared distribution
  with degrees of freedom DOF1 and DOF2 respectively.  The F-value is
  computed as:

     F = (VAR1/DOF1) / (VAR2/DOF2)

  and then the probability is computed as:

     PROB = MPFTEST(F, DOF1, DOF2, ... )


  For the test of additional parameters in least squares fitting, the
  user should perform two separate fits, and have two chi-squared
  values.  One fit should be the "original" fit with no additional
  parameters, and one fit should be the "new" fit with M additional
  parameters.

    CHI1 - chi-squared value for original fit

    DOF1 - number of degrees of freedom of CHI1 (number of data
           points minus number of original parameters)

    CHI2 - chi-squared value for new fit

    DOF2 - number of degrees of freedom of CHI2

  Note that according to this formalism, the number of degrees of
  freedom in the "new" fit, DOF2, should be less than the number of
  degrees of freedom in the "original" fit, DOF1 (DOF2 < DOF1); and
  also CHI2 < CHI1.

  With the above definition, the F value is computed as:

    F = ( (CHI1-CHI2)/(DOF1-DOF2) )   /  (CHI2/DOF2)

  where DOF1-DOF2 is equal to M, and then the F-test probability is
  computed as:

     PROB = MPFTEST(F, DOF1-DOF2, DOF2, ... )

  Note that this formalism assumes that the addition of the M
  parameters is a small peturbation to the overall fit.  If the
  additional parameters dramatically changes the character of the
  model, then the first "ratio of variance" test is more appropriate,
  where F = (CHI1/DOF1) / (CHI2/DOF2).

 INPUTS:

   F - ratio of variances as defined above.

   DOF1 - number of degrees of freedom in first variance component.

   DOF2 - number of degrees of freedom in second variance component.


 RETURNS:

  Returns a scalar or vector of probabilities, as described above,
  and according to the /SLEVEL, /CLEVEL and /SIGMA keywords.

 KEYWORD PARAMETERS:

   SLEVEL - if set, then PROB describes the significance level
            (default).

   CLEVEL - if set, then PROB describes the confidence level.

   SIGMA - if set, then PROB is the number of "sigma" away from the
           mean in the normal distribution.

 EXAMPLE:

   chi1 = 62.3D & dof1 = 42d
   chi2 = 54.6D & dof2 = 40d

   f = ((chi1-chi2)/(dof1-dof2)) / (chi2/dof2)
   print, mpftest(f, dof1-dof2, dof2)

   This is a test for addition of parameters.  The "original"
   chi-squared value was 62.3 with 42 degrees of freedom, and the
   "new" chi-squared value was 54.6 with 40 degrees of freedom.
   These values reflect the addition of 2 parameters and the
   reduction of the chi-squared value by 7.7.  The significance of
   this set of circumstances is 0.029568701.

 REFERENCES:

   Algorithms taken from CEPHES special function library, by Stephen
   Moshier. (http://www.netlib.org/cephes/)

 MODIFICATION HISTORY:
   Completed, 1999, CM
   Documented, 16 Nov 2001, CM
   Reduced obtrusiveness of common block and math error handling, 18
     Nov 2001, CM
   Added documentation, 30 Dec 2001, CM
   Documentation corrections (thanks W. Landsman), 17 Jan 2002, CM
   Example docs were corrected (Thanks M. Perez-Torres), 17 Feb 2002, CM

  $Id: mpftest.pro,v 1.6 2002/02/17 14:48:28 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpftest.pro)


MPI_AXIS__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MPI_AXIS__DEFINE

 PURPOSE:

       This is a compound widget program for interactively adjusting and keeping track
       of keywords appropriate for configuing axis properties.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       xAxisObjext = Obj_New("MPI_AXIS", /XAxis)
       xAxisID = xAxisObject->GUI(baseWidgetID)

 INPUT PARAMETERS:

       None.

 INPUT KEYWORDS (Sent to the INIT method. The same keywords can be set with the SETPROPERTY method of the object.):

       AUTOKEYWORDS - An anonymous struture of keywords that are passed to the AutoRange function.

       AUTORANGE - The name of a function that can return axis range information as 2-element array.

       CHARSIZE - The character size used for the axis. By default, 1.0.

       EXACT - Set to indicate exact axis range scaling. (Can also be set with the STYLE keyword.)

       EXTEND - Set to indicate extended axis range. (Can also be set with the STYLE keyword.)

       GRIDSTYLE - The style used for drawing grid lines.

       HIDE - Set to indicate hidden axis style. (Can also be set with the STYLE keyword.)

       LOG - Set to indicate logarithmic axis.

       MARGIN - The axis margin. (Currently unimplemented.)

       MINOR - The number of minor tick marks between the major tick marks on the axis.

       NAME = A user-defined "name" for the object.

       NOBOX - Set to inhibit box-style axis. (Can also be set with the STYLE keyword.)

       NOZERO - Set to indicate NO_ZERO axis style. (Can also be set with the STYLE keyword.)

       RANGE - The axis range as a two-element array, [minrange, maxrange].

       STYLE - The axis style. A 32-bit value whose bits select certain properties. See the
          on-line documentation for the !X.STYLE system variable for more information. These
          style properties can be set in a more natural way with other keywords.

       THICK - The thickness of the axis. By default, 1.0.

       TICKFORMAT - The format to use with tick marks. May be name of procedure.

       TICKINTERVAL - The interval to space tick marks for first-level axis. (Currently not implemented.)

       TICKLAYOUT - The type of tick layout desired. (Currently not implemented.)

       TICKLEN - The length of the ticks on the axis. By default, 0.0. (Note that changing this
          value will cause the Plot TICKLEN value to be ignored for the axis.)

       TICKNAME - The string names associated with each tick mark. (Currently not implemented.)

       TICKS - The number of major tick intervals.

       TICKUNITS - The units to use for tick labeling. (Currently not implemented.)

       TICKV - A vector of tick values. (Currently not implemented.)

       TITLE - The axis title.

       XAXIS - Set to indicate an X axis object. This is the default.

       YAXIS - Set to indicate a Y axis object.

       ZAXIS - Set to indicate a Z axis.

 METHOD PROCEDURES:

      GUI - This procedure method displays a graphical user interface that allows the user
            to change the axis configuration parameters.

            PARAMETERS:

                parent - The parent of the compound widget.

            KEYWORDS:

                EVENT_PRO - The specified event handler procedure.
                EVENT_FUNC - The specified event handler function.
                ONLY_STYLE - If set, display only style parameters in the GUI.
                ONLY_TICK - If set, display only tick parameters in the GUI.
                SHORT_FORM - Normally, all the axis properties are displayed in the GUI. Setting
                     this keyword places the Tick and Style properties behind buttons on the interface.
                UVALUE - The user value of the compound widget.

      SETPROPERTY - This procedure can be used to set the properties of the axis
               configuration object without using the graphical user interface. The
               keywords are identical to those used in the INIT method, above.

 METHOD FUNCTIONS:

      GETKEYWORDS - This function method contains no arguments or keywords. It returns a
            structure, with fields equivalent to PLOT keywords for setting axis properties.
            The idea is that these keywords can be passed directly to the PLOT command using
            the keyword inheritance mechanism via the _EXTRA keyword to the plot command. ished with it.

 PROGRAM NOTES:

      Required Programs: The following programs are required to reside in your !PATH. They can be
         obtained from the Coyote Library:

                     http://www.dfanning.com/programs/cw_spacer.pro
                     http://www.dfanning.com/programs/error_message.pro
                     http://www.dfanning.com/programs/fsc_droplist.pro
                     http://www.dfanning.com/programs/fsc_field.pro

 EXAMPLE:

       A heavily documented program, named MPI_PLOT, is supplied with this program.
       This program not only explains how to use the MPI_PLOTCONFIG__DEFINE and the
       MPI_AXIS__DEFINE programs, it can be used as a wrapper program for the PLOT command
       that you can use with your own data. The program can be downloaded here:

                     http://www.dfanning.com/programs/mpi_plot.pro

 MODIFICATION HISTORY:

       Written by David Fanning, March 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\mpi_axis__define.pro)


MPI_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MPI_PLOT

 PURPOSE:

       This program is a simple wrapper for the IDL PLOT command. The
       main purpose of the program is to demonstrate one way the
       MPI_PLOTCONFIG program can be used to update plot parameters.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       MPI_Plot, x, y
       MPI_Plot, xx, yy, /Overplot

 INPUT PARAMETERS:

       x - The independent data. If y is not present, x is taken to be the dependent data.

       y - The dependent data. The vectors x and y must be the same length.

       xs - The independent data to overplot. If yy is not present, xx is taken to be the dependent data.

       yy - The dependent data to overplot. The vectors xx and yy must be the same length.

 INPUT KEYWORDS:

       BACKGROUND - The name of a background color. (See below for a list of color names.)
         By default on 24-bit systems: 'IVORY'. Uses 'GRAY' on 8-bit systems.

       COLOR - The name of the plot color. (See below for a list of color names.)
         By default on 24-bit systems: 'SADDLE BROWN'. Uses 'GREEN' on 8-bit systems.
         When OVERPLOTing, use the COLOR keyword to specify the color of the overplot.

       DATACOLOR - The name of the data color. By default the same as the COLOR keyword.
         (See below for a list of color names.) When OVERPLOTing, use the COLOR keyword
         to specify the color of the overplot.

       OVERPLOT - Set this keyword to overplot data into the MPI_PLOT window.
         If multiple windows are on the display, select the one to overplot into
         by selecting it with the cursor.

       PSYM - The plot symbol value. By default, 18. Possible values are:
         0 - Dot
         1 - Filled Circle
         2 - Filled Upward Triangle
         3 - Filled Downward Triangle
         4 - Filled Diamond
         5 - Filled Square
         6 - Open Circle
         7 - Open Upward Triangle
         8 - Open Downward Triangle
         9 - Open Diamond
        10 - Open Square
        11 - Plus Sign
        12 - X
        13 - Star
        14 - Filed Rightfacing Triangle
        15 - Filled Leftfacing Triangle
        16 - Open Rightfacing Triangle
        17 - Open Leftfacing Triangle
        18 - No Symbol (the default).

       TITLE - The title of the plot. By default, a null string.

       XTITLE - The title of the X axis of the plot. By default, a null string.

       YTITLE - The title of the Y axis of the plot. By default, a null string.

       In addition, any keyword appropriate for the MPI_PLOTCONFIG object program can be used.
       Among those keywords, are these most popular ones:

       CHARSIZE - The character size of the plot. By default, 1.0.

       CHARTHICK - The character thickness of the plot. By default, 1.0.

       FONT - The type of plot font: -1=Hershey, 0=Hardware, 1=True-Type. By default, !P.FONT.

       LINESTYLE - The plot linestyle. By default, 0. Possible values are:
         0 - Solid Line
         1 - Dotted
         2 - Dashed
         3 - Dash Dot
         4 - Dash Dot Dot
         5 - Long Dash
         6 - No Line

       POSITION - The position of the plot in the plot window in normalized coordinates. By default, [0.20, 0.15, 0.95, 0.95].

       SYMSIZE - The plot symbol size. By default, 1.0.

       THICK - The plot line thickness. By default, 1.0.

       TICKLEN - The plot tick length. By default, 0.02.

 COLOR NAMES:

        The following color names can be used for BACKGROUND, COLOR and DATACOLOR keywords:

           White, Snow, Ivory, Light Yellow, Cornsilk, Beige, Seashell, Linen, Antique White,
           Papaya, Almond, Bisque, Moccasin, Wheat, Burlywood, Tan, Light Gray, Lavender,
           Medium Gray, Gray, Slate Gray, Dark Gray , Charcoal, Black, Light Cyan, Powder Blue,
           Sky Blue, Steel Blue, Dodger Blue, Royal Blue, Blue, Navy, Honeydew, Pale Green,
           Aquamarine, Spring Green, Cyan, Turquoise, Sea Green, Forest Green, Green Yellow,
           Chartreuse, Lawn Green, Green, Lime Green, Olive Drab, Olive, Dark Green, Pale Goldenrod,
           Khaki, Dark Khaki, Yellow, Gold, Goldenrod, Dark Goldenrod, Saddle Brown, Rose,
           Pink, Rosy Brown, Sandy Brown, Peru, Indian Red, Chocolate, Sienna, Dark Salmon,
           Salmon, Light Salmon, Orange, Coral, Light Coral, Firebrick, Brown, Hot Pink,
           Deep Pink, Magenta, Tomato, Orange Red, Red, Violet Red, Maroon, Thistle, Plum,
           Violet, Orchid, Medium Orchid, Dark Orchid, Blue Violet, and Purple.

 REQUIRED PROGRAMS:

        The following programs are required to reside in your !PATH. They can be
        obtained from the Coyote Library:

                     http://www.dfanning.com/programs/adjustposition.pro
                     http://www.dfanning.com/programs/cw_drawcolor.pro
                     http://www.dfanning.com/programs/cw_spacer.pro
                     http://www.dfanning.com/programs/error_message.pro
                     http://www.dfanning.com/programs/fsc_color.pro
                     http://www.dfanning.com/programs/fsc_droplist.pro
                     http://www.dfanning.com/programs/fsc_field.pro
                     http://www.dfanning.com/programs/fsc_fileselect.pro
                     http://www.dfanning.com/programs/fsc_inputfield.pro
                     http://www.dfanning.com/programs/fsc_psconfig__define.pro
                     http://www.dfanning.com/programs/mpi_plotconfig__define.pro
                     http://www.dfanning.com/programs/mpi_axis.pro
                     http://www.dfanning.com/programs/mpi_axis__define.pro
                     http://www.dfanning.com/programs/pickcolorname.pro
                     http://www.dfanning.com/programs/psconfig.pro
                     http://www.dfanning.com/programs/pswindow.pro
                     http://www.dfanning.com/programs/tvread.pro

         All these programs can be obtained at once by downloading the MPI_PLOT zip file:

                     http://www.dfanning.com/programs/mpi_plot.zip


 COMMON BLOCK:

       The addition of the OVERPLOT keyword required a COMMON block named MPI_PLOT_COMMMON
       to store the program information pointer. This pointer is loaded in the COMMON block
       when the keyboard focus changes. Thus, to overplot into an MPI_PLOT window, first
       select the window with the cursor.

 RESTRICTIONS

       Colors will be loaded in the color table.

 EXAMPLE:

       x = Findgen(11) & y = Findgen(11)
       MPI_PLOT, x, y
       MPT_PLOT, Reverse(x), y, /Overplot, Linestyle=2

 MODIFICATION HISTORY:

       Written by David Fanning, March 2001, and offered to the IDL user
       community by the Max-Plank Institute of Meteorology in  Hamburg, Germany.
       Added OVERPLOT keyword and made numerous general improvements. 21 November 2001. DWF
       Removed restriction for only one copy of MPI_PLOT on display at once. 25 November 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\mpi_plot.pro)


MPI_PLOTCONFIG__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MPI_PLOTCONFIG__DEFINE

 PURPOSE:

       This is a program for interactively adjusting and keeping track
       of keywords appropriate for configuring the PLOT command.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       plotConfigObj = Obj_New("MPI_PLOTCONFIG")

 INPUT PARAMETERS:

       None.

 INPUT KEYWORDS (Sent to the INIT method. The same keywords can be set with the SETPROPERTY method of the object.):

       BACKGROUND - The name of the background color. By default on 24-bit systems: 'IVORY'. ON 8-bit systems 'GRAY'.

       CHARSIZE - The character size of the plot. By default, 1.0.

       CHARTHICK - The character thickness of the plot. By default, 1.0.

       COLOR - The name of the plot color. (This will be the axis color if DATACOLOR is also used.)
         By default on 24-bit systems: 'SADDLE BROWN'. Uses 'GREEN' on 8-bit systems.

       DATACOLOR - The name of the data color. (Requires use of USEDATACOLOR to be active.) By default
         on 24-bit systems: 'NAVY'. Uses 'YELLOW' on 8-bit systems.

       _EXTRA - Extra keywords to be passed to MPI_AXIS objects used internally.

       FONT - The type of plot font: -1=Hershey, 0=Hardware, 1=True-Type. By default, !P.FONT.;

       LINESTYLE - The plot linestyle. By default, 0. Possible values are:
         0 - Solid Line
         1 - Dotted
         2 - Dashed
         3 - Dash Dot
         4 - Dash Dot Dot
         5 - Long Dash
         6 - No Line

       NOAXISINFO - Set this keyword to inhibit axis information on the GUI. By default, 0.

       POSITION - The position of the plot in the plot window in normalized coordinates. By default, [0.20, 0.15, 0.95, 0.95].

       PSYM - The plot symbol value. By default, 18. Possible values are:
         0 - Dot
         1 - Filled Circle
         2 - Filled Upward Triangle
         3 - Filled Downward Triangle
         4 - Filled Diamond
         5 - Filled Square
         6 - Open Circle
         7 - Open Upward Triangle
         8 - Open Downward Triangle
         9 - Open Diamond
        10 - Open Square
        11 - Plus Sign
        12 - X
        13 - Star
        14 - Filed Rightfacing Triangle
        15 - Filled Leftfacing Triangle
        16 - Open Rightfacing Triangle
        17 - Open Leftfacing Triangle
        18 - No Symbol (the default).

      SYMSIZE - The plot symbol size. By default, 1.0.

      SUBTITLE - The plot subtitle. By default, "".

      TITLE - The plot title. By default, "".

      THICK - The plot line thickness. By default, 1.0.

      TICKLEN - The plot tick length. By default, 0.02.

      USEDATACOLOR - Set this keyword to return a DATACOLOR field in the keyword structure. By default, 0.

      XAXIS - An MPI_AXIS object for the X axis. One is created by default, if not provided.

      YAXIS - An MPI_AXIS object for the Y axis. One is created by default, if not provided.

 METHOD PROCEDURES:

      GUI - This procedure method displays a graphical user interface that allows the user
            to change plot configuration parameters. The following keywords can be used:

            ALL_EVENTS - Set this keyword to have an event sent any time something in the
               GUI changes. The default is to send an event only when the user hits the ACCEPT button.
               Note that the NOTIFYID keyword must be used to generate events.

            BLOCK - Set this keyword if you want to block the command line. The default is to NOT block the command line.

            DEFAULTFONT - The name of a font to use as the default font.

            GROUP_LEADER - The group leader for this GUI. If this keyword is used, the program will be
               distroyed when the group leader is destroyed.

            LABELDEFAULTSIZE - The default screen size for a label. All labels are offsets from this size. 55 by default.
               The purpose of this keyword is to allow the user to modify the look of the GUI if different
               fonts are used.

            LABELFONT - The name of a font to use for program labels.

            NOTIFYID - A two-element array containing the widget identifier and top-level base ID of a widget
               designated to receive an event from this program. The event structure will be defined and sent
               like this:

                    Widget_Control, notifyid[0], Send_Event={ MPI_PLOTCONFIG_EVENT, $
                                                              ID: notifyid[0], $
                                                              TOP:notifyid[1], $
                                                              HANDLER: 0L, $
                                                              OBJECT: self }

               Most event handlers will be written so that they will get the plot keywords
               from the plot configuration object and draw the plot. A sample event handler might
               look like this:

                    PRO MPI_Plot_Configuration_Events, event
                    Widget_Control, event.top, Get_UValue=info, /No_Copy
                    WSet, info.wid
                    plotkeywords = event.object->GetKeywords()
                    Plot, info.indep, info.dep, _Extra=plotkeywords
                    Widget_Control, event.top, Set_UValue=info, /No_Copy
                    END

            XLONGFORM - By default, the X axis information is displayed in "short" form, with only the
               most relevant information readily available. Other axis information is accessed via buttons.
               Set this keyword to display the X axis information in a "long" form, in which all the axis
               information is immediately visible.

            YLONGFORM - By default, the Y axis information is displayed in "short" form, with only the
               most relevant information readily available. Other axis information is accessed via buttons.
               Set this keyword to display the Y axis information in a "long" form, in which all the axis
               information is immediately visible.

      SETPROPERTY - This procedure can be used to set the properties of the plot
               configuration object without using the graphical user interface. The
               keywords are identical to those used in the INIT method, above.

 METHOD FUNCTIONS:

      GETKEYWORDS - This function method contains no arguments or keywords. It returns a
            structure, with fields equivalent to PLOT keywords. The idea is that these
            keywords can be passed directly to the PLOT command using the keyword inheritance
            mechanism via the _EXTRA keyword to the plot command. A possible sequence of commands
            might look like this:

               IDL> plotConfigObj = Obj_New("MPI_PLOTCONFIG")   ; Create the plot configuration object.
               IDL> plotConfigObj->GUI, /Block                  ; Allow the user to configure the plot parameters.
               IDL> plotKeywords = plotConfigObj->GetKeywords() ; Get the plot keywords.
               IDL> Plot, x, y, _Extra=plotKeywords             ; Draw the plot in the way the user specified.
               IDL> Obj_Destroy, plotConfigObj                  ; Destroy the object when finished with it.

 PROGRAM NOTES:

      Color Names: Color names are those used with FSC_Color and PickColorName. See the
         documentation for those programs for instuctions on loading your own colors.
         To see the default colors and names, type this:

                IDL> color = PickColorName('yellow')

      Working with DataColor: Many people like to have the data color in a line plot
         different from the axis color. This requires two commands in IDL: a PLOT command
         with the NODATA keyword set, to draw in the axis color, followed by the OPLOT command,
         with the data drawn in the data color. Unfortunately, IDL only has a single COLOR keyword
         to represent both colors. So, you must be a bit resourceful to use this feature.

         The proper sequence of commands to use this feature of the plot configuration object
         will looks like this. First, initialize the object with the USEDATACOLOR keyword:

             plotConfigObj = Obj_New("MPI_PLOTCONFIG", /UseDataColor) ; Use the DataColor option.

         When you are ready to draw the plot, the keyword structure will have a new field named
         DataColor. Since this keyword is not recognized by the PLOT command, it will be ignored
         in the first PLOT command to draw the axes:

             plotKeywords = plotConfigObj->GetKeywords() ; Get the plot keywords.
             Plot, x, y, _Extra=plotKeywords, /NoData    ; Just draw the axes.

         Next, change the color field to the datacolor field value, and overplot the
         data onto the axes you just drew:

             plotKeywords.color = PlotKeywords.datacolor
             OPlot, x, y, _Extra=plotKeywords

         You can see an example of how this is done in the heavily documented example program
         MPI_PLOT, which you can use as a wrapper for the PLOT command with your own data, if you like.

      Required Programs: The following programs are required to reside in your !PATH. They can be
         obtained from the Coyote Library:

                     http://www.dfanning.com/programs/adjustposition.pro
                     http://www.dfanning.com/programs/cw_drawcolor.pro
                     http://www.dfanning.com/programs/cw_spacer.pro
                     http://www.dfanning.com/programs/error_message.pro
                     http://www.dfanning.com/programs/fsc_color.pro
                     http://www.dfanning.com/programs/fsc_droplist.pro
                     http://www.dfanning.com/programs/fsc_field.pro
                     http://www.dfanning.com/programs/fsc_plotwindow.pro
                     http://www.dfanning.com/programs/mpi_axis__define.pro
                     http://www.dfanning.com/programs/pickcolorname.pro
                     http://www.dfanning.com/programs/pswindow.pro
                     http://www.dfanning.com/programs/tvread.pro

 EXAMPLE:

       A heavily documented program, named MPI_PLOT, is supplied with this program.
       This program not only explains how to use the MPI_PLOTCONFIG__DEFINE program,
       it can be used as a wrapper program for the PLOT command that you can use with
       your own data. The program can be downloaded here:

                     http://www.dfanning.com/programs/mpi_plot.pro

 MODIFICATION HISTORY:

       Written by David Fanning, March 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\mpi_plotconfig__define.pro)


MPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mplot

 PURPOSE:
	General purpose x,y plot routine

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	mplot, [x_data,] y_data
	mplot, [x_data,] y_str		(if all y data sets share same x data - e.g. time series)
	mplot, [x_str,] y_str
	mplot, icgs0 [, icgs1, icgs2, icgs3, icgs4, icgs5]
	mplot, p_icgs

 INPUTS:
	y_data:	Array with y data.
	y_str:	Structure of arrays with y data (e.g. {y0: FINDGEN(10), y1: SQRT(FINDGEN(10))} ).
	icgs0:	ICG structure
	p_icgs:	Pointer or array of pointers to ICG structure(s)

 OPTIONAL INPUTS:
	x_data:	Array with x data.
	x_str:	Structure of arrays with x data.
	icgs1, icgs2, icgs3, icgs4, icgs5: More ICG structures

 KEYWORD PARAMETERS:
	AXIS_COLOR: Color to be used for axes and annotation (default: !P.COLOR)
	/NO_XANNOTATION: If set no annotation of the x axis will be plotted
	/NO_YANNOTATION: If set no annotation of the y axis will be plotted
	/NO_TITLE: If set no title will be plotted
	/HLINE: horizontal line will be plotted with the following defaults:
		HL_VALUE = 0.0 (e.g. @ y = 0). Entry may also be a vector to plot more than one horizontal line.
		HL_STYLE = 2
		HL_THICK = 1.0
		HL_COLOR = axis_color
	/VLINE: vertical line will be plotted with the following defaults:
		VL_VALUE = 0.0 (e.g. @ x = 0). Entry may also be a vector to plot more than one vertical line.
		VL_STYLE = 2
		VL_THICK = 1.0
		VL_COLOR = axis_color
	/DLINE: arbitrary line will be plotted with the following defaults:
		DL_VALUE = Coordinates of plot to yield 1:1 straight line
		DL_STYLE = 2
		DL_THICK = 1.0
		DL_COLOR = axis_color
	/TIMEAXIS: The x axis is formatted as a time axis with the following optional keyword parameters:
		TIMEFORMAT = tf where tf may be any meaningfull sub string of 'dd.mm.yy hh:mm:ss'
		TIMESTEP = ts (major time intervall in seconds)
		/NO_DATE: If set, no date information is appended to the ticknames even if the
			displayed time range covers a change of date.
	MY_PLOTSTR = my_pls: name of structure with default settings for any number of plot keywords.
	XERR = x_err_data: array of X error bar values.
	YERR = y_err_data: array of Y error bar values.
	/TAX_BREAK: Applies to time axis only. If set, data points which are further apart
		then 1/24 of the data time range are not connected by a line.
	TBREAK_INTV = tbi: Time interval in sec to be used by TAX_BREAK.
	[XY]RANGE = [low, high]:
		low, high can either be float numbers (standard IDL)
		or can be set to !VALUES.F_NAN (NaN). If an entry is
		specified as NaN its translated into a float number
		using the following convention:
		low = MIN(0., MIN(x|y)), high = MAX(0., MAX(x|y))
	/XNOZERO:	Same as IDL plot keyword parameter /YNOZERO but for x axis
	MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
	Y_AT_XPOS:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible
	X_OFFSET = js_offset: On return js_offset holds the offset of the time axis in Js to adopt
		actual time range to the precision of a floating point number (XRANGE is of type float).
	/SHARE_YAXIS: If set, all data sets will share one y axis.
	INDEX = index: Index of data to be plotted.
	/NO_DATA: If set no data will be plotted.

	any other keywords which are excepted by the IDL PLOT, OPLOT, and AXIS command

 EXAMPLE:
	mplot, FINDGEN(10), PSYM = 4, /DLINE

	or

	x_data = DINDGEN(10) * 100 + dmyhms2js('28.10.1999 17:46:00')
	y_str = {y0: FINDGEN(10), y1: SQRT(FINDGEN(10)), y2: EXP(FINDGEN(10))}
	psym = [[4], [5], [-2]]
	yt = [['Linear'], ['SQRT'], ['EXP']]
	yatx = [[0], [1], [1.25]]
	mplot, x_data, y_str, PSYM = psym, YTITLE = yt, Y_AT_XPOS = yatx, /TIMEAXIS, XMARGIN = [10, 20], L_KEY = 1

	or

	icgs0 = read_enz('O3_data.enz')
	icgs1 = read_ncdf('HOx_data.nc')
	icgs2 = read_ncdf('NOx_data.nc')
	mplot, icgs0, icgs1, icgs2,

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 28.10.1999
	08.11.1999:	Header edited
	11.11.1999:	Call to icgs2plot2c was exchanged against call to icgs_plot
	15.11.1999:	Removed bug. If icg strucrure was passed, the close_device statement was never reached.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\mplot.pro)


MPLOT2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mplot2

 PURPOSE:
	General purpose x,y plot routine

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	mplot, [x_data,] y_data
	mplot, [x_data,] y_str		(if all y data sets share same x data - e.g. time series)
	mplot, [x_str,] y_str
	mplot, icgs0 [, icgs1, icgs2, icgs3, icgs4, icgs5]
	mplot, p_icgs

 INPUTS:
	y_data:	Array with y data.
	y_str:	Structure of arrays with y data (e.g. {y0: FINDGEN(10), y1: SQRT(FINDGEN(10))} ).
	icgs0:	ICG structure
	p_icgs:	Pointer or array of pointers to ICG structure(s)

 OPTIONAL INPUTS:
	x_data:	Array with x data.
	x_str:	Structure of arrays with x data.
	icgs1, icgs2, icgs3, icgs4, icgs5: More ICG structures

 KEYWORD PARAMETERS:
	AXIS_COLOR: Color to be used for axes and annotation (default: !P.COLOR)
	/NO_XANNOTATION: If set no annotation of the x axis will be plotted
	/NO_YANNOTATION: If set no annotation of the y axis will be plotted
	/NO_TITLE: If set no title will be plotted
	/HLINE: horizontal line will be plotted with the following defaults:
		HL_VALUE = 0.0 (e.g. @ y = 0). Entry may also be a vector to plot more than one horizontal line.
		HL_STYLE = 2
		HL_THICK = 1.0
		HL_COLOR = axis_color
	/VLINE: vertical line will be plotted with the following defaults:
		VL_VALUE = 0.0 (e.g. @ x = 0). Entry may also be a vector to plot more than one vertical line.
		VL_STYLE = 2
		VL_THICK = 1.0
		VL_COLOR = axis_color
	/DLINE: arbitrary line will be plotted with the following defaults:
		DL_VALUE = Coordinates of plot to yield 1:1 straight line
		DL_STYLE = 2
		DL_THICK = 1.0
		DL_COLOR = axis_color
	/TIMEAXIS: The x axis is formatted as a time axis with the following optional keyword parameters:
		TIMEFORMAT = tf where tf may be any meaningfull sub string of 'dd.mm.yy hh:mm:ss'
		TIMESTEP = ts (major time intervall in seconds)
		/NO_DATE: If set, no date information is appended to the ticknames even if the
			displayed time range covers a change of date.
	MY_PLOTSTR = my_pls: name of structure with default settings for any number of plot keywords.
	XERR = x_err_data: array of X error bar values.
	YERR = y_err_data: array of Y error bar values.
	/TAX_BREAK: Applies to time axis only. If set, data points which are further apart
		then 1/24 of the data time range are not connected by a line.
	TBREAK_INTV = tbi: Time interval in sec to be used by TAX_BREAK.
	[XY]RANGE = [low, high]:
		low, high can either be float numbers (standard IDL)
		or can be set to !VALUES.F_NAN (NaN). If an entry is
		specified as NaN its translated into a float number
		using the following convention:
		low = MIN(0., MIN(x|y)), high = MAX(0., MAX(x|y))
	/XNOZERO:	Same as IDL plot keyword parameter /YNOZERO but for x axis
	MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
	Y_AT_XPOS:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible
	X_OFFSET = js_offset: On return js_offset holds the offset of the time axis in Js to adopt
		actual time range to the precision of a floating point number (XRANGE is of type float).
	/SHARE_YAXIS: If set, all data sets will share one y axis.
	INDEX = index: Index of data to be plotted.
	/NO_DATA: If set no data will be plotted.

	any other keywords which are excepted by the IDL PLOT, OPLOT, and AXIS command

 EXAMPLE:
	mplot, FINDGEN(10), PSYM = 4, /DLINE

	or

	x_data = DINDGEN(10) * 100 + dmyhms2js('28.10.1999 17:46:00')
	y_str = {y0: FINDGEN(10), y1: SQRT(FINDGEN(10)), y2: EXP(FINDGEN(10))}
	psym = [[4], [5], [-2]]
	yt = [['Linear'], ['SQRT'], ['EXP']]
	yatx = [[0], [1], [1.25]]
	mplot, x_data, y_str, PSYM = psym, YTITLE = yt, Y_AT_XPOS = yatx, /TIMEAXIS, XMARGIN = [10, 20], L_KEY = 1

	or

	icgs0 = read_enz('O3_data.enz')
	icgs1 = read_ncdf('HOx_data.nc')
	icgs2 = read_ncdf('NOx_data.nc')
	mplot, icgs0, icgs1, icgs2,

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 28.10.1999
	08.11.1999:	Header edited
	11.11.1999:	Call to icgs2plot2c was exchanged against call to icgs_plot
	15.11.1999:	Removed bug. If icg strucrure was passed, the close_device statement was never reached.
	24.01.2000:	The call to init_dev has been removed from this routine.
	01.03.2000:	Test on icgs2mplot structure: TAG 'yname' is no longer required.
	16.03.2000:	Change in procedure definition statement: _EXTRA = e to _REF_EXTRA = e

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\mplot2.pro)


MPLOT_CORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	mplot_core

 PURPOSE:
	This procedure plots multiple data sets into one plot

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	mplot_core, [x_data,] y_data

 INPUTS:
	y_data:	Array or structure of arrays with y data.

 OPTIONAL INPUTS:
	x_data:	Array or structure of arrays with x data.

 KEYWORD PARAMETERS:
	AXIS_COLOR: Color to be used for axes and annotation (default: !P.COLOR)
	/NO_XANNOTATION: If set no annotation of the x axis will be plotted
	/NO_YANNOTATION: If set no annotation of the y axis will be plotted
	/NO_TITLE: If set no title will be plotted
	/HLINE: horizontal line will be plotted with the following defaults:
		HL_VALUE = 0.0 (e.g. @ y = 0). Entry may also be a vector to plot more than one horizontal line.
		HL_STYLE = 2
		HL_THICK = 1.0
		HL_COLOR = axis_color
	/VLINE: vertical line will be plotted with the following defaults:
		VL_VALUE = 0.0 (e.g. @ x = 0). Entry may also be a vector to plot more than one vertical line.
		VL_STYLE = 2
		VL_THICK = 1.0
		VL_COLOR = axis_color
	/DLINE: arbitrary line will be plotted with the following defaults:
		DL_VALUE = Coordinates of plot to yield 1:1 straight line
		DL_STYLE = 2
		DL_THICK = 1.0
		DL_COLOR = axis_color
	/TIMEAXIS: The x axis is formatted as a time axis with the following optional keyword parameters:
		TIMEFORMAT = tf where tf may be any meaningfull sub string of 'dd.mm.yy hh:mm:ss'
		TIMESTEP = ts (major time intervall in seconds)
		/NO_DATE: If set, no date information is appended to the ticknames even if the
			displayed time range covers a change of date.
	MY_PLOTSTR = my_pls: name of structure with default settings for any number of plot keywords.
	XERR = x_err_data: array of X error bar values.
	YERR = y_err_data: array of Y error bar values.
	/TAX_BREAK: Applies to time axis only. If set, data points which are further apart
		then 1/24 of the data time range are not connected by a line.
	TBREAK_INTV = tbi: Time interval in sec to be used by TAX_BREAK.
	[XY]RANGE = [low, high]:
		low, high can either be float numbers (standard IDL)
		or can be set to !VALUES.F_NAN (NaN). If an entry is
		specified as NaN its translated into a float number
		using the following convention:
		low = MIN(0., MIN(x|y)), high = MAX(0., MAX(x|y))
	/XNOZERO:	Same as IDL plot keyword parameter /YNOZERO but for x axis
	MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
	Y_AT_XPOS:	Position where the y axis intersects the x axis in normal coordinates
		0 - x_min, 1 - x_max, values <0 or >1 are possible
	X_OFFSET = js_offset: On return js_offset holds the offset of the time axis in Js to adopt
		actual time range to the precision of a floating point number (XRANGE is of type float).
	/SHARE_YAXIS: If set, all data sets will share one y axis.
	INDEX = index: Index of data to be plotted.
	/NO_DATA: If set no data will be plotted.

	any other keywords which are excepted by the IDL PLOT, OPLOT, and AXIS command

 EXAMPLE:
	see ex_mplot_core.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 16. Dec. 97.
	18.01.1998:	All keyword parameters are passed into _EXTRA
	21.01.1998:	New keyword: NO_XANNOTATION
	09.02.1998:	Handling of false calls to plot_2c
	3./4. 1998:	New keywords: H_LINE, V_LINE and TIMEAXIS
	01.05.1998:	New keyword: MY_PLOTSTR
	08.06.1998:	New keyword: X_OFFSET
	09.11.1998:	New keyword: NO_YANNOTATION
	28.04.1999:	Header edited
	29.04.1999:	Routine tag_defined wurde durch is_tag ersetzt
					Routine concat_str2 wurde durch concat_str mit Keyword /PARSE ersetzt
	21.06.1999:	Routine noch einmal überarbeitet.
					mplot_leg und mplot_extr_data in diese Datei mit aufgenommen.
	29.07.1999:	New keyword: SHARE_YAXIS
	20.08.1999:	YTITLE is not longer used as legend text. Either LEGEND_TEXT
					(if specified) or Y tagnames are used.
	01.10.1999:	Mew keyword parameter: INDEX = index
	20.10.1999:	New keyword: NO_DATA
	25.10.1999:	Now correctly handels ytitles of shared data sets: If two or more
					data sets share a common y axis then its y title is a composit of all
					individuel y titles.
	27.10.1999:	Bug removed if index = -1
	28.10.1999:	Bug removed if two positional arguments were passed
					but one or both were not defined.
	!!!!!			Routine was renamed into mplot_core
	20.01.2000:	Keyword parameter charsize is now handeled correctly by mplot_core_leg
	29.02.2000:	Keyword parameter charthick is now handeled correctly by mplot_core_leg
	01.03.2000:	Time gaps in time series data are now handled correctly for the first
					as well as for overplotted data sets.
	01.03.2000:	Bug removed if index is a scalar.
	27.03.2000:	Changed from plotleg3 to plotleg4
	28.03.2000:	Removed bug if all y_err_data are NaN.
	16.05.2000:	mplot_core_leg: If legend_text EQ '' no legend will be plotted for that data set

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\mplot_core.pro)


MPNORMLIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPNORMLIM

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute confidence limits for normally distributed variable

 MAJOR TOPICS:
   Curve and Surface Fitting, Statistics

 CALLING SEQUENCE:
   Z = MPNORMLIM(PROB, [/CLEVEL, /SLEVEL ])

 DESCRIPTION:

  The function MPNORMLIM() computes confidence limits of a normally
  distributed variable (with zero mean and unit variance), for a
  desired probability level.  The returned values, Z, are the
  limiting values: a the magnitude of a normally distributed value
  is greater than Z by chance with a probability PROB:

    P_NORM(ABS(X) > Z) = PROB

  In specifying the probability level the user has two choices:

    * give the confidence level (default);

    * give the significance level (i.e., 1 - confidence level) and
      pass the /SLEVEL keyword; OR

  Note that /SLEVEL and /CLEVEL are mutually exclusive.

 INPUTS:

   PROB - scalar or vector number, giving the desired probability
          level as described above.

 RETURNS:

  Returns a scalar or vector of normal confidence limits.

 KEYWORD PARAMETERS:

   SLEVEL - if set, then PROB describes the significance level.

   CLEVEL - if set, then PROB describes the confidence level
            (default).

 EXAMPLE:

   print, mpnormlim(0.99d, /clevel)

   Print the 99% confidence limit for a normally distributed
   variable.  In this case it is about 2.58 sigma.

 REFERENCES:

   Algorithms taken from CEPHES special function library, by Stephen
   Moshier. (http://www.netlib.org/cephes/)

 MODIFICATION HISTORY:
   Completed, 1999, CM
   Documented, 16 Nov 2001, CM
   Reduced obtrusiveness of common block and math error handling, 18
     Nov 2001, CM

  $Id: mpnormlim.pro,v 1.3 2001/11/18 12:59:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpnormlim.pro)


MPNORMTEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   MPNORMTEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute the probability of a given normally distributed Z value

 MAJOR TOPICS:
   Curve and Surface Fitting, Statistics

 CALLING SEQUENCE:
   PROB = MPNORMTEST(Z, [/CLEVEL, /SLEVEL ])

 DESCRIPTION:

  The function MPNORMTEST() computes the probability for the
  magnitude of a value drawn from the normal distribution to equal or
  exceed the given value Z.  This can be used for confidence testing
  of a measured value obeying the normal distribution.

    P_NORM(ABS(X) > Z) = PROB

  In specifying the returned probability level the user has two
  choices:

    * return the confidence level when the /CLEVEL keyword is passed;
      OR

    * return the significance level (i.e., 1 - confidence level) when
      the /SLEVEL keyword is passed (default).

  Note that /SLEVEL and /CLEVEL are mutually exclusive.

 INPUTS:

   Z - the value to best tested.  Z should be drawn from a normal
       distribution with zero mean and unit variance.  If a given
       quantity Y has mean MU and standard deviation STD, then Z can
       be computed as Z = (Y-MU)/STD.

 RETURNS:

  Returns a scalar or vector of probabilities, as described above,
  and according to the /SLEVEL and /CLEVEL keywords.

 KEYWORD PARAMETERS:

   SLEVEL - if set, then PROB describes the significance level
            (default).

   CLEVEL - if set, then PROB describes the confidence level.

 EXAMPLES:

   print, mpnormtest(5d, /slevel)

   Print the probability for the magnitude of a randomly distributed
   variable with zero mean and unit variance to exceed 5, as a
   significance level.

 REFERENCES:

   Algorithms taken from CEPHES special function library, by Stephen
   Moshier. (http://www.netlib.org/cephes/)

 MODIFICATION HISTORY:
   Completed, 1999, CM
   Documented, 16 Nov 2001, CM
   Reduced obtrusiveness of common block and math error handling, 18
     Nov 2001, CM

  $Id: mpnormtest.pro,v 1.4 2001/11/18 12:59:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\mpnormtest.pro)


MPRANK

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

 purpose       compute the nth percentile value in each of a number of a
               image superpixel subregions
 input:

   image       image array

   perc        percentile threshold ( measured from the top, 
               ie perc=7 => the pixel value which is at the 93% percentile))

   binsize     size of subregions (assumed square)

 keyword input:

   interp      if set use, interpolation is used to resize results up
               to the input image size. A boxy result is ofter produced
               when INTERP is not set.
 output:

   result=     value of pixels which are at the PERC percentilie in the
               subarea.  Values are CONGRIDed up to the size of image.

 procedure:    MPRANK looks at each subregion in the image and seperately
               evaluates the value within that subregion which is in the
               upper PERC percentile.  The result of the function are
               these values CONGRIDed up to the size of the original image.
 

 EXAMPLE:
               n=256
               xs=sqrt(findgen(n))                  
               ys=sqrt(findgen(n))                  ; xss and yss are used
               xss=xs # replicate(1,n_elements(ys)) ; to give the random
               yss=replicate(1,n_elements(xs)) # ys ; data a nice shape
               f=randata(n,n,s=4)
               !p.multi=[0,2,2]
               tvim,f,title='original data'
               tvim,mprank(f,5,32),title='no interp'
               tvim,mprank(f,5,32,/interp),title='with interp'

  author:  Paul Ricchiazzi                            Nov93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mprank.pro)


MSTDEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MSTDEV

 PURPOSE:
	Compute the standard deviation and, optionally, the
	mean of any array.

 CATEGORY:
	G1- Simple calculations on statistical data.

 CALLING SEQUENCE:
	Result = STDEV(Array [, Mean])

 INPUTS:
	Array:	The data array.  Array may be any type except string.

 OUTPUTS:
	STDEV returns the standard deviation (sample variance
	because the divisor is N-1) of Array.
		
 OPTIONAL OUTPUT PARAMETERS:
	Mean:	Upon return, this parameter contains the mean of the values
		in the data array.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Mean = TOTAL(Array)/N_ELEMENTS(Array)
	Stdev = SQRT(TOTAL((Array-Mean)^2/(N)))

 MODIFICATION HISTORY:
	DMS, RSI, Sept. 1983.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mstdev.pro)


MSVELOVECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MSVELOVECT

 PURPOSE:
	Produce a two-dimensional velocity field plot.

	A directed arrow is drawn at each point showing the direction and 
	magnitude of the field.

       This routine was developed from the original VELOVECT routine
       and now allows two dimensional arrays for X and Y for irregularily
       spaced data.
               
 CATEGORY:
	2D Graphics

 CALLING SEQUENCE:
	MSVELOVECT, U, V [, X, Y]

 INPUTS:
	U:	The X component of the two-dimensional field.  
		U must be a two-dimensional array.

	V:	The Y component of the two dimensional field.  Y must have
		the same dimensions as X.  The vector at point [i,j] has a 
		magnitude of:

			(U[i,j]^2 + V[i,j]^2)^0.5

		and a direction of:

			ATAN2(V[i,j],U[i,j]).

 OPTIONAL INPUT PARAMETERS:
 	X:	Optional abcissae values.  X must be a vector with a length 
		equal to the first dimension of U and V *OR* a 2-dimensional
               array with the same dimensions as U and V.

	Y:	Optional ordinate values.  Y must be a vector with a length
		equal to the first dimension of U and V *OR* a 2-dimensional
               array with the same dimensions as U and V.

 KEYWORD INPUT PARAMETERS:
	COLOR:	The color index used for the plot.

	DOTS:	Set this keyword to 1 to place a dot at each missing point. 
		Set this keyword to 0 or omit it to draw nothing for missing
		points.  Has effect only if MISSING is specified.

	LENGTH:	Length factor.  The default of 1.0 makes the longest (U,V)
		vector the length of a cell.
              ### Franz Rohrer's modification of the LENGTH keyword:
              LENGTH now applies a scale factor relative to the data values,
              not just a relative scaling. If you don't specify LENGTH it acts
              as before.

       MISSING: Missing data value.  Vectors with a LENGTH greater
		than MISSING are ignored.

       OVERPLOT: Set this keyword to make VELOVECT "overplot".  That is, the
               current graphics screen is not erased, no axes are drawn, and
               the previously established scaling remains in effect.

       NOZERO: Do not plot zero vectors as dots.

	Note:   All other keywords are passed directly to the PLOT procedure
		and may be used to set option such as TITLE, POSITION, 
		NOERASE, etc.
 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Plotting on the selected device is performed.  System
	variables concerning plotting are changed.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.  Unrecognized keywords are passed to the PLOT
	procedure.  

 MODIFICATION HISTORY:
	DMS, RSI, Oct., 1983.
	For Sun, DMS, RSI, April, 1989.
	Added TITLE, Oct, 1990.
	Added POSITION, NOERASE, COLOR, Feb 91, RES.
	August, 1993.  Vince Patrick, Adv. Visualization Lab, U. of Maryland,
		fixed errors in math.
	August, 1993. DMS, Added _EXTRA keyword inheritance.
	January, 1994, KDB. Fixed integer math which produced 0 and caused
		            divide by zero errors.
	December, 1994, MWR. Added _EXTRA inheritance for PLOTS and OPLOT.
	June, 1995, MWR. Removed _EXTRA inheritance for PLOTS and changed
			 OPLOT to PLOTS.
       September, 1996, GGS. Changed denominator of x_step and y_step vars. 
       February, 1998, DLD.  Add support for CLIP and NO_CLIP keywords.
       June, 1998, DLD.  Add support for OVERPLOT keyword.
       16 Sep 1999: Martin Schultz added support for 2D U and V arrays
              cleaned up the routine some and added the NOZERO keyword.
              (renamed as msvelovect.pro on Sep 23)
              Also included Franz Rohrer's modification of the LENGTH keyword:
              LENGTH now applies a scale factor relative to the data values,
              not just a relative scaling. If you don't specify LENGTH it acts
              as before.
       29 Feb 2000: mgs. Bug fix: for loop needs long int!
              Also sx and sy are now always computed even if no x or
              y are passed into routine.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\msvelovect.pro)


MULTICOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MULTICOL
 PURPOSE:
       Reformat a string array into multi-columns.
 CATEGORY:
 CALLING SEQUENCE:
       out = multicol(in)
 INPUTS:
       in = input 1-d string array to reformat.  in
 KEYWORD PARAMETERS:
       Keywords:
         LINES=ln how many lines per page (def=50).
           This is in addition to a page number and column headers.
         COLUMNS=col how many columns per page (def=2).
         SPACES=sp array of spaces before each column (def=none).
           Reuses last element repeatedly if needed.
         HEADER=h column header string array, must be
           same width as IN, getting this right may be tricky.
         /PAGE means print page number.
         TOP=txt Line of text for top of each page.
 OUTPUTS:
       out = reformated string array.            out
         2-d array: out(lines, pages), so
         out(*,0) is first page.
 COMMON BLOCKS:
 NOTES:
       Notes: input string array may already have several
         columns of text. For example: let A and B be 1-d
         arrays, like fltarr(20).  Let SA=string(transpose(A)),
         and SB=string(transpose(b)).  Then S=SA+SB is a one
         column string array with A(i) and B(i) in each element.
         S may be sent to MULTICOL to reformat to several columns.
 MODIFICATION HISTORY:
       R. Sterner, 20 Sep, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\multicol.pro)


MULTIPANEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        MULTIPANEL

 PURPOSE:
        This routine provides an easy-to-use interface to 
        IDL's !p.multi mechanism and it can be used 
        to retrieve the position vector of the next plot 
        in line (even if !p.multi is not set). You can 
        specify plot margins and a page margin in normalized 
        coordinates.
           For multi-panel plots, multipanel works in three
        stages (somewhat similar to XInterAnimate): 
        1) set up a multi-panel page by specifying the number
           of rows and columns or the maximum number of plots
           on the page.
        2) advance to the next plot position and return that 
           position. If the page was filled (i.e. the maximum
           number of plots (advance steps) has been made, it 
           will be erased (unless /NOERASE is set).
        3) turn the multi-panel environment off and reset margin
           values.
        Subsequent PLOT, MAP_SET, etc. commands should use the
        POSITION vector returned from this routine and they should
        use the /NOERASE keyword.

 CATEGORY:
        Plotting tools

 CALLING SEQUENCE:
        Get position of next plot
        MULTIPANEL,position=p

        Setting up multi-panel pots
        MULTIPANEL,[rows=r,cols=c | nplots=n] [,options]

        Advance to the next panel (and get its position)
        MULTIPANEL,/advance [,position=p] [,options]

        Reset multi-panel environment to start over at the first panel
        MULTIPANEL,/reset   [,options]

        Turn multi-panel environment off (reset !p.multi and some other
        parameters)
        MULTIPANEL,/OFF

 INPUTS:
     Optionally you can give the number of plots (keyword NPLOTS) as
     a parameter instead. Th euse of a parameter will override the
     keyword.

 KEYWORD PARAMETERS:
        General keywords (honored under all circumstances)
        -------------------------------------------------------------------
        POSITION -> Returns a 4-element vector with the position of
            the next plot in the line. As always this vector contains
            [X0,Y0,X1,Y1].

        MARGIN -> specify a margin around the plot in normalized 
            coordinates. This keyword does not change any IDL
            system variables and will thus only become "visible" 
            if you use the POSITION returned by MULTIPANEL in subsequent plot
            commands.
            MARGIN can either be one value which will be applied to
            all four margins, or a 2-element vector which results in
            equal values for the left and right and equal values for 
            the bottom and top margins, or a 4-element vector with
            [left,bottom,right,top]. 

        OMARGIN -> specify a page margin around all panels in normalized
            coordinates. Works like MARGIN.
            
        Note that you can change the values of MARGIN and OMARGIN after
        you set up your plot page. The values given with MARGIN and OMARGIN 
        remain active until you specify a new one or use the /OFF keyword.

        /NOERASE -> This keyword prevents erasing the screen (or page) 
            when setting a multi-panel environment or after a page was
            filled. NOERASE is automatically turned ON when the /OFF
            keyword is given.


        Informational keywords:
        -------------------------------------------------------------------

        FIRSTPANEL -> returns 1 if the current plotting panel is
            the first one on a page

        LASTPANEL -> returns 1 if the current plotting panel is the last
            on a page

 
        Setting up a multi-panel page:
        -------------------------------------------------------------------
        ROWS, COLS -> specify the number of rows and columns
            you want on your page. If one is specified, the 
            other one must be given as well. Alternatively,
            you can use the NPLOTS keyword. 

        NPLOTS -> maximum number of plots on one page. The 
            number of rows and columns is automatically computed
            so that the plots "approach a square" and they are
            returned in the ROWS and COLS keywords. Setting
            NPLOTS to a ROWS*COLS value is equivalent to using
            ROWS and COLS. If you specify an "uneven" number
            (e.g. 5), multipanel,/advance will erase the page 
            after 5 plots instead of 6.

        /PORTRAIT -> Normally, ROWS tends to be larger than COLS
            when NPLOTS is used (e.g. 12 gives 4 rows and 3 cols).
            Use this keyword to revert this behaviour.

        /LANDSCAPE -> Make ROWS larger than COLS if necessary. This
            is the default. Thi skeyword is actually unnecessary and
            was introduced for purely aesthetic reasons (symmetry).


        Advance to the next plot:
        -------------------------------------------------------------------
        /ADVANCE -> this keyword issues a hidden plot command to find
            out the position of the next plot to be made. The position
            is then returned in the POSITION keyword. The value of
            !P.MULTI[0] is increased afterwards so that you can issue
            your plot command without explicitely specifying the
            position or /NOERASE. When the maximum number of plots set
            with NPLOTS is reached, MULTIPANEL,/ADVANCE will erase the
            screen and reset the plot position to the upper left corner.

        CURPLOT -> use this keyword to advance to a specific plot position
            on the page. If you specify 0, the screen will be erased.
            CURPLOT also returns the current plot number. If you don't
            want to set the plot number but just query it, you must pass 
            an undefined variable (see procedure UNDEFINE.PRO).


        Reset the plot position (and erase the screen)
        -------------------------------------------------------------------
        /RESET -> does just this.


        Turn multi-panel environment off
        -------------------------------------------------------------------
        /OFF -> Overrides all other keywords. Resets !p.multi to 0.
            

 OUTPUTS:
        none.

 SUBROUTINES:
        function GET__PLOTPOSITION() issues a dummy plot command
            and returns the plot position from the ![xy].window
            variables.

 REQUIREMENTS:
        none. (example uses RECTANGLE.PRO)

 NOTES:
        Side effect: Opens a window in standard size if none was open 
        before. This happens because the next plot position is 
        determined by issuing a hidden (or dummy) plot command with
        no visible output.
        
        Make sure to use POSITION=P,/NOERASE with all your PLOT, MAP_SET
        CONTOUR, etc. commands. In fact, you don't _need_ /NOERASE for
        PLOT, but it guarantees consistent behaviour with MAP_SET etc.)
        A PLOT command without /NOERASE will advance to the next panel
        and thereby interfere with MULTIPANEL's plot counter.

        If you don't use MARGIN and OMARGIN, the values in ![XY].margin
        ![XY].omargin will take effect.

        A common block is used to store the current plot number and 
        margin information. This limits the use to one window at a time
        (although you can save all parameters elsewhere and supply them
        to the routine on a window-by-window basis).

 EXAMPLES:
        ; just retrieve the position of the next plot
        ; ---------------------------------------------------------------
        MULTIPANEL,position=p
        PLOT,findgen(10),color=1,position=p,/noerase

        ; same thing but use a specific margin (2-element form) 
        ; ---------------------------------------------------------------
        MULTIPANEL,margin=[0.1,0.05],position=p
        PLOT,findgen(10),color=1,position=p,/noerase

        ; (if you want to see both previous plots together use 
        ' /NOERASE with MULTIPANEL)

        ; multi-panel use:
        ; ---------------------------------------------------------------
        MULTIPANEL,NPlots=5                     ; set up for 5 plots
        for i=0,4 do begin
           MULTIPANEL,Position=p,margin=0.04    ; get current plot position
           plot,findgen(10),color=1,position=p,/noerase   ; plot
           MULTIPANEL,/Advance,/NoErase ; go to next panel
           ; note that the screen would be erased after the last plot
           ; without the /NoErase keyword.
        endfor
        ; now let's draw a frame around everything
        MULTIPANEL,/OFF,omargin=0.01,margin=0.,position=p,/noerase 
        Rectangle,p,xvec,yvec                   ; <<< uses RECTANGLE.PRO !!
        plots,xvec,yvec,color=1,/norm

 MODIFICATION HISTORY:
        mgs, 19 Mar 1999: VERSION 1.00
        mgs, 22 Mar 1999: - improved documentation, changed OMARGIN
                 to accept normalized coordinates.
                          - position now also returned if turned OFF
                          - added FIRSTPANEL and LASTPANEL keywords
                          - allow NPLOTS to be specified as parameter 
        mgs, 02 Jun 1999: - now saves old values of !X, !Y, and !P
                            and restores them when turned OFF.
        mgs, 03 Jun 1999: - save !X, !Y, and !P only if !p.multi was 
                            really off
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\multipanel.pro)


MULTISORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     MULTISORT

 PURPOSE:
     hierarchical sorting of a data set, each column can be sorted
     reversely. Works well together with W_SORT, a widget interface 
     that handles up to three sort levels(columns). COLUMNS are defined
     as first array index (e.g. DATA=FLTARR(5,20) has 5 columns).

 CATEGORY:
     Data sorting, filtering and statistics

 CALLING SEQUENCE:
     multisort,data,index=index,revert=revert

 INPUTS:
     DATA --> a 2D array to be sorted

 KEYWORD PARAMETERS:
     INDEX --> an integer or integer array containing the indices for
         which the array shall be sorted (e.g. [ 3,1,0 ] will sort DATA
         first by column 3, then within groups of same values for column
         3 values will be sorted by column 1, and finally by column 0.
         Default is to sort by the first column.

     REVERT --> an integer or integer array indicating which columns shall
         be sorted in reverse order. REVERT=1 reverts all sorting,
         REVERT=[0,1,0] reverts the sort order only for the 2nd column.
         Default is 0, i.e. do not revert.


 OUTPUTS:
     The DATA array will be sorted according to the specifications.

 SUBROUTINES:
     testsort : little test program (historic debugging purposes)

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
     Sort data first in column 3, then in reverse order for column 1,
     and finally ascending order for column 0.
            multisort,data,index=[3,1,0],revert=[0,1,0]

 MODIFICATION HISTORY:
        mgs, 30 Jun 1997: VERSION 1.00
        mgs, 08 Apr 1998: - now stand-alone routine and documentation
        mgs, 22 Dec 1998: - bug fix (startindex must be -1)
        mgs, 17 Mar 1999: - bug fix: now has default 0 for revert
                            (thanks to G. Fireman)
        mgs, 26 Aug 2000: - copyright changed to open source
                          - loop variables now long
                          - [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\multisort.pro)


MULTI_DAY_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   multi_day_plot

 PURPOSE:
   This routine produces a postscript file with small plots of one
   day of a dataset given by the vectors of julian seconds and
   the data array

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   multi_day_plot, name, time, value

 INPUTS:
   name:   the name of the enz data File#
   time:   array with julian sec
   value:  array (same size as time) with data values

 KEYWORD PARAMETERS:
   rows:   number of rows (default=3)
   cols:   number of cols (default=4)
   title:  title string, if omitted title is name + date
   stat:   if set small statistics is printed on side of plot
   stamp:  plot stamp with info about time, user, file, etc.

   further keyword parameters of the jsplot routine are parsed thru
   the extra keyword

 MODIFICATION HISTORY:
   Written by: T.Brauers , Dec 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\multi_day_plot.pro)


MUSLOPE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  muslope

 PURPOSE:  compute dot product of surface normal to incomming solar ray

 USEAGE:   result=muslope(sunzen,sunaz,nrmzen,nrmaz)

 INPUT:    

   sunzen  solar zenith angle (degrees)

   sunaz   solar azimuth angle (clockwise from due north, degrees) 

   nrmzen  zenith angle of surface normal vector
           (nrmzen=0 for a horizontal surface)

   nrmaz   azimuth angle of surface normal vector (nrmaz=45 degrees
           for a surface that slopes down in the north-east direction)

 OUTPUT:
   result  the dot product of the surface-to-sun unit vector
           and the surface normal unit vector. 

 EXAMPLE:  

;  find the solar zenith and azimuth for 3 pm, january 8

   zensun,8,15.,34.456,-119.813,sunzen,sunaz,/local

;  compute surface solar flux onto a surface inclined
;  5 degrees to the north-east

   print,f='(3a15/3g15.4)','solar zenith','cos(sunzen)','muslope', $
      sunzen,cos(sunzen*!dtor),muslope(sunzen,sunaz,5.,45.)

 AUTHOR:   Paul Ricchiazzi                        08 Jan 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\muslope.pro)


MUSTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	muster

 PURPOSE:
   This procedure is an example for creating a simple netCDF File

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   muster

 OUTPUTS:
   output is a netCDF File

 EXAMPLE:
   muster

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\muster.pro)


MVE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:                 mve

 AUTHOR:                 Terry Figel, ESRG, UCSB 10-21-92

 CALLING SEQUENCE:        mve,var

 INPUT:   
              var         an array

 PURPOSE:                 print out the max min mean and std deviation of var

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\mve.pro)


MYNAME_IS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     myname_is

 PURPOSE:
     The result of this function is the username of the caller

 CATEGORY:
    PROG_TOOLS

 CALLING SEQUENCE:
  result=myname_is()

 OUTPUTS
   result: a string holding the username

 MODIFICATION HISTORY:
       R. Bauer, 1998-Jun-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\myname_is.pro)


MZOOM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MZOOM
 PURPOSE:
       Compute new region needed to zoom a mandelbrot image.
 CATEGORY:
 CALLING SEQUENCE:
       mzoom, rin, img, rout
 INPUTS:
       rin = complex plane region to zoom into.   in
         Same format as for mandlebrot.
       img = mandelbrot image to zoom into.       in
         Image for region rin.
 KEYWORD PARAMETERS:
 OUTPUTS:
       rout = new complex plane region.           out
         Use as input to mandlebrot.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 20 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\mzoom.pro)


N1001_G

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1997, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.

 NAME:
	n1001_g

 PURPOSE:
   This procedure reads all nasa1001 global Attributes into the structure INHALT


 CATEGORY:
   DATAFILES/NASA_AMES


 CALLING SEQUENCE:
   n1001_g,file=file,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n1001_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26 1997 areal in type renamed
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_g
                                            to n1001_g
                                            the procedure nasa_g now will use n1001_g
                                            if the NASA Format is 1001
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n1001_g.pro)


N1001_GR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n1001_gr

 PURPOSE:
   This procedure reads from a NASA 1001 data file a parameter with all it's attributes and all global informations
   into the structure inhalt

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n1001_gr,file=file,name=name,inhalt=inhalt,[/no_cache],[experiment=experiment],[platform=platform],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File
   name:   the short_name of a parameter in a nasa 1001 File

 OPTIONAL INPUTS:
   inpath: maybe the path
   platform: to describe the platform type e.g. AIRCRAFT this is the default too
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file
   no_cache: if set no cache file is used
   new_cache: if set old cache file is removed

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n1001_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26. 1997 areal in type renamed
                       R.Bauer June 28. 1997 param_units conversion better
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_gr
                                            to n1001_gr
                                            the procedure nasa_gr now will use n1001_gr
                                            if the NASA Format is 1001
1998-01-16 number_format changed to find_form
1999-04-21 openr/readf changed to read_data_file
1999-04-21 default data is cached additional keywords no_cache and new_cache added
1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n1001_gr.pro)


N1001_NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n1001_ncdf

 PURPOSE:
   This procedure translates all parameters in a nasa 1001 File to a netCDF File

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   n1001_ncdf,files,[time_offset=time_offset],[param_sample_interval=param_sample_interval],[/first],[/trans]

 INPUTS:
   files: name of the nasa ames file

 OPTIONAL INPUTS:
   time_offset:           Offset for the time
   param_sample_interval: The sample interval

 KEYWORD PARAMETERS:
	first: to create in the icg-1 database a translationscript
   trans: to use the translationscript

 OUTPUTS:
   This procedure writes with ncdf_w a netCDF File

 EXAMPLE:
   n1001_ncdf,/first

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 13. 1997
 1998-Jun-05  input  added: files
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n1001_ncdf.pro)


N1010_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n1010_g

 PURPOSE:
   This procedure reads all nasa1010 global Attributes into the structure INHALT


 CATEGORY:
   DATAFILES/NASA_AMES


 CALLING SEQUENCE:
   n1010_g,file=file,inhalt=inhalt,[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1010 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n1010_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26 1997 areal in type renamed
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_g
                                            to n1010_g
                                            the procedure nasa_g now will use n1010_g
                                            if the NASA Format is 1010
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n1010_g.pro)


N1010_GR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n1010_gr

 PURPOSE:
   This procedure reads from a NASA 1010 data file a parameter with all it's attributes and all global informations
   into the structure inhalt

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n1010_gr,file=file,name=name,inhalt=inhalt,[experiment=experiment],[platform=platform],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File
   name:   the short_name of a parameter in a nasa 1001 File

 OPTIONAL INPUTS:
   platform: to describe the platform type e.g. AIRCRAFT this is the default too
   inpath: maybe the path

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n1010_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
                       R.Bauer Feb. 26. 1997 areal in type renamed
                       R.Bauer June 28. 1997 param_units conversion better
                       R.Bauer June 30 1997 the procedure name was renamed from nasa_gr
                                            to n1010_gr
                                            the procedure nasa_gr now will use n1010_gr
                                            if the NASA Format is 1001
;   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n1010_gr.pro)


N2160B2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  n2160b2ncdf

 PURPOSE:
  This  procedure will translate a n2160b Data File and translate it into
  a netCDF File.

 CATEGORY:
  DATAFILES/FILTER

 CALLING SEQUENCE:
  n2160b2ncdf

 EXAMPLE:
  n2160b2ncdf

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160b2ncdf.pro)


N2160B_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n2160b_g

 PURPOSE:
   This procedure reads all NASA 2160b global Attributes into the structure INHALT

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n2160b_g,file=file,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n2160b_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
               R.Bauer Feb. 26 1997 areal in type renamed
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160b_g.pro)


N2160B_GR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n2160b_gr

 PURPOSE:
   This procedure reads from a NASA 2160b file a parameter with all it's attributes, all global informations
   and the belonging time into the structure inhalt

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n2160b_gr,file=file,name=name,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File
   name:   the short_name of a parameter in a nasa 1001 File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n2160b_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
               R.Bauer Feb. 26. 1997 areal in type renamed
               R.Bauer June 28. 1997 param_units conversion better
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160b_gr.pro)


N2160B_TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n2160b_trans

 PURPOSE:
	This  procedure will translate a n2160b Data File and translate it into
   a netCDF File.

 CATEGORY:
	OBSOLETE


 CALLING SEQUENCE:
	n2160b_trans


 EXAMPLE:
   n2160b_trans

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160b_trans.pro)


N2160_2_NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  n2160_2_ncdf

 PURPOSE:
  This  procedure will translate a n2160 Data File (e.g. CNES ozone file) into  a netCDF File.

 CATEGORY:
  DATAFILES/FILTER

 CALLING SEQUENCE:
  n2160_2_ncdf

 EXAMPLE:
  n2160_2_ncdf

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160_2_ncdf.pro)


N2160_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n2160_g

 PURPOSE:
   This procedure reads all nasa2160 global Attributes into the structure INHALT

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n2160_g,file=file,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n2160_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
               R.Bauer Feb. 26 1997 areal in type renamed
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160_g.pro)


N2160_GR

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1997, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.

 NAME:
	n2160_gr

 PURPOSE:
   This procedure reads from the NASA 2160 data file a parameter with all it's attributes and all global informations
   into the structure inhalt

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   n2160_gr,file=file,name=name,inhalt=inhalt,[experiment=experiment],[platform=platform],[inpath=inpath],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File
   name:   the short_name of a parameter in a nasa 1001 File

 OPTIONAL INPUTS:
   platform: to describe the platform type e.g. BALLOON this is the default too
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   n2160_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 2 1996
               R.Bauer Feb. 26. 1997 areal in type renamed
               R.Bauer June 28. 1997 param_units conversion better
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n2160_gr.pro)


N2S

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n2s

 PURPOSE:
	This function coverts a number into a string with blanks stripped off.

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	Result = n2s(number [, FORMAT = format])

 INPUTS:
	number:	number to be converted into string

 KEYWORD PARAMETERS:
	FORMAT = format:	String '(...)' with output format of number.
	/TRIM: If set together with FORMAT leading blanks of the formatted output will be removed.

 OUTPUTS:
	Result: Number converted to string

 EXAMPLE:
	print, '<' + n2s(54) + '>'
	print, '<' + n2s(34.12, FORMAT = '(F8.2)') + '>'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 11.03.99
	12.03.1999:	Header corrected
	23.07.1999:	Leading blancks are no longer removed when FORMAT keyword is specified.
	22.03.2000:	New keyword parameter /TRIM

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\n2s.pro)


NAMENUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NAMENUM
 PURPOSE:
       Break a name into a pattern and numbers in the name.
 CATEGORY:
 CALLING SEQUENCE:
       namenum, name, pat, i, j, k
 INPUTS:
       name = text string to analyze.              in
 KEYWORD PARAMETERS:
       Keywords:
         DIGITS=d  max number of digits in a number in the string.
 OUTPUTS:
       pat = pattern of text string.               out 
       i = number that was in the # position.      out 
       j = number that was in the $ position.      out 
       k = number that was in the % position.      out 
 COMMON BLOCKS:
 NOTES:
       Notes: Ex1: name='file7.txt' -> pat = 'file#.txt',  i=7
         Ex2: name='A1B2C3D' -> pat = 'A#B$C%D', i=1, j=2, k=3
         Ex3: name='A0005B' -> pat='A#B', i=5.
         If $ and % are not in resulting pattern then"
           j and k did not occur.
         Inverse of numname, see numname.
 MODIFICATION HISTORY:

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\namenum.pro)


NAMES_AND_PTRS2STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    names_and_ptrs2struct

 PURPOSE:
   This functions constructs a structure from a name and pointer data array

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=names_and_ptrs2struct(names,ptr_values,[sort=sort],[recurse=recurse])

 INPUTS:
   names:      the the names of the meta-structure to transform to a structure
   ptr_values: the pointer values of the meta-structure to transform to a structure

 KEYWORD PARAMETERS:
  sort: if set sort_names_and_ptrs is used to sort
  recurse: is used by recursion of names_and_ptrs2struct.

 PROCEDURE:
   This routine was written after a discussion of Frank Hollands Meta-Structure
   First idea Frank Holland, advanced idea Franz Rohrer and Reimar Bauer


 EXAMPLE:
   d={A:1,B:{B1:0,B2:1},C:2}
   n=struct2names_and_ptrs(d,names=names,ptr_values=ptr_values)
   PRINT,n
      4
   PRINT,names
     A B.B1 B.B2 C

   PRINT,ptr_values
   

   result=names_and_ptrs2struct(names,ptr_values)
   help,result,/str
   ** Structure <7d4eb68>, 2 tags, length=6, refs=1:
   A               INT              1
   B               STRUCT    ->  Array[1]
   C               INT              2

   help,result.b,/str
   ** Structure <7d4eef8>, 2 tags, length=4, refs=2:
   B1              INT              0
   B2              INT              1


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\names_and_ptrs2struct.pro)


NASA2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	nasa2ncdf

 PURPOSE:
   This procedure translates all parameters in a nasa 1001,1010,2160 File to a netCDF File

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   nasa2ncdf,files,[platform=platform],[time_offset=time_offset],[param_sample_interval=param_sample_interval],[/first],[/trans]

 INPUTS
   files: name of the nasa ames file

 OPTIONAL INPUTS:
   platform:              to describe the platform type e.g. AIRCRAFT this is the default too
   time_offset:           Offset for the time
   param_sample_interval: The sample interval

 KEYWORD PARAMETERS:
	first: to create in the icg-1 database a translationscript
   trans: to use the translationscript
   _extra: to submit keywords to nasa_gr
       no_cache: no cache file
       new_cache: def a new cache file

 OUTPUTS:
   This procedure writes with ncdf_w a netCDF File

 EXAMPLE:
   nasa2ncdf,/first

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May, 13. 1997
 1998-Jun-05  input  added: files

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nasa2ncdf.pro)


NASA_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	nasa_g

 PURPOSE:
   This procedure reads NASA global Attributes into the structure INHALT. NASA 1001,1010 and 2160 are known


 CATEGORY:
   DATAFILES/NASA_AMES


 CALLING SEQUENCE:
   nasa_g,file=file,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   nasa_g, file='test.nas', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 30 1997
   1998-Jan-16 case of 1010 added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nasa_g.pro)


NASA_GR

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1997, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.

 NAME:
	nasa_gr

 PURPOSE:
   This procedure reads NASA global Attributes and all parameter attributes of a choosen parameter into the structure INHALT
   It is able to read NASA 1001, NASA 1010 and NASA 2160

 CATEGORY:
   DATAFILES/NASA_AMES

 CALLING SEQUENCE:
   nasa_gr,file=file,name=name,inhalt=inhalt,[experiment=experiment],[inpath=inpath],[_extra=extra],[/xp]

 INPUTS:
   File:   the file_name of the nasa 1001 File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: for future use

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 EXAMPLE:
   nasa_gr, file='test.nas', name='F12',inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), June 30 1997
   1998-Jan-16 Format 1010 added
   1999-Apr-21 _extra added to n1001_gr
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nasa_gr.pro)


NATAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		NATAN
 VERSION:
		4.0
 PURPOSE:
		Calculates the function /int{(1 + x^2)^(-n-1)}, or, optionally,
		/int{(1 - x^2)^(-n-1)}
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = NATAN( X [, N [, /HYPER]])
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
	N
		Integer scalar, defaults to 0.
 KEYWORD PARAMETERS:
	/HYPER
		Switch, turns on the "hyperbolic" option.
 OUTPUTS:
		Returns /int{(1 + x^2)^(-n-1)} (for N = 0 it amounts to ATAN(X)), or,
		if /HYPER is set, /int{(1 - x^2)^(-n-1)} (for N = 0 this is the
		hyperbolic ATAN).  The result is of the same form as X, of type FLOAT
		or higher (if X is of a higher type).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		N must be >= 0, otherwise it is taken to be 0.
 PROCEDURE:
		Exact evaluation in powers of 1/(1 + x^2).  Uses CAST, DEFAULT, FPU_FIX
		and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 30-MARCH-1994 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\natan.pro)


NAXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NAXES
 PURPOSE:
       Find nice axis tics.
 CATEGORY:
 CALLING SEQUENCE:
       naxes, xmn, xmx ,nx, tx1, tx2, nt, xinc, ndec
 INPUTS:
       xmn, xmx = Axis min and max.			in.
       nx = Desired number of axis tics.			in.
 KEYWORD PARAMETERS:
       Keywords:
         /NO25  Means do not allow multiples of 2.5
            (Attempt to better match IDL axes ticks).
 OUTPUTS:
       tx1, tx2 = Sugested first and last tic positions.	out.
       nt = Suggested number of axis tics.			out.
       xinc = Sugggested tic spacing.			out.
       ndec = Suggested number tic label decimal places.	out.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 7 Nov, 1988 ---  Converted from FORTRAN.
       R. Sterner, 1997 Feb 18 --- Added /NO25
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\naxes.pro)


NCDF

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  ncdf

 PURPOSE:  

 USEAGE:   ncdf

 OUTPUT:    
  z      net_cdf variable (the last one selected for preview)
 

 KEYWORD INPUT/OUTPUT:

 file    A string containing the name of an existing NetCDF file or
         on return, the name of a selected file.

 dir     if set to one (an integer) the current directory is scanned
         for any files with a .cdf suffix.  If instead dir is set to
         a directory name (a string) then that directory is scanned
         for NetCDF files.  The list of files is presented as a menu,
         and information for a selected file is displayed.  If
         present, the command line argument, FILE, is set to the
         selected file, and can be used in subsequent commands.

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        20 Jul 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ncdf.pro)


NCDF2NASA1001

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ncdf2nasa1001

 PURPOSE:
   This routine is a filter for netCDF and NASA1001

 CATEGORY:
 DATAFILES/FILTER

 CALLING SEQUENCE:
   ncdf2nasa1001,file,[names],[/choose_names],[outpath=outpath]

 INPUTS:
   file: the file name of the netCDF data file

 OPTIONAL INPUTS:
   names: a subset of short names of the netCDF data file
   special_comment: if is set text is used as special comment line if not set the string "peliminary data" is default

 KEYWORD PARAMETERS:
   outpath: if set it is the output path where the result is saved to
   choose_names: if is set a widget is given to choose the short names of relevant

 EXAMPLE:
  ncdf2nasa1001,'avionik.nc',/choose_names,outpath='./'

 PROCEDURE:
   the output file name is given by:
       first two signs of experiment
       the date information
       first type_of_data (M: MEAUREMENTS or C: CALIBRATION'
       last two digits are the hour of the first time in the dataset

   if QUALITY is set for a parameter all values not having QUALITY EQ 0 will be set to missing_value

 MODIFICATION HISTORY:
   R.Bauer 1999 Apr. 19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf2nasa1001.pro)


NCDF_CH

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

 NAME:
	ncdf_ch

 PURPOSE:
   the procedure ncdf_ch will handle all kinds of possible netCDF renaming,
   adding and erasing of attributes.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_ch,file=file,[name=name],[new_name=new_name],[attname=attname],[attvalue=attvalue].[/global],[/history],[/delete],[/insert],[/append]

 INPUTS:
   file:      The file name of the netCDF file

 OPTIONAL INPUTS:
   attname:   The name of the netCDF Attribute
   attvalue:  The value of the netCDF Attribute
   name:      The short_name of a netCDF parameter
   new_name:  The new_name of a netCDF parameter

 KEYWORD PARAMETERS:
   global:    To indicate an global attribute
   history:   To set special mode for history
   delete:    To delete an attribute name whith value
   insert:    To insert an atribute name whith value
   append:    To append an attribute Value, separator is '!C' only by flag it's ' '

 EXAMPLE:
   1) To replace  a global attribute value
      ncdf_ch,file='/test.nc',attname='pi_name',attvalue='P.Muster',/glob,/rep
   2) To change a name
      ncdf_ch,file='/test.nc',name='sin2',new_name='sin3'
   3) To change a parameter attribute
      ncdf_ch,file='/test.nc',name='H113',attname='param_long_name',attvalue='mixing ratio',/del,/ins
   4) To add an history
      ncdf_ch,file='/test.nc',attvalue='testphase',/history

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), August 1997, 04
               R.Bauer, Sep. 1997 03 Replace faster
               R.Bauer, June 1998 08 a bit more user friendly if errors are occuring
               R.Bauer, June 1998 08 param_modification_time now changed if a name was submitted
               R.Bauer, June 1998 08 disabled replace because sometimes the filesystem isn't fast enough to copy the
                                     deleted one before the inserted one
                                     use the both keywords /del,/ins for this feature
   1999-Nov-06 help added
   1999-Nov-17 if attribute is altered or deleted the netCDF Cache file is removed too

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_ch.pro)


NCDF_FILES2ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ncdf_files2icg_struct

 PURPOSE:
  This function returns one icg_struct of all given files

 CATEGORY:
   ICG_STRUCT/DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=ncdf_files2icg_struct(files)

 INPUTS:
   files: the netcdf File names to concatinate to one icg_struct

 OUTPUTS:
   The result is the icg_struct

 PROCEDURE:
   This routine is under construction
   At the moment only a  minimum of tags is used in the result structure.
   The routine uses f_time to generate one master time of all given files
   Then the parameters of the files are added belonging to master time to one icg_struct using time_series_sync
   with an master_time_window of 0 Seconds.

 EXAMPLE:
   files=['S:/links/daten/experiments/stream1997/database/../0323_1/fish_cessna.nc',$
          'S:/links/daten/experiments/stream1997/database/../0323_1/avionik.nc',$
          'S:/links/daten/experiments/stream1997/database/../0323_1/cvi.nc']

   result=ncdf_files2icg_struct(files)

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1),  1999-MAY-06
 1999-Sep-06 exp key structure added
       2000-Feb-25: CATEGORY changed
 2000-May-11 : def_valid_tagname changed to text2tagname because of idl5.3 interpretation of signs in structures

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_files2icg_struct.pro)


NCDF_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_g

 PURPOSE:
   This procedure reads all defined global attribute from a netCDF File

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_g,file=file,[inhalt=inhalt],[experiment=experiment],[history=history],[inpath=inpath] ,[_extra=extra]

 INPUTS:
   file:   the file_name of the netCDF File
           if inpath too then file= inpath+File

 OPTIONAL INPUTS:
   inpath: maybe the path
   _extra: to stop error processing if more non positional keys are submitted

 KEYWORD PARAMETERS:
   xp:   to choose a file by dialog_pickfile

 OUTPUTS:
   inhalt:     the structure inhalt

 OPTIONAL OUTPUTS:
   experiment: the structure experiment with all experimentspecific attributes
   history:    the history field


 EXAMPLE:
   ncdf_g, file='test.nc', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5 1996
               R.Bauer Feb. 26 1997 areal in type renamed
               R.Bauer June 25 1997 all with execute
               R.Bauer Aug 12 1997 f_history included
               R.Bauer Sep 05 1998 remove of execute statement
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_g.pro)


NCDF_GET_1FIELD

[Previous Routine] [Next Routine] [List of Routines]
 Get a variable and its metadata from a NetCDF file

 Written 1 April 1993 by William Weibel, UCLA Atmospheric Sciences

 Source code control Id %W%	%G%

 USEAGE:    ncdf_get_1field, file, varname, z, name

 arguments
	file		string containing the name of the NetCDF file
	varname		name of the variable to read (string)
	z		dependent field variable, any data type
       name            ?

 bugs
	only gets data, doesn't slice yet
	assumes the field is rectilinear.
	The way multiple coordinate arrays are allocated is not pretty
	  passes only up to nine dimensions

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ncdf_get_1field.pro)


NCDF_GET_FIELD

[Previous Routine] [Next Routine] [List of Routines]
ROUTINE: NCDF_GET_FIELD
 
Get a variable and its metadata from a NetCDF file.
 
Calling Sequence
        ncdf_get_field, File, Varname, Z, Name, C0, C1, C2, ...
 
Arguments
 
        File
 
                A string containing the name of an existing NetCDF file.
 
        Varname
                A string containing the name of the variable you want to
                read, or an integer corresponding to a NetCDF variable
                identifier.  
 
        Z
                An array output by ncdf_get_field containing the dependent
                variable given in Varname.  The procedure will determine the
                data type and dimensions of the array from the information
                in the NetCDF file.
 
        Name
                An array of strings containing names for the coordinate axes,
                i.e. the names of the independent variables.
 
        C0, C1, C2, ...
                Arrays output by ncdf_get_field containing the coordinates,
                i.e. independent variables, of the field.
 
Example
 
        Suppose you have a file called stuff.cdf, and you know it contains
        a four-dimensional scalar variable called 't'.  You would read the
        data this way.
 
              IDL> ncdf_get_field, 'stuff.cdf', 't', t, titles, x, y, z, time
        
        If you examine your IDL memory contents, you find the following
 
              IDL>help,t
                T               FLOAT     = Array(60, 60, 10, 3)
 
        The data could be sliced and displayed like so
 
              IDL>sst = t(*,*,0,2)
              IDL>contour,sst,x,y,max_value=9000
 
Bugs
        only gets entire field, doesn't slice yet
        The way multiple coordinate arrays are allocated is not pretty
          passes only up to nine dimensions
        Has not been tested on irregular fields
 
Author
        William Weibel, UCLA Atmospheric Sciences
 
Last Revision Date
 
        1 April 1993  

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ncdf_get_field.pro)


NCDF_GET_ONE_GLOBAL_ATTRIBUTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ncdf_get_one_global_attribute

 PURPOSE:
  The result of this function is the value from  a given global attribute of a netCDF File
  It is allowed to submit attname with the defintion by INHALT. e.g. 'email' is the same as 'pi_email'

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=ncdf_get_one_global_attribute(file_name,attname,[/xp])

 INPUTS:
   file_name: The name of the netCDF File
   attname:   The name of the global attribute

 KEYWORD PARAMETERS:
  xp:   launch pickfile to choose a file

 OUTPUTS:
  This function returns a value or a vector of values

 EXAMPLE:
   result=ncdf_get_one_global_attribute('otto.nc','pi_email')
      is the same as
   result=ncdf_get_one_global_attribute('otto.nc','email')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),1998-Aug-06

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_get_one_global_attribute.pro)


NCDF_GET_ONE_PARAMETER_ATTRIBUTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ncdf_get_one_parameter_attribute

 PURPOSE:
  The result of this function is the value from  a given parameter attribute of a netCDF File
  It is allowed to submit attname with the defintion by INHALT, e.g. 'long_name' is the same as 'param_long_name'
  Results like [1,2] or [2,1] are reformed to [2]

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=ncdf_get_one_parameter_attribute(file_name,short_name,attname,[/XP])

 INPUTS:
   file_name:  The name of the netCDF File
   short_name: The short name of the netCDF Parameter
   attname:    The name of the global attribute

 KEYWORD PARAMETERS:
  xp:   launch pickfile to choose a file

 OUTPUTS:
   This function returns a string or stringarray of param_creation_time
   You can choose to submit one file and many short names or
   many files and one short_name or many files and many short names
   If no short name is submitted the result is a vector of size n_elements(file_name).
   Because in different files a different number of short names could be defined the result are
   strings where the att value is seperated by a ",". Otherwise if short_names are submitted
   the result ist an array



 EXAMPLE:
   result=ncdf_get_one_parameter_attribute('otto.nc','H2O','param_long_name')
      is the same as
   result=ncdf_get_one_parameter_attribute('otto.nc','H2O','long_name')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),1998-Aug-06

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_get_one_parameter_attribute.pro)


NCDF_GR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      ncdf_gr

 PURPOSE:
      Thist procedure accumalets the structure INHALT from ncdf_g and the structure INHALT from ncdf_r

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
  ncdf_gr,  file=file, name=name, inhalt = inhalt,[experiment=experiment],[history=hostory],[_extra=extra],[array_index=array_index],[use_units],[file_path=file_path],[local_cache_path=local_cache_path],[/new_cache],[/no_cache],[/xp]

 INPUTS:
   file: name of the netCDF file
   name: parameter short name


 OPTIONAL INPUTS:
   array_index: the index position of the parameter to read in
   file_path:   the path where are the netCDF File will be
   use_units:   the new unit in which the data should be caclulated in
   local_cache_path: to define an own cache_path
                     doing this most cases you could not share your cache files

 KEYWORD PARAMETERS:
   new_cache: ignore previous cache files and write a new one
   no_cache:  don't use cache files
   xp:        use dialog_pickfile to choose a file

  OUTPUTS:
   Inhalt: structure

  OPTIONAL OUTPUTS:
   experiment: structure of experiment specific attributes
   history: an array holding the history of the netCDF File
   _extra: to stop error processing if more non positional keys are submitted

 PROCEDURE:
  global settings with environmental key are possible:

  setenv,'no_cache=1'        : means: no cache system during the whole idl session
  setenv,'new_cache=1'       : means: write always a new cache file during the whole idl session
  setenv,'ncdf_gr_no_output' : means: all output comments from ncdf_gr are switched off during the whole idl session

  to switch back set 0 to the environmental keys

 MODIFICATION HISTORY:
       R. Bauer, 5 Oct, 1996
       R. Bauer, 26. Feb. 1997 areal in type umbenannt
       R. Bauer, Oct 12 1997, array_index added to read a single trjectory from a file
       R. Bauer, 07. Jun 1998 cache files included
                 means: if param_modification_time is different from the file_name then cache will be rebuilded
                 else cache will be used
                 It will only write in directories where it has write access
       if links/idl_source/idl_cache is available this will be used
       if not then on PCs TEMP and on WS $HOME will be used
       R.Bauer,09. Jun 1998 local_cache_path added
       1998-Jul-1 cache_file_name: input  use_units added
       1998-Aug-27 f_names to /all altered
       R.Bauer Sep 05 1998 remove of execute statement
   1999-Nov-06 help added


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_gr.pro)


NCDF_INFO

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

ROUTINE: NCDF_INFO
 
PURPOSE: Summarize the information from a NetCDF file
 
USEAGE:  NCDF_INFO, File
 
INPUT:
 
 file    A string containing the name of an existing NetCDF file.

KEYWORD_INPUT:

 dir     if set to one (an integer) the current directory is scanned
         for any files with a .cdf suffix.  If instead dir is set to
         a directory name (a string) then that directory is scanned
         for NetCDF files.  The list of files is presented as a menu,
         and information for a selected file is displayed.  If
         present, the command line argument, FILE, is set to the
         selected file, and can be used in subsequent commands.

 noless  0 view info file with less (default)
         1 do not view info file with less 
         2 view info file with xless

 Keyword OUTPUT:

 names   array of variable names

Example
 
; Review information for a specific netcdf file
 
    ncdf_info,'stuff.cdf'
 

; Review information for one of many files in a directory

    ncdf_info,file,/dir            ; defines file on output

; Retrieve a list of variable names and use in a menu to retrieve values

    ncdf_info,file,/dir,/no,na=n & ncdf_get_1field,file,n(wmenu(n)),z
 
Bugs:
 
    Although this algorithm follows NetCDF conventions, it is inappropriate
    for irregularly gridded data.
  
Author:
 
        William Weibel, Department of Atmospheric Sciences, UCLA
        
 
Revisions:

 may98:PJR correct do loop index range (WW forgot to start at 0)
 may98:PJR return variable names to caller
 apr98:PJR pipe info into less
 apr93:WW  Summarize the information from a NetCDF file


 Bugs:

    Although this algorithm follows NetCDF conventions, it is inappropriate
    for irregularly gridded data.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ncdf_info.pro)


NCDF_R

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_r

 PURPOSE:
   This procedure reads one parameter and the time from a netCDF File and all parameter attributes from both
   additional all subparameter defined by param_flag and time_flag


 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_r,file=file,name=name,inhalt=inhalt,[inpath=inpath],[array_index=array_index],[use_units=use_units],[/xp]

 INPUTS:
   File:        the file_name of the netCDF File
                if inpath too then file= inpath+File
   name:        the short_name of a parameter in a netCDF File


 OPTIONAL INPUTS:
   inpath:      maybe the path
   array_index: the index position of the parameter to read in
   use_units:   the unit in which the data should be scaled to

 KEYWORD PARAMETERS:
   xp:    to launch pickfile to choose a file


 OUTPUTS:
   inhalt: the structure inhalt


 EXAMPLE:
   ncdf_r, file='test.nc',name='F12', inhalt=F12
   The structure F12 will be builded

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5 1996
               R.Bauer March 17 1997 ,param_stdev,param_accuracy,
                                      param_detection_limit,param_low_err,
                                      param_high_err defined
               R.Bauer June 17 1997, param_accuracy changed to param_acc_rel
                                     and param_acc_abs
               R.Bauer Oct 12 1997, array_index added to read a single trjectory from a file
               R.Bauer Nov 1 1997, syntax from ncdf_rm and ncdf_r are combined in this version
                                   it's now faster. I think between 1.5 and 6 times depending for what file
                                   is used
               R.Bauer Jan 14 1998, if time_units eq  'seconds since 2000-01-01 00:00:00 UTC' $
                                       then time_units='seconds since 2000-1-1 00:00:00 UTC'
               R.Bauer Mar 5  1998, finite Abfrage fuer !VALUES.F_NAN
               R.Bauer Mar 6  1998, Abfrage wenn Quality ueberhaupt keinen WErt findet so geaendert
                                    das valid dann -1 ist.
               R.Bauer Mar 20 1998 stress Abfrage nur 1 Element geaendert
               R.Bauer Jun 11 1998 scale_factor and add_offset extended for flags
               R.Bauer Jun 12 1998 *_previous added
               FR 19.8.1998 Untersuchung is_array(valid), d.h. wenn keine gültigen Werte da sind
               R.Bauer  1998-Aug-27 f_names to /all altered
               R.Bauer  1999-Apr-16 line 198 :
                                    IF N_ELEMENTS(param) EQ s_dim[1]  THEN param=TRANSPOSE(param) ; removed 1999-04-16
                                    removed, because if a second dimension size is 1 the result was a vector
                                    this not wished.
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_r.pro)


NCDF_READ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        NCDF_READ

 PURPOSE:
        Open a netCDF file and read data from it. The data is 
        returned as a structure whose tag names are the names of 
        the variables with blanks etc. replaced. If no variables 
        are specified with the VARIABLES keyword, only dimensional 
        information is returned. You can load all variables using
        the ALL keyword. Other keyword options include OFFSET, COUNT, STRIDE,
        NO_DIMENSIONS, NO_STRUCT, DIMNAMES, VARNAMES, VARDIMS, ATTRIBUTES.
        Thus, this program includes ncdump functionality.
        If no filename is given, a file selection dialog is
        opened with the default mask '*.nc'. The name of the selected
        file is returned in the TRUENAME keyword. A file selection
        dialog also appears when the file cannot be found (see
        OPEN_FILE.PRO). This can be turned off with the NO_DIALOG
        keyword. The VERBOSE keyword provides information while
        analyzing and reading the file.

 AUTHOR:
        Dr. Martin Schultz
        Max-Planck-Institut fuer Meteorologie
        Bundesstr. 55, D-20146 Hamburg
        email: martin.schultz@dkrz.de
        
 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        NCDF_READ, result, filename=, truename=,
            variables=, all=, varnames=, 
            vardimid=, vardims=, attributes=,
            count=, offset=, stride=, 
            dimnames=, dims=, no_dimensions=,
            no_struct=, no_dialog=, verbose=, title=

 ARGUMENTS:
        RESULT(out) -> a structure containing all the variable data
             from the netCDF file. If only one variable is specified 
             and the NO_STRUCT keyword set, then RESULT will be an
             array instead of a structure. Use the ALL keyword
             to load all variables at once. Note, that the COUNT, OFFSET,
             and STRIDE keywords can affect the size of RESULT.
             RESULT is set to -1L if an error occurs before the structure
             has been built. You can use CHKSTRU.PRO to test for this.

 KEYWORD PARAMETERS:
        FILENAME(in) -> the name of the netCDF file to be opened.
             NCDF_READ uses OPEN_FILE to check the validity of
             the file first. You can specify a search mask
             instead of a filename in which case a file selection
             dialog is displayed (unless you set the NO_DIALOG
             keyword). The TRUENAME keyword contains the name
             of the selected file or an empty string if the
             file selection was canceled.

        TRUENAME(out) -> the (fully qualified) name of the file selected
             with the file selection dialog or an unaltered copy
             of FILENAME if FILENAME is a valid filename.

        VARIABLES(in) -> a string array containing the names of variables
             for which data shall be read. Default is to read 
             only the dimensional information from the file. 
             (Currently) no warning is issued if a variable is not in the file.

        ALL(in) -> set this keyword to load all variables stored in the 
             netCDF file. Generally, you cannot usethis keyword together with
             COUNT, OFFSET, and STRIDE.

        VARNAMES(out) -> a string array containing the names of all variables 
             as stored in the file. Note, that the tag names of e.g. the
             result structure are filtered with the Valid_TagName function.
             
        VARDIMID(out) -> a structure with integer arrays containing the 
             dimension ID's for all variables. See also VARDIMS which returns
             the dimensions themselves.

        VARDIMS(out) -> a structure with integer arrays containing the 
             dimensions for all variables in the netCDF file. These are not
             kept in sync with potential COUNT, OFFSET, and STRIDE values,
             but reflect the data sizes as stored in the file.

        ATTRIBUTES(out) -> a structure holding the variable and global
             attributes stored in the netCDF file (global attributes
             are stored in tag name GLOBAL). 

        COUNT(in) -> an integer array containing the number of values to
             be read for each dimension of the variables. Mapping of the
             COUNT dimensions to the variable dimensions is achieved via
             the first entry in the VARIABLES list and the COUNT parameter
             will be applied to all variables that have that dimension. 
             Example: The first variable has dimensions LON, LAT, LEV,
             the second variable has dimensions LON, LAT, and the third
             variable has LAT, LEV. A COUNT of [40,20,10] would lead to
             result dimensions of [40,20,10], [40,20], and [20,10].

        OFFSET(in) -> an integer array containing the offsets for each
             dimension of the variables to be read. Dimension mapping
             is the same as for COUNT.

        STRIDE(in) -> an integer array containing the stride for each
             dimension of the variables to be read. Dimension mapping
             is the same as for COUNT.
             
        DIMNAMES(out) -> a string array containing the names of the 
             dimensions stored in the netCDF file.

        DIMS(out) -> a long array containing the dimension values. Purely
             for convenience. Use VARDIMS to retrieve the dimensions of
             the variables.

        TITLE(in) -> A title for the file selection dialog if an
             incomplete or incorrect filename is specified. This
             keyword is ignored if the no_dialog keyword is set.

        NO_DIMENSIONS(in) -> set this keyword if you do not want to store
             the dimensional variables from the file in the result structure. 
             DIMNAMES and DIMS will still be retrieved.

        NO_STRUCT(in) -> if only one variable is selected with the
             VARIABLE keyword, you can set this keyword to return only
             the data for this variable as an array. This keyword implies
             the functionality of NO_DIMENSIONS.

        NO_DIALOG(in) -> set this keyword if you do not want interactive 
             behaviour when a file mask is given instead of a filename or
             when the specified file does not exist.

        VERBOSE(in) -> set this keyword to get detailed information while
             reading the netCDF file.

 SUBROUTINES:
        Valid_TagName : replaces invalid characters in variable names so that
            a structure can be built.
      
        ncdf_attributes : retrieves global and variable attributes from netcdf
            file and stores them as structure.

        ncdf_dimensions : retrieves size and name for all dimensions in netcdf file.

        ncdf_varnames : retrieves names and dimension information for all variables
            in the netCDF file.

        ncdf_mapdims : map dimension indices for COUNT, OFFSET, and STRIDE with 
            dimensions of first selected variable.

        ncdf_TestDimensions : compute the COUNT, OFFSET, and STRIDE vectors that
            must be applied for retrieving the data of one variable.

 REQUIREMENTS:
        uses OPEN_FILE and STRREPL.

 NOTES:
        Correct handling of dimensional information requires that the variables
        storing the dimension values have the same name as the dimensions
        themselves - a common feature in most netCDF standards.

        I am still working on a netcdf file object which will be even
        more powerful. At some point ncdf_read will only be a
        procedure interface to this objec!

 EXAMPLE:
        ncdf_read,result,/All
        ; plot ozone vs. temperature
        plot,result.temperature,result.ozone

 MODIFICATION HISTORY:
        mgs, 18 Sep 1999: VERSION 1.00
        mgs, 29 Feb 2000: - added variables keyword
                          - added CATCH error handler
        mgs, 21 Mar 2000: - bug fix for tag names
        mgs, 09 May 2000: VERSION 2.00
                          - now only reads dimensions as default
                          - added ALL keyword to compensate
                          - returns dimnames and attributes
                            (makes ncdf_detail obsolete)
                          - added COUNT, OFFSET and STRIDE keywords
                          - added NO_DIMENSIONS and NO_DIALOG
                            keywords and more
        mgs, 22 Aug 2000: - added title keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\ncdf_read.pro)


NCDF_READ_FILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ncdf_read_files

 PURPOSE:
   This function will handle a list of ncdf-files and will return a structure concatenated out of all those files.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   result=ncdf_read_files(file=file,name=name)

 INPUTS:
   file : list of file names (vector or scalar)
   name : name of the data columnm in the ncdf-files (scalar)

 OUTPUTS:
   result: concatenated structure 'inhalt'

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by Franz Rohrer Jan 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ncdf_read_files.pro)


NCDF_TO_ENZ_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     NCDF_TO_ENZ_FILE

 PURPOSE:
     This Procedure reads a ncdf-file or a list of files, creates header/param-values, and writes them to an enz-file

 CATEGORY:
     DATAFILES/ZCHN

 CALLING SEQUENCE:
     ncdf_to_enz_file,file_old,file_new,short_name_list=short_name_list

 INPUTS:
     file_old : the name of the ncdf-file (string-var) or a list of files with identical structure
     file_new : the name of the enz-file  (string-var)

 KEYWORD PARAMETERS:
     short_name_list: string array with short names of the parameters which
                      are to be read out of the ncdf-file,
                      if it is missed all parameters will be read
     xls            : if set uses EXCEL timre format with refdate='00:00:00 30.12.1899'

 OUTPUTS:
     files : name : file_new1.enz, file_new2.enz ...

 SIDE EFFECTS:
     uses the procedures NCDF_G, NCDF_GR, HEADKEYS, ZCHN_KEYS, JS2TENZ, IWZN

 EXAMPLE:
     ncdf_to_enz_file,'test.nc','testneu',short_name_list=['Fluoreszenz','Untergrund']
     result-files: testneu1.enz, testneu2.enz

 MODIFICATION HISTORY:
     Written       Marsy Lisken, June 1998
     Completed
     Revised       Franz Rohrer, 14.8.1998
     Modified      Franz Rohrer, 22.2.1999   list of files enabled

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\ncdf_to_enz_file.pro)


NCDF_W

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_w

 PURPOSE:
   This procedure writes the structure INHALT and or EXPERIMENT to a netCDF file.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_w, new_file = new_file, inhalt=inhalt,[experiment=experiment],[/overwrite]

 INPUTS:
   new_file:   the file_name of the netCDF File
   inhalt:     the structure inhalt

 OPTIONAL INPUTS:
   experiment: the structure experiment with all experimentspecific attributes

 KEYWORD PARAMETERS:
   overwrite: to overwrite a parameter

 OUTPUTS:
   this procedure writes a netCDF File


 RESTRICTIONS:
   using /overwrite it's not possible to create momentanly new parameters

 EXAMPLE:
  ncdf_w,new_file=new_file,inhalt=inhalt

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jan-1
 1998-Mar-03 extended the use of defined uppercase words for attributes
 1998-Mar-29 first time overwrite is included
 1998-Jun-17 code more simpilified
 1998-Jun-17 q_type_missing_fill added to test param_fill_value and param_missing_value
 1998-Jul-30 second ncdf_open removed first one altered to open in read/write mode
             this should give more speed during write process
 1998-Jul-30 findfile by file_exist replaced
 1998-Sep-12 now writing of scalars is possible
 1998-Nov-16 altering GE 4 by param_ARRAYS=WHERE(inhalt_def[2,*] GE '4' )
 1999-Mar-31 flag mistake removed
 1999-Jun-11 because of some unknow difficulties by PC system parameter definitions are done in a while loop now
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_w.pro)


NCDF_WO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_wo

 PURPOSE:
   This procedure overwrites the structure INHALT into a netCDF file.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_wo ,file=file,inhalt=inhalt

 INPUTS:
   file:   the file_name of the netCDF File
   inhalt:     the structure inhalt

 RESTRICTIONS:
  This routine only works by calling from ncdf_w with /overwrite

 OUTPUTS:
   this procedure writes into a netCDF File

 RESTRICTIONS:
   This procedure is only called by ncdf_w ,/overwrite


 EXAMPLE:
  ncdf_wo,file=file,inhalt=inhalt

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Mar-28
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_wo.pro)


NCDF_WO_DEFINE_VARIABLES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_wo_define_variables

 PURPOSE:
   This procedure is used to define undefined variables in a netCDF Files

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_wo_define_variables,file=file,inhalt=inhalt,[/param],[/time]

 INPUTS:
   file:   the file_name of the netCDF File
   inhalt: the structure inhalt

 KEYWORD PARAMETERS:
   param:  to do all settings for parameter
   time:   to do all settings for the time

 OUTPUTS:
   this procedure writes into a netCDF File

 RESTRICTIONS:
  This procedure is used by ncdf_wo_param and ncdf_wo_time

 EXAMPLE:
  ncdf_wo_define_variables,file=file,inhalt=inhalt./param

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-06
   1999-Nov-06 help added


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_wo_define_variables.pro)


NCDF_WO_GLOBAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_wo_global

 PURPOSE:
   This procedure overwrites the global attribute of the structure INHALT into a netCDF file.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_wo_global,file=file,inhalt=inhalt

 INPUTS:
   file:   the file_name of the netCDF File
   inhalt: the structure inhalt

 OUTPUTS:
   this procedure writes into a netCDF File

 RESTRICTIONS:
  This procedure is used by ncdf_w ,/overwrite.


 EXAMPLE:
  ncdf_wo_global,file=file,inhalt=inhalt

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Mar-28
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_wo_global.pro)


NCDF_WO_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_wo_param

 PURPOSE:
   This procedure overwrites the structure INHALT.param* into a netCDF file.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_wo_param,file=file,inhalt=inhalt

 INPUTS:
   file:   the file_name of the netCDF File
   inhalt:     the structure inhalt

 OUTPUTS:
   this procedure writes into a netCDF File

 RESTRICTIONS:
  This procedure is used by ncdf_w ,/overwrite

 EXAMPLE:
  ncdf_wo_param,file=file,inhalt=inhalt

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Mar-28
 1998-06-06 overwrite modud for new arrays added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_wo_param.pro)


NCDF_WO_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ncdf_wo_time

 PURPOSE:
   This procedure overwrites the structure INHALT.time* into a netCDF file.

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   ncdf_wo_time,file=file,inhalt=inhalt

 INPUTS:
   file:   the file_name of the netCDF File
   inhalt:     the structure inhalt

 OUTPUTS:
   this procedure writes into a netCDF File

 RESTRICTIONS:
  This procedure is used by ncdf_w, /overwrite.

 EXAMPLE:
  ncdf_wo_time,file=file,inhalt=inhalt

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Mar-28
 1998-06-06 overwrite modud for new arrays added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\ncdf_wo_time.pro)


NC_DEF_GLOBAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  nc_def_global

 PURPOSE:
   This function returns the possible global attributes from inhalt_def

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=nc_def_global([/lowercase],[/uppercase])

 KEYWORD PARAMETERS:
  lowercase: returns only the defintion from lowercase attributes
  uppercase: returns only the defintion from uppercase attributes
  structure: if it is set result is a structure
     pi:        only PI attributes
     dataset:   only dataset attributes
     platform:  only platform attributes


 OUTPUTS:
   Result is string array of the possible global attributes for the INHALT structure and their translation as netCDF Variable
   Default is to return all

 EXAMPLE:
   result=nc_def_global()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_def_global.pro)


NC_DEF_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  nc_def_param

 PURPOSE:
   This function returns the possible param attributes from inhalt_def

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=nc_def_param([/lowercase],[/uppercase])

 KEYWORD PARAMETERS:
  lowercase: returns only the defintion from lowercase attributes
  uppercase: returns only the defintion from uppercase attributes

 OUTPUTS:
   Result is string array of the possible global attributes for the INHALT structure and their translation as netCDF Variable
   Default is to return all

 EXAMPLE:
   result=nc_def_param()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_def_param.pro)


NC_DEF_PARAM_FLAGS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  nc_def_param_flags

 PURPOSE:
  This function returns the possible param flags from inhalt_def

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=nc_def_param_flags([/to_calculate])

 KEYWORD PARAMETERS:
   to_calculate: if set only the array of flag names which has to be calculated with scale_factor and offset is returned

 OUTPUTS:
   Result is a string array of the possible param flags

 EXAMPLE:
   result=nc_def_param_flags()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-05
   R.Bauer 1998-11-16 added to_calculate

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_def_param_flags.pro)


NC_DEF_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  nc_def_time

 PURPOSE:
   This function returns the possible time attributes from inhalt_def

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=nc_def_time([/lowercase],[/uppercase])

 KEYWORD PARAMETERS:
  lowercase: returns only the defintion from lowercase attributes
  uppercase: returns only the defintion from uppercase attributes

 OUTPUTS:
   Result is string array of the possible global attributes for the INHALT structure and their translation as netCDF Variable
   Default is to return all

 EXAMPLE:
   result=nc_def_time()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_def_time.pro)


NC_DEF_TIME_FLAGS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  nc_def_time_flags

 PURPOSE:
   This function returns the possible time flags from inhalt_def

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=nc_def_time_flags()

 OUTPUTS:
   Result is a string array of the possible time flags

 EXAMPLE:
   result=nc_def_time_flags()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_def_time_flags.pro)


NC_DISPLAY

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   nc_display

 PURPOSE:
 
This widget displays the data columns from a netCDF file in a widget table
IMAGE
CATEGORY: DATAFILES/NETCDF CALLING SEQUENCE: nc_display,file_name INPUTS: file_name: The name of the netCDF File EXAMPLE: nc_display,'otto.nc' MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Sep-04 1999-Mar-07 a bit faster now 1999-Nov-06 help added 2000-May-11 @ changed to $ in the structure definition because of idl.5.3

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_display.pro)


NC_DISPLAY_AIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   nc_display_aix

 PURPOSE:
 This widget displays the data columns from a netCDF file in a widget table
this name is reserved by runtime for AIX CATEGORY: DATAFILES/NETCDF CALLING SEQUENCE: nc_display_aix,file_name INPUTS: file_name: The name of the netCDF File KEYWORD PARAMETERS: help: gives a short description EXAMPLE: nc_display_aix,'otto.nc' MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Sep-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_display_aix.pro)


NC_DISPLAY_PC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   nc_display_pc

 PURPOSE:
 This widget displays the data columns from a netCDF file in a widget table
this name is reserved by runtime for PC CATEGORY: DATAFILES/NETCDF CALLING SEQUENCE: nc_display_pc,file_name INPUTS: file_name: The name of the netCDF File EXAMPLE: nc_display_pc,'otto.nc' MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Sep-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_display_pc.pro)


NC_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NC_INFO

 PURPOSE:
    returns a structure with info about a ncdf-file and a header like output of irzn

 CATEGORY:
    DATAFILES

 CALLING SEQUENCE:
    file_info=NC_INFO(filename)

 INPUTS:
    filename: the name of the netCDF file

 OUTPUTS:
    a structure of info about a ncdf-file see create_info_struct for details
      .file_info.name           : name of file
      .file_info.filetype       : 'zus'
      .file_info.filedate       : date of file
      .record_info.jstime[0] : start-time in julian seconds (double)
      .record_info.jstime[1] : end-time in julian seconds   (double)
      .record_info.ntime[0]  : start-time in normal date and time (string)
      .record_info.ntime[1]  : end-time in normal date and time   (string)
      .record_info.n_records :number of rows
      .record_info.n_sets    :number of columns
      .pi.pi_name   :
      .pi.email     :
      .pi.phone_number :
      .pi.organisation :
      .hrefs.ps   : 'ps'  (reference to ps-file: filename+.ps )
      .hrefs.data : 'data'
      .hrefs.html : 'html' (reference to html-file: filename + .savinfo.html )
      .data.text   :string-array : description of a data columnstring-array
      .data.nvalid :array containing the number of valid values of a column
      .data.mean   :array containing the avarage values of a data column
      .data.median :array containing the median values of a data column
      .data.stdev  :array containing the standard deviation of a column
      .data.minimum:array containing the lowest values of a data column
      .data.maximum:array containing the greatest values of a data column
      .header.text :string array containing the header of the file (like output of IRZN)
      .experiment.text  :containing the text of structure experiment

 SIDE EFFECTS:
     uses the procedures CREATE_FILE_STRUCT, -NCDF_GR-, HEADKEYS, ZCHN_KEYS,JS2DMY, FIND_TAG, MCALCX, read_ncdf

 EXAMPLE:
      file_contents=NC_INFO(filename)

 REVISION HISTORY:
       Written         Marsy Lisken, June 1998
       Corrected              9.7.98; 25.8.98
       Revised
   R.Bauer 1998-Sep-03 beginning of removing a lot of inconsistency
   R.Bauer 1999-Apr-09 replaced syntax of ncdf_gr to read_ncdf
                       added is_read_access because of permission failures
   R.Bauer 1999-Apr-27 added is_time_monotonic

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\nc_info.pro)


NC_READ_P

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   nc_read_p

 PURPOSE:
   This procedure is used to transform inputs of x,y or z data names from netCDF files to their equivalent inhalt structure

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
	nc_read_p,file=file,x=x,y=y,[z=z],x_array_index=x_array_index,y_array_index=y_array_index,[z_array_index=z_array_index],use_units_x=use_units_x,use_units_y=use_units_y,[use_units_z=use_units_z]

 INPUTS:
   file:          the filename of the netCDF Dataset
   x:             The parameter name x
   y:             The parameter name y
   x_array_index: The number of a trjaectorie
   y_array_index: The number of a trjaectorie
   x_use_units:   the choosen unit of the values
   y_use_units:   the choosen units of the values


 OPTIONAL INPUTS:
   z:         The parameter name z
   z_array_index: The number of a trjaectorie

 OUTPUTS:
   x:    The structure INHALT as x
   y:    The structure INHALT as y

 OPTIONAL OUTPUTS:
   z:    The structure INHALT as z


 EXAMPLE:
   nc_read,file='test.nc',x='time',y='F12'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nc_read_p.pro)


NEAREST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEAREST
 PURPOSE:
       Return multiple of a given step nearest a target value.
 CATEGORY:
 CALLING SEQUENCE:
       v = nearest( s, t, [ vlo, vhi ])
 INPUTS:
       s = step size.                      in
       t = target value.                   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       vlo =  largest multiple of S <= T.  out
       vhi = smallest multiple of S >= T.  out
       v = multiple of S nearest T.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner  10 Apr, 1986.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nearest.pro)


NEIGHBORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		NEIGHBORS
 VERSION:
		4.0
 PURPOSE:
		Finding the nearest neighbors of an array element.
 CATEGORY:
		Array function.
 CALLING SEQUENCE:
		Result = NEIGHBORS( IND, SIZ [, COUNT])
 INPUTS:
	IND
		Index of an array element.  Provided either in contracted (1-dim) or
		expanded version.  In the second case IND has to be a vector the length
		of which equals the number of dimension of the array (given by SIZ(0)).
	SIZ
		Vector in the form of the standard output of the system function SIZE.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	COUNT
		An optional output parameter.  See below.
 OUTPUTS:
		Returns a vector containing the indices of the nearest neighbors of the
		element corresponding to IND.  If no neighbors exist returns -1.
 OPTIONAL OUTPUT PARAMETERS:
	COUNT
		The name of the variable to receive the number of neighbors.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls ARRLOC from MIDL.
 MODIFICATION HISTORY:
		Created 30-MARCH-1994 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\neighbors.pro)


NERFC_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		NERFC_MM
 VERSION:
		4.0
 PURPOSE:
		Calculates A renormalized complementary error function.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = NERFC_MM( X )
 INPUTS:
	X
		Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None
 OUTPUTS:
		Returns the values of exp(x^2)*(1 - errorf(x)).  For larger values of
		X, above ~4, this values cannot be calculated directly from the error
		function due to cancellation errors.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		For large and negative values of Real(x) an overflow may result.  A
		warning is issued in such case.
 PROCEDURE:
		Using direct calculation for small values of abs(x) and continued
		fraction expansion for larger values.  Call ABS_MM, CAST, CONFRAC,
		ERRORF_MM, ISNUM and REAL_MM, from MIDL.
 MODIFICATION HISTORY:
		Created 20-DEC-1994 by Mati Meron, under the name RENERF_FUN.
		Renamed M_NERFC and completely rewritten 15-JAN-1996, by Mati Meron,
		in order to enhance range and accuracy.
		Modified 25-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to NERFC_MM.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\nerfc_mm.pro)


NEXTITEM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEXTITEM
 PURPOSE:
       Return next line from a file, ignore comments & null lines.
 CATEGORY:
 CALLING SEQUENCE:
       itm = nextitem(lun, [txt])
 INPUTS:
       lun = unit number of opened text file.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       txt = optionally returned complete line.   out
       itm = first word in text line.             out
 COMMON BLOCKS:
 NOTES:
       Note: Useful to read control files.  First item on each
         line is returned. Items may be delimited by spaces,
         commas, or tabs.  Null lines and comments are ignored.
         Comment lines have * as the first character in the line.
         If a line contains only a single space it is considered
         a null line. The entire text line may optionally be
         returned.  It has commas and tabs converted spaces,
         ready for GETWRD.  On EOF a null string is returned.
 MODIFICATION HISTORY:
       Written by R. Sterner, 19 June, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES  5 Nov, 1985 --- returned TXT.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nextitem.pro)


NEXTNUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEXTNUM
 PURPOSE:
       Return next number using the arrow keys.
 CATEGORY:
 CALLING SEQUENCE:
       n = nextnum(m)
 INPUTS:
       m = input number.           in
 KEYWORD PARAMETERS:
       Keywords:
         STEPS=s  give list of allowed step sizes.
           Ex: STEPS=[1,5,10].  Use Up and down arrows to select.
         LIMITS=l gives lower and upper limits on n.
           Ex: LIMITS=[0,100] allows numbers from 0 to 100.
         /MENU gives menu selection of a number in the limit range.
           If returned value is 1 less than lower limit then quit
           was selected. Best for a small range of values.
         EXIT=e  returns character typed on keyboard.
 OUTPUTS:
       n = output number.          out
         n is + or - 1 step from m.
 COMMON BLOCKS:
       nextnum_com
 NOTES:
       Notes: a number may also be directly typed in, a non-digit
         terminates the number entry and returns the number.
         The ENTER key gives a menu to select from.
         Best for a small range.
 MODIFICATION HISTORY:
       R. Sterner, 21 Mar, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nextnum.pro)


NEXTPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEXTPLOT
 PURPOSE:
       Update !p.multi to next plot position.
 CATEGORY:
 CALLING SEQUENCE:
       nextplot
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: needed for plots using the /noerase option.
 MODIFICATION HISTORY:
       R. Sterner, 26 Sep, 1990
       R. Sterner, 8 Jul, 1993 --- Handled the case where nx or
       ny is 0 but used as 1.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nextplot.pro)


NEXTPPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEXTPPOS

 PURPOSE:
       get the position of the next frame

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
       pp = NEXTPPOS(ppos)

 INPUTS:
       array of positions

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       position of last plot according to !p.multi

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       pp = nextppos(ppos)
       xyoutp, .1, .1, 'text', framepos=pp

 REVISION HISTORY:
       Written         Theo Brauers, Aug 1997
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\nextppos.pro)


NEXTTOK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NEXTTOK
 PURPOSE:
       Find the next occurance of any of a set of characters in a
       string and return the character which occurs next.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       tok = nexttok( strn, tokens )
 INPUTS:
       strn   -- string to be searched for sub/superscripts    in
       tokens -- string containing characters to be found.     in
 KEYWORD PARAMETERS:
       POSITION -- Set to a named variable to get position     out
                   of next token, or -1 if none found.
       /HELP    -- Print useful message and exit.
 OUTPUTS:
       tok    -- Contains the character among tokens which     out
                 occurs next in strn, or null '' if none found.
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
 EXAMPLE:
       nexttok( 'x^2 + N_j^3', '^_', position=pos ) returns '^' and sets
       pos to 1.
 MODIFICATION HISTORY:
       $Id: nexttok.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
       $Log: nexttok.pro,v $
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Generalized so that the next occurence of any of a set of characters will
       be returned.

       Revision 1.1  1996/01/31 18:41:06  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\nexttok.pro)


NGROUPS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NGROUPS
 PURPOSE:
       Gives # of groupss of identical elements in given array.'
 CATEGORY:
 CALLING SEQUENCE:
       n = nruns(a)
 INPUTS:
       a = array to process.          in
 KEYWORD PARAMETERS:
       Keywords:
         START=strt  Start indices for all groups.
         LENGTH=len  Lengths of all groups.
 OUTPUTS:
       n = number of groups in a.     out
 COMMON BLOCKS:
 NOTES:
       Note: see getgroup.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 02

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ngroups.pro)


NICENUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NICENUMBER
 PURPOSE:
       Find a nice number close to the given number.
 CATEGORY:
 CALLING SEQUENCE:
       n = nicenumber(x)
 INPUTS:
       x = given number.              in
 KEYWORD PARAMETERS:
       Keywords:
         /FLOOR finds next nice number le to X.
         /CEIL finds the next nice number ge to X.
         MINOR=m  Returned suggested minor tick spacing.
 OUTPUTS:
       n = nice number close to x.    out
         1, 2, 2.5, or 5 scaled to size of x.
 COMMON BLOCKS:
 NOTES:
       Notes:
         Default operation is useful for finding tick spacings:
         dx = nicenumber((xmx-xmn)/nticks).
         /FLOOR and /CEIL are useful for scaling data plots:
         xmn = nicenumber(min(x),/floor)
         xmx = nicenumber(max(x),/ceil)
         plot, x, y, xrange=[xmn,xmx], . . .
         /floor and /ceil may not give values related to the
         step size, dx.  The following method will:
         ceil(t/dx)*dx is a multiple of dx on the high side of t.
         floor(t/dx)*dx  is a multiple of dx on the low side of t.
 MODIFICATION HISTORY:
       R. Sterner, 6 Feb, 1990
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner, 12 Feb, 1993 --- returned 1 element array as a scalar.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nicenumber.pro)


NN_CLUST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		nn_clust.pro

 PURPOSE:	tag events with cluster #

 CATEGORY:	data processing - cluster analysis

 CALLING SEQUENCE:	result = NN_CLUST(data,weights,[N_PARAM=n_param],
			[N_EVENT=n_event],[N_CLUST=n_clust])

 INPUTS: data = data set to be clustered, weights = array of weights which
	  describe cluster centers (produced by the function NN_LEARN)

 OPTIONAL INPUT PARAMETERS:
	n_param = # of parameters in data set - 1st dimension of data set
	n_event = # of events in data set - 2nd dimension of the data set
	n_clust = # of clusters to find - arbitrary

 KEYWORD PARAMETERS:	none

 OUTPUTS:	result = integer array of cluster assignment of each event

 OPTIONAL OUTPUT PARAMETERS:	none

 COMMON BLOCKS:	none

 SIDE EFFECTS:	none (?)

 RESTRICTIONS:	Read the header of 'nn_learn.pro'.

 PROCEDURE: The data set is processed against the weights array and a cluster
	     # assignment is made for each event in the input data set based
	     on the weights array which describe the center of each cluster.

 MODIFICATION HISTORY:	initial algorithm: Mark Naiver (Univ of Texas - Austin)
	Date last modified ==>  1 March 93 : RCH [LANL]
	Contact: Robb Habbersett (505/667-0296 or robb@big-geek.lanl.gov)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\nn_clust.pro)


NN_LEARN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		nn_learn.pro

 PURPOSE:	Learning step to cluster data using neural network techniques.

 CATEGORY:	Data processing - cluster analysis

 CALLING SEQUENCE:	weights = nn_learn(data,max_val,[BLR=blr],[ELR=elr],
	[N_EVENT=n_event],[N_PASS=n_pass],[N_PARAM=n_param],[N_CLUST=n_clust]

 INPUTS:	data = data set to be clustered, max_val = maximum range of each
		parameter in the data set (to normalize the weights).

 OPTIONAL INPUT PARAMETERS:
	blr = begining learning rate, elr = ending learning rate
	n_pass = # of iterations of the learning pass
	n_param = # of parameters in data set - 1st dimension of data set
	n_event = # of events in learning set - 2nd dimension of data set
	n_clust = # of clusters to find - arbitrary (?)

 KEYWORD PARAMETERS:	none

 OUTPUTS:	result = an array of weights describing the cluster centers.

 OPTIONAL OUTPUT PARAMETERS:	none

 COMMON BLOCKS:	none

 SIDE EFFECTS: This approach has an inherent weakness in that it must be
		set to find a specific number of clusters; It will find
		that number of clusters in the data set - regardless.

 RESTRICTIONS:	This routine has not been rigorously tested on different types
		of data. It "appears" to work on flow cytometry data.

 PROCEDURE:	A limited subset of a larger data set is presented to this
		routine as a training set to condition the neural network. The
		result is a set of weights which describe the centers of the
		resolved clusters.

 MODIFICATION HISTORY:	Initial algorithm: Mark Naiver (Univ of Texas - Austin)
	Date last modified ==>  1 March 93 : RCH [LANL]
	Contact: Robb Habbersett (505/667-0296 or robb@big-geek.lanl.gov)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\nn_learn.pro)


NOISE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		NOISE
 VERSION:
		4.0
 PURPOSE:
		Adds Gaussian or Poissonian noise to data.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = NOISE( DAT [, keywords])
 INPUTS:
	DAT
		numerical, nonnegative.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/POISSON
		Switch.  If set, Poisson noise is generated.  The default is gaussian.
	SEED
		Can be used to provide a randomization seed.  Optional but highly
		recommended (with an uninitialized variable) when doing repeated calls
		to NOISE.  See RESTRICTIONS below.
 OUTPUTS:
		Returns the input data with noise added to it.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		NOISE relies on the IDL routines RANDOMU and RANDOMN which, in the
		absence of externally provided seed generate one using the system
		time.  When consecutive calls to NOISE are made on a fast machine,
		they may occur within a single "clock tick" yielding the same random
		series.  This is highly undesirable.  The problem can be avoided if
		NOISE is always called with SEED = S when S is an uninitialized
		variable.
 PROCEDURE:
		Generates Gauss-distributed (with sigma = square_root(dat)) random
		numbers for gaussian noise.  Uses the rejection method for Poisson
		noise.  Calls CAST, DEFAULT and FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 25-JAN-1997 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\noise.pro)


NORM2FRAME_POSITION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   norm2frame_position

 PURPOSE:
   This function will convert position in normal koordinates to frame position (plot-window going from 0,0 to 1,1 in frame position)

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   result=norm2frame_position([x,y] or [xl,yl,xr,yr])

 INPUT PARAMETERS:
   x,y-positions

 OUTPUTS:
   result: frame-position

 EXAMPLE:
   result=norm2frame_position([0.5,0.5])
   result=norm2frame_position([0.5,0.5,0.9,0.8])

 MODIFICATION HISTORY:
   Written by Franz Rohrer Apr 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\norm2frame_position.pro)


NORMALIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NORMALIZE

 PURPOSE:

       This is a utility routine to calculate the scaling vector
       required to position a graphics primitive of specified range
       at a specific position in an arbitray coordinate system. The
       scaling vector is given as a two-element array like this:

          scalingVector = [translationFactor, scalingFactor]

       The scaling vector should be used with the [XYZ]COORD_CONV
       keywords of a graphics object or model. For example, if you
       wanted to scale an X axis into the coordinate range of -0.5 to 0.5,
       you might type something like this:

          xAxis->GetProperty, Range=xRange
          xScale = Normalize(xRange, Position=[-0.5, 0.5])
          xAxis, XCoord_Conv=xScale

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Object Graphics

 CALLING SEQUENCE:
       xscaling = NORMALIZE(xrange, POSITION=position)

 INPUTS:
       XRANGE: A two-element vector specifying the data range.

 KEYWORD PARAMETERS:
       POSITION: A two-element vector specifying the location
       in the coordinate system you are scaling into. The vector [0,1]
       is used by default if POSITION is not specified.

 COMMON BLOCKS:
       None.

 EXAMPLE:
       See above.

 MODIFICATION HISTORY:
       Written by:  David Fanning, OCT 1997.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\normalize.pro)


NOT_SET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NOT_SET

  otherwise known as 'set...NOT!' thanks to Paul Ricchiazzi

 PURPOSE:
       Return the values of array2 that are not in array1.  If array2 
       not defined, use lindgen(max(array1+1))

 CATEGORY:
       Array manipulation.

 CALLING SEQUENCE:
       array3 = not_set(array1, array2)

 INPUTS:
       array1     

 OPTIONAL INPUTS:
       array2       See PURPOSE.
       maxarr       If array2 not defined, use this length rather 
                    than max(array1+1))    

 OUTPUTS:
       See PURPOSE.

 EXAMPLE:
     x = [0,2,3,4,6,7,9]
     y = [3,6,10,12,20]

     print,intersect(x,y)
      3       6

     print,intersect(x,y,/xor_flag)
      0       2       4       7       9      10      12      20

     print,not_set(x,y)
       0       2       4       7       9     

     print,not_set(x)
           1           5           8

     print,not_set(x,maxarr=15)
           1           5           8          10          11          12
         13          14

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/03/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\not_set.pro)


NOWHERE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		NOWHERE
 VERSION:
		4.0
 PURPOSE:
		Complement to the IDL WHERE function
 CATEGORY:
		Utility.
 CALLING SEQUENCE:
		Result = NOWHERE( ARR, WOUT [, COUNT])
 INPUTS:
	ARR
		Array, arbitrary.
	WOUT
		The output of WHERE, called with ARR and some condition.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the complement set of WOUT, i.e. if
			WOUT = WHERE(ARR, Condition)
		then
			NOWHERE(ARR, WOUT) = WHERE(ARR, Not Condition)
		If the complement is an empty set then, like WHERE, NOWHERE returns -1.
 OPTIONAL OUTPUT PARAMETERS:
	COUNT
		Same as COUNT in WHERE, the neame of a variable to receive the count of
		indices returned by NOWHERE.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward application of WHERE.  Calls ARREQ from MIDL.
 MODIFICATION HISTORY:
		Created 20-FEB-2000 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\nowhere.pro)


NRUNS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NRUNS
 PURPOSE:
       Gives # of runs of consecutive integers in given array.'
 CATEGORY:
 CALLING SEQUENCE:
       n = nruns(w)
 INPUTS:
       w = output from where to process.          in
 KEYWORD PARAMETERS:
       Keywords:
         START=strt  Start indices for all runs.
         LENGTH=len  Lengths of all runs.
 OUTPUTS:
       n = number of runs in w.                   out
 COMMON BLOCKS:
 NOTES:
       Note: see getrun.
 MODIFICATION HISTORY:
       R. Sterner, 1990
       R. Sterner, 12 Aug, 1993 --- minor simplification.
       R. Sterner, 19 Mar 1996 --- Returned all run lengths and starts.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nruns.pro)


NSO2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	nso2ncdf

 PURPOSE:
	This  procedure will translate a cnes Data File and translate it into
   a netCDF File.

 CATEGORY:
	DATAFILES/FILTER


 CALLING SEQUENCE:
	nso2ncdf,file=file,inpath=inpath,outpath=outpath,[campaign=campaign],[/xp] ,[gps_aus=gps_aus]

 INPUTS:
   file:      the filename of the cnes file
   inpath:    the path where the cnesfile is
   outpath:   the path where the result should be stored

 OPTIONAL INPUTS:
   campaign:  the campaign name belonging to the cnes file

 KEYWORD PARAMETERS:
   xp:        will use pickfile for opening a cnes file

 OPTIONAL OUTPUTS:
   gps_aus:  the GPS data array from the cnesfile


 EXAMPLE:
   inpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/asc/'
   outpath = '/usr/local/icg/icg1/daten/experiments/adeos/cnes/bin/'
   file = 'kir05110297.krn'
   campaign = 'ADEOS1997'
   nso2ncdf,file=file,inpath=inpath,outpath=outpath,campaign=campaign

 MODIFICATION HISTORY:
 	Written by:	R.Bauer March, 3, 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\nso2ncdf.pro)


NTHWEEKDAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NTHWEEKDAY
 PURPOSE:
       Julian Day of N'th weekday of month (like 2nd tues).'
 CATEGORY:
 CALLING SEQUENCE:
       jd = nthweekday(yr,mn,wd,n)
 INPUTS:
       yr = year number (like 1991).       in
       mn = month number (like 12).        in
       wd = weekday number.                in
         Sun=1, Mon=2, ... Sat=7.
       n = occurance number.               in
         1st=1, 2nd=2, ...
 KEYWORD PARAMETERS:
       Keywords:
         /LAST  means last occurance.  If n is given
           it may be < 0 to offset from last like:
           next to last monday, n=-1, wd=2, /LAST.
           If /LAST is used and n > 0 then dates beyond
           the end of the month will be found.  Ex:
           n=1, wd=2, /LAST gives the next monday after
           the last monday in the month.
 OUTPUTS:
       jd = Julian Day of desired date.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 31 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nthweekday.pro)


NUMBER_FORMAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	number_format

 PURPOSE:
	This function will translate a number or array of numbers to its/there
       idl format specification. print,number_format(5.) gives 5.


 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
       Result = number_format(number,[input_format=input_format],[/form],[/max_format])

 INPUTS:
    number: A number or an array of numbers.

 OPTIONAL INPUTS:
   input_format: with this variable you can format your data to this format


 KEYWORD PARAMETERS:
	form:   Switch to get the format specifiers
   max_format: If an array was submitted with this key the function founds
               the maximum format identifier to use for all numbers

 OUTPUTS:
       result=number_format(10.1)
       will give result = '10.1'

 OPTIONAL OUTPUTS:
       result=number_format(10.1,/form)
       will give result= 'f5.1'

 PROCEDURE:
   This function is able to process int, long, float, double numbers and character

 EXAMPLE:
   To get the format of to numbers type:
   result=number_format([10.1,100.20],/form)
   To get a number or numbers formatted as string type:
   result=number_format(10.1)


 MODIFICATION HISTORY:
 	Written by:	R. Bauer June 11,  1997
               R. Bauer Nov. 12, corrected for negative values
               R. Bauer 1998-Jan-05 Exponental included but only for one value
               R. Bauer 1998-Mar-20 function find_form included
               R. Bauer 2000-Apr-02 string max format is limited to A255

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\number_format.pro)


NUMFACTORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NUMFACTORS
 PURPOSE:
       Gives the number of factors of a number.
 CATEGORY:
 CALLING SEQUENCE:
       nf = numfactors(x)
 INPUTS:
       x = number to factor.         in
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET do not list factors.
         PROGRESS=n  Indicate progress every n values (for arrays).
 OUTPUTS:
       nf = number of factors of x.  out
         Does not include 1 and x.
 COMMON BLOCKS:
 NOTES:
       Note: let the factors of x be described by p, the array
         of prime factors, and n, the count of each prime factor.
         The i'th prime factor, p(i), may occur from 0 to n(i)
         times (that is, up to n(i)+1 times) in any given factor
         of x.  The total number of factors is the product of the
         maximum number of occurences of each prime factor.
         For example: let n = [3,1,1], then the total number of
         factors, nf = 4*2*2.  To exclude 1 and x subtract 2.
         (From a conversation with Robert Jensen, JHU/APL.)
         See also prime, factor, print_fact.
 MODIFICATION HISTORY:
       R. Sterner, 25 Oct, 1990
       R. Sterner, 26 Feb, 1991 --- Renamed from num_factors.pro
       R. Sterner,  5 Feb, 1993 --- Modified to handle arrays.
       R. Sterner, 2000 Jan 06 --- Added /QUIET.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\numfactors.pro)


NUMFORM

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  numform

 PURPOSE:  

 USEAGE:   xlab=numform(x)

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        18 Nov 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\numform.pro)


NUMFRAC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NUMFRAC
 PURPOSE:
       Convert a number to a decimal string with n places.
 CATEGORY:
 CALLING SEQUENCE:
       ss = numfrac(val, n)
 INPUTS:
       val = value to convert (may be an array).   in
       n = number of decimal places (def=0).       in
 KEYWORD PARAMETERS:
       Keywords:
         DIGITS=nd  Force number of digits to nd.
           Only for n=0, no decimal places.
 OUTPUTS:
       ss = resulting string.                      out
 COMMON BLOCKS:
 NOTES:
       Notes: Why is this routine needed?  Try the following:
         print,string(230d0-5e-14,format='(I3)')
         Try it again without the format.  The I format does
         not round, but the F format does.  This routine
         uses that fact and makes it convenient to do.
         The result has no spaces on the ends so varying length
         values will not line up (except integers).
 MODIFICATION HISTORY:
       R. Sterner, 1998 May 22

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\numfrac.pro)


NUMNAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NUMNAME
 PURPOSE:
       Generate names or text strings with embedded numbers.
 CATEGORY:
 CALLING SEQUENCE:
       name = numname(pat, i, [j, k])
 INPUTS:
       pat = pattern of text string.                      in
       i = number to substitute for # in pat.             in
       j = number to substitute for $ in pat.             in
       k = number to substitute for % in pat.             in
 KEYWORD PARAMETERS:
       Keywords:
         DIGITS=d number of digits to force in name (def=none).
 OUTPUTS:
       name = resulting text string.                      out
 COMMON BLOCKS:
 NOTES:
       Notes: Ex1: pat = 'file#.txt',  i=7, name='file7.txt'
          Ex2: pat = 'A#B$C%D', i=1, j=2, k=3, name='A1B2C3D'
          Ex3: pat='A#B', i=5, DIGITS=4, name='A0005B'.
          If j and k are not given then $ and % are not changed
          in pat if they occur.
          Inverse of namenum, see namenum.
 MODIFICATION HISTORY:
       R. Sterner, 11 Jan, 1990
	R. Sterner,  3 Sep, 1992 --- fixed an integer overflow problem
	  found by George Simon at Sac Peak NSO.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\numname.pro)


NUMPERSEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NUMPERSEC
 PURPOSE:
       Given values increasing with time return rate per second.
 CATEGORY:
 CALLING SEQUENCE:
       rate = numpersec(num)
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         DELTA=nsec  Initialize minimum estimate interval (sec).
           Must do first, also give first value on init call:
           Ex: rate0 = numpersec(0,delta=60). Ignore rate0.
 OUTPUTS:
 COMMON BLOCKS:
       numpersec_com
 NOTES:
       Notes: will only do a new estimate every delta seconds,
        else returns previous estimate.
 MODIFICATION HISTORY:
       R. Sterner, 1998 Jun 7

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\numpersec.pro)


NUM_DEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NUM_DEC
 PURPOSE:
       Number of decimal places in given number.
 CATEGORY:
 CALLING SEQUENCE:
       nd = num_dec(val)
 INPUTS:
       val = number to examine.              in
 KEYWORD PARAMETERS:
 OUTPUTS:
       nd = number of decimal places in val. out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 15 Nov, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\num_dec.pro)


NWIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NWIN
 PURPOSE:
       Convert from normalized window coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       nwin, x, y, x2, y2
 INPUTS:
       x,y = normalized window coordinates of a point.     in
 KEYWORD PARAMETERS:
       Keywords:
         /TO_DATA  converts to data coordinates (def).
         /TO_DEVICE  converts to device coordinates.
         /TO_NORMALIZED  converts to normalized coordinates.
 OUTPUTS:
       x2,y2 = same point in specified coordinate system.  out
 COMMON BLOCKS:
 NOTES:
       Notes: The plot window is the area defined by the axes.
         Normalized window coordinates are defined here to be
         linear from (0,0) at the lower left corner of the plot
         window, and (1,1) at the upper right.
         Useful for plot window related items such as legends.
         Normalized coordinates are really normalized device
         coordinates.  Normalized window coordinates are missing
         from IDL's list of coordinate systems.
 MODIFICATION HISTORY:
       R. Sterner, 30 Jul, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nwin.pro)


NWRDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       NWRDS
 PURPOSE:
       Return the number of words in the given text string.
 CATEGORY:
 CALLING SEQUENCE:
       n = nwrds(txt)
 INPUTS:
       txt = text string to examine.             in
 KEYWORD PARAMETERS:
       Keywords:
         DELIMITER = d.  Set delimiter character (def = space).
 OUTPUTS:
       n = number of words found.                out
 COMMON BLOCKS:
 NOTES:
       Notes: See also getwrd.
 MODIFICATION HISTORY:
       R. Sterner,  7 Feb, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES 4 Sep, 1989 --- converted to SUN.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\nwrds.pro)


N_FELEMENTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n_felements

 PURPOSE:
	This function returns the number of finite elements in an array.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	nfin = n_felements(a)

 INPUTS:
	a: array of which number of finite elements are to be returned.

 KEYWORD PARAMETERS:
	/NAN:	If set the number of "Not A Number" (NaN) elements in a are returned.
	/INFINITY: If set the number of positive or negative infinity elements in a are returned.
	Only one of these keyword parameters may be set at a time.

 OUTPUTS:
	This function returns the number of finite elements in array a.

 EXAMPLE:
	a = [1., 2., 3., !VALUES.F_NAN, !VALUES.F_INFINITY, !VALUES.F_INFINITY]
	PRINT, N_ELEMENTS(a)					--> 6
	PRINT, n_felements(a)				--> 3
	PRINT, n_felements(a, /NAN)		--> 1
	PRINT, n_felements(a, /INF)		--> 2

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 01.04.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\n_felements.pro)


N_HEAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	n_head

 PURPOSE:
   Header definition for Fred ClO dataset

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   n_head


 OPTIONAL OUTPUTS:
   inhalt: the builded structure inhalt
   date:   the date
   param_type: the parameter type


 EXAMPLE:
   n_head

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\n_head.pro)


N_LINES

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  n_lines

 PURPOSE:  count number of lines in a file

 USEAGE:   result=numlines(file,nw)

 INPUT:    
   file    file name

 OUTPUT:
   result  number of lines in file
   nw      number of words in file

 EXAMPLE: 

  file='/home/paul/idl/esrg/n_lines.pro
  print,'number of lines   =',n_lines(file,nw) ,$
        'number of words   =',nw

 AUTHOR:   Paul Ricchiazzi                        29 Feb 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\n_lines.pro)


N_SEPARATOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    n_separator

 PURPOSE:
   This functions returns how ofen a string is given in a text

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   result=n_separator(text,separator)

 INPUTS:
   text: a string or stringarray of text
   separator: this is the string to count in each text line


 EXAMPLE:
   n=n_separator('A.B.V','.')
   print,n
   2

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n_separator.pro)


N_SORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   n_sort

 PURPOSE:
   sort an array according to n columns 

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   result=n_sort(matrix)

 INPUTS:
   matrix : the input matrix, which shoul be sorted

 KEYWORD PARAMETERS:
   INDEX:  a vector of column numbers (default: indgen(number of columns))
           it defines the order of the columns, how the matrix will be sorted

   DECREASING_ORDER: the matrix will be sorted decreasingly

 OUTPUTS:
   j_index: the vector of sorted line numbers

 EXAMPLE:
     matrix = [[ 2, 3, 4 ], $
               [ 1, 4, 6 ], $
               [ 1, 4, 5 ]]
     j_index=n_sort,matrix
     j_index=[2,1,0]

     matrix = [[ 1, 4, 5 ], $
               [ 1, 4, 6 ], $
               [ 2, 3, 4 ]]
     j_index=n_sort,matrix,index=[1,0,2]     
     j_index=[2,0,1]


 MODIFICATION HISTORY:
   Written     Juergen Ankenbrand, 26.04.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\n_sort.pro)


N_SORT_VSTRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   n_sort_vstruct

 PURPOSE:
   This function returns an indexfield given by n_sort() to sort a vector of structures

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=n_sort_vstruct(data,names)

 INPUTS:
    data: a vector of structures
    names: the tag_names of the structure which should be used to sort by n_sort()

 EXAMPLE:
   idx=n_sort_vstruct(data,['EXPERIMENT','MISSION'])
   result=x_vstruct(data[idx])

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Apr-27
       1999-09-29 sort is used if only one names is submitted

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n_sort_vstruct.pro)


N_TAGS_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   n_tags_struct

 PURPOSE:
   The result of this function is the n_tags() of a structure with all sub-structures

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=n_tags_struct(struct)

 INPUTS:
   struct:   A structure


 EXAMPLE:
    pi={name:'P.Mustermann',organisation:'FZ Jülich'}
    platform={name:'cessna',type:'AIRCRAFT'}
    dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT',$
              experiment:'GHOST',title:'validation',$
              type_of_data:'MEASUREMENTS'}
    global=CREATE_STRUCT('pi',pi,'platform',platform,'dataset',dataset)

    n2o={units:'ppm',$
         long_name:'N2O',short_name:'N2O',$
         flag:'NONE'}
    time={units:'seconds since 2000-01-01 00:00:00 UTC',$
          long_name:'time',short_name:'time',flag:'NONE'}
    struct=CREATE_STRUCT('!global',global,'time',time,'n2o',n2o)

    result=n_tags_struct(struct)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Nov-10


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\n_tags_struct.pro)


O1D_BRANCHING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   o1d_branching

 PURPOSE:
   This functions calculates the branching ratio of O1D with water, N2, And O2

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = O1D_BRANCHING(Water, Nitrogen, Oxygene)

 INPUTS:
   Water:    concentration of water vapor
   Nitrogen: concentration of N2
   Oxygene:  concentration of O2
       these number must be provided in the same units !!!!!

 KEYWORD PARAMETERS:
   MISSING:        missing data value, if omitted, -12345.Do is assumed
   TEMPERATURE:    temperature for rate constant calculation, if omitted 298K is assumed
   K_O1D_N2:       if set to a named variable the rate for O1D+N2 is returned
   K_O1D_O2:       if set to a named variable the rate for O1D+N2 is returned
   K_O1D_H2O:      if set to a named variable the rate for O1D+H2O is returned

 OUTPUTS:
   This function returns the double value of the O1D branching with respect to:
       O1D + H2O --> O3P + H2O
       O1D + N2 --> O3P + N2
       O1D + O2 --> O3P + O2

 EXAMPLE:
   q = o1d_branching(h2o, n2, o2)
   P_OH = jo1d * q * o3 * 2.

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-APR-10
   Modified:   Theo Brauers, 1998-AUG-11
               sign was wrong in the Arrhenisu expressions

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\o1d_branching.pro)


O2O2CONT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  o2o2cont

 PURPOSE:  plot o2*o2 continuum optical depth

 USEAGE:   o2o2cont

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        27 Jul 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\o2o2cont.pro)


OAXIS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  oaxis

 PURPOSE:  overplot the x or y axis with tick marks and labels 
           at irregularly spaced intervals.  

 NOTE:     much of the same results can be obtained with
           [xyz]ticks, [xyz]tickname, [xyz]minor, and [xyz]tickv
           just make sure that the number of elements in xtickname
           or xtickv exceeds the VALUE of xticks by one.
           

 USEAGE:   oaxis,t,tlabel=tlabel,bot=bot,top=top,right=right,left=left, $
            title=title,charsize=charsize,space=space,ticklen=ticklen, $
            gridstyle=gridstyle,extend=extend,color=color,tcolor=tcolor, $
            offset=offset

 INPUT:    


   t
     a vector of axis points (data coordinates) to label or mark
     if not set t is set to the number of tlabel elements, n_elements
     of talel gt 1, or otherwise to !x.crange or !y.crange as appropriate

 keyword input:

   tlabel
     string array of axis tickmark labels, if not of type
     string, will be coerced into string.  If tlable eq 1 then
     tlabel is set to the values of t and then coerced into a string
     using procedure numform.

   title
     x axis title, If XTICKNAME is undefined, TITLE appears immediately
     outside axis line, outside the plot area if space is positive.

   space  
     controls vertical spacing between axis, tick labels and axis
     title.  By default the centerline of the tick labels appear 1
     character height below the x-axis while the x-axis title appears
     2.5 character heights below the x-axis.  The SPACE factor
     multiplies these vertical offsets. SPACE < 0 causes the titles
     to appear inside the plot area wrt to the axis.  (default=1)

   offset
     controls offset from normal axis position.  positive offset moves
     the axis away from the center of the plot in units of the character
     size

   ticklen   
     length of tickmarks as a PERCENTAGE of the entire y coordinate range
     TICKLEN=2 produces the standard major tickmark length, while
     TICKLEN=1 produces the standard minor tickmark length. (defualt=0)
     
   charsize
     character size used for axis annotation.  If more than two
     plots are ganged in either the X or Y direction, the character
     size is halved.
     
   extend
     if set and y lt 0 or y gt 1 then the y-axis lines are extended to 
     to intersect the new x-axis line.  This produces an enclosed
     rectangular area between the new x-axis and the old x-axis (if it
     exists).

   color
     color index used to color axis

   tcolor
     color index used to color axis and tick titles (just for the characters)

 DISCUSSION:
     call the plot with ystyle or xstyle set to 4 or 5 to disable axis
     drawing. Then call OAXIS to oveplot axis.
    
 EXAMPLE:  

    f=randf(100,3) & f=(f-min(f))/(max(f)-min(f))
    plot,f,xstyle=5,ystyle=5,ymargin=[10,10]
    xpnts=findrng(0,99,11)
    xlbl=findrng(0,20,11)
    oaxis,xpnts,tlabel=xlbl,/ticklen,title='days'
    oaxis,xpnts,tlabel=20-findrng(0,20,11),title='days remaining',offset=6
    oaxis,xpnts,tlabel=xlbl*24,/ticklen,title='hours',/top
    oaxis,findrng(0,1,11),/tlabel,/ticklen,title='value',/left
    oaxis,findrng(0,1,11),/ticklen,/right

; fancy non-linear x-axis

    f=randf(100,3) & f=(f-min(f))/(max(f)-min(f))
    plot,f,xstyle=5,ymargin=[10,10]
    xpnts=findrng(0,99,11)
    xlbl=findrng(0,20,11)^2
    oaxis,xpnts,tlabel=xlbl,/ticklen,title='days^2'
    oaxis,xpnts,/ticklen,/top


 AUTHOR:   Paul Ricchiazzi                        24 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\oaxis.pro)


OBAND

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   oband

 USEAGE:    oband,x,y1,y2,border=border,color=color,spacing=spacing,$
                  fill_pattern=fill_pattern,line_fill=line_fill,$
                  pattern=pattern,orientation=orientation
                  

 PURPOSE:   Over plot shaded band on an x-y plot.  Shaded region is
            between y1 and y2 as a function of x.  This is useful for
            indicating an error bounds on an x-y plot.  

 INPUTS:

 x          vector of x values (data coordinates)
 y1         vector of lower y values (data coordinates)
 y2         vector of upper y values (data coordinates)
 
            NOTE: y1 need not be smaller than y2. The shaded region
                  always extends from y1 to y2 no matter which one is
                  greater.

            NOTE: If y1 or y2 is a scalor it will be used internally
                  as if it were a constant value vector of the same
                  length as x.

 OPTIONAL KEYWORDS:

   border
        if set, draw a border around the filled region, the numerical
        value of BORDER is the color index used to draw the border
    

 Keywords recognized by the POLYFILL procedure:

   COLOR
        color index used to fill region

   LINE_FILL
        Set this keyword to indicate that polygons are 
        to be filled with parallel lines, rather than using 
        solid or patterned filling methods.When using the 
        line-drawing method of filling, the thickness, line-
        style, orientation, and spacing of the lines may be 
        specified with keywords.
        
   PATTERN
        A rectangular array of pixels giving the fill 
        pattern. If this keyword parameter is omitted, POLY-
        FILL fills the area with a solid color. The pattern 
        array may be of any size; if it is smaller than the 
        filled area the pattern array is cyclically 
        repeated.

   SPACING
        The spacing, in centimeters, between the parallel
        lines used to fill polygons.
        
   ORIENTATION
        Orientation angle of lines used to fill region.
        
Graphics Keywords Accepted

        See Chapter 2, Graphics Keywords and System Variables, 
        for the description of graphics and ploting keywords not 
        listed above. CHANNEL CLIP DATA DEVICE LINE NOCLIP NORMAL 
        T3D THICK Z.
 
 EXAMPLE:

        x=indgen(200)
        y=randf(200,3)
        y1=y+.1*(1.+randf(200,2)^2)
        y2=y-.1*(1.+randf(200,2)^2)
        plot,x,y
        oband,x,y1,y2,color=100
        oplot,x,y

        plot,x,y
        oband,x,y,0,/line_fill,orien=45,border=100


 DISCUSSION: If y1 and y2 are more than 1 element, make sure their
             array lengths are the same as x.
     

  author:  Paul Ricchiazzi                            12apr93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\oband.pro)


OBJECT_SHADE_SURF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OBJECT_SHADE_SURF

 PURPOSE:

       This program shows you the correct way to write an
       elevation-shaded surface in object graphics. This would
       be the equivalent of these direct graphics commands:

           Surface, data, Shades=BytScl(data)
           Shade_Surf, data, Shades=BytScl(data)

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Object Graphics

 CALLING SEQUENCE:
       OBJECT_SHADE_SURF, data, x, y

 INPUTS:
       data: The 2D surface data.
       x:    A vector of X values, corresponding to the X values of data.
       y:    A vector of Y values, corresponding to the Y values of data.

 KEYWORD PARAMETERS:
       STYLE: Set equal to 1 for a wire-frame surface. Set equal to 2 for
       a solid surface (the default).

 COMMON BLOCKS:
       None.

 EXAMPLE:
       OBJECT_SHADE_SURF

 MODIFICATION HISTORY:
       Written by:  David Fanning, November 1998.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\object_shade_surf.pro)


OBJ_DRAW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OBJ_DRAW
 PURPOSE:
       Display graphical object in a resizable window.
 CATEGORY:
 CALLING SEQUENCE:
       obj_draw, obj
 INPUTS:
       obj = Object to display.    in
         Must have a DRAW method.
         Should also have a method called XSET which is
         a widget interface to all plot control parameters.
         XSET method should accept group_leader and current
         plot window.
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=ttl Window title (def=none).
         /NOTITLE  Suppress title bar.  To move window drag
           while holding down the ALT key.
         XSIZE=xs, YSIZE=ys  Given initial display window size.
         WIN=win  returned window ID.
         WID=wid  returned widget ID for this widget.
         GROUP_LEADER=group  Set group leader.  When it is
           iconized or destroyed this widget will be too.
         ANNOTATE=ann  Name of a procedure called after the
           objects DRAW method to add annotation.  Optional.
         /USER_OPTIONS lists notes on adding custom options.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: window may be resized with the pointing device.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Nov 21
       R. Sterner, 1999 Jun 10 --- returned to this routine.
       R. Sterner, 1999 Nov 16 --- Added GROUP_LEADER for XSET call.
       R. Sterner, 1999 Dec 14 --- Improved debug mode.

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\obj_draw.pro)


OBSTAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		OBSTAT
 VERSION:
		4.0
 PURPOSE:
		Providing informational messages about obsolete routines.
 CATEGORY:
		Utility.
 CALLING SEQUENCE:
		OBSTAT [,/RESET]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/RESET
		Switch.  Normally OBSTAT issues a warning message only once per session
		for each called obsolete routine.  Calling OBSTAT with RESET set,
		resets the message counter.
 OUTPUTS:
		None other than screen output.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		MERON_OBSOLETE_ROUTINES
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		OBSTAT maintains a list of obsolete routines and their replacements.
		When called from MAIN, OBSTAT diplays the full list.  When called from
		within a specific routine, OBSTAT checks whether this routine is on the
		obsolete list.  If yes, the action taken is one of the following:

		If the routine, though obsolete, is still maintained, a warning message
		to the effect is issued, together with the name of the replacement
		routine.  Program execution then proceeds normally.  The message is
		issued only once per IDL section (on the first call to the routine).

		If the routine is no longer maintained, an error message is issued,
		together with the name of the replacement routine.  The program then
		quits and returns to the calling routine.  The message is issued on
		every call to the obsolete routine.

		OBSTAT Calls STRMATCH_MM, STRPARSE_MM and TABULATE from MIDL.
 MODIFICATION HISTORY:
		Created 30-SEP-1999 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\obstat.pro)


ODE_RELAX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ODE_RELAX
 VERSION:
		4.3
 PURPOSE:
		Solving differential equations of the form

			Y'' + F(X)*Y' + G(X)*Y = H(X)

		or the more general (nonlinear)

			Y'' + F(X)*Y' + G(X,Y) = H(X)

 CATEGORY:
		Mathematical.
 CALLING SEQUENCE:
		Result = ODE_RELAX( X [, Y], LO_BOUND = LOB, HI_BOUND = HIB [,keywords])
 INPUTS:
	X
		Numeric vector, at least 3 elements long.  The X coordinates for which
		the result is calculated.
 OPTIONAL INPUT PARAMETERS:
	Y
		Numerical vector, same length as X, serves as an initial guess at the
		solution.  Ignored for the case of linear equation.  Otional for non-
		linear equation (if not given, it is generated internally).
 KEYWORD PARAMETERS:
	LO_BOUND
		Numeric vector providing the boundary condition at the lower endpoint of
		the X interval.  The general boundary condition is of the form

			a*Y' + b*Y = c  (where Y', Y are evaluated at the endpoint).

		and LO_BOUND is provided as the 3-element vector [a,b,c] (optionally,
		it can be given as a 2-element vector [a,b] in which case c defaults
		to zero.  This input is mandatory.
	HI_BOUND
		Same as LO_BOUND, for the upper endpoint of the X interval.
	/SYM_YBOUND
		Switch.  If set, the symmetrized value (Y[0] + Y[1])/2 is used to
		represent Y in the lower boundary condition (instead of plain Y[0])
		and, similarly, a symmetrized combination is used at the upper end.
	FFUN
		Character value representing an existing IDL function, corresponding
		to F(X) in the expression above.  The function must comply with the IDL
		standard of being able to accept an array input and return an array
		output.  The calling sequence for the function must be either

			Result = FFUN(X)
		or
			Result = FFUN(X, extra)

		where X is the variable and EXTRA may be any single entity (scalar,
		array, structure etc.) used to pass additional parameters to the
		function (see FPAR, below)

		If no argument is provided to FFUN, it defaults to the MIDL function
		POLEVAL, amounting to polynomial evaluation using FPAR to provide the
		coefficients.  Specifically (in this case) if FPAR is a scalar constant
		the action of FFUN amounts to multiplication by same constant.
	GFUN
		Character value representing an existing IDL function, complying with
		same standards as FFUN.  Corresponds to G(X) or G(X,Y) in the
		expression above.  The calling sequence for the function depends on
		the setting of the NON_LINEAR switch (see below).

		If NON_LINEAR is *not* set then the calling sequence is same as for
		FFUN (see above).  Also, same as in the case of FFUN, GFUN defaults to
		POLEVAL if not provided.

		If NON_LINEAR is set, then GFUN is a function of both X and Y and the
		calling sequence is either

			Result = GFUN(X, Y)
		or
			Result = GFUN(Y, Y, extra)

		where EXTRA has same meaning as for FFUN and is provided through GPAR
		(see below).  There is no default setting for GFUM in the non-linear
		case and, if not provided, an error results.
	HFUN
		Character value representing an existing IDL function, complying with
		same standards as FFUN.  Corresponds to H(X) in the expression above.
		The calling sequence for the function is same as for FFUN.  In the
		linear case HFUN defaults to POLEVAL if not provided, same as FFUN.
		In the non-linear case, if HFUN is not provided, it is ignored.
	FPAR
		An arbitrary value or variable which is passed to the function FFUN.
		May be an array or structure.
	GPAR
		Same as FPAR, for GFUN.
	HPAR
		Same as FPAR, for HFUN.
	/NONLINEAR
		Switch.  If set, indicates that the equation is non linear and that the
		iterative mode needs to be used.
	CORR_COEF
		Value of a parameter which is used in the nonlinear mode to hasten
		convergence.  Any value will be accepted but values <0 or >=1 tend to
		destabilize the procedure and should be avoided.  Default value is 1/2.
		This parameter is ignored in the case of a linear equation.
	SHOW_PROGRESS
		Accepts a numerical value determining how much progress info will be
		displayed during the iteration process, in the nonlinear mode.  For
		value N, information is printed every N-th iteration.  The info
		displayed consists of 3 numbers, in order:  number of steps so far,
		length of the most recent vector of Y corrections and the scalar
		product of the most recent and the previous vector of Y corrections,
		divided by the product of their lengths.  In the case of linear
		equation, this parameter is ignored.
	COND_F
		Optional output, see below.
	COND_G
		Optional output, see below.
	LAST_INC
		Optional outpput, see below.
 OUTPUTS:
		Returns a vector of Y values, of the same length as the original X
		vector.  These Y values are an approximation to the solution of the
		differential equation.
 OPTIONAL OUTPUT PARAMETERS:
	COND_F
		Returns the maximal (over the grid provided) value of F(X)*dX/2.  This
		provides an indirect measure of the quality of the approximation.
	COND_G
		Returns the maximal (over the grid provided) value of G(X)*dX^2/4 or
		G(X,Y)*dX^2/4.  This also provides an indirect measure of the quality
		of the approximation.
	LAST_INC
		In the case of a nonlinear equation returns the length of the last
		Y-increment vector, providing a measure of the convergence of the
		iteration.  Not active in the case of a linear equation.

		Note:  small or zero value of LAST_INC indicates that the iteration
		has converged but provides no information regarding the quality of the
		result.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Based on minimalization of the *action* corresponding to the 2nd order
		ODE.  For a linear differential equation the minimalization over a
		finite mesh yields a triagonal equation which is solved in a single
		step.  In the case of a non-linear equation the minimalization
		generates a vector of Y corrections which is added to the original
		values and the process is repeated, iteratively, till it converges.

		Calls CAST, DEFAULT, FPU_FIX, ISNUM, TOLER and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 10-DEC-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\ode_relax.pro)


OGRID

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  ogrid

 PURPOSE:  

 USEAGE:   ogrid,nx,ny,style=style

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        30 Oct 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ogrid.pro)


ONE2TWO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ONE2TWO
 PURPOSE:
       Convert from 1-d indices to 2-d indices.
 CATEGORY:
 CALLING SEQUENCE:
       one2two, in, arr, ix, iy
 INPUTS:
       in = 1-d indices (may be a scalar).  in
       arr = array to use (for size only).  in
         Alternatively, arr can be [nx, ny]
         where nx and ny are the image sizes
         in x and y (saves space).
 KEYWORD PARAMETERS:
 OUTPUTS:
       ix, iy = equivalent 2-d indices.     out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 25 May, 1986.
       Johns Hopkins Applied Physics Lab.
       R. Sterner, 19 Nov, 1989 --- converted to SUN.
       R. Sterner, 9 Jun, 1993 --- Allowed [nx,ny] instead of ARR.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\one2two.pro)


ONE_DAY_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   one_day_plot

 PURPOSE:
   This routine produces a postscript file with a plot of one
   day of a dataset given by the vectors of julian seconds and
   the data array

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   one_day_plot, name, time, value

 INPUTS:
   name:   the name of the enz data File#
   time:   array with julian sec
   value:  array (same size as time) with data values

 KEYWORD PARAMETERS:
   day:    if this parameter is set to a value in julian seconds
           only a certain day which includes this time is plotted
           if omitted, the whole data set will be plotted in multi
           ps files
   title:  title string, if omitted title is name + date
   psfile: returns the name of the postscriptfile
   stat:   if set small statistics is printed on side of plot
   stamp:  plot stamp with info about time, user, file, etc.

   further keyword parameters of the jsplot routine are parsed thru
   the extra keyword

 MODIFICATION HISTORY:
   Written by: T.Brauers , Dec 1997
   Modified:       new psfile name returned

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\one_day_plot.pro)


ONE_OF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		ONE_OF
 VERSION:
		4.0
 PURPOSE:
		Called with up to 8 variables V_0 through V_7 , ONE_OF checks which
		variable is defined (only one is supposed to be).
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = ONE_OF( V_0 [,V_1, ... V_7] [, VALUE = VAL])
 INPUTS:
	V_0 through V_7
		Arbitrary, all are optional.
 OPTIONAL INPUT PARAMETERS:
		See above.
 KEYWORD PARAMETERS:
	VALUE
		Optional output, see below.
 OUTPUTS:
		Returns the serial number (range 0 through 7) of the defined variable,
		or -1 if none is defined.  If more than one variable is defined, ONE_OF
		issues an error message and returns to the main level.
 OPTIONAL OUTPUT PARAMETERS:
	VALUE
		The name of the variable to receive the value of the single defined
		variable, or a null string if none is defined.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Currently ONE_OF is restricted to a maximum of 8 variables.  If needed,
		the number can be increased.
 PROCEDURE:
		Straightforward.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 30-JUL-1991 by Mati Meron.  The dependence of the original
		code on the EXECUTE system routine has been eliminated in order to
		assure compatibility with the OUTPUT routine.
		Modified 15-NOV-1993 by Mati Meron.  Since IDL now allows for recursive
		calls to EXECUTE, the original code has been restored.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\one_of.pro)


OPEN_DEVICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        OPEN_DEVICE

 PURPOSE:
        If hard copy is to be generated, OPEN_DEVICE opens the 
        PostScript device.  Otherwise OPEN_DEVICE opens an Xwindow. 

 CATEGORY:
        Input/Output

 CALLING SEQUENCE:
        OPEN_DEVICE [,OLD_DEVICE] [,keywords]

 INPUTS:

 KEYWORD PARAMETERS:
        PS        (int)  -> will send PostScript file to printer

        COLOR     (int)  -> will enable PostScript color mode

        LANDSCAPE (int)  -> will enable PostScript landscape mode

        PORTRAIT  (int)  -> will enable PostScript portrait mode

        FILENAME  (str)  -> The name to be given the PostScript file.
                  Default: idl.ps

        WINPARAM  (int)  -> An integer vector with up to 5 elements:
                  WINPARAM(0) = window number  (if negative, a window
                       will be opened with the /FREE option.
                  WINPARAM(1) = X dimension of window in pixels (width)
                  WINPARAM(2) = Y dimension of window in pixels (height)
                  WINPARAM(3) = X offset of window (XPOS)
                  WINPARAM(4) = Y offset of window (YPOS)

        TITLE -> window title
         
        _EXTRA -> additional keywords that are passed to the call to
                  the DEVICE routine (e.g. /ENCAPSULATED)

 OUTPUTS:
        OLD_DEVICE (str) -> stores the previous value of !D.NAME for
            use in CLOSE_DEVICE. Note that CLOSE_DEVICE will automatically
            set the default screen device if OLD_DEVICE is not provided,
            hence it will only rarely be used.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        If PS=0 then  
            Open Xwindow WINPARAM(0), which is WINPARAM(1) pixels wide
            in the X-direction, and WINPARAM(2) pixels wide in the
            Y-direction. 

        If PS=1 then 
           depending on /PORTRAIT or /LANDSCAPE and /COLOR
           postscript is enabled in either portrait or landscape
           mode as color or b/w plot

        The key parameter which determines whether to open a postscript
        file or a screen window is PS. Therefore, e.g. in a widget 
        application, you can pass a standard set of parameters for both,
        postscript and screen, to this routine, and determine the device
        to be chosen by a button state or checkbox which is passed into PS.
              

 EXAMPLE:
        OPEN_DEVICE, WINPARAM=[0,800,800]  
            opens a screen window of size 800x800 pixels at the default 
            position

        OPEN_DEVICE, OLD_DEVICE, /LANDSCAPE, FILENAME='myplot.ps'
            opens a postscript file named myplot.ps in b/w and landscape
            orientation

        OPEN_DEVICE, OLDDEV, PS=PS, /PORTRAIT, /COLOR, WIN=2
            depending on the value of PS either a color postscript file 
            named idl.ps is opened or screen window number 2 in default
            size.


 MODIFICATION HISTORY:
        bmy  15 Aug 1997: VERSION 1.00
        bmy, 19 Aug 1997: VERSION 1.01
        mgs, 20 Aug 1997: VERSION 1.02
        mgs, 09 Apr 1998: VERSION 1.10 
            - added 2 more parameters for WINPARAM and TITLE keyword
        mgs, 13 Jun 2000: settings for A4 paper size
                                         

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\open_device.pro)


OPEN_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        OPEN_FILE

 PURPOSE:
        Open a file for input. This routine can automatically
        decide whether to use DIALOG_PICKFILE, and it contains
        basic error handling. After successful operation the
        file with logical unit LUN will be open for input.

 CATEGORY:
        I/O routines

 CALLING SEQUENCE:
        OPEN_FILE,filemask,lun [,keywords]

 INPUTS:
        FILEMASK -> a filename with path information that may
            contain wildcards ('*', '?')

        LUN -> a named variable that will contain the logical unit
            number upon return. If a unit number > 0 is passed,
            an attempt is made to open the file with this number,
            otherwise, a free unit is selected with /GET_LUN. In case
            of an error, LUN contains -1. This can be used instead of
            the RESULT keyword to detect errors (see below).

        (both parameters are mandatory !)

 KEYWORD PARAMETERS:
        FILENAME -> a named variable that will contain the complete
            filename upon return (i.e. the file selected with PICKFILE)

        WRITE -> Set this keyword to open a file for read and write
            operations. Normally, a file is opened for reading only.

        UPDATE -> Set this keyword to open the file for reading and
            writing. Contrary to Write, the file must already exist,
            and its content will not be erased (unless you start
            writing into it without setting the file pointer to the
            end). Note that the APPEND option is also available via
            the _EXTRA mechanism.

        RESULT -> a named variable that will return the error status
            of the operation. A value of 0 indicates the file was
            opened sucessfully, otherwise the value of !Error_State.Code
            is returned.

        PICKFILE -> logical flag to force use of the DIALOG_PICKFILE
            routine, even if a complete filemask without wildcards was
            passed.

        TITLE -> the title of the pickfile dialog. Default is
            'Choose a file'.

        DEFAULTMASK -> A default filemask to be used when no filename
            is given or the filename does not contain wildcards and
            /PICKFILE is set. This mask will also be used if the
            file cannot be opened because of 'FILE NOT FOUND' error.

        NO_PICKFILE -> prevents the pickfile dialog for batch operation.
            The filemask must not contain wildcards.
            Normally a 'FILE NOT FOUND' condition leads to
            a second attempt with the /PICKFILE flag set (recursive
            call). Use this flag if you want to abort instead.

        _EXTRA keywords are passed to the openr routine
            (e.g. /F77_UNFORMATTED)

 OUTPUTS:

 SUBROUTINES:

 REQUIREMENTS:
        Uses EXTRACT_FILENAME function

 NOTES:

 EXAMPLE:
        ; Quick and dirty with pickfile dialog
        OPEN_FILE,'*.dat',ilun
        if (ilun le 0) then stop    ; check error condition

        ; A few more options invoked
        OPEN_FILE,'~/data/thisfile.dat',lun,default='*.dat', $
            title='Choose a data file',filename=name
        if (lun le 0) then stop    ; check error condition
        print,filename,' was opened successfully
        ; NOTE that filename does not have to be identical with
        ; '~/data/thisfile.dat' !
        ; readf,lun,...
        free_lun,lun

 MODIFICATION HISTORY:
        mgs, 13 Aug 1998: VERSION 1.00
        mgs, 14 Aug 1998:
          - small bug fix: handle empty filename string correctly
        mgs, 22 Aug 1998:
          - added WRITE keyword to open writable files
        mgs, 22 Oct 1998:
          - now always returns LUN=-1 in case of an error
        mgs, 21 Jan 1999:
          - Added explicit F77_Unformatted keyword and set
            Swap_If_Little_Endian or Swap_If_Big_Endian automatically
        mgs, 10 Feb 1999:
          - bug fix: swap_if was wrong way round
        mgs, 12 May 1999:
          - ok. finally got the hang of byte swapping! it's the
            machine architecture not the operating system! Now changed
            it so that !version.arch is tested for 'x86'
        mgs, 20 May 1999: 
          - abandoned SWAP_IF completely and use explicit SWAP_ENDIAN
            keyword in users grace now.
        mgs, 08 Aug 2000:
          - include extract_filename and rstrpos as a local
            procedures and changed copyright to open source
        mgs, 13 Aug 2000:
          - added UPDATE keyword.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\open_file.pro)


OPFIT1D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OPFIT1D
 PURPOSE:
       Calculate orthonormal polynomial fit for 1-d data.
 CATEGORY:
 CALLING SEQUENCE:
       yfit = opfit1d( y, ndeg, [x, c, p])
 INPUTS:
       y    = Data to fit.                                   in
       ndeg = Degree of polynomial to use.                   in
       x = optional vector of independant variable values.   in
         Degree must be greater than 1.
 KEYWORD PARAMETERS:
 OUTPUTS:
       c = opt. matrix of orthonormal polynomial coef.       out
       p = optional vector of orthonormal polynomial values. out
       yfit = 1-d fit to original data.                      out
 COMMON BLOCKS:
 NOTES:
       Notes: Method is based on Forsythe, J. Soc. Indust. 
         Appl. Math. 5, 74-88,1957.
 MODIFICATION HISTORY:
       19-MAR-85 -- Initial entry by RBH@APL (as opfit.pro)
       28-DEC-91 -- Name changed from opfit to opfit1d.   blg
       R. Sterner, 6 Mar, 1992 --- cleaned up.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\opfit1d.pro)


OPFIT2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OPFIT2D
 PURPOSE:
       Calculate orthonormal polynomial fit for 2-d data.
 CATEGORY:
 CALLING SEQUENCE:
       zfit = opfit2d( z, xdeg, ydeg, [x, y, c, px, py])
 INPUTS:
       z    = Image to fit.                                   in
       xdeg = Degree of polynomial to use in X direction.     in
       ydeg = Degree of polynomial to use in Y direction.     in
         X and Y degrees must be greater than 1.
       x = optional vector of independant variable values.    in
       y = optional vector of independant variable values.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       c = opt. matrix of orthonormal polynomial coef.        out
       px = optional vector of orthonormal polynomial values. out
       py = optional vector of orthonormal polynomial values. out
       zfit = 2-d fit to original image.                      out
 COMMON BLOCKS:
 NOTES:
       Notes: Method is based on Forsythe, J. Soc. Indust. 
         Appl. Math. 5, 74-88,1957.
 MODIFICATION HISTORY:
       19-MAR-85 -- Initial entry by RBH@APL
       R. Sterner, 29 Mar, 1990 --- converted to SUN.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\opfit2d.pro)


OPLANCK

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    oplanck

 PURPOSE:    overplot a series of plack body curves 
             units of planck function output is 

             W/m2/str/micron    (microns=1)  xrange in microns
             W/m2/str/cm-1      (microns=0)  xrange in cm-1


 USEAGE:     oplanck,t,xrange=xrange,microns=microns,scale=scale,$
                     xlab=xlab,color=color,linestyle=linestyle

 INPUT:
   t         temperature(s) for black body curves

 KEYWORD INPUT:

   xrange    x limits of planck output

   microns   if set,      xrange is in microns and planck is in W/m2/micron, 
             otherwise    xrange is in cm-1    and planck is in W/m2/cm-1

   scale     scale factor to multiply, planck function radiance.
             set scale to !pi to convert planck to irradiance 

   xlab      if set, write temperature label.  Set xlab=0 to put labels
             at xrange(0) or set xlab=1 to put lables at xrange(1)

  
 EXAMPLE:

; thermal radiance, output in microns

             ww=findrng(4,20,100)
             rand=smooth((5*randomu(seed,100)) < 1,3)
             rr=planck(ww,300,/mic)*rand
             plot,ww,rr,xrange=[4,22]
             oplanck,findrng(200,300,5),/mic,xrange=[4,20],ylab1=ylab1

; thermal radiance, output in cm-1

             ww=findrng(300,2500,100)
             rand=smooth((5*randomu(seed,100)) < 1,3)
             rr=planck(ww,300)*rand
             plot,ww,rr
             oplanck,findrng(200,300,5),xrange=[300,2500],xlab=0

 REVISIONS:

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\oplanck.pro)


OPLOTIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   OPLOTIMAGE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Overlays an image on an existing plot.

 CALLING SEQUENCE:
   OPLOTIMAGE, img

 DESCRIPTION: 

   OPLOTIMAGE overlays an image on an already-existing set of plot
   axes.  It should not matter what plot elements have already be
   displayed, but at least one command is needed to set up the plot
   axes.

   Only the IMGXRANGE and IMGYRANGE keywords, specifying the extent
   of the image, can be given in a call to OPLOTIMAGE.

   See PLOTIMAGE for more detailed information.

 INPUTS:

   IMG - A byte array to be displayed.  An image declared as
         ARRAY(M,N) will be M pixels in the x-direction and N pixels
         in the y-direction.  The image is resampled via
         interpolation to fill the desired display region.
 
 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   IMGXRANGE, IMGYRANGE - Each is a two component vector that
                          describes the X and Y position of the first
                          and last pixels.
                          Default: the size of the image in pixels

 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

   This example first constructs an image whose values are found by
       z(x,y) = cos(x) * sin(y)
   and x and y are in the range [-2,2] and [4,8], respectively.
   The image is then plotted in the range [-10, 10] in both x and
   y directions.
   
   x = findgen(20)/5. - 2.
   y = findgen(20)/5. + 4.
   zz = cos(x) # sin(y)
   imgxrange = [min(x), max(x)]
   imgyrange = [min(y), max(y)]
   xr=[-10.,10]
   yr=[-10.,10]
   plotimage, bytscl(zz), imgxrange=imgxrange, imgyrange=imgyrange

   Now for the overlay.  A new image is created in the ranges between
   -10 and 0:
      z(x,y) = x y

   x = findgen(20)/2 - 10.
   y = findgen(20)/2 - 10.
   imgxrange = [min(x), max(x)]
   imgyrange = [min(y), max(y)]
   zz = x # y
   oplotimage, bytscl(zz), imgxrange=imgxrange, imgyrange=imgyrange

 SEE ALSO:

   PLOTIMAGE, BYTSCL

 EXTERNAL SUBROUTINES:

   SUBCELL, DEFSUBCELL, TVIMAGE

 MODIFICATION HISTORY:
   Written, CM, 1997
   Removed BYTE requirement, added ON_ERROR, CM 19 Apr 2000
   Added copyright notice, CM 25 Mar 2001

   $Id: oplotimage.pro,v 1.2 2001/03/25 18:10:44 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\oplotimage.pro)


OPLOT_2Y

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	oplot_2y

 PURPOSE:
	This procedure acts like the IDL OPLOT command with the following exceptions:
	- an additional y axis is plotted for the data set
	- different colors can be specified for the axes and the data points
	- X and Y error bar values can be specified.
	- Annotation of the y axis can be omitted

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	OPLOT_2Y, [X,] Y

 INPUTS:
	Y:	see IDL OPLOT command

 OPTIONAL INPUTS:
	X:	see IDL OPLOT command

 KEYWORD PARAMETERS:
	AXIS_COLOR:	Color to be used for axes and annotation (default: !P.COLOR)
	Y_AT_XPOS:	Position where the y axis intersects the x axis in normal coordinates
				0 - x_min, 1 - x_max, values <0 or >1 are possible
	XERR: array of Y error bar values.
	YERR: array of Y error bar values.
	/NO_YANNOTATION: If set no annotation of the y axis will be plotted
	YRANGE = [low, high]:
		low, high can either be float numbers (standard IDL)
		or can be set to !VALUES.F_NAN (NaN). If an entry is
		specified as NaN its translated into a float number
		using the following convention:
		low = MIN(0., MIN(y)), high = MAX(0., MAX(y))
	/NOYAXIS: If set no new axis will be plotted
	/NO_DATA: If set no data will be plotted
	/YTCOLOR: If set the y axis title will be plotted in the color of the data
	/SHARE_ZERO: If set the right y axis zero point will be at the same level as on the left axis

	any other keywords which are excepted by the IDL OPLOT and AXIS commands

 EXAMPLE:
	see ex_oplot_2y.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 8. Jan. 98.
	18.01.1998:	All keyword parameters are passed into _EXTRA
	09.02.1998:	Handling of false calls to oplot_2y
	09.06.1998:	Handling of YAXIS keyword was changed
	09.11.1998:	New keyword parameter: /NO_YANNOTATION
	29.04.1999:	Routine grundlegend ueberarbeitet
	29.07.1999:	New keyword parameter: /NOYAXIS for compatibility with /OVERPLOT keyword in plot_2c
	20.10.1999:	New keyword parameter: /NO_DATA - Only axis will be plotted
	27.10.1999:	New keyword parameter: YTCOLOR = ytcolor
	05.11.1999:	Now handles also user-defined symbols.
	20.01.2000:	Bug removed if /NORMAL was set together with Y_AT_XPOS
	01.03.2000:	Now handles gaps in time series data if keyword parameters
					/TIMEAXIS and /TAX_BREAK (and optional TBREAK_INTV = tbi) are set.
	03.03.2000:	Bug removed if all elements of error data vector were !VALUES.F_NAN
	07.03.2000:	New keyword flag /SHARE_ZERO
	11.05.2000:	Plotting errorbars now make use of e.thick if provided.
	12.05.2000:	Changed keyword parameter YTCOLOR = ytcolor to flag /YTCOLOR

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\oplot_2y.pro)


ORTHOPOLY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ORTHOPOLY
 PURPOSE:
       Calculates a set of orthonormal polynomials.
 CATEGORY:
 CALLING SEQUENCE:
       p = orthopoly( x, ndeg, [w])
 INPUTS:
       x = Array of X points to be fitted.        in
          Range of -1. to +1. is best.
       ndeg = Highest degree polynomial desired.  in
          Must be greater than 1.
       w = opt weighting to be applied to pts.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       p = Orthonormal Polynomial.                out
 COMMON BLOCKS:
 NOTES:
       Notes: Method is based on Forsythe, J. Soc. Indust.
         Appl. Math. 5, 74-88,1957.
         Used by opfit2d.pro.
 MODIFICATION HISTORY:
       19-MAR-85 -- Converted from FORTRAN by RBH@APL
       R. Sterner, 29 Mar, 1990 --- converted to SUN.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\orthopoly.pro)


OUTBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OUTBOX
 PURPOSE:
       Test if given point outside given box.
 CATEGORY:
 CALLING SEQUENCE:
       flag = outbox( x, y, x1, x2, y1, y2)
 INPUTS:
       x, y = x and y of point to test.           in
       x1, x2 = min and max x of test box.        in
       y1, y2 = min and max y of test box.        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       flag = result: 0=not outside, 1= outside.  out
 COMMON BLOCKS:
 NOTES:
       Notes: x and y may be a scalar or array.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Nov 10

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\outbox.pro)


OUTPUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		OUTPUT
 VERSION:
		4.4
 PURPOSE:
		Generic output interface.  Allows sending the results of virtually any
		IDL command or file to any predefined hard copy device.  In detail,
		OUTPUT executes the provided command, and sends the output to the
		specified device, generating a file if needed.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		OUTPUT, COMM [, keywords] [,optional input parameters]
 INPUTS:
	COMM
		Character value representing a valid IDL command.  Can be (and usually
		is) a procedure or function call.
 OPTIONAL INPUT PARAMETERS:
	V_0 through V_7
		Serve to pass variables which are used in the command COMM.  Since COMM
		is passed to output as a single string, OUTPUT is not receiving the
		values of any variables used by COMM.  If such values are needed they
		have to be passed separately.  This is done using the variables V_0
		through V_7 in combination with the keyword SUBST (see below), which
		accepts a string made of the names of the variables separated by spaces
		or commas.
		Example:
			Assume a routine named NEWPLOT which is called using the syntax
				NEWPLOT, I, X, SCOPE = Y
			If at the time of call I, X, and Y have known values, say 3, 12.4
			and [12,95] then it is possible to issue the command
				OUTPUT, 'NEWPLOT, 3, 12.4, SCOPE = [12,95]'
			If, on the other hand one would want to pass NEWPLOT to output
			using the variables K, E and RANG for I, X, Y, the command can be
				OUTPUT, 'NEWPLOT, I, X, SCOPE = Y', $
				SUBST = 'I,X   Y', K, E, RANG
			The order in which the variable names appear in SUBST is arbitrary
			but it has to be in a one-to-one correspondence with the order in
			which the actual arguments are given.  Therefore, the following is
			equally valid
				OUTPUT, 'NEWPLOT, I, X, SCOPE = Y', $
				SUBST = 'Y, I, X', RANG, K, E
 KEYWORD PARAMETERS:
	OPTION
		Accepts a string representing a valid IDL command.  If given, this
		command will be executed BEFORE COMM.  If the command in OPTION
		includes variables, their values can be passed using the same mechanism
		as the one used for COMM (see above).
	/HALF_SIZE
		Switch.  If set, the size of the output is (roughly) halved.
	/QUARTER_SIZE
		Switch.  If set, the size of the output is (roughly) cut to a quarter.
	DEVICE
		Accepts a string specifying a graphics device.  Currently accepted
		devices are:
			'PRINTER'	-  The default printer.
			'PS'		-  Writes a PostScript file.
			'EPS'		-  Writes an encapsulated PostScript file.
		This list may be extended in the future, as needed.  For all devices on
		the list only the first two characters of the name are needed as input.
		If "DEVICE" is not provided, it defaults to "PRINTER" on the first call
		in a session and to the last used device on all subsequent calls.
	FIL
		Accepts a string representing a valid file name.  Extension isn't
		necessary.  If not given, a file name is generated using date and time.
		If the "PRINTER" device is being used, the filename is ignored.
	/PRINT
		Switch.  Specifies sending the file to the printer, for the cases where
		a file is generated ("PS" and "EPS").  Ignored for the "PRINTER" device.
		Valid only with "WIN" OS.
	/COLOR
		Switch.  Specifies color output, when valid.
	/SELECT
		Switch.  Works only with the "PRINTER" device.  When set, calls on
		DIALOG_PRINTERSETUP, enabling the user to select any of the printers
		recognized by the machine.
	SUBST
		Accepts a string containing the names of the variables which are to
		receive the values V_0 through V_7 (or part of them) for substitution
		purposes.  Commas and/or spaces are valid delimiters.
 OUTPUTS:
		None, other then the file that's created and whatever outputs are
		generated by COMM.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		M_OUT_PREFS.  Contains the name of the last device used.
 SIDE EFFECTS:
		OUTPUT tries to avoid any side effects, as far as possible.
		Specifically, the values of all the system variables are reset at exit
		from OUTPUT to the values they had before output was called.  Still,
		since COMM can be any possible command, side effects cannot be totally
		avoided.
		A currently known side effect has to do with PostScript printers.  If
		either COMM or OPTION change the postscipt settings, the new settings
		will remain in effect after OUTPUT exits.
 RESTRICTIONS:
		1) Currently the number of substitution variables is limited to 8.  If
		it'll turn out that this number isn't sufficient it can be easily
		increased.  Let me know.
		2) The commands in COMM (and OPTION) shouldn't change the output device
		(i.e. NO using SET_PLOT, DEVICE/CLOSE, etc., all this is taken care of
		by OUTPUT).  If they do, no error will result but the outcome will be
		unpredictable.
		3) In order to make the best use of OUTPUT it is recommended that the
		commands in COMM will be totally device independent (i.e. no using
		explicit device coordinates etc.).  This allows to send the output of
		the same procedure to the various printers and get consistent results.
		If one finds it necessery to use some device specific commands (like
		setting a color table for aprinter), they should be put in OPTION
		(that's really the whole purpose of having OPTION)
 PROCEDURE:
		OUTPUT contains a list of the appropriate device opening and closing
		commands for the devices it recognizes.  When called, it does the
		following.
		1)  Checks DEVICE and if recognizable generates the appropriate OPEN,
		CLOSE and PRINTOUT commands.
		2)  Performs variable substitution if so specified (by a non-blank
		value of SUBST)
		3)  Opens device.
		4)  Executes OPTION, if given.
		5)  Executes COMM
		6)  Closes device.
		7)  Optionally (for file-generating devices) prints out the file.

		OUTPUT uses various routines from MIDL, namely:
		DEFAULT, ONE_OF, PLVAR_KEEP, STREQ, STRMATCH_MM, STRPARSE_MM and TYPE.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Updated 5-FEB-2001 by Mati Meron.  Major rewrite, converting OUTPUT
		from VMS specific to a generic routine.
		Updated 10-MAY-2002 by Mati Meron.  Added keyword HALF_SIZE.
		Updated 15-JUN-2002 by Mati Meron.  Added keyword QUARTER_SIZE.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\output.pro)


OVECTOR

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

 PURPOSE:
   Produce a two-dimensional direct graphics velocity field overplot.

   A directed arrow is drawn at each point showing the direction and
   magnitude of the field.

 CATEGORY:
   Plotting, two-dimensional.

 CALLING SEQUENCE:
   OVECTOR, U, V [, X, Y]

 INPUTS:

   U:  The X component of the two-dimensional field.
       U must be a two-dimensional array.

   V:  The Y component of the two dimensional field.  Y must have
       the same dimensions as X.  The vector at point (i,j) has a
       magnitude of:

           (U(i,j)^2 + V(i,j)^2)^0.5

       and a direction of:

           ATAN2(V(i,j),U(i,j)).


 OPTIONAL INPUT PARAMETERS:

   X:  Optional abcissae values. X must be a vector with a length
       equal to the first dimension of U and V.

   Y:  Optional ordinate values. Y must be a vector with a length
       equal to the second dimension of U and V.


 KEYWORD INPUT PARAMETERS:

   NX: The # of vectors to actually plot in the X-direction.
       Uses CONGRID to reduce the size of the U,V,X arrays
   NY: The # of vectors to plot in the Y-direction.

   MISSING: Missing data value. Vectors with a LENGTH greater
       than MISSING are ignored.

   MINIMUM: Minimum data value. Vectors with LENGTH < MINIMUM are ignored.

   MAXIMUM: Maximum data value. Vectors with LENGTH > MAXIMUM are ignored.

   LENGTH: The vector length as fraction of Max(magnitude)

   STANDARD: The standard length of a vector, instead of 2*STDEV(lengths).
             This is useful when plotting several graphs, each of
             which should have vectors of the same standard length.

   HSIZE: Size of arrowhead, default is 1.

   COLORS: The colors used for the vectors. Default is black.

   FCOLORS: The colors used for the vector heads. Default is black.

   DOTS: Set this keyword to place a dot at each missing point.
          Has effect only IF MISSING is specified.

   ZERO: Set this keyword to place a dot at each point
          with magnitude 0.

   NOTAIL: Set this keyword to not draw any tail, just the arrowhead.
            (note that HSIZE may then need to be adjusted)

   SCALE_HEAD: If set then scale the arrowheads in proportion to the length.

   NOSCALE: Do not scale the vectors. Normally, OVECTOR takes
             the ratio of plot window size to data coordinate
             window size and uses this to scale the V component,
             so the scale in the V-direction is the same in the U.

   NOFILL: If set then don't fill arrow heads.

   CENTER: If set then center the vectors over each point, rather
           than starting from the tail.

   LEGEND: Place a vector of the STANDARD length on the plot with a label

   LEG_LOC: Two element vector in data coords for the LEGEND location

   LEG_UNITS: String containing the units of the LEGEND vector eg. "m/s"

 OUTPUTS:
   None.

 COMMON BLOCKS:
   None.

 SIDE EFFECTS:
   Plotting on the selected device is performed.  System
   variables concerning plotting are changed.

 RESTRICTIONS:
   None.

 MODIFICATION HISTORY:
   Created 2/16/93  C. Torrence

   6/10/95 Added LEGEND keyword G. Compo
   3/16/98 Added CENTER keyword C. Torrence

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\ovector.pro)


OWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       OWINDOW

 PURPOSE:
       The purpose of this program is to create an object window.
       I use it mostly when I am creating and testing object graphics
       programs, but it is also a nice template for larger object
       graphics programs. The window is resizeable and it destroys
       its objects when it is destroyed.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, IDL 5 Object Graphics.

 CALLING SEQUENCE:
       thisWindow = OWindow(thisView)

 REQUIRED INPUTS:
       None. A default view object is created with a gray background and
          a viewplane rectangle defined as [0,0,1,1].

 OPTIONAL INPUTS:

       thisView: A view or scene object that you wish to be displayed
          in the window.

 RETURN VALUE:
       thisWindow: The window graphics object associated with this window.

 OPTIONAL KEYWORD PARAMETERS:

       GROUP_LEADER: The group leader for this program. When the group leader
          is destroyed, this program will be destroyed.

       TITLE: A string used as the title of the graphics window.

       XSIZE: The X Size of the graphics window in device coordinates. The
          default value is 300.

       YSIZE: The Y Size of the graphics window in device coordinates. The
          default value is 300.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To display a view object in this window, type:

          IDL> thisWindow = OWindow(thisView)

       Later, after you have modified the view object, you can type:

          IDL> thisWindow->Draw, modifiedView

 MODIFICATION HISTORY:
       Written by David Fanning, 19 June 97.
       Set RETAIN=1 on draw widget. 6 Oct 97. DWF.
       Changed discredited IDLgrContainer to IDL_Container. 29 JUN 98. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\owindow.pro)


OWNER_OF_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	owner_of_file

 PURPOSE:
	This function returns the owner of a file


 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   result=owner_of_file(file)

 INPUTS:
 file: the file name of a file

 RESTRICTIONS:
  only for unix


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-25
   2000-Jan-28: changed to file_uid instead of spawn 2000-Jan-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\owner_of_file.pro)


PACK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PACK
 PURPOSE:
       Find best packing of images (rectangles) on a page.
 CATEGORY:
 CALLING SEQUENCE:
       pack
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /TOP   means display information to position images at
           the top of each region, else center each image.
         /CODE  display IDL code to position images.
           Given code is only an example.  It assumes all the
           images have been resized and placed in a 3-d array.
           The JHU/APL library routine tvpos computes the
           position to give tv for the given image and position.
 OUTPUTS:
 COMMON BLOCKS:
       pack_com
 NOTES:
       Notes: a new image size is computed to fit the given number
         of images on the page or screen.  Look for the flags
         *** Largest image ***, or *** Best fit ***,
         whichever is more important (if both the same, no flag
         is displayed).
 MODIFICATION HISTORY:
       R. Sterner, 27 Aug, 1993.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pack.pro)


PAGE_TITLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	page_title

 PURPOSE:
   This procedure organizes the variables which are belonging to the page title

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   page_title,plot,page_title

 INPUTS:
   plot: the predefined structure PLOT by pl_init
   page_title: The title for each page

 OPTIONAL INPUTS:
   charsize:  the charsize of the characters for the title
   color:     the colorcode for the title

 OUTPUTS:
   plot: the structure plot defined by pl_init,plot

 EXAMPLE:
   pro ce_test
   z=makez(20,20)
   @init
   plotinit,plot
     page_title,plot,'title'
     plotcell,plot,z=z
   plotend,plot
   end


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Nov. 19 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\page_title.pro)


PAINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PAINT
 PURPOSE:
       Paint on an image.
 CATEGORY:
 CALLING SEQUENCE:
       paint
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         MAG=m  Viewing window magnification (def=10).
         SIZE=s Mag window approx. size in pixels (def=200).
         BOUND=b  Pixel value of boundary for flood fill command.
           May be a scalar or array of values.  If not given
           the connected region with same pixel value as the
           starting point is filled.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 12
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\paint.pro)


PAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PAN
 PURPOSE:
       Pan around a screen image.  Set pixels to a specified value.
 CATEGORY:
 CALLING SEQUENCE:
       pan, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         INWINDOW=w1  input window (window to zoom, def=0).
         OUTWINDOW=w2 output window (magnified image, def=1).
         COLOR=clr    If this keyword is given then when the
           middle mouse button is clicked the pixel under the
           crosshairs is set to clr.  Next click unsets pixel
           if cursor position has not changed.
 OUTPUTS:
       out = returned color index.    out.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 17 Mar, 1993
       R. Sterner,  1 Jun, 1993 --- Added COLOR keyword and pixel set.
       R. Sterner, 15 Oct, 1993 --- Added output value.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pan.pro)


PARCURVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PARCURVE
 PURPOSE:
       Return a curve parallel to given curve.
 CATEGORY:
 CALLING SEQUENCE:
       parcurve, x, y, x2, y2
 INPUTS:
       x,y = arrays of coordinates along original curve.  in
 KEYWORD PARAMETERS:
       Keywords:
         SHIFT=s distance to shift curve (def=1).
         /POLY means form a closed polygon by shifting
           the given curve +/- s from the original position.
 OUTPUTS:
       x2,y2 = coordinates along a parallel curve.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\parcurve.pro)


PARSELINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PARSELINE

 PURPOSE:
   This function accepts a string as an argument and returns an
   array which contains the numerical values in that string.  It can
   handle space or comma delimited numerical values.  It returns
   a value of -1 if non-numerical stuff is found in the line.

 CALLING SEQUENCE:
   array_out = PARSELINE(string_in, desired_data)

 OPTIONAL INPUTS:

   DESIRED_DATA -- An array which specifies the desired columns of data
   from the string.  It is zero based.  Column numbers can be repeated in
   the array.  If this is not specified the default is to return an array
   containing each value in the string once in the order they appear in
   the string.

 KEYWORD PARAMETERS:

   DOUBLE -- The default behavior.  The returned array will be a double
   precision floating point array.

   FLOAT -- The returned array will be a single precision floating point
   array.

   INTEGER -- The returned array will be an array of short integers.

 RETURN VALUE:

   array_out = dblarr(n_data)  N_DATA is either the number of columns in
   the string or the number of elements in the DESIRED_DATA array.

 USAGE:

 The calling procedure will look something like:

    IDL> text=''
    IDL> openr,1,'input.dat'
    IDL> readf,1,text
    IDL> data=parseline(text,[0,1,5,4,6,7])
    IDL> print,data
    0.10000000  3.4000000  2.4000000e-06  5.0000000  2.0080000  0.0000000

 MAJOR FUNCTIONS and PROCEDURES:

   None.

 MODIFICATION HISTORY:

   Written by: Alan Munter, munter@uiuc.edu, May 1997.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\parseline.pro)


PARTOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		PARTOT
 VERSION:
		4.0
 PURPOSE:
		Array summation.
 CATEGORY:
		Array Function.
 CALLING SEQUENCE:
		Result = PARTOT( FARR [, TOD] [, keywords])
 INPUTS:
	FARR
		Array, numeric, otherwise arbitrary (scalars accepted too).
 OPTIONAL INPUT PARAMETERS:
	TOD
		Totaling dimension.  Must be integer in the range of
		[1, number of array dimensions]
 KEYWORD PARAMETERS:

		warning!!!
		The keywords are divided into two groups
		1) regular mode:	LOW, HIGH, LOFRINGE, HIFRINGE
		2) symmetric mode	SYMEDGE, SYMFRINGE

		Either group (1) or (2) may be used.  Mixing will cause error.

	LOW
		Numeric vector (or scalar) containing starting channels for summation
		for each dimension.  First entry corresponds to first dimension,
		second to second dimension etc.  If number of entries is smaller then
		number of dimensions, the remaining ones are replaced by 0.  If it is
		larger then number of dimensions, the excess is ignored.  If absent,
		all the values are replaced by 0.
		Alternatively:  If TOD is used, LOW must be scalar (or vector of length
		1), providing the summation start for the dimension specified by TOD.
		Again, if absent, it is replaced by 0.
	HIGH
		Same as LOW for ending summation channel.  Missing values are replaced
		by maximal value.  For example, if the array has dimensions [7,8,12]
		and HIGH is given as [6,5] then internally [6,5,11] is used (maximal
		value is always dimension - 1).
	LOFRINGE
		Numeric vector (or scalar) specifying partial counting of the value
		in the first summation channel.  Acceptable values are in the
		[-0.5, 0.5] range.  For example if the array has dimensions [6,8,10],
		LOW is [2,1,5] and LOFRINGE = [0.2, 0.3,-0.4] then the beginning
		elements in the first dimension, arr(2,*,*), will be multiplied by
		(1 + 0.2) = 1.2 while the beginning elements in the third dimension,
		arr(*,*,5) will be multiplied by (1 - 0.4) = 0.6.  If the number of
		entries is shorter then the number of dimensions, it'll be padded with
		zeros.  If it is larger, the excess will be ignored.  If absent
		alltogether, zeros will be used.
		Alternatively:  If TOD is used, LOFRINGE must be scalar (or vector of
		length 1), and is applied to the summation dimension specified by TOD.
		Again, if absent, it is replaced by 0.
	HIFRINGE
		Same as LOFRINGE but applied to the ending channel.

	SYMEDGE
		Used in a symmetrical mode.  IN this case the start and end channels
		for each dimension are counted symmetrically from the center.  If the
		number of channels in a specific dimension is odd then the center is
		the middle channel.  For example for a vector of length 9 (indices
		0 through 8) index of 4 (fifth element) gives the center.  For a vector
		of length 8 (indices 0 through 7) the center is at the imaginary point
		between indices 3 and 4.
		Example:
		Assume and array with dimensions [8,9,10] and SYMEDGE given as [3,3]
		Thus:
		On first dimension summation is from index 1 to index 6 (3 on each side
		of the center, 6 total).
		On second dimension summation is from index 1 to index 7 (3 on each
		side, 7 total since the center is now also included).
		On third dimension, since no data is provided, the summation is from
		index 0 to index 9 (i.e full)
		Alternatively:  If TOD is used, SYMEDGE must be scalar (or vector of
		length 1), and is applied to the summation dimension specified by TOD.
	SYMFRINGE
		Same as LOFRINGE and HIFRINGE in the regular case.  Applied to both
		summation limits, symmetrically.
 OUTPUTS:
		Scalar equal the value of the summation, unless TOD is used, in which
		case the output is an array with one less dimension then the original
		one.  This is identical to the behavior of the IDL function TOTAL.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		1)  The array must be numerical.
		2)  Mixing keywords from the regular and symmetrical group is not
	    allowed.
		3)  The value of TOD cannot exceed the number of dimensions.
		4)  If TOD is used, all the edges and fringes provided by the
	    keywords must have no more then one element.
		5)  The values given by LOW mustn't exceed these given by HIGH.
 PROCEDURE:
		A straightforward generalization on the IDL function TOTAL, making it
		closer to a variable limit numerical integration.  Calling DEFAULT and
		ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 30-OCT-1996 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\partot.pro)


PARTVELVEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       partvelvec

 PURPOSE:
       This procedure plots the velocity vectors of particles (at the
       positions of the particles).

 CATEGORY:
       Plotting, Two-dimensional.

 CALLING SEQUENCE:
       PARTVELVEC, VELX, VELY, POSX, POSY [, X, Y]

 INPUTS:
       VELX:  An array of any dimension, containing the x-components
              of the particle velocities.
       VELY:  An array of the same dimension as velx, containing the
              y-components of the particle velocities.
       POSX:  An array of the same dimension as velx, containing the
              x-components of the particle positions.
       POSY:  An array of the same dimension as velx, containing the
              y-components of the particle positions.

 OPTIONAL INPUTS:
       X:   Optional abcissae values. X must be a vector.
       Y:   Optional ordinate values. Y must be a vector. If only X
            is specified, then Y is taken equal to be equal to X.

 OPTIONAL INPUT KEYWORD PARAMETERS:
       FRACTION:   The fraction of the vectors to plot. They are
                   taken at random from the complete sample.    Default is
               FRACTION = 1.0, use all vectors

       LENGTH:     The maximum vectorlength relative to the plot data
                   window.   Default = 0.08

       COLOR:      The color for the vectors, axes and titles.
               Default=!P.COLOR

       OVER:       Plot over the previous plot

       Plot        All other keywords available to PLOT are also used
       Keywords:   by this procedure.

 OUTPUTS:
       This procedure plots the velocity vectors (VELX,VELY) at the
       positions of the particles, (POSX,POSY). If X and Y are not
       specified, then the size of the plot is such that all vectors
       just fit within in the plot data window.

 SIDE EFFECTS:
       Plotting on the current device is performed.

 EXAMPLE:
       Generate some particle positions and velocities.

         POSX=RANDOMU(seed,200)
         POSY=RANDOMU(seed,200)
         VELX=RANDOMU(seed,200)-0.5
         VELY=RANDOMU(seed,200)-0.5

       Plot the particle velocities.

         PARTVELVEC, VELX, VELY, POSX, POSY

 MODIFICATION HISTORY:
       Written by:  Joop Schaye (jschaye@astro.rug.nl), Sep 1996.
       Modified:    Theo Brauers (th.brauers@fz-juelich.de) Oct. 1997
                    use with maps

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\partvelvec.pro)


PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PATH
 PURPOSE:
       Examine and modify the IDL path.
 CATEGORY:
 CALLING SEQUENCE:
       path, new
 INPUTS:
       new = new path name to add to existing path.     in
 KEYWORD PARAMETERS:
       Keywords:
         /LAST forces new path to be added to end of existing
            path instead of front which is default.
         /LIST displays a numbered list of all the paths.
         /RESET restores initial path (found on first call).
         FRONT=n move the n'th directory to the front.
         PATHARRAY=txt  Return in a text array directories on path.
 OUTPUTS:
 COMMON BLOCKS:
       path_com
 NOTES:
       Notes: can use paths like ../xxx or [-.xxx] as a shortcut.
         Useful to turn on & off libraries of IDL routines.
 MODIFICATION HISTORY:
       R. Sterner, 20 Sep, 1989
       R. Sterner, 24 Sep, 1991 --- Added DOS.
       R. Sterner, 24 Jan, 1994 --- Added MACOS.
       R. Sterner, 2000 Sep 20 --- Dropped DOS, added WINDOWS.
       Kristian Kjær (Kristian.Kjaer@risoe.dk) requested WINDOWS
       and the use of !version.os_family.
       KK          18 Apr  2001 --- Added patharray=patharray

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\path.pro)


PAUSE

[Previous Routine] [Next Routine] [List of Routines]
 routine:        pause

 useage:         pause
                 pause,up=up,xcrs=xcrs,ycrs=ycrs,on_screen=on_screen

 input:          none

 keyword input:  
   up
     if set, don't return until a upward button transition is
     detected.  This is useful when pause is used between plots which
     draw quickly.  Setting this keyword ensures that no plots are
     skipped but also requires that each new plot be accompanied by a
     downward and upward button transition.  The default is to skip
     to the next plot as long a mouse button is pressed down.


 xcrs,ycrs
     pixel location to put cursor while waiting

 on_screen
     if set, don't pause if cursor not in plot window

 output:         none

 PURPOSE:
     Momentarily stop execution until a mouse key is pressed.  While
     in the paused state the cursor is changed to what looks like an
     arrow pointing down on a button.  When any of the mouse buttons
     are pressed the cursor returns to its original form and
     execution continues.
     
     PAUSE will only interrupt execution if the output device is 'X'
     and plot system variable !p.multi(0) eq 0.  The first condition
     disables PAUSE when output is directed to a postscript file.
     The second condition ensures that pauses occur only just before
     the screen is erased for a new plot.
     
     NOTE: After PAUSE returns to the calling program different
     actions can be performed depending on whether the left, middle
     or right mouse button was pressed.  Just test on the !err system
     variable: !err=1 => left !err=2 => middle !err=4 => right.

 COMMON BLOCKS: pause_blk
                       
 EXAMPLE:        

x=findgen(201)/10.-10. 
for a=-2.,2.,.1 do begin & plot,x,1/(x^2*10.^a+1),tit=string(a) & pause & end

for a=-2.,2.,.1 do begin & plot,x,1/(x^2*10.^a+1),tit=string(a) &$
   pause,/u & end

  author:  Paul Ricchiazzi                            22sep92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pause.pro)


PCA

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

 PURPOSE:
	Carry out a Principal Components Analysis (Karhunen-Loeve Transform)

 CALLING SEQUENCE:
	PCA, data, eigenval, eigenvect, percentages, proj_obj, proj_atr, 
		[MATRIX =, TEXTOUT = ,/COVARIANCE, /SSQ, /SILENT ]

 INPUT PARAMETERS:
	data -  2-d data matrix, data(i,j) contains the ith sample of the
               jth variable.  DATA shoud be dimensioned (NSAMP,NVAR), where
               NSAMP is the total number of samples and NVAR is the total
               number of variable parameters.  For example, consider
               a scatter plot of temperature vs relative humidity.
               The first index of DATA cycles over all measurments and the
               second index cycles over two parameters: T and Rh.  IF
               T and Rh are 1-D arrays containing all sampled values then
               DATA may be constructed as DATA=[[T],[Rh]].

 OPTIONAL INPUT KEYWORD PARAMETERS:
	/COVARIANCE - if this keyword set, then the PCA will be carried out
		on the covariance matrix (rare), the default is to use the
		correlation matrix
	/SSQ - if this keyword is set, then the PCA will be carried out on
		on the sums-of-squares & cross-products matrix (rare)

 OPTIONAL OUTPUT PARAMETERS:
 eigenval	NVAR element vector containing the sorted eigenvalues
	
 eigenvect 	NVAR x NVAR matrix containing the corresponding 
		eigenvectors, first index cycles over different eigenvectors
               second index cycles over original coordinate directions
	
 percentages	NVAR element vector containing the cumulative percentage 
		variances associated with the principal components
	
 proj_obj 	NSAMP by NVAR matrix containing the projections of the 
		objects on the principal components
	
 proj_atr	NVAR by NVAR	matrix containing the projections of 
		the attributes on the principal components
 	
 MATRIX	analysed matrix, either the covariance matrix if
               /COVARIANCE is set, the "sum of squares and
               cross-products" matrix if /SSQ is set, or the (by
               default) correlation matrix.  MATRIX will have
               dimensions NVAR x NVAR

 NOTES:
	This procedure performs Principal Components Analysis (Karhunen-Loeve
	Transform) according to the method described in "Multivariate Data 
	Analysis" by Murtagh & Heck [Reidel : Dordrecht 1987], pp. 33-48. 

	Keywords /COVARIANCE and /SSQ are mutually exclusive.

	The printout contains only (at most) the first seven principle 
	eigenvectors.    However, the output variables EIGENVECT contain 
	all the eigenvectors
	
       Different authors scale the covariance matrix in different ways.
	The eigenvalues output by PCA may have to be scaled by 1/NSAMP or
	1/(NSAMP-1) to agree with other author's calculations when /COVAR is 
	set.

	Users of V3.5.0 or later could change the calls to TQLI and TRED2
	to NR_TQLI and NR_TRED2

 EXAMPLE:
;	PCA analysis on a scatter plot of two variable, t1,t2, which we
;      will assume are linearly dependent on 2 random gaussian variables
;      x1,x2 as follows,
;
    nsamp=10000
    x1=randomn(iseed,nsamp)   
    x2=randomn(iseed,nsamp)
    t1=5*x1+2*x2             ;  =  = 25*+4* = 29
    t2=5*x1-2*x2             ;  = 25*-4* = 21
                             ; 
    data=[[t1],[t2]]         ; nsamp measurements of 2 parameters
    pca,data,eval,evec,per   ;  
                             ;  |1-ev    21/29|       eigenvalue 
    print,eval               ;  |             | = 0   equation on  
    print,evec               ;  |21/29   1-ev |       correlation matrix
    print,per                ; 
                             ; ev=1+-(21/29) = 1.7248, .2752

    t=findrng(0,2*!pi,100)
    xx1=evec(0,0)*20                       ; 1st eigenvector
    yy1=evec(0,1)*20
    xx2=sqrt(eval(1)/eval(0))*evec(1,0)*20 ; 2nd eigenvector
    yy2=sqrt(eval(1)/eval(0))*evec(1,1)*20
    plot,t1,t2,psym=3,xra=[-20,20],yra=[-20,20],pos=boxpos(/asp)        
    oplot,xx1*[-1,1],yy1*[-1,1] & oplot,xx2*[-1,1],yy2*[-1,1]
    oplot,cos(t)*xx1+sin(t)*xx2, cos(t)*yy1+sin(t)*yy2
    putstr,'eigenvector 1',11.,16.6,chars=1.3
    putstr,'eigenvector 2',5.4,-7.1,chars=1.3


 COPYRIGHT:
	Copyright 1993, Hughes STX Corporation, Lanham MD 20706.

 REVISION HISTORY:
	Immanuel Freedman (after Murtagh F. and Heck A.).     December 1993
       code cleanup and corrected output description (PJR)   June     1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pca.pro)


PCKEY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PCKEY
 PURPOSE:
       Read PC keyboard. Interpret special keys.
 CATEGORY:
 CALLING SEQUENCE:
       pckey, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         ASCII=a returns the ascii code of the key.
         FLAG=f  returns a flag indicating a leading
           255: 0=no, 1=yes.
 OUTPUTS:
       out = output string.   out
         Will be a letter or:
         F1, ... F12, UP, DOWN, LEFT, RIGHT.
         ALT-UP, CTR-UP, ...
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 5 Oct, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pckey.pro)


PCON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PCON
 PURPOSE:
       IDL path control utility. May turn libraries on or off.
 CATEGORY:
 CALLING SEQUENCE:
       pcon, [command]
 INPUTS:
       command = optional library command.      in
         Syntax: 'tag on' or 'tag off'.  See notes below.
         If command not given interactive mode is entered.
 KEYWORD PARAMETERS:
       Keywords:
         /LIST  lists known libraries.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: pcon refers to IDL libraries using a short tag name
         instead of a full directory path.  These tags are defined
         in a pcon setup file pointed to by the env. var. IDL_PCON.
         If IDL_PCON is not defined, pcon looks for the file
         .idl_pcon in your home directory.  The file format is:
         tag full_directory
          optional library description line
         where tag must start in the first column and the
         description must be indented at least one space.
         Lines starting with * or ;, and null lines, are ignored.
         An example pcon setup file (with two libraries):
         *       .idl_pcon = IDL library list for pcon.pro
         USR     /data_bases/idl_libs/idlusr
          Local, general interest.
         STATLIB /usr/local/lib/idl/lib/statlib
          IDL, statistics routines.
 MODIFICATION HISTORY:
       R. Sterner, 22 Mar, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pcon.pro)


PEDGE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        PEDGE  (function)

 PURPOSE:
        Computes pressure edges of a grid from the pressure centers

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        RESULT = PEDGE( MID, PSURF )

 INPUTS:
        MID -> Vector of pressure centers that defines the grid.  
             MID will be sorted in descending order.

        PSURF -> Surface pressure (which also corresponds to the
             lowest pressure edge).  Default is 1000.0 (mb).

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        The vector of pressure edges is returned in RESULT.  

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        The relationship between sigma centers and sigma edges is
        as follows:
   
              MID[N] = ( EDGE[N] + EDGE[N+1] ) / 2
   
        or conversely:
    
              EDGE[N+1] = ( 2 * MID[N] ) - EDGE[N]
   
        where EDGE[N] is the lower pressure edge, and EDGE[N+1]
        is the upper sigma edge of the box with center MID[N].
          
        The boundary condition PE[0] = PSURF is necessary to
        start the iteration.
      
 EXAMPLE:
        Result = PEDGE( [ 900, 700, 500 ], 1000.0 ) 
        print, Result
            1000.00      800.000      600.000      400.000

 MODIFICATION HISTORY:
        bmy, 17 Jun 1999: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\pedge.pro)


PERCENTILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        PERCENTILES

 PURPOSE:
        compute percentiles of a data array

 CATEGORY:
        statistical function

 CALLING SEQUENCE:
        Y = PERCENTILES(DATA [,VALUE=value-array])

 INPUTS:
        DATA --> the vector containing the data

 KEYWORD PARAMETERS:
        VALUE --> compute specified percentiles
        default is a standard set of min, 25%, median (=50%), 75%, and max
        which can be used for box- and whisker plots.
        The values in the VALUE array must lie between 0. and 1. !

 OUTPUTS:
        The function returns an array with the percentile values or
        -1 if no data was passed or value contains invalid numbers.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
      x = (findgen(31)-15.)*0.2     ; create sample data
      y = exp(-x^2)/3.14159         ; compute some Gauss distribution
      p = percentiles(y,value=[0.05,0.1,0.9,0.95])
      print,p

      IDL prints :  3.92826e-05  0.000125309     0.305829     0.318310


 MODIFICATION HISTORY:
        mgs, 03 Aug 1997: VERSION 1.00
        mgs, 20 Feb 1998: - improved speed and memory usage
                (after tip from Stein Vidar on newsgroup)
        mgs, 26 Aug 2000: - changed copyright to open source
                          - median now correctly returned as average
                            of two central values for data sets with
                            even number of elements
                          - modernized look and [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\percentiles.pro)


PFILL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  pfill

 PURPOSE:  break a long string consisting of many blank-separated
           words into a paragraph that consists of several lines each
           with a given number of characters (60 character default).
           This procedure can be use used with LEGEND and CAPTION to
           produce nicely formated figure captions.  The nice thing
           about PFILL is that it will properly compute the length of
           lines which contain text escape sequences such as a =
           !7d!x!ai!b.

 USEAGE: result=pfill(string,nchars=nchars,exdent=exdent,cr=cr,nlines=nlines)

 INPUT:    
  string   a string which consists of words separated by blanks
           Note that the !9K!x maps to a hardwired space

 KEYWORD INPUT:

  nchars   maximum number of characters per line (default=60)

  exdent   if set, EXDENT specifies the number of characters with
           which to indent all but the first line.  Use this to make
           a "hanging indent."  You can indent the first line by
           simply adding some spaces to the beginning of the string.

  cr       if set, replace instances of "\" in output string with "!c".  
           This allows formatted string to be used with XYOUTS or PUTSTR.

 OUTPUT:
  result   a paragraph string which consists of several lines each 
           with a given number of characters (60 character default).
           Lines are separated by the character "\", which is
           understood by LEGEND to indicate a newline.  You can turn
           the string into a string array, with each array element
           corresponding to one line in the paragraph by using
           STR_SEP.  For example, t=str_sep(pfill(t,n=30),'\').

 KEYWORD OUTPUT:

  nlines   number of lines in result


 EXAMPLE:  

 
 t='PURPOSE: break a long string consisting of many blank-separated '+$
   'words into a paragraph that consists of several lines each with '+$
   'a given number of characters (60 character default).  This procedure'+$
   ' can be used with LEGEND to produce nicely formated figure'+$
   ' captions.  The nice thing about PFILL is that it will properly'+$
   ' compute the length of lines which contain text escape sequences'+$
   ' such as x = !7d!xa!a2!n / !7d!xb!bi!n * (!13A - B!x) * (!13C -'+$
   ' D!3).  Text editors do not understand that all those extra exclamation'+$
   ' points should not be included in the character count of each line.'
 
 w8x11

 legend,pfill(t),/fill,/box,/norm,pos=[0.14,0.71,0.82,0.98]

 legend,pfill(t,nchar=80),/fill,/box,/norm,pos=[0.05,0.48,0.96,0.68]

 legend,pfill(t,n=80,exdent=11),/fill,/norm,pos=[0.11,0.28,0.85,0.46]

 legend,pfill('        '+t,n=80),bg=0,/fill,/norm,pos=[0.11,0.04,0.89,0.22]

 AUTHOR:   Paul Ricchiazzi                        03 Jul 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pfill.pro)


PH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PH
 PURPOSE:
       Return the phase of a complex number.
 CATEGORY:
 CALLING SEQUENCE:
       p = ph(z)
 INPUTS:
       z = a complex number or array.    in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES returns result in degrees.
 OUTPUTS:
       p = phase of z.                   out
 COMMON BLOCKS:
 NOTES:
       Notes: results between -Pi and Pi (-180 and 180 deg).
         Undefined phases are set to 999.
 MODIFICATION HISTORY:
       R. Sterner, 13 May, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ph.pro)


PHASE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PHASE
 PURPOSE:
       Return an array filled in to indicate specified moon phase.
 CATEGORY:
 CALLING SEQUENCE:
       a = phase(sz, ph, [xtr, xed, y])
 INPUTS:
       sz = Size of array to generate.                     in
       ph = Phase angle in deg.                            in
         0=new, 90=first Q, 180=full, 270=last Q.
 KEYWORD PARAMETERS:
 OUTPUTS:
       tr = Terminator X coordinates.                      out
       ed = Edge X coordinates.                            out
       y = Y coordinates for terminator and edge.          out
       a = returned array.                                 out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 23 Feb, 1988.
       R. Sterner, 13 Dec 1990 --- updated to IDL V2.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\phase.pro)


PHIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PHIST

 PURPOSE:
       plot histogram

 CALLING SEQUENCE:
       phist,variable

 INPUTS:
   arr    	  array to be plotted

 KEYWORD INPUTS:

   numbin        number of histogram bins
   binsize       size of bins (nullifies effect NUMBIN)
   xrange        x value range on plot (implies xstyle=1)
   yrange        y value range on plot 
   percent       show percentage histogram
   cumulative    show cumulative histogram
   overplot      plot this histogram over a previous plot
   xtitle        x title on plot
   ytitle        y title on plot
   title         title on plot
   width         width of the histogram bars (1 causes vertical bars
                 to fill the horizontal space, values less than 1 leave
                 space between bars)


 EXAMPLE:

   !p.multi=[0,2,2]
   r=randomn(seed,2000)
   phist,r
   phist,r,/perc
   phist,r,/perc,/cum
   phist,r,yrange=[0,.5],binsize=.5,color=100,/per
   phist,r^3,yrange=[0,.5],binsize=.5,color=150,/per,/over,width=.3
 
 AUTHOR and DATE:
  author:  Paul Ricchiazzi                            feb95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\phist.pro)


PHUX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   phux

 PURPOSE:
   This function will calculate Roeth's photolysis frequency parameterisation

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   result=phux(x,y,z,chi)

 INPUTS:
   chi   : solar zenith in grad  (scalar)
   x,y,z : parameter of Roeth's photolysis frequency parameterisation

 OUTPUTS:
   result: calculated photolysis frequency

 EXAMPLE:
   for chi=0,180,10 do print,chi,phux(1.07e-2,1.01319,0.8333,chi)

 MODIFICATION HISTORY:
   Written by Franz Rohrer März 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\phux.pro)


PHYSCONST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   physconst

 PURPOSE:
   This procedure defines a system variable !PHYSCONST with physical
   constants. It is meant to be included in the startup file. You can
   then access the constants either by short or long name (example:
   !physconst.e or !physconst.elementary_charge).

 CATEGORY:
    Startup Utilities

 MODIFICATION HISTORY:
    mgs, some time 1999: VERSION 1.00
    mgs, 26 Aug 2000: - added header and copyright

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\physconst.pro)


PICKC

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   pickc

 PURPOSE:   interactive adjustment of a series of discreet color values

 USEAGE:    pickc,colrng,labels=labels,group=group

 INPUT:
  colrng    2 element vector specifying the color index range accessable
            to pickc (default=[0,!d.n_colors-1])
 
 KEYWORD INPUT:
  labels    names to be associated with particular color indecies.
            if labels are provided NN is reset to n_elements(LABELS).

  group     widget id of widget procedure that calls PICKC

 OUTPUT:    none

 PROCEDURE:
            When first called, PICKC will create a new IDL window
            named "PICKC".  A color wheel is drawn with hue values
            varying from 1 - 360 degrees around the circle and
            saturation values varying from 0 at the center to 1 at
            the outer edge of the circle.
             
            Motion of the cursor inside the PICKC window with the
            with a mouse button pressed down adjusts the Hue and Saturation
            values and leaves the brigtness unchanged.

            Use the intensity slider to change the brightness.

            Use the color index slider to select a new color index

 BUTTONS:

      DONE: save new RGB values and quit

    CANCEL: restore old RGB values and quit
 
   XLOADCT: call the XLOADCT widget
    
   DIFFUSE: smear the current color to adjacent color indicies
            repeated clicks on DIFFUSE button causes the current
            color to diffuse further along the color scale.

      HELP: print this text


 EXAMPLE:
            Make a color plot and use PICKC to adjust color values:

  plot, [0,100],[-3,3],/nodata
  d=findgen(100)
  efac=exp(-((d-50)/20)^2)
  oplot,3*sin(d/2)*efac,color=1,thick=3 
  oplot,sin(d/3)*efac,color=2,thick=3  
  oplot,sin(d/2)*efac,color=3,thick=3  
  oplot,3*efac,color=4,thick=3
  oplot,efac,color=5,thick=3
  oplot,-3*efac,color=4,thick=3
  oplot,-efac,color=5,thick=3
  r=[0,0,127,255,0,127] & g=[0,127,255,0,127,255] & b=[0,255,0,127,255,0]
  tvlct,r,g,b
  pickc,[1,5]

  loadct,0
  pickc            ;  choose a color index, change its RGB value, smear it


  author:  Paul Ricchiazzi                            5feb93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pickc.pro)


PICKCOLORNAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PICKCOLORNAME

 PURPOSE:

       The purpose of this program is to provide a blocking
       or modal widget interface for selecting a color "name".
       The program uses colors familiar to the FSC_COLOR program,
       and is often used to select a color name for passing to FSC_COLOR.

 AUTHOR:

       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics, Color Specification.

 CALLING SEQUENCE:

       colorName = PickColorName(startColorName)

 OPTIONAL INPUT PARAMETERS:
       startColorName: A string with the "name" of the color. Valid names
           depend on program variables, but typically include these colors:

              Black       Pink
              Magenta     Aqua
              Cyan        SkyBlue
              Yellow      Beige
              Green       Charcoal
              Red         Gray
              Blue        Orchid
              Navy        White

       The color WHITE is used if this parameter is absent.

 INPUT KEYWORD PARAMETERS:

       BOTTOM: The colors used in the program must be loaded somewhere
           in the color table. This keyword indicates where the colors
           start loading. By default BOTTOM is set equal to !D.Table_Size-NCOLORS-1.

       COLUMNS: Set this keyword to the number of columns the colors should
           be arranged in.

       FILENAME: The string name of an ASCII file that can be opened to read in
           color values and color names. There should be one color per row
           in the file. Please be sure there are no blank lines in the file.
           The format of each row should be:

              redValue  greenValue  blueValue  colorName

           Color values should be between 0 and 255. Any kind of white-space
           separation (blank characters, commas, or tabs) are allowed. The color
           name should be a string, but it should NOT be in quotes. A typical
           entry into the file would look like this:

               255   255   0   Yellow

       GROUP_LEADER: This identifies a group leader if the program is called
           from within a widget program. Note that this keyword MUST be provided
           if you want to guarantee modal widget functionality. (If you don't know
           what this means, believe me, you WANT to use this keyword, always.)

       INDEX: This keyword identifies a color table index where the selected color
           is to be loaded when the program exits. The default behavior is to restore
           the input color table and NOT load a color.

       TITLE: This keyword accepts a string value for the window title. The default
           is "Select a Color".

 OUTPUT KEYWORD PARAMETERS:

       CANCEL: On exit, this keyword value is set to 0 if the user selected
           the ACCEPT button. IF the user selected the CANCEL button, or
           closed the window in any other way, this keyword value is set to 1.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       Colors are loaded in the current color table. The input color table
       is restored when the program exits. This will only be noticable on
       8-bit displays. The startColorName is returned if the user cancels
       or destroys the widget before a selection is made. Users should
       check the CANCEL flag before using the returned color.

 EXAMPLE:

       To call the program from the IDL comamnd line:

         IDL> color = PickColorName("red") & Print, color

       To call the program from within a widget program:

         color = PickColorName("red", Group_Leader=event.top) & Print, color

 MODIFICATION HISTORY:

       Written by: David Fanning, 31 August 2000.
       Modified program to read colors from a file and to use more
         colors on 24-bit platforms. 16 October 2000. DWF.
       Added the COLUMNS keyword. 16 October 2000. DWF.
       Fixed a small problem with mapping a modal widget. 2 Jan 2001. DWF

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\pickcolorname.pro)


PICKCOLOR[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PICKCOLOR
 PURPOSE:
       Allow user to pick a color from current color table.
 CATEGORY:
 CALLING SEQUENCE:
       pickcolor, clr
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: if clr is given as an input it is the default.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 7.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pickcolor.pro)


PICKCOLOR[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PICKCOLOR

 PURPOSE:

       A modal dialog widget allowing the user to select
       the RGB color triple specifying a color. The return
       value of the function is the color triple specifying the
       color or the "name" of the color if the NAME keyword is set.

 AUTHOR:
       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics, Color Specification. See related program FSC_COLOR.

 CALLING SEQUENCE:

       color = PickColor(colorindex)

 RETURN VALUE:

       The return value of the function is a 1-by-3 array containing
       the values of the color triple that specifies the selected color.
       The color can be loaded, for example, in any color index:

           color = PickColor(240)
           TVLCT, color, 240

       The return value is the original color triple if the user
       selects the CANCEL button.

       IF the NAMES keyword is set, the return value of the function is
       the "name" of the selected color. This would be appropriate for
       passing to the FSC_COLOR program, for example.

 OPTIONAL INPUT POSITIONAL PARAMETERS:

       COLORINDEX: The color index of the color to be changed. If not
              specified the color index !D.Table_Size - 2 is used.
              The Current Color and the Color Sliders are set to the
              values of the color at this color index.

 OPTIONAL INPUT KEYWORD PARAMETERS:

       GROUP_LEADER: The group leader for this widget program. This
              keyword is required for MODAL operation. If not supplied
              the program is a BLOCKING widget. Be adviced, however, that
              the program will NOT work if called from a blocking widget
              program, unless a GROUP_LEADER is supplied.

       NAMES: Set this keyword to return the "name" of the selected color
              rather than its color triple.

       STARTINDEX: 88 pre-determined colors are loaded The STARTINDEX
              is the index in the color table where these 88 colors will
              be loaded. By default, it is !D.Table_Size - 89.

       TITLE: The title on the program's top-level base. By default the
              title is "Pick a Color".

 OPTIONAL INPUT KEYWORD PARAMETERS:

       CANCEL: A keyword that is set to 1 if the CANCEL button is selected
              and to 0 otherwise.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       88 pre-determined colors are loaded in the color table.
       In addition, the color index at COLORINDEX is modified while
       the program is on the display. When the program exits, the
       entry color table is restored. Thus, on 8-bit displays there
       might be some color effects in graphics windows while PICKCOLOR
       is on the display. Changes in the color table are not noticable
       on 16-bit and 24-bit displays.

 EXAMPLE:

       To specify a color for a plot in color decomposition OFF mode:

          Device, Decomposed=0
          !P.Color = !P.Color < (!D.Table_Size - 1)
          color = PickColor(!P.Color, Cancel=cancelled)
          IF NOT cancelled THEN BEGIN
              TVLCT, color, !P.Color
              Plot, data
          ENDIF

       To specify a color for a plot in color decomposition ON mode:

          Device, Decomposed=1
          color = PickColor(Cancel=cancelled)
          !P.Color = Color24(color)
          IF NOT cancelled THEN Plot, data

        To obtain the name of the selected color to pass to GetColor:

          selectedColor = PickColor(/Name)
          axisColor = FSC_Color(selectedColor, !D.Table_Size-4)

 MODIFICATION HISTORY:
       Written by: David Fanning, 28 Oct 99.
       Added NAME keyword. 18 March 2000, DWF.
       Fixed a small bug when choosing a colorindex less than !D.Table_Size-17. 20 April 2000. DWF.
       Added actual color names to label when NAMES keyword selected. 12 May 2000. DWF.
       Modified to use 88 colors and FSC_COLOR instead of 16 colors and GETCOLOR. 4 Dec 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\pickcolor.pro)


PICK_CURSOR

[Previous Routine] [Next Routine] [List of Routines]
 routine:   pick_cursor
 useage:    pick_cursor
 inputs:    none
 outputs:   none
 side effects:
            changes the graphics cursor

 procedure  cycle through different cursor types by hitting the
            the left or middle mouse button.  Hit the right mouse button
            to exit
 
  author:  Paul Ricchiazzi                            aug93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pick_cursor.pro)


PK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PK
 PURPOSE:
       Pick a set of points on a plot.
 CATEGORY:
 CALLING SEQUENCE:
       pk, x, y, ind
 INPUTS:
       x,y = point coordinate arrays.              in
 KEYWORD PARAMETERS:
       Keywords:
         /NOMARK means don't mark selected points.
         XRANGE=xr  Return x range of selected box.
         YRANGE=yr  Return y range of selected box.
           Use to zoom plot:
           plot,x,y,xrange=xr,yrange=yr
         CODE=c  box exit code: 4=normal exit, 2=alternate exit.
 OUTPUTS:
       ind = array of indices of selected points.  out
             ind = -1 if no points selected.
 COMMON BLOCKS:
       pk_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 16 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pk.pro)


PLACETEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLACETEXT

 PURPOSE:
       Put text on a plot using LEGEND.PRO.

 CALLING SEQUENCE:
       placetext,'this is a test'

 INPUTS:
       text        text to be written to screen.  May either be string
                   array or string with different lines separated by '\'.

 OPTIONAL INPUTS:
   center      lines are centered rather than left justified

   (below are taken from legend.pro)

   pos         position and size of legend area in normalized data
               coordinates.  Format of this four element vector is
               [x0,y0,x1,y1] where x0,y0 is the position of lower
               left corner and x1,y1 is the position of the upper
               right corner.  For example pos=[.5,.5,.9,.9] specifies
               a legend in the upper right quadrant of the data
               window.  If the POS parameter is not set or if POS is
               set to zero, then the CURBOX procedure is called to
               set the legend position interactively.

               NOTE: the value of POS can be retrieved by setting POS
               to a named variable which has an initial value of zero.

   linestyle   an array of linestyle types, one for each element of LABELS

   psym    an array of symbol types, one for each element of LABELS

   color       an array of color indices, one for each element of LABELS.
               Any elements of COLOR set to -1 causes the default color,
               !P.COLOR, to be used.

   thick       an array of line thicknesses, one for each element of LABELS
               (default=!p.thick)

   numsym      number of symbol nodes used to indicate linestyle or symbol
               type.  The length of the line is measured in units of 4
               character widths so that the length of the line
               = 4*(NUMSYM-1) * X_CHARSIZE    (default=3)

   fg_color    color of box and legend titles (default=!P.COLOR)

   bg_color    background color. Setting BG_COLOR erases the area
               covered by the legend (filling it with color BG_COLOR)
               prior to writing the legend.  If both BG_COLOR and !p.color
               are zero then the background color is reset to 255 to
               gaurantee a readability.


   box         if set draw a box around the legend text

   ystretch    factor by which to increase vertical spacing of legend
               entries. (default = 1)

   silent      if set, don't print anything to the terminal

 OUTPUTS:

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  2/22/94

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\placetext.pro)


PLANCK

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     planck

 USEAGE:      result=planck(ww,t [,/microns])

 INPUT:

   ww         wavenumber (cm-1) or wavelength (microns) if /microns set,
              can be either scalar or vector

   t          temperature (degrees K), can be scalar or vector.

 OUTPUT:

   result     black body spectral intensity, commonly known as the 
              Planck function

                               microns set         microns not set
                               -----------         ---------------
                units:        W/m2/sr/micron         W/m2/sr/cm-1

              

 UNIT CONVERSION FACTORS:

               W/m2/sr/cm-1    x 1000 = erg/s/cm2/sr/cm-1
               W/m2/sr/micron  x 1000 = erg/s/cm2/sr/micron
               W/m2/sr/micron         = erg/s/cm2/sr/nm

 the spectral flux generated by a black body surface is =   pi * planck

; EXAMPLE
 
; plot black body curve for a 300, 280 and 260 degrees K.

 w=findrng(10000/333.33,10000/4.,200)
 plot,w,planck(w,300),xtitle='wavenumber (cm!a-1!n)',ymargin=[10,2],$
        ytitle='W/m!a2!n/sr/cm!a-1!n',title='Black Body Radiance'
 AXIS,0,4*!d.y_ch_size,XAX=0,/dev,xtickv=[0,10000./[50,20,13,10,8,6,5,4]],$
       xticks=8,xtickn=[' ','50','20','13','10','8','6','5','4'],$
       xtitle='wavelength (microns)'
 
 oplot,w,planck(w,280),li=3
 oplot,w,planck(w,260),li=4
 legend,'.cBlack Body\.cTemperature\\300\280\260',li=[0,3,4],pos=[.7,.6,.9,.9]

; planck function for one of the sbdart standard atmospheres

 atmosz,idatm=4,zz,pp,tt
 !p.multi=[0,2,2] & yt='Altititude (km)' & xt='W/m!a2!n/sr'
 plot,planck(3,tt,/mic),zz,title='!7k!x = 3um',ytit=yt
 plot,planck(4,tt,/mic),zz,title='!7k!x = 4um'
 plot,planck(5,tt,/mic),zz,title='!7k!x = 5um',ytit=yt,xtit=xt
 plot,planck(15,tt,/mic),zz,title='!7k!x = 15um',xtit=xt


  author:  Paul Ricchiazzi                            3dec92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\planck.pro)


PLANE_INT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLANE_INT
 PURPOSE:
       Compute the intersection line of two planes.
 CATEGORY:
 CALLING SEQUENCE:
       plane_int, a1, a2, a3, b1, b2, b3, p, u, flag
 INPUTS:
       a1, a2, a3 = 3 pts in plane A (a1=(xa,ya,za),...).  in.
       b1, b2, b3 = 3 pts in plane B (b1=(xb,yb,zb),...).  in.
 KEYWORD PARAMETERS:
 OUTPUTS:
       p = a point on intersection line (Px,Py,Pz).        out.
       u = Unit vector along intersection line (Ux,Uy,Uz). out.
       flag = intersect flag.  0: none, 1: intersection.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 25 Oct, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 1996 Dec 10 --- Fixed a mistake found by
       David S. Foster, UCSD.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plane_int.pro)


PLINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLINT
 PURPOSE:
       Intersection point of a plane and a line.
 CATEGORY:
 CALLING SEQUENCE:
       plint, lp1, lp2, n, pp, pi, flag
 INPUTS:
       lp1, lp2 = two points on the line.     in
         lp1 is the 0 point, + toward lp2.
       n = normal to plane.                   in
       pp = any point on the plane.           in
 KEYWORD PARAMETERS:
 OUTPUTS:
       pi = intersection point.               out
       flag = intersection flag:              out
         0: no intersection,
        +1: + side of line (also 0),
        -1: - side of line.
 COMMON BLOCKS:
 NOTES:
       Notes: all points are 3 element arrays (x,y,z).
 MODIFICATION HISTORY:
       RES  20 May, 1985 from PLINT.FOR sub.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plint.pro)


PLOT2D

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

 USERLEVEL:
   TOPLEVEL

 NAME:
	plot2d

 PURPOSE:
   This procedure does a contour plot.

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d,plot,z=z,[x=x],[y=y],[file=file],[icg_struct=icg_struct],[/time]

 INPUTS:
  plot: The predefined Structure PLOT by get_plot_struct()

 KEYWORD PARAMETERS:
   x:    The x-Parameter Array or a parameter name from a netCDF file
   y:    The y-Parameter Array or a parameter name from a netCDF file
   z:    The z-Parameter Array or a parameter name from a netCDF file

   file: The name of the netCDF File, if you like to have dirctly access to data in files
   icg_struct: the defined icg_struct, if used x,y,z hat to be short_names of this structure

   time: If x is a vector of Julian Seconds then with switch time plotxy will show a time formatted X Axis


 OUTPUTS:
   You get a contour plot on screen or ps file


 EXAMPLE:
   pro ct_test
   z=makez(20,20)
   @init ;
      color_scheme,plot,scheme=1
   plotinit,plot
     plot.xtitle='X' & plot.ytitle='Y'
     plot.nlevels=0
     defp2d,plot,'levels',findgen(20)/20
     plot.title='Titel 1'
     plot2d,plot,z=z
     page_title,plot,'ct_test'
   plotend,plot
   end
   

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 5. Oct 1997 Dec-13 pltstamp added 1998-02-25 irregular added 1998-02-26 plot.new=1 corrected to erase at any case 1998-03-11 max_colors moved to pl_av_cols 1998-03-28 failure of irregular recognized resolved by using triangulate 1998-04-27 bug found in contour using 2-dim x,y,z values belonging to min_value and using of map_set 1998-05-17 a lot of things changed to _extra 1998-05-17 now cell_fill is used automaicly when maps are drawn by plotmap 1998-05-18 min_value and max_value are handled different by corr_fact in case of negative or not 1998-06-02 again min and max value 1998-06-15 plot.map_set.axis_label request added 1998-10-06 timeaxis error removed 1999-03-26 Caution In order for CONTOUR to fill the contours properly when using a map projection, the X and Y arrays (if supplied) must be arranged in increasing order. This ensures that the polygons generated will be in counterclockwise order, as required by the mapping graphics pipeline. if x eq 1-D and y eq 1-D and z eq 2-D they are sorted in increasing order at the moment I don't know how to handle booth all are 2D or 1D 1999-08-30 remember only closed contours could be filled 1999-09-13 bug removed additional axes are now in the range of map_set 1999-11-25 some changes in the page control by plot.new are solved 2000-01-21 plot.irregular=2 means sperical triangulation.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot2d.pro)


PLOT2D_BAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_bar

 PURPOSE:
   This routine manages the several posibilities in doing a colorbar

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_bar,plot,[color=color],[/right],[/left],[/top],[/bottom],[/line]

 INPUTS:
   plot: The by pl_init predefined structure plot

 OPTIONAL INPUTS:
   color:  The used colors ; ueberfluessig

 KEYWORD PARAMETERS:
   right:  to adjust the colorbar at the right side of the plot
   left:   to adjust the colorbar at the left side of the plot
   top:    to adjust the colorbar at the top of the plot
   bottom: to adjust the colorbar at the bottom of the plot
   line:   to initialize a lined colorbar

 OUTPUTS:
   on choosen device a colorbar

 EXAMPLE:
   plot2d_bar,plot,/right

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct 5. 1997
       1997-Nov-12 output of max_value max= removed
       1997-Dec-21 alignment of text for filled c_bar is now right
                   later on it will be possible to change it between left, center and right
 1998-Mar-12 find_form used now for number_format later on find_form will be included in number_format
 1998-Jun-17 l_width now by /norm 100.,100.
 1999-03-30 Part1 for plot.plot_frameposition added
 1999-05-06   IF plot.cbar EQ 1 THEN  BEGIN [if plot.nlevels eq 0 then]  defp2d,PLOT,'cbar_values',PLOT.levels: Part within [] added
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot2d_bar.pro)


PLOT2D_BAR_B1

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	plot2d_bar_b1 
 
 PURPOSE: 
 
plot2d_bar standalone
CATEGORY: EXAMPLES/PLOT/PLOT2D_BAR CALLING SEQUENCE: plot2d_d_bsp2_g EXAMPLE: plot2d_bar_b1 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-7

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d_bar\plot2d_bar_b1.pro)


PLOT2D_D_BSP1_A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot2d_d_bsp1_a

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_a

 EXAMPLE:
   plot2d_d_bsp1_a
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_a.pro)


PLOT2D_D_BSP1_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot2d_d_bsp1_b

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_b

 EXAMPLE:
   plot2d_d_bsp1_b
 gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_b.pro)


PLOT2D_D_BSP1_C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_c

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_c

 EXAMPLE:
   plot2d_d_bsp1_c
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_c.pro)


PLOT2D_D_BSP1_C2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_c2

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_c2

 EXAMPLE:
   plot2d_d_bsp1_c2
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-AUG-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_c2.pro)


PLOT2D_D_BSP1_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_d

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_d

 EXAMPLE:
   plot2d_d_bsp1_d
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_d.pro)


PLOT2D_D_BSP1_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_e

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_e

 EXAMPLE:
   plot2d_d_bsp1_e
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_e.pro)


PLOT2D_D_BSP1_F

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_f

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_f

 EXAMPLE:
   plot2d_d_bsp1_f
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_f.pro)


PLOT2D_D_BSP1_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_g

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_g

 EXAMPLE:
   plot2d_d_bsp1_g
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_g.pro)


PLOT2D_D_BSP1_H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp1_h

 PURPOSE:
   

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp1_h

 EXAMPLE:
   plot2d_d_bsp1_h
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp1_h.pro)


PLOT2D_D_BSP2_A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot2d_d_bsp2_a

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_a

 EXAMPLE:
   plot2d_d_bsp2_a
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_a.pro)


PLOT2D_D_BSP2_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot2d_d_bsp2_b

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_b

 EXAMPLE:
   plot2d_d_bsp2_b
 gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_b.pro)


PLOT2D_D_BSP2_C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_c

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_c

 EXAMPLE:
   plot2d_d_bsp2_c
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_c.pro)


PLOT2D_D_BSP2_C2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_c2

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_c2

 EXAMPLE:
   plot2d_d_bsp2_c2
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-AUG-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_c2.pro)


PLOT2D_D_BSP2_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_d

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_d

 EXAMPLE:
   plot2d_d_bsp2_d
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_d.pro)


PLOT2D_D_BSP2_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_e

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_e

 EXAMPLE:
   plot2d_d_bsp2_e
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_e.pro)


PLOT2D_D_BSP2_F

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_f

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_f

 EXAMPLE:
   plot2d_d_bsp2_f
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_f.pro)


PLOT2D_D_BSP2_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_g

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_g

 EXAMPLE:
   plot2d_d_bsp2_g
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_g.pro)


PLOT2D_D_BSP2_H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_h

 PURPOSE:
   

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_h

 EXAMPLE:
   plot2d_d_bsp2_h
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_h.pro)


PLOT2D_D_BSP2_I

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_i

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_i

 EXAMPLE:
   plot2d_d_bsp2_i
   


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_i.pro)


PLOT2D_D_BSP2_J

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plot2d_d_bsp2_j

 PURPOSE:
 
use of irregular
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plot2d_d_bsp2_j EXAMPLE: plot2d_d_bsp2_j gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-Feb-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_j.pro)


PLOT2D_D_BSP2_K

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_k

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_k

 EXAMPLE:
   plot2d_d_bsp2_k
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_k.pro)


PLOT2D_D_BSP2_L

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_l

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_l

 EXAMPLE:
   plot2d_d_bsp2_l
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-Jul-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_l.pro)


PLOT2D_D_BSP2_M

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_m

 PURPOSE:
 
This routine shows a problem with the projection of some kind of data
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plot2d_d_bsp2_m EXAMPLE: plot2d_d_bsp2_m gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Mar-26

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_m.pro)


PLOT2D_D_BSP2_N

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot2d_d_bsp2_n

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_n

 EXAMPLE:
   plot2d_d_bsp2_n
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-Aug-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_n.pro)


PLOT2D_D_BSP2_O

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_d_bsp2_o

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plot2d_d_bsp2_o

 EXAMPLE:
   plot2d_d_bsp2_o
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_d_bsp2_o.pro)


PLOT2D_EX2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot2d_ex2

 PURPOSE:
 
Example two plots by plot2d
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plot2d_ex2 EXAMPLE: plot2d_ex2 gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plot2d_ex2.pro)


PLOT3D[1]

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

 (C) Cooperative Institute for Meteorological Satellite Studies, 1999

 NAME:
       plot3d

 PURPOSE:
       Procedure to plot vector data in 3-dimensions.

 CATEGORY:
       Graphics

 LANGUAGE:
       IDL v5

 CALLING SEQUENCE:
       plot3d, x, y, z
            title = title, $
            xlog = xlog, ylog = ylog, zlog = zlog, $
            xrange = xrange, yrange = yrange, zrange = zrange, $
            xstyle = xstyle, ystyle = ystyle, zstyle = zstyle, $
            xtitle = xtitle, ytitle = ytitle, ztitle = ztitle, $
            xyproject = xyproject, xzproject = xzproject, yzproject = yzproject, $
            allproject = allproject, $
            drawgrid = drawgrid, gridstyle = gridstyle, $
            psym = psym, symsize = symsize, thick = thick, linestyle = linestyle, $
            color = color, project_color = project_color, $
            oplot = oplot

 INPUTS:
       x,y,z: Data vectors to plot in 3-dimensions.

 INPUT KEYWORD PARAMETERS:
       title:             Set this keyword to a string containing the plot title.
       [xyz]log:          Set this keyword to specify a logarithmic axis.
       [xyz]range:  .     Set this keyword to the desired data range of the axis
       [xyz]style:        This keyword allows specification of axis options. See
                          PLOT command documentation.
       [xyz]title:        Set this keyword to the title for the specified axis.
       [xy,xz,yz]project: Set these keywords to plot 2-D projections of the
                          3-D plot on the axis planes.
       allproject:        Equivalent to setting all [xy,xz,yz]project keywords.
       drawgrid:          Set this keyword to draw gridlines on the 2-D axis planes.
       gridstyle:         Set this keyword to the index of the linestyle to be used
                          for grids.
       psym:              Set this keyword to the index of the symbol type to be used
                          to mark each data point. If the value is negative, both
                          symbols *and* lines are drawn.
       symsize:           Set this keyword to the symbol size to be used when PSYM
                          is set.
       thick:             Set this keyword to specify the data plot line thickness.
                          This overrides the setting of !P.THICK.
       linestyle:         Set this keyword to the index of the linestyle to be used
                          for the data plots (and projections).
       color:             Set this keyword to the color table index of the data to be
                          drawn.
       project_color:     Set this keyword to the color table index of the 2-D
                          data projections to be drawn.
       oplot:             Set this keyword to overplot data on an existing 3-D plot.

 OUTPUTS:
       None.

 OUTPUT KEYWORD PARAMETERS:
       None.

 CALLS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None known

 RESTRICTIONS:
       User has to keep his/her wits about them regarding the setting and use of
       the 3-D transformation. Weird plots can result if one performs a regular
       2-D plot between a plot3d and plot3d, /oplot call.

 PROCEDURE:
       The SURFACE command is used to set up the 3-D transformation and the base
       axes. Other axes are drawn in to complete a 3-sided box. The data is plotted
       using PLOTS and the current 3-D transform in !P.T.

 EXAMPLE:
       Create a test data set:

         IDL> n=56
         IDL> x=REPLICATE( 5.0, 10 )
         IDL> x1 = 5.0 + COS( FINDGEN( 36 ) * 10 * !DTOR ) * 2.0
         IDL> x = [ x, x1, x ]
         IDL> y = FINDGEN( n )
         IDL> z = REPLICATE( 5.0, 10 )
         IDL> z1 = 5.0 + SIN( FINDGEN( 36 ) * 10 * !DTOR ) * 2.0
         IDL> z = [ z, z1, z ]

       and plot the data with the various projections turned on (assuming that
       color index #5 is visible):

         IDL> plot3d, x, y, z, /drawgrid, /xzproject, project_color = 5
         IDL> plot3d, x, y, z, /drawgrid, /yzproject, project_color = 5
         IDL> plot3d, x, y, z, /drawgrid, /xyproject, project_color = 5

 CREATION HISTORY:
       Written by:     Paul van Delst, CIMSS/SSEC, 13-Jun-1999
                       paul.vandelst@ssec.wisc.edu


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\vandelst\plot3d.pro)


PLOT3D[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot3d

 PURPOSE:
   This procedure does a surface or shade_surf plot.

 CATEGORY:
   PLOT/PLOT_SURFACE

 CALLING SEQUENCE:
   plot3d,plot,z=z,[x=x],[y=y],[shades=shades],[file=file],[/time]

 INPUTS:
  plot: The predefined Structure PLOT by pl_init

 KEYWORD PARAMETERS:
   z:    The z-Parameter Array or a parameter name from a netCDF file
   x:    The x-Parameter Array or a parameter name from a netCDF file
   y:    The y-Parameter Array or a parameter name from a netCDF file
   shades: The 4-th dimension (will be shown with different colors)
   file: The name of the netCDF File, if you like to have dirctly access to data in files
   time: if set timeaxis on x


 OUTPUTS:
   You get a surface- or shade_surf- plot on screen or ps file


 EXAMPLE:
   pro surface_test

@init ;                          ;

     color_scheme,PLOT,scheme_code='ct_yellow_red_blue'

     plotinit,plot

     defp2d,plot,'levels',[-6,-4,-2,0,2]

     plot.irregular=0
     plot.new=1
     plot.fill=1
     x = indgen(10)
     y = indgen(10)
     z = dist(10,10)
     shades=1-dist(10,10)

     plot3d,plot,z=z,x=x,y=y,shades=shades

     plotend,plot

   end

 MODIFICATION HISTORY:
 	Written by:	J.Ankenbrand (ICG-1) 2.November 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\plot3d.pro)


PLOT3D_AV_COLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot3d_av_cols

 PURPOSE:
   This routine manages the colors for the colortable.

 CATEGORY:
   PLOT/PLOT_SURFACE

 CALLING SEQUENCE:
   plot3d_av_cols,plot,shades=shades,shade_values=shade_values

 INPUTS:
   plot : The by pl_init predefined structure PLOT

 KEYWORDS:
   shades : is input and output parameter
            input: the 4th dimension values
            output: the color index of each point
   shade_values : (output) the values of shade, which will have an own colour
 
 OUTPUTS:
   plot: defined by pl_init but now c_colors is actualized
   plot.c_colors holds the actual indices for use by a 3D Plot
   plot.surface.shades contains the shades-array

 EXAMPLE:
   plot3d_av_cols,plot,shades=shades,shade_values=shade_values

 MODIFICATION HISTORY:
 	Written by:	J.Ankenbrand, ICG-1, 29.October 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\plot3d_av_cols.pro)


PLOT3D_ROT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  plot3d_rot

 PURPOSE:  plot a 3-D trajectory and rotate plot interactively

 USEAGE:   plot3d_rot,xx,yy,zz

 INPUT:    
   xx,yy,zz
     vector trajectory of path

 KEYWORD INPUT:

   title
     title string

   dang
     angle increment between successive rotations (default=5)

   cang
     constant angle of rotation of the xyz coordinate axis about z-axis.
     (default=30)

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

  x=randf(30,3)
  y=randf(30,3)
  z=randf(30,3)

  plot3d_rot,x,y,z

  plot3d_rot,x,y,z,/continuous


 AUTHOR:   Paul Ricchiazzi                        11 Apr 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\plot3d_rot.pro)


PLOTBIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PLOTBIN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Makes a plot in a histogram style.

 CALLING SEQUENCE:
   PLOTBIN, x, y, WIDTH=width, PIXCENTER=pixcenter, ...

 DESCRIPTION: 

   PLOTBIN makes an unfilled histogram plot.  The width of each
   histogram bin can be specified individually, and the alignment of
   the bin centers can be given explicitly.

   PLOTBIN accepts several specialized keyword parameters of its own,
   but passes any other keywords to the built-in IDL PLOT procedure.
   Thus, any keywords accepted by PLOT can be passed to PLOTBIN.

   PLOTBIN uses the PANEL/SUBPANEL system to partition the viewport.

 INPUTS:

   X, Y - Two arrays which give the "X" and "Y" position of each bin.
          If only the Y values are given, then the X values will be
          the bin numbers.

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   PANEL, SUBPANEL - An alternate way to more precisely specify the
                     plot and annotation positions.  See SUBCELL.
                     Default is full-screen.  Overridden by POSITION.

   WIDTH - The width of each histogram bin.  If a scalar, then the
           width is assumed to be the same for all histogram bins.
           If a vector, then WIDTH should have the same number of
           elements as X and Y, and specify the width of each
           individual bin.
           Default value: width is the separation between the first
                          two X values.

   PIXCENTER - Describes the alignment of "X" values with respect to
               the histogram bin centers:
                   PIXCENTER = 0.0  -- "X" values are left edges of bins
                             = 0.5  -- "X" values are bin centers
                             = 1.0  -- "X" values are right edges of bins
               Intermediate values are also permitted.
               Default value: 0.5 ("X" values are bin centers)

   MIDPOINT - if set, then ignore the WIDTH and PIXCENTER keyword
              values, and instead construct bin edges which lie at
              the midpoints between data points.  This is usually the
              most straightforward way to connect irregularly sampled
              points "like a histogram," although at the expense of
              not having a direct relation between X and the bin
              centers.

   EDGE - if set, then the X values will be taken to be the bin edges
          rather than the bin midpoints.  In this case, the number of
          X values should be one more than the number of Y values.

   Other options are passed along to the PLOT command directly.

 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

 SEE ALSO:

   SUBCELL, DEFSUBCELL, SUBCELLARRAY

 EXTERNAL SUBROUTINES:

   PLOT, SUBCELL

 MODIFICATION HISTORY:
   Written, CM, 1997
   Documented, CM, July 1999
   Added MIDPOINT keyword, 21 Feb 2000
   Added EDGE keyword, 21 Apr 2000
   Corrected way that PIXCENTER works (Thanks to 
     J. Guerber), CM, 28 Mar 2002

  $Id: plotbin.pro,v 1.3 2002/04/02 17:10:57 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\plotbin.pro)


PLOTCELL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell

 PURPOSE:
   This procedure did a cell contouring where each element of an array will be scaled
   to a color from the colorbar

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plotcell,plot,[x=x],[y=y],z=z,[file=file],[icg_struct=icg_struct],[/overplot],[/time]_extra=_extra

 INPUTS:
   plot: the predefined structure PLOT by get_plot_struct()

 KEYWORD PARAMETERS:
   x:    The x-Parameter Array or a parameter name from a netCDF file
   y:    The y-Parameter Array or a parameter name from a netCDF file
   z:    The z-Parameter Array or a parameter name from a netCDF file

   file: The name of the netCDF File, if you like to have dirctly access to data in files
   icg_Struct: the defined icg_struct, if used x,y,z hat to be short_names of this structure

   time: If x is a vector of Julian Seconds then with switch time plotxy will show a time formatted X Axis


 OUTPUTS:
   on the selected device a celled contour plot

 KEYWORD PARAMETERS:
   overplot: to define the plot as an overplot
   _extra:  for future use

 EXAMPLE:
   pro ce_test
   z=makez(20,20)
   @init
   plotinit,plot
     plotcell,plot,z=z
   plotend,plot
   end


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5 1997
                       Dec-13 pltstamp added
 1998-03-11 max_colors moved to pl_av_cols
 1998-10-07 xrange and yrange implemented
 1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
 1999-Aug-10 boundaries are overlayed at end

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotcell.pro)


PLOTCELL_D_BSP2_A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_a

 PURPOSE:

 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_a EXAMPLE: plotcell_d_bsp2_a gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_a.pro)


PLOTCELL_D_BSP2_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_b

 PURPOSE:
 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_b EXAMPLE: plotcell_d_bsp2_b gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_b.pro)


PLOTCELL_D_BSP2_C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_c

 PURPOSE:
 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_c EXAMPLE: plotcell_d_bsp2_c gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_c.pro)


PLOTCELL_D_BSP2_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_d

 PURPOSE:
 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_d EXAMPLE: plotcell_d_bsp2_d gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_d.pro)


PLOTCELL_D_BSP2_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_g

 PURPOSE:
 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_g EXAMPLE: plotcell_d_bsp2_g gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_g.pro)


PLOTCELL_D_BSP2_H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_h

 PURPOSE:
 
Example
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_h EXAMPLE: plotcell_d_bsp2_h gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_h.pro)


PLOTCELL_D_BSP2_I

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotcell_d_bsp2_i

 PURPOSE:
 
Example: showing ranges
CATEGORY: EXAMPLES/PLOT/PLOT2D CALLING SEQUENCE: plotcell_d_bsp2_i EXAMPLE: plotcell_d_bsp2_i MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plot2d\plotcell_d_bsp2_i.pro)


PLOTCOLORFILL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PLOTCOLORFILL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Plots colorful bar charts

 CALLING SEQUENCE:
   PLOTCOLORFILL, x, y, COLOR=col, BOTTOM=bot, WIDTH=wid, ...

 DESCRIPTION: 

   PLOTCOLORFILL plots a colorful vertical bar chart.  This may be
   useful in cases where two dimensions of information need to be
   conveyed in one plot.  [ I use it to show total intensity as a
   function of time on the vertical axis, and temperature is coded
   with color. ]

   Most aspects of the bars are configurable.  The color is specified
   by an array of colors, one for each bar.  [ Alternatively, a
   single color for the entire plot can be given. ] Also, one color
   can be designated as transparent.

   Stacked bar charts can be constructed using two calls to
   PLOTCOLORFILL.  See the example.

 INPUTS:

   X, Y - Two arrays which give the X and Y position of the points.
          In this style of plot, the x values should be monotonically
          increasing, but not necessarily monospaced (see WIDTH).

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   COLOR - an array giving the color of each bar, or alternatively a
           scalar color for all of the bars.  The current color table
           is not changed.  Default is color "1"

   BOTTOM - normally the bottom of the bars is set to be zero.  You
            may either specify a scalar bottom value for all of the
            bars, or an array giving the bottom of each bar
            individually.  See the example to see how stacked bar
            charts can be constructed with this keyword.

   WIDTH - sets the width of each bar, globally or individually.
           Bars are centered on the "X" value, and extend 0.5 * WIDTH
           to either side.  Default is to assume monospacing, using
           the separation between the first two x values.  If only
           one data value is present, then a width of 1 is used.

   MIDPOINT - if set, then ignore the WIDTH keyword value, and
              instead construct bin edges which lie at the midpoints
              between data points.  This is usually the most
              straightforward way to connect irregularly sampled
              points "like a histogram," although at the expense of
              not having a direct relation between X and the bin
              centers.

   NOERASE - if set, do not erase an existing plot before rendering
             colored histogram.  The effect is comparable to "OPLOT",
             or the OVER keyword to CONTOUR.

   NOTRACE - if set, do not draw a linear trace at the top of the
             histogram.

   TRANSPARENT - designates a color which is "transparent".  Any bars
                 with this color are simply not rendered.  Default is
                 no transparent color.

   PANEL, SUBPANEL - An alternate way to more precisely specify the
                     plot and annotation positions.  See SUBCELL.
                     Default is full-screen.

   POSITION - Position of the bar chart in normal coordinates.
              Overrides position given by PANEL/SUBPANEL.

   Other keywords are passed to the plot command directly.
           
 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

   Stacked barcharts can be constructed by first making one chart
   with a flat bottom, and then a second chart whose bottom is top of
   the first.

   x = findgen(30)
   y1 = x^2
   y2 = 400.-x
   c1 = bindgen(30)*3+1b
   c2 = 100b-bindgen(30)*3+1b
   plotcolorfill, x, y1,    color=c1, bottom=0.
   plotcolorfill, x, y1+y2, color=c2, bottom=y1, /noerase

 SEE ALSO:

   PLOTPAN

 EXTERNAL SUBROUTINES:

   SUBCELL, DEFSUBCELL, PLOTPAN

 MODIFICATION HISTORY:
   Written, CM, 1997
   Added NOERASE, NOTRACE and MIDPOINT keywords, CM 11 Feb 2000
   Logarithmic plots now work; so does the THICK keyword, CM 02 Apr
     2001
   Optimize drawing when the bin is zero, CM 04 Apr 2001
   Try to handle YRANGE more properly, since there seem to be some
     cases where the overlayed axes were erroneous, CM 15 Mar 2002

  $Id: plotcolorfill.pro,v 1.6 2002/03/15 11:30:26 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\plotcolorfill.pro)


PLOTCOMPARE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLOTCOMPARE

 PURPOSE:
       Scatter plot two similar variables, print statistics.

 CALLING SEQUENCE:
       plotcompare,xquantity,yquantity

 INPUTS:
      xquantity      variable to plot along x-axis
      yquantity      variable to plot along y-axis

 KEYWORD INPUTS:
      hist        plot as 2D histogram (xrange, yrange turned off)
      bindim      number of bins on one side for 2D histogram
      tvim        display 2D histogram as image (default is contour plot)
      interactive interactively set the statistics legend
      pos         after locating legend with interactive keyword, specify 
                  legend location with this
      bigtext     print statistics with bigger font
      widetext    print statistics with wider font for use in printouts

   below are plot keywords:
      title          
      ymargin        
      xtitle         
      ytitle         
      xrange
      yrange
      psym

 OPTIONAL INPUTS:

 OUTPUTS:

 OPTIONAL OUTPUTS:

 EXAMPLE:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  1/04/94

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\plotcompare.pro)


PLOTCUBE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PLOTCUBE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Plots a three dimensional data that can be printed and made into a cube

 CALLING SEQUENCE:
   PLOTCUBE, x, y, z

 DESCRIPTION: 

   PLOTCUBE plots a three dimensional data set so that it can be
   printed on paper, cut out, and folded together to make a real-life
   three dimensional cube.  This may be useful in visualization
   applications.  The six faces of the cube contain a projection of
   the data onto that face.

   The output consists of a flat matrix of six plots, which are
   joined together at the proper edges of the cube.  Your task,
   should you choose to accept it, is to cut out the cube and
   assemble it.

   Before folding the cube together, it will look like the diagram
   below.  You need to match together edges labelled with the same
   letter.

                            A
                          +----+
                         B|    |G
                      B   |    |   G
                     +----+----+----+
                     |    |    |    |
                    C|    |    |    |E
                     +----+----+----+
                      D   |    |   F
                         D|    |F
                          +----+
                          |    |
                         C|    |E
                          +----+
                            A

   HINT 1: When printing, be sure that the XSIZE and YSIZE are given
           in the ratio of 3 to 4.  A size of 6 in by 8 in is
           suitable.

   HINT 2: As a practical matter for assembling the cube once it has
           been printed, you should leave some extra paper tabs so
           that adhesive can be applied.

 INPUTS:

   X, Y, Z - Three arrays which specify position in three dimensional
             space.  All three arrays should be of the same length.

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   PANEL, SUBPANEL - An alternate way to more precisely specify the
                     plot and annotation positions.  See SUBCELL.
                     Default is full-screen.

   XRANGE, YRANGE, ZRANGE - gives plot range for each dimension, as
                            for other plot commands.  Default is
                            range of data.

   XTITLE, YTITLE, ZTITLE - gives title for each axis.  The title
                            labels each face of the cube where
                            possible.

   NOERASE - If set, the display is not erased before graphics
             operations.

   Other options are passed along to the PLOT command directly.

 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

   This example takes some synthetic data and makes a cube out of it.
   Visualizing the trace of the curve is more convenient when it can
   be projected on the cube in each dimension.

   t = findgen(200)/20. - 10.
   x = cos(t)
   y = sin(t) + 0.05*t
   z = exp(t) + 0.05*randomn(seed, 200)
   plotcube, x, y, z, xrange=[-1.5,1.5], yrange=[-1.5,1.5], zrange=[-1.5,1.5]

 SEE ALSO:

   DEFSUBCELL, SUBCELLARRAY

 EXTERNAL SUBROUTINES:

   SUBCELL, DEFSUBCELL, PLOTPAN

 MODIFICATION HISTORY:
   Written, CM, 1997
   Modified to include SUBCELL, DEFSUBCELL and PLOTPAN when
     distributed, CM, late 1999

  $Id: plotcube.pro,v 1.2 2001/03/25 18:10:44 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\plotcube.pro)


PLOTEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotend

 PURPOSE:
       This procedure finishes a plot in plotxy

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
       plotend,plot

 INPUTS:
       plot:  The plot structure defined by pl_init

 PROCEDURE:
       This procedure finishs a plot by closing the plot device
       device will be set to the olddevice

 EXAMPLE:
       plotend,plot

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer May 1997
       27. 5.97 : plot.beschriftungeingefuehrt; Filenamen werden in PS-Plot ausgegeben, wenn plot.stamp gt 1
       27. 5.99 : FR Änderungen zur Einführung des plot-devices Z
       02.10.99 ; Z Buffer key 12 added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotend.pro)


PLOTIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PLOTIMAGE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Displays an image via a "PLOT"-like interface.

 CALLING SEQUENCE:
   PLOTIMAGE, img, [xrange=xrange,] [yrange=yrange,] ...

 DESCRIPTION: 

   PLOTIMAGE displays an image (or slice of an image) on the current
   graphics device.  The syntax is very similar to the PLOT command,
   in the sense that an XRANGE and YRANGE for the plot can be
   specified.  

   More importantly, coordinate ranges can be specified for the
   *image* itself, and then PLOTIMAGE will intelligently crop the
   image so that only the part that falls within the XRANGE and
   YRANGE is displayed.  Images often have physical units (other than
   pixels) assigned to their X and Y dimensions.  PLOTIMAGE allows
   you to slice the image appropriately and display appropriate
   coordinate axes.

   Image coordinates are specified via the IMGXRANGE and IMGYRANGE
   keywords.  IMGXRANGE specifies the x-values for the first and last
   pixels in each row.  IMGYRANGE gives the y-values for the first
   and last pixels in each column.  Default image coordinates are in
   units of pixels.

   Plot coordinates are specified in the usual XRANGE and YRANGE
   keywords.  The [XY]RANGE may specify a range smaller than the
   image size, so that the image is cropped; or a range larger than
   the image size, in which case the appropriate portion of the image
   is displayed.

   Psuedocolor images may be of any type, but must rescaled to a byte
   range by using the RANGE keyword.  By default the color range used
   in the rescaling operation is 0 to !D.N_COLORS - 3B.  The extra
   two color values are reserved for the background and default pen
   colors.  This behavior can be adjusted by specifying the BOTTOM
   and/or NCOLORS keywords.

   Truecolor images must always be of type BYTE and one of their
   dimensions must have 3 elements, corresponding to the three color
   planes of the image.


 INPUTS:

   IMG - Array to be displayed.  For single-plane images (i.e.,
         pseudocolor), the image must be two dimensional and of any
         real numeric type.  For images that are not of BYTE type,
         the RANGE keyword must be supplied to rescale the image
         values to a byte range.

         An image declared as ARRAY(NX,NY) will be NX pixels in the
         x-direction and NY pixels in the y-direction.  The image is
         resampled to fill the desired display region (and optionally
         smoothed).

         For three-plane images (i.e., truecolor) the image must be
         of type BYTE.  One of the dimensions of the array must have
         three elements.  Hence it must be one of BYTARR(NX, NY, 3),
         BYTARR(NX, 3, NY) or BYTARR(3, NX, NY).  The 3-element
         dimension is recognized automatically.
 
 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   IMGXRANGE, IMGYRANGE - Each is a two component vector that
                          describes the X and Y position of the outer
                          edges of the first and last pixels.
                          Default: [0, NUM_[XY]PIX] for IMG[XY]RANGE

   XRANGE, YRANGE - Each is a two component vector that specifies the
                    X and Y plot ranges, respectively.  These values
                    are not required to coincide with IMG[XY]RANGE.
                    Default: IMG[XY]RANGE

   POSITION - Position of the inner plot window in the standard
              graphics keyword format.  Overrides PANEL and SUBPANEL.

   INTERP - if set, interpolate (smooth) the image before displaying.
            This keyword applies to the screen displays.  For printed
            images that are coarser than MIN_DPI, the image is
            implicitly interpolated regardless of INTERP.

   PRESERVE_ASPECT - if set, preserve the aspect ratio of the
                     original image (in pixels).  The result will be
                     the largest image that fits in the display
                     region while maintaining approximately square
                     pixels.  The POSITION keyword will be reset upon
                     output to the ultimate image position.

   MIN_DPI - if printing, the minimum dot-per-inch pixel resolution
             for the resulting image.  Output images that would be
             coarser than this value are resampled to be at least
             MIN_DPI and smoothed.  Some common resolutions are:
             screen, 90 dpi; dot matrix, 72 dpi; laser printer
             300-600 dpi.  Note that large values of MIN_DPI will
             produce very large output files.
             Default: 0 (i.e., the output image will not be smoothed)

   RANGE - a two element vector.  If the image is single plane (i.e.,
           pseudocolor) the input image can be of any real numeric
           type, and then must be rescaled into byte range with this
           keyword.  In contrast, truecolor images must always be of
           type BYTE.  Values are scaled into byte range with the
           following statement:
              RESULT = BYTSCL(INPUT, MIN=RANGE(0), MAX=RANGE(1), $
                              TOP=NCOLORS-1) + BOTTOM
           so that pixels with an intensity RANGE(0) are set to
           BOTTOM; those with RANGE(1) are set to the maximum color.
           Default: no range scaling occurs (and the image must hence
                    be of type BYTE -- otherwise an error occurs)

   NCOLORS - number of color table values be used in the byte
             rescaling operation.
             Default: !D.N_COLORS - BOTTOM - 1 (for default pen color)

   BOTTOM - bottom-most value of the color table to be used in the
            byte rescaling operation.
            Default: 1 (for default background color)

   NOERASE - If set, the display is not erased before graphics
             operations.

   NODATA - If set, the image is not actually displayed, but
            coordinate axes may be drawn.

   NOAXES - An attempt is made to render the image without coordinate
            axes.  This is possible if POSITION, PANEL, or SUBPANEL
            are  given.

   PANEL, SUBPANEL - An alternate way to more precisely specify the
                     plot and annotation positions.  See SUBCELL.

   PLOTIMAGE will pass other keywords directly to the PLOT command
   used for generating the plot axes.  XSTYLE=1 and YSTYLE=1 are
   enforced.

 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

   This example constructs an image whose values are found by
       z(x,y) = cos(x) * sin(y)
   and x and y are in the range [-2,2] and [4,8], respectively.
   The image is then plotted, with appropriate axes.
   
   x = findgen(20)/5. - 2. + .1   ; 0.1 = half-pixel
   y = findgen(20)/5. + 4. + .1
   zz = cos(x) # sin(y)
   imgxrange = [-2.,2.]           ; extend to pixel edges
   imgyrange = [4.,8.]
   plotimage, bytscl(zz), imgxrange=imgxrange, imgyrange=imgyrange

   This second example plots the same image, but with a plot range
   much larger than the image's.

   xr=[-10.,10]
   yr=[-10.,10]
   plotimage, bytscl(zz), imgxrange=imgxrange, imgyrange=imgyrange, $
      xrange=xr, yrange=yr

 SEE ALSO:

   OPLOTIMAGE, BYTSCL

 EXTERNAL SUBROUTINES:

   SUBCELL, DEFSUBCELL

 MODIFICATION HISTORY:
   Written, CM, 1997
   Correct various one-off problems, 02 Feb 1999, CM
   Made self-contained with some pre-processing, 17 Oct 1999, CM
   Corrected bug in newly introduced CONGRID functions, 18 Oct 1999, CM
   Correct behavior with no POSITION keyword, 17 Nov 1999, CM
   Simplified axis plotting, 17 Nov 1999, CM
   Use _EXTRA keyword in first PLOT, but with blank TITLEs, 11 Jan
     2000, CM
   Correct implementation of X/YSTYLE in first PLOT, 11 Feb 2000, CM
   Correct CONGRID implementation (small effect when enlarging most
     images), 14 Feb 2000, CM
   Major changes: 19 Apr 2000
      - now handle decomposed color, automatic color mapping via
        RANGE, and 24-bit multiplane images
      - new PRESERVE_ASPECT keyword to keep square pixels
      - removed legacy TVIMAGE code
      - smoothing is more configurable, esp. for printers, but is not
        done by default; more printers are supported
   Corrected INTERPOLATE behavior (thanks to Liam Gumley
     ), other minor tweaks, CM 20 Apr 2000
   Added ability to use PRESERVE_ASPECT with POSITION, PANEL or
     SUBPANEL keywords CM 20 Oct 2000
   Oops, a typo is now fixed, CM 23 Oct 2000
   Add fix for MacIntoshes and DECOMPOSED color, Tupper, 02 Aug 2001
   Better behavior with fractional pixels (ie, when the image pixels
     are very large compared to the screen), 23 Aug 2001

   $Id: plotimage.pro,v 1.4 2001/08/23 23:39:53 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\plotimage.pro)


PLOTINIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plotinit

 PURPOSE:
  This procedure initializes the plot device defined in the plot structure for plotxy

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
       plotinit,plot,[/np_colors]

 INPUTS:
       plot:  The plot structure defined by pl_init

 KWYWORD PARAMETERS:
       no_colors: if set colortable is not chnaged

 PROCEDURE:
       This procedure initializes a plot by setting the plot device,
       defining the page and plot layout etc.

 EXAMPLE:
       plotinit,plot

 MODIFICATION HISTORY:
  Written by: Franz Rohrer May 1997
22. 4.97 den window-Befehl mit Fenster-Nr. plot.window ausgestattet
Dieses Unterprogramm soll die Plot-Initialisierung durchführen.
Dies betrifft :
 die Größe und Art des Plot-Fensters,
 Festlegung des Plot-Devices,
 etc.
plot ist eine Struktur, die alle plot-Definitions-Merkmale enthalten soll
Aenderungen
 7. 8.97 : Abfrage nach plot.window < 32 eingebaut, da widgets Fensternummern größer 31 benutzen, normale Fenster jedoch kleiner sein müssen
28.10.97 : isolatin1=1 in den device-Befehl eingebaut, um deutsche Umlaute zu ermöglichen
11.01.98 : Berechnung von plot.charsize_norm_factor eingeführt; Textbreite bei PS-Device wird als Normierungsfaktor genutzt
16.02.98 : Seitenformat jetzt auch beliebig anwaehlbar
07.03.98 : PS-Font Symbol auf Fontnr. 4 und 7 gemapped
1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
27.05.99 : device Z eingeführt
           10 Z-Device only closed at plotend
           11 Z-Device output at plotend closed at plotend
29.10.99  : device Z erweitert
           12 Z-Device wird bei plotend nicht geschlossen
03.06.00 : plot=reorganize_plot(plot) eingeführt; setzt plot.zeilen/spalten nach plot.rows/columns um

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotinit.pro)


PLOTLEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plotleg

 PURPOSE:
  This procedure initializes the creation of a legend for plotxy

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
       plotleg,plot

 INPUTS:
       plot:   The plot structure defined by pl_init

 EXAMPLE:
       plotleg,plot

 MODIFICATION HISTORY:
  Written by: Franz Rohrer July 1997
          30. 7.97 : 2 mal >1 eingefuehrt damit plot auf erster Seite auch mit Legende versehen wird
          1.  8.97 : plot.current_charsize eingefuehrt
          22.11.97 : symsize und thick an Legende uebergeben
          17.12.97 : linestyle an Legende uebergeben
          14.01.98 : plot.legend_position, plot.legend_frameposition,
                     plot.legend_align an Legende uebergeben  mb
          19.01.98 : spacing von 1.2/3. auf 1.25/1.5 geaendert
          05.02.98 : Bei psym=10 wird psym=0 genommen
          24.09.99 : FR : charsize=charsize*plot.legend_charsize

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotleg.pro)


PLOTLEG2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotleg2

 PURPOSE:
       This procedure makes a legend for a plot.  The legend can contain
       a mixture of symbols, linestyles, Hershey characters (vectorfont),
       and filled polygons (usersym).

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:

 INPUTS:
       items = text for the items in the legend, a string array.
               You can omit items if you don't want any text labels.
               For example, items = ['diamond','asterisk','square'].

 OPTIONAL INPUTS:
       linestyle = array of linestyle numbers  If linestyle(i) < 0, then omit
               ith symbol or line to allow a multi-line entry.
       psym = array of plot symbol numbers.  If psym(i) is negative, then a
               line connects pts for ith item.  If psym(i) = 8, then the
               procedure usersym is called with vertices define in the
               keyword usersym.
       N. B.: Choose either linestyle, psym, neither, or both.  If neither is
               present, only the text is output.  If both linestyle and
               psym parameters are present, they both have to have the
               same number of elements, and normal plot behaviour occurs.
               By default, if psym is positive, you get one point so there is
               no connecting line.
       vectorfont = vector-drawn characters for the sym/line column, e.g.,
               ['!9B!3','!9C!3','!9D!3'] produces an open square, a checkmark,
               and a partial derivative, which might have accompanying items
               ['BOX','CHECK','PARTIAL DERIVATIVE'].  If vectorfont(i) = '',
               then plots is called to make a symbol or a line, but if
               vectorfont(i) is a non-null string, then xyouts is called.
               There is no check that !p.font is set properly, e.g., -1 for
               X and 0 for PostScript.  This can produce an error, e.g., use
               !20 with PostScript and !p.font=0, but allows use of Hershey
               *AND* PostScript fonts together.

 KEYWORD PARAMETERS:
       /help = flag to print header
       /horizontal = flag to make the legend horizontal
       /vertical = flag to make the legend vertical (D=vertical)
       box = flag to include/omit box around the legend (D=include)
       delimiter = embedded character(s) between symbol and text (D=none)
       colors = array of colors for plot symbols/lines (D=!color)
       textcolors = array of colors for text (D=!color)
       margin = margin around text measured in characters and lines
       spacing = line spacing (D=bit more than character height)
       pspacing = psym spacing (D=3 characters)
       charsize = just like !p.charsize for plot labels
       position = normalized coordinates of the upper left of the legend
       number = number of plot symbols to plot or length of line (D=1)
       usersym = 2-D array of vertices, cf. usersym in IDL manual. (D=square)
       /fill = flag to fill the usersym

 OUTPUTS:
       legend to current plot device

       corners = 4-element array, like !p.position, of the normalized
         coords for the box (even if box=0): [llx,lly,urx,ury].
         Useful for multi-column or multi-line legends, for example,
         to make a 2-column legend, you might do the following:
           c1_items = ['diamond','asterisk','square']
           c1_psym = [4,2,6]
           c2_items = ['solid','dashed','dotted']
           c2_line = [0,2,1]
           legend,c1_items,psym=c1_psym,corners=c1,box=0
           legend,c2_items,line=c2_line,corners=c2,box=0,pos=[c1(2),c1(3)]
           c = [c1(0)c2(2),c1(3)>c2(3)]
           plots,[c(0),c(0),c(2),c(2),c(0)],[c(1),c(3),c(3),c(1),c(1)],/norm
         Useful also to place the legend.  Here's an automatic way to place
         the legend in the lower right corner.  The difficulty is that the
         legend's width is unknown until it is plotted.  In this example,
         the legend is plotted twice: the first time in the upper left, the
         second time in the lower right.
           legend,['1','22','333','4444'],linestyle=indgen(4),corners=corners
                       ; BOGUS LEGEND---FIRST TIME TO REPORT CORNERS
           xydims = [corners(2)-corners(0),corners(3)-corners(1)]
                       ; SAVE WIDTH AND HEIGHT
           chdim=[!d.x_ch_size/float(!d.x_size),!d.y_ch_size/float(!d.y_size)]
                       ; DIMENSIONS OF ONE CHARACTER IN NORMALIZED COORDS
           pos = [!x.window(1)-chdim(0)-xydims(0) $
                       ,!y.window(0)+chdim(1)+xydims(1)]
                       ; CALCULATE POSITION FOR LOWER RIGHT
           plot,findgen(10)    ; SIMPLE PLOT; YOU DO WHATEVER YOU WANT HERE.
           legend,['1','22','333','4444'],linestyle=indgen(4),pos=pos
                       ; REDO THE LEGEND IN LOWER RIGHT CORNER
         You can modify the pos calculation to place the legend where you
         want.  For example to place it in the upper right:
           pos = [!x.window(1)-chdim(0)-xydims(0),!y.window(1)-xydims(1)]

 COMMON BLOCKS:
       none

 SIDE EFFECTS:

 RESTRICTIONS:
       Here are some things that aren't implemented.
       - It would be nice to allow data and device coords as well.
       - An orientation keyword would allow lines at angles in the legend.
       - An array of usersyms would be nice---simple change.
       - An order option to interchange symbols and text might be nice.
       - Somebody might like double boxes, e.g., with box = 2.
       - Another feature might be a continuous bar with ticks and text.
       - There are no guards to avoid writing outside the plot area.
       - There is no provision for multi-line text, e.g., '1st line!c2nd line'
         Sensing !c would be easy, but !c isn't implemented for PostScript.
         A better way might be to simply output the 2nd line as another item
         but without any accompanying symbol or linestyle.  A flag to omit
         the symbol and linestyle is linestyle(i) = -1.
       - There is no ability to make a title line containing any of titles
         for the legend, for the symbols, or for the text.
       - It might be nice to force the legend to be placed at hardwired
         locations in the plot, e.g., with keywords like /left/bottom for
         lower left.  Allowing this requires knowing the width of the text
         before it is printed, which is difficult.

 EXAMPLE:
       The call:
               legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
       produces:
               -----------------
               |               |
               |  + Plus sign  |
               |  * Asterisk   |
               |  . Period     |
               |               |
               -----------------
       Each symbol is drawn with a plots command, so they look OK.
       Other examples are given in usage and in optional output keywords.
 Usage:
       legend,items,linestyle=linestyle        ; vertical legend at upper left
       legend,items,psym=psym                  ; ditto except using symbols
       legend,items,psym=psym,/horizontal      ; horizontal format
       legend,items,psym=psym,box=0            ; sans border
       legend,items,psym=psym,delimiter='='    ; embed an '=' betw psym & text
       legend,items,psym=psym,margin=2         ; 2-character margin
       legend,items,psym=psym,position=pos     ; position of legend
       legend,items,psym=psym,number=2         ; plot two symbols, not one
       legend,items,/fill,psym=[8,8,8],colors=[10,20,30]; 3 filled squares

 REVISION HISTORY:
       write, 24-25 Aug 92, F K Knight (knight@ll.mit.edu)
       allow omission of items or omission of both psym and linestyle, add
         corners keyword to facilitate multi-column legends, improve place-
         ment of symbols and text, add guards for unequal size, 26 Aug 92, FKK
       add linestyle(i)=-1 to suppress a single symbol/line, 27 Aug 92, FKK
       add keyword vectorfont to allow characters in the sym/line column,
         28 Aug 92, FKK

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotleg2.pro)


PLOTLEG3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotleg3

 PURPOSE:
       This procedure creates a legend for a plot.  The legend can contain
       a mixture of symbols, linestyles, Hershey characters (vectorfont),
       and filled polygons (usersym).

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       plotleg3,items

 INPUTS:
       items = text for the items in the legend, a string array.
               You can omit items if you don't want any text labels.
               For example, items = ['diamond','asterisk','square'].

 OPTIONAL INPUTS:
       psym = array of plot symbol numbers.  If psym(i) is negative, then a
               line connects pts for ith item.  If psym(i) >7 then the
               procedure icgsym is called to generate the usersymbol
       linestyle = array of linestyle numbers  If linestyle(i) < 0, then omit
               ith symbol or line to allow a multi-line entry.
       N. B.: Choose either linestyle, psym, neither, or both.  If neither is
               present, only the text is output.  If both linestyle and
               psym parameters are present, they both have to have the
               same number of elements, and normal plot behaviour occurs.
               By default, if psym is positive, you get one point so there is
               no connecting line.
       vectorfont = vector-drawn characters for the sym/line column, e.g.,
               ['!9B!3','!9C!3','!9D!3'] produces an open square, a checkmark,
               and a partial derivative, which might have accompanying items
               ['BOX','CHECK','PARTIAL DERIVATIVE'].  If vectorfont(i) = '',
               then plots is called to make a symbol or a line, but if
               vectorfont(i) is a non-null string, then xyouts is called.
               There is no check that !p.font is set properly, e.g., -1 for
               X and 0 for PostScript.  This can produce an error, e.g., use
               !20 with PostScript and !p.font=0, but allows use of Hershey
               *AND* PostScript fonts together.

 KEYWORD PARAMETERS:
       /help = flag to print header
       /horizontal = flag to make the legend horizontal
       /vertical = flag to make the legend vertical (D=vertical)
       box = flag to include/omit box around the legend (D=include)
       bthick = thickness of box around legend.
       delimiter = embedded character(s) between symbol and text (D=none)
       colors = array of colors for plot symbols/lines (D=!color)
       textcolors = array of colors for text (D=!color)
       margin = margin around text measured in characters and lines
       spacing = line spacing (D=bit more than character height)
       pspacing = psym spacing (D=3 characters)
       charsize = just like !p.charsize for plot labels
       charthick = character thickness of legend text output
       number = number of plot symbols to plot or length of line (D=1)
       /fill = flag to fill the usersym
       align=[x,y]    : alignment of legend, x=0:align left corner, x=1:align right corner, y=0:align at bottom edge y=1:align at top edge, default [0,1]
       key=k          : predifined positions, 0:top-right besides plot area, 1:top-left, 2:top-right, 3:bottom-right, 4:bottom-left, default 0
       position=[x,y] : normalized coordinates of the legend in frame-coordinates, default=[-999,-999] means take key
       symsize : array of symsizes, default=1
       thick   : array of thickness of lines, default=1

 OUTPUTS:
       legend to current plot device

       corners = 4-element array, like !p.position, of the normalized
         coords for the box (even if box=0): [llx,lly,urx,ury].
         Useful for multi-column or multi-line legends, for example,
         to make a 2-column legend, you might do the following:
           c1_items = ['diamond','asterisk','square']
           c1_psym = [4,2,6]
           c2_items = ['solid','dashed','dotted']
           c2_line = [0,2,1]
           legend,c1_items,psym=c1_psym,corners=c1,box=0
           legend,c2_items,line=c2_line,corners=c2,box=0,pos=[c1(2),c1(3)]
           c = [c1(0)c2(2),c1(3)>c2(3)]
           plots,[c(0),c(0),c(2),c(2),c(0)],[c(1),c(3),c(3),c(1),c(1)],/norm
         Useful also to place the legend.  Here's an automatic way to place
         the legend in the lower right corner.  The difficulty is that the
         legend's width is unknown until it is plotted.  In this example,
         the legend is plotted twice: the first time in the upper left, the
         second time in the lower right.
           legend,['1','22','333','4444'],linestyle=indgen(4),corners=corners
                       ; BOGUS LEGEND---FIRST TIME TO REPORT CORNERS
           xydims = [corners(2)-corners(0),corners(3)-corners(1)]
                       ; SAVE WIDTH AND HEIGHT
           chdim=[!d.x_ch_size/float(!d.x_size),!d.y_ch_size/float(!d.y_size)]
                       ; DIMENSIONS OF ONE CHARACTER IN NORMALIZED COORDS
           pos = [!x.window(1)-chdim(0)-xydims(0) $
                       ,!y.window(0)+chdim(1)+xydims(1)]
                       ; CALCULATE POSITION FOR LOWER RIGHT
           plot,findgen(10)    ; SIMPLE PLOT; YOU DO WHATEVER YOU WANT HERE.
           legend,['1','22','333','4444'],linestyle=indgen(4),pos=pos
                       ; REDO THE LEGEND IN LOWER RIGHT CORNER
         You can modify the pos calculation to place the legend where you
         want.  For example to place it in the upper right:
           pos = [!x.window(1)-chdim(0)-xydims(0),!y.window(1)-xydims(1)]

 COMMON BLOCKS:
       none

 SIDE EFFECTS:

 RESTRICTIONS:
       Here are some things that aren't implemented.
       - It would be nice to allow data and device coords as well.
       - An orientation keyword would allow lines at angles in the legend.
       - An array of usersyms would be nice---simple change.
       - An order option to interchange symbols and text might be nice.
       - Somebody might like double boxes, e.g., with box = 2.
       - Another feature might be a continuous bar with ticks and text.
       - There are no guards to avoid writing outside the plot area.
       - There is no provision for multi-line text, e.g., '1st line!c2nd line'
         Sensing !c would be easy, but !c isn't implemented for PostScript.
         A better way might be to simply output the 2nd line as another item
         but without any accompanying symbol or linestyle.  A flag to omit
         the symbol and linestyle is linestyle(i) = -1.
       - There is no ability to make a title line containing any of titles
         for the legend, for the symbols, or for the text.
       - It might be nice to force the legend to be placed at hardwired
         locations in the plot, e.g., with keywords like /left/bottom for
         lower left.  Allowing this requires knowing the width of the text
         before it is printed, which is difficult.

 EXAMPLE:
       plotleg3,['A','BB','CC'],psym=[1,2,3]

       The call:
               legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
       produces:
               -----------------
               |               |
               |  + Plus sign  |
               |  * Asterisk   |
               |  . Period     |
               |               |
               -----------------
       Each symbol is drawn with a plots command, so they look OK.
       Other examples are given in usage and in optional output keywords.
 Usage:
       legend,items,linestyle=linestyle        ; vertical legend at upper left
       legend,items,psym=psym                  ; ditto except using symbols
       legend,items,psym=psym,/horizontal      ; horizontal format
       legend,items,psym=psym,box=0            ; sans border
       legend,items,psym=psym,delimiter='='    ; embed an '=' betw psym & text
       legend,items,psym=psym,margin=2         ; 2-character margin
       legend,items,psym=psym,position=pos     ; position of legend
       legend,items,psym=psym,number=2         ; plot two symbols, not one
       legend,items,/fill,psym=[8,8,8],colors=[10,20,30]; 3 filled squares

 REVISION HISTORY:
       write, 24-25 Aug 92, F K Knight (knight@ll.mit.edu)
       allow omission of items or omission of both psym and linestyle, add
         corners keyword to facilitate multi-column legends, improve place-
         ment of symbols and text, add guards for unequal size, 26 Aug 92, FKK
       add linestyle(i)=-1 to suppress a single symbol/line, 27 Aug 92, FKK
       add keyword vectorfont to allow characters in the sym/line column,
         28 Aug 92, FKK
       add keyword key and align 14 Jan 98  mb
       key: to position the legend, see below mb
       position: exact position of legend, alignment of legend
       postioning possible       mb
 FR  2. 2.98 : defaults defined for align, position, thick, symsize, psym, key
 FR  7. 2.98 : plotsymbol/line: plot only one symbol instead of two
 FR  7. 2.98 : handling the case n_elements(linestyle) ne n_elements(items)
 FH 29.02.00 : Added keyword parameter CHARTHICK = charthick for legend text output.
 FH 29.02.00 : Added keyword parameter BTHICK = bthick for line thickness of box around legend.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotleg3.pro)


PLOTLEG4

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      plotleg4

 PURPOSE:
       This procedure creates a legend for a plot.  The legend can contain
       a mixture of symbols, linestyles, Hershey characters (vectorfont),
       and filled polygons (usersym).

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       plotleg4,items

 INPUTS:
       items = text for the items in the legend, a string array.
               You can omit items if you don't want any text labels.
               For example, items = ['diamond','asterisk','square'].

 OPTIONAL INPUTS:
       psym = array of plot symbol numbers.  If psym(i) is negative, then a
               line connects pts for ith item.  If psym(i) >7 then the
               procedure icgsym is called to generate the usersymbol
       linestyle = array of linestyle numbers  If linestyle(i) < 0, then omit
               ith symbol or line to allow a multi-line entry.
       N. B.: Choose either linestyle, psym, neither, or both.  If neither is
               present, only the text is output.  If both linestyle and
               psym parameters are present, they both have to have the
               same number of elements, and normal plot behaviour occurs.
               By default, if psym is positive, you get one point so there is
               no connecting line.
       vectorfont = vector-drawn characters for the sym/line column, e.g.,
               ['!9B!3','!9C!3','!9D!3'] produces an open square, a checkmark,
               and a partial derivative, which might have accompanying items
               ['BOX','CHECK','PARTIAL DERIVATIVE'].  If vectorfont(i) = '',
               then plots is called to make a symbol or a line, but if
               vectorfont(i) is a non-null string, then xyouts is called.
               There is no check that !p.font is set properly, e.g., -1 for
               X and 0 for PostScript.  This can produce an error, e.g., use
               !20 with PostScript and !p.font=0, but allows use of Hershey
               *AND* PostScript fonts together.

 KEYWORD PARAMETERS:
       /help = flag to print header
       /horizontal = flag to make the legend horizontal
       /vertical = flag to make the legend vertical (D=vertical)
       box = flag to include/omit box around the legend (D=include)
       delimiter = embedded character(s) between symbol and text (D=none)
       colors = array of colors for plot symbols/lines (D=!color)
       textcolors = array of colors for text (D=!color)
       margin = margin around text measured in characters and lines
       spacing = line spacing (D=bit more than character height)
       pspacing = psym spacing (D=3 characters)
       charsize = just like !p.charsize for plot labels
       number = number of plot symbols to plot or length of line (D=1)
       /fill = flag to fill the usersym
       align=[x,y]    : alignment of legend, x=0:align left corner, x=1:align right corner, y=0:align at bottom edge y=1:align at top edge, default [0,1]
       key=k          : predifined positions, 0:top-right besides plot area, 1:top-left, 2:top-right, 3:bottom-right, 4:bottom-left, default 0
       position=[x,y] : normalized coordinates of the legend in frame-coordinates, default=[-999,-999] means take key
       symsize : array of symsizes, default=1
       thick   : array of thickness of lines, default=1
       title:  : a title for the legend inside the box

 OUTPUTS:
       legend to current plot device

       corners = 4-element array, like !p.position, of the normalized
         coords for the box (even if box=0): [llx,lly,urx,ury].
         Useful for multi-column or multi-line legends, for example,
         to make a 2-column legend, you might do the following:
           c1_items = ['diamond','asterisk','square']
           c1_psym = [4,2,6]
           c2_items = ['solid','dashed','dotted']
           c2_line = [0,2,1]
           legend,c1_items,psym=c1_psym,corners=c1,box=0
           legend,c2_items,line=c2_line,corners=c2,box=0,pos=[c1(2),c1(3)]
           c = [c1(0)c2(2),c1(3)>c2(3)]
           plots,[c(0),c(0),c(2),c(2),c(0)],[c(1),c(3),c(3),c(1),c(1)],/norm
         Useful also to place the legend.  Here's an automatic way to place
         the legend in the lower right corner.  The difficulty is that the
         legend's width is unknown until it is plotted.  In this example,
         the legend is plotted twice: the first time in the upper left, the
         second time in the lower right.
           legend,['1','22','333','4444'],linestyle=indgen(4),corners=corners
                       ; BOGUS LEGEND---FIRST TIME TO REPORT CORNERS
           xydims = [corners(2)-corners(0),corners(3)-corners(1)]
                       ; SAVE WIDTH AND HEIGHT
           chdim=[!d.x_ch_size/float(!d.x_size),!d.y_ch_size/float(!d.y_size)]
                       ; DIMENSIONS OF ONE CHARACTER IN NORMALIZED COORDS
           pos = [!x.window(1)-chdim(0)-xydims(0) $
                       ,!y.window(0)+chdim(1)+xydims(1)]
                       ; CALCULATE POSITION FOR LOWER RIGHT
           plot,findgen(10)    ; SIMPLE PLOT; YOU DO WHATEVER YOU WANT HERE.
           legend,['1','22','333','4444'],linestyle=indgen(4),pos=pos
                       ; REDO THE LEGEND IN LOWER RIGHT CORNER
         You can modify the pos calculation to place the legend where you
         want.  For example to place it in the upper right:
           pos = [!x.window(1)-chdim(0)-xydims(0),!y.window(1)-xydims(1)]

 COMMON BLOCKS:
       none

 SIDE EFFECTS:

 RESTRICTIONS:
       Here are some things that aren't implemented.
       - It would be nice to allow data and device coords as well.
       - An orientation keyword would allow lines at angles in the legend.
       - An array of usersyms would be nice---simple change.
       - An order option to interchange symbols and text might be nice.
       - Somebody might like double boxes, e.g., with box = 2.
       - Another feature might be a continuous bar with ticks and text.
       - There are no guards to avoid writing outside the plot area.
       - There is no provision for multi-line text, e.g., '1st line!c2nd line'
         Sensing !c would be easy, but !c isn't implemented for PostScript.
         A better way might be to simply output the 2nd line as another item
         but without any accompanying symbol or linestyle.  A flag to omit
         the symbol and linestyle is linestyle(i) = -1.
       - There is no ability to make a title line containing any of titles
         for the legend, for the symbols, or for the text.
       - It might be nice to force the legend to be placed at hardwired
         locations in the plot, e.g., with keywords like /left/bottom for
         lower left.  Allowing this requires knowing the width of the text
         before it is printed, which is difficult.

 EXAMPLE:
       plotleg_control,['A','BB','CC'],psym=[1,2,3]

       The call:
               legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
       produces:
               -----------------
               |               |
               |  + Plus sign  |
               |  * Asterisk   |
               |  . Period     |
               |               |
               -----------------
       Each symbol is drawn with a plots command, so they look OK.
       Other examples are given in usage and in optional output keywords.
 Usage:
       legend,items,linestyle=linestyle        ; vertical legend at upper left
       legend,items,psym=psym                  ; ditto except using symbols
       legend,items,psym=psym,/horizontal      ; horizontal format
       legend,items,psym=psym,box=0            ; sans border
       legend,items,psym=psym,delimiter='='    ; embed an '=' betw psym & text
       legend,items,psym=psym,margin=2         ; 2-character margin
       legend,items,psym=psym,position=pos     ; position of legend
       legend,items,psym=psym,number=2         ; plot two symbols, not one
       legend,items,/fill,psym=[8,8,8],colors=[10,20,30]; 3 filled squares

 REVISION HISTORY:
       write, 24-25 Aug 92, F K Knight (knight@ll.mit.edu)
       allow omission of items or omission of both psym and linestyle, add
         corners keyword to facilitate multi-column legends, improve place-
         ment of symbols and text, add guards for unequal size, 26 Aug 92, FKK
       add linestyle(i)=-1 to suppress a single symbol/line, 27 Aug 92, FKK
       add keyword vectorfont to allow characters in the sym/line column,
         28 Aug 92, FKK
       add keyword key and align 14 Jan 98  mb
       key: to position the legend, see below mb
       position: exact position of legend, alignment of legend
       postioning possible       mb
 FR  2. 2.98 : defaults defined for align, position, thick, symsize, psym, key
 FR  7. 2.98 : plotsymbol/line: plot only one symbol instead of two
 FR  7. 2.98 : handling the case n_elements(linestyle) ne n_elements(items)
 RB  20.5.98 : width_box and height_box and no_draw
 RB  22.5.98 : plotleg_control is the new name of plotleg4
 FR  28.5.98 : fak=MIN([fakneu*fak*0.95,1]) kommentiert, fak von 0.83 auf 1.0 gesetzt
 RB 1998-0-26 : removed in line 376 -0.01 to expose linestyle
                because the better way is in part of plotleg_control adding a space
                before the items.
                In this way it gaves no conflict with the box sizes by using linesymbols.
 RB 1999-03-02 : intern_items=' '+items
 RB 1999-03-02 : keyword title added
 FH 29.02.00 : Added keyword parameter CHARTHICK = charthick for legend text output.
 FH 29.02.00 : Added keyword parameter BTHICK = bthick for line thickness of box around legend.
 FR 07.03.00 : Added keyword parameter linewidth for width of line-symbols

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotleg4.pro)


PLOTLEG_CONTROL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      plotleg_control

 PURPOSE:
       This procedure is an interface between xp_legend and plotleg4

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       plotleg_control,items, [width_box=width_box],[height_box=height_box], [/no_draw], [_extra=pkey]

 INPUTS:
       items = text for the items in the legend, a string array.
               You can omit items if you don't want any text labels.
               For example, items = ['diamond','asterisk','square'].


 KEYWORD PARAMETERS:
       width_box:  output of the box width if no_draw is set
       height_box: output of the box height if no_draw is set
       no_draw:    if is set no legend will be drawn
       _extra:     to submit keywords to plotleg4

 MODIFICATION HISTORY:
 R.Bauer 1998-09-26

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotleg_control.pro)


PLOTMAP

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

 USERLEVEL:
   TOPLEVEL

 NAME:
	plotmap

 PURPOSE:
   This procedure is used to define maps for the icg plot structure

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plotmap,plot

 INPUTS:
  plot: The predefined Structure PLOT by pl_init

 OUTPUTS:
   You get a map plot on screen or ps file

 EXAMPLE:
   pro ct_test
   z=makez(20,20)
   @init
      color_scheme,plot,scheme=1
   plotinit,plot
     page_title,plot,'map_test'
     plot.xtitle='X' & plot.ytitle='Y'
     plot.nlevels=0
     defp2d,plot,'levels',findgen(20)/20
     plot.title='Titel 1'
     plotmap,plot
   plotend,plot
   end
  

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 15. May 1998 R.Bauer 1998-Jun-19 /noborder added to remove the trailing white space border 1999-03-26 plot.map_set.active=1 now at call from plotmap 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotmap.pro)


PLOTMAP_BOUNDARIES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotmap_boundaries

 PURPOSE:
   This procedure is used to overplot continents or/and grid over a plot defined by plot_map

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plotmap_boundaries,plot

 INPUTS:
  plot: The predefined Structure PLOT by pl_init


 OUTPUTS:
   You get a map plot with continents or/and grids on screen or ps file


 EXAMPLE:
   pro ct_test
   z=makez(20,20)
   @init
      color_scheme,plot,scheme=1,max_colors=20
   plotinit,plot
     page_title,plot,'map_test'
     plot.xtitle='X' & plot.ytitle='Y'
     plot.nlevels=0
     defp2d,plot,'levels',findgen(20)/20
     plot.title='Titel 1'
     plot.map_set.grid=1
     plot.map_set.continents=1
     plotmap,plot
   plotend,plot
   end

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 15. May 1998
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotmap_boundaries.pro)


PLOTMAP_D_BSP1_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotmap_d_bsp1_e

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotmap_d_bsp1_e

 EXAMPLE:
   plotmap_d_bsp1_e
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-May-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotmap\plotmap_d_bsp1_e.pro)


PLOTNEU

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotneu

 PURPOSE:
      This procedure controls the start of the next plot for plotxy.
      The procedure could be used to overlay a plotpage on an other one.

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
       plotneu,plot,flag

 INPUTS:
       plot:  The plot structure defined by pl_init
       flag:  if 1 then the next plot will be overlayed to the first one

 EXAMPLE:
       plotinit,plot,1

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer May 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotneu.pro)


PLOTNEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotnew

 PURPOSE:
      This procedure controls the start of the next plot for plotxy.
      The procedure could be used to overlay a plotpage on an other one.

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
       plotnew,plot,flag

 INPUTS:
       plot:  The plot structure defined by pl_init
       flag:  if 1 then the next plot will be overlayed to the first one

 EXAMPLE:
       plotinit,plot,1

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer May 1997
  name changed from plotneu to plotnew

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotnew.pro)


PLOTOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		PLOTOT
 VERSION:
		4.0
 PURPOSE:
		Plots multiple data sets on a single plot.
 CATEGORY:
		Plotting.
 CALLING SEQUENCE:
		PLOTOT, [X,] Y [, optional keywords]
 INPUTS:
	Y
		A numeric vector or 2 dimensional array containing the Y coordinates of
		the data.  If Y is a vector PLOTOT operates same as PLOT.  If it is
		a 2-dim.array, each row is ploted separately.  It is assumed that the
		number of points per plot is larger than the number of plots so that if
		 is an (M*N) array with N > M, it will be transposed prior to plotting.
 OPTIONAL INPUT PARAMETERS:
	X
		A numeric vector containing the X coordinates of the data.  If absent
		it is replaced by the vector [0, 1, 2 ...].
 KEYWORD PARAMETERS:
	XTYPE
		Standard IDL plotting interpretation.
	YTYPE
		Ditto.
	/YNOZERO
		Ditto.
	PSYM
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive plots.
	LINESTYLE
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive plots.
	COLOR
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive plots.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses calls to DEFAULT, SIGN and WHERINSTRUCT in MIDL.
 MODIFICATION HISTORY:
		Created 30-JUL-1991 by Mati Meron.
		Modified 15-JAN-1994 by Mati Meron.  Now PLOTOT takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\plotot.pro)


PLOTP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLOTP
 PURPOSE:
       Pencode plot routine.  Allows disconnected lines.
 CATEGORY:
 CALLING SEQUENCE:
       plotp, x, y, [p]
 INPUTS:
       x,y = arrays of x and y coordinates to plot.       in
       p = optional pen code array.                       in
           0: move to point, 1: draw to point.
 KEYWORD PARAMETERS:
       Keywords:
         /DATA plots in data coordinates (default).
         /DEVICE plots in device coordinates.
         /NORMAL plots in normalized coordinates.
         COLOR=clr.  Set plot color.
         LINESTYLE=ls.  Set linestyle.
         /CLIP means clip to plot window (/DATA only).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Oct, 1989
       R. Sterner, 10 Dec, 1990 --- added LINESTYLE.
       R. Sterner, 19 Dec, 1991 --- made loop index long.
       R. Sterner, 1999 Dec 3 --- Added THICK.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plotp.pro)


PLOTPAGE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  plotpage

 PURPOSE:  

 USEAGE:   plotpage,x,y,npage=npage

 INPUT:    
   x       variable ploted along x-axis
   y       variable ploted along y-axis, 
           if y is an 2-d array then 
           plot,x,y(*,0) 
           oplot,x,y(*,1)
           oplot,x,y(*,2)...

 KEYWORD INPUT:

   npage   suggested number of pages into which horizontal range of
           plot is broken.  the actual number of pages is chosen to
           make the x range values come out to nice even numbers.

   xrange  x axis range which will be broken up into pages

   yrange  either a vector specifying y range, or a scalor.  If
           yrange is set to a scalor (e.g., /yrange) then the yrange
           adapts to the y variable range appropriate to each page.

           All other plot keywords are also accepted and passed to
           the plot procedure.

 KEYWORD OUTPUT:

   xrng    the x-axis range that corresponds to the last active page 
           before plotpage is terminated.

 DISCUSSION:
          use plotpage to page through pages of a very high density 
          plot.  New pages (i.e., the next increment in the x-range
          of the plot) are selected by the middle (forward) or left
          (backward) mouse button.  The number of plot pages in which
          to break the horizontal range of the plot is selected with
          the keyword parameter npage.

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 solar,x,y
 plotpage,x,y,npage=100

 AUTHOR:   Paul Ricchiazzi                        24 Feb 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\plotpage.pro)


PLOTPAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PLOTPAN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Same as PLOT command, but respects PANEL and SUBPANEL

 CALLING SEQUENCE:
   PLOTPAN, x, y, ...

 DESCRIPTION: 

   PLOTPAN is almost identical to PLOT, except that it accounts for
   panels and subpanels in the display.  In fact, after a short
   calculation, PLOTPAN calls PLOT to do its dirty work.

   Once the coordinate grid has been set up by PLOTPAN, other plots
   can be overlaid by calling OPLOT.

 INPUTS:

   X, Y - Two arrays which give the x and y position of each point.

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   PANEL, SUBPANEL - An alternate way to more precisely specify the
                     plot and annotation positions.  See SUBCELL.
                     Default is full-screen.  Overridden by POSITION.

   Other options are passed along to the PLOT command directly.

 OUTPUTS:
   NONE

 PROCEDURE:

 EXAMPLE:

 SEE ALSO:

   SUBCELL, DEFSUBCELL, SUBCELLARRAY

 EXTERNAL SUBROUTINES:

   PLOT, SUBCELL

 MODIFICATION HISTORY:
   Written, CM, 1997
   Added copyright notice, 25 Mar 2001, CM

  $Id: plotpan.pro,v 1.2 2001/03/25 18:54:31 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\plotpan.pro)


PLOTPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLOTPOS
 PURPOSE:
       Compute plot position for a plot of specified shape.
 CATEGORY:
 CALLING SEQUENCE:
       pos = plotpos(j, nx, ny)
 INPUTS:
       j = plot position number (0 to nx*ny-1, def=0).      in
       nx = number of plots across page or screen (def=1).  in
       ny = number of plots down page or screen (def=1).    in
 KEYWORD PARAMETERS:
       Keywords:
         HWRATIO=hw    plot window height/width ration (def=1.0).
         XMARGIN=xmar  X axis margin (def=!x.margin).
         YMARGIN=ymar  Y axis margin (def=!y.margin).
         CHARSIZE=csz  Character size (def=!p.charsize).
         ORIGIN=org    Origin of plot window in device coordinates.
         NORIGIN=norg  Origin of plot window in normalized coords.
           Origins over-ride margins and plot position number.
         /NORMAL  means return position in normalized coords (def).
         /DEVICE  means return position in device coords.
 OUTPUTS:
       pos = returned plot position.                        out
         Four element array: [xmn,ymn,xmx,ymx].
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 15 Oct, 1993
       R. Sterner, 1994 Feb 7 --- Made args have defaults.
       R. Sterner, 1995 Apr 3 --- Added CHARSIZE.
       R. Sterner, 1995 Jun 22 --- Added NORIGIN=normalized origin.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plotpos.pro)


PLOTSEQ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLOTSEQ
 PURPOSE:
       Plot a movielike sequence of graphs.
 CATEGORY:
 CALLING SEQUENCE:
       plotseq, x, y, [ind]
 INPUTS:
       x = array of x coordinates.  May be 1-d or 2-d.   in
           When x is 1-d all plots share same x values.
       y = array of y coordinates.  May be 1-d or 2-d.   in
           If 2-d second index is plot number.
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=ttxt  Plot titles (def=plot number).
           May be an array with one element for each plot.
         XTITLE=xtxt X axis title (def=none).
           Same for all plots.
         YTITLE=ytxt Y axis title (def=none).
           Same for all plots.
         COLOR=clr   Plot color (def=!p.color).
         SYMSIZE=sz  Symbol size (def=1).
         XOVER=x2    Second data set x array.  Same format as x.
         YOVER=y2    Second data set y array.  Same format as y.
         YTICKNAMES=ytn String array of user specified Y tick
           labels.  Must also give YTICKVALUES.
         YTICKVALUES=ytv Array of Y positions of the tick labels
           given in YTICKNAMES.  # elements must match.
         XSCALE=xs   X array scaling. 2-d in general: xs(3,n).
           If xs is given then xs(0,j) + xs(1,j)*x
           will be plotted as X where j=plot number.
           The number of points plotted will be xs(2,j).
         GH=h an array of Y values of horizontal lines.
         GV=v an array of X values of vertical lines.
           Any horizontal or vertical lines are known together
           as the grid.
         GCOLOR=c      grid color (def=!p.color).
         GLINESTYLE=s  grid line style (def=!p.linestyle).
         XRANGE=xran   A 2-d array giving the X axis range.
         YRANGE=yran   A 2-d array giving the Y axis range.
         XTYPE=t       Set linear (0) or log (1) X axis.
         YTYPE=t       Set linear (0) or log (1) Y axis.
 OUTPUTS:
       ind = optional indices of last plotted points.    out
           The indices of a subset of points may be
           returned if used with the ZOOM option.
 COMMON BLOCKS:
       plotseq_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plotseq.pro)


PLOTSYM

[Previous Routine] [Next Routine] [List of Routines]
 routine:    plotsym

 usage:      plotsym,x,y,xsym,ysym

 purpose:    overlays plot symbols on the last data window.  A single
             call can create symbols of varying size, fill color, and
             outline color and thickness.  Symbols of arbitrary shape
             can be created.  Note that the symbols may be filled
             with a different color then the outline color.  This can
             dramatically unclutter the appearance of densely packed
             scatter plots.  See example.
              

 input:
   x         x coordinates of symbol centers on plot
   y         y coordinates of symbol centers on plot 
   xsym      x coordinantes of symbol outline with respect to symbol center
   ysym      y coordinantes of symbol outline with respect to symbol center

   NOTE:     if TYPE or XSYM and YSYM are not supplied a circular symbol
             is assumed

 keyword input:
   ocolor    outline color of symbol 
   fcolor    fill color of symbol
   thick     line thickness of symbol outline
   size   symbol size multiplier
   type      symbol type, a string matching one of 

                       'DIAMOND',   'PENTAGON',  'CLOVER',   'PACMAN',
                       'SPIRAL',    'BIGX',      'CIRCLE',   'SQUARE',
                       'TRIANGLE',  'STAR',      'HEXAGON',  'HEART',
                       'SPADE',     'CLUB'
             
   NOTE:     OCOLOR, FCOLOR, THICK and SIZEE may be specified as
             single values or vector of values, one for each element 
             of x and y

   device    if set, coordinates are in device units
   normal    if set, coordinates are in normalized units
   data      if set, coordinates are in data units (default)


   NOTE:

   the OCOLOR, FCOLOR, THICK and SIZE parameters may be specified as 
   vectors quantities, one value for each point on the plot

 SIDE EFFECTS:
   changes the shape of user-defined plot symbol (accessed with psym=8).

 EXAMPLE:

   x=randomu(iseed,400)                                                 
   y=randomu(iseed,400)                                                 
   z=1.-x-y                                                             
   fcolor=bytscl(z,top=!p.color)                                        
   ocolor=5*!p.color                                                    
   loadct,5                                                             
   plot,x,y,/nodata                                                     
   plotsym,x,y,type='square',fcolor=fcolor,ocolor=ocolor,thick=1,size=1.5

;  In this example note how PLOTSYM unclutters the scatter plot

   !p.multi=[0,1,2]
   x=randomn(iseed,400)                                                 
   y=randomn(iseed,400)                                                 
   plot,x,y,/nodata                                                     
   plotsym,x,y,size=2

   plot,x,y,psym=8
          
  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\plotsym.pro)


PLOTWIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLOTWIN
 PURPOSE:
       Gives plot window (area enclosed by axes) in pixels.
 CATEGORY:
 CALLING SEQUENCE:
       plotwin, px0, py0, dpx, dpy
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         CHARSIZE=csz  Set character size (def=1).
 OUTPUTS:
       px0, py0 = window lower-left corner coord. (pixels).   out
       dpx, dpy = window size in pixels.                      out
 COMMON BLOCKS:
 NOTES:
       Note: Only for square pixels currently.
 MODIFICATION HISTORY:
       R. Sterner, 13 Dec, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plotwin.pro)


PLOTXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy

 PURPOSE:
       standardized plotting routine

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       plotxy,plot,file=ncdf_file,x=x_name,y=y_name
               or
       plotxy,plot,x=x_vector,y=y_vector

 INPUTS:
       plot  : structure with plot-options (see init.pro for details)

 OPTIONAL INPUTS:

 KEYWORD PARAMETERS:
       Keywords:
       [/time] : x-axis 1 is timeaxis in julian seconds ( if x='time' then x-axis 1 is timeaxis in julian seconds also)
       [file]  : netCDF-file following ICG convention
       [icg_struct] : defined ICG data structure, x and y short_names are used from this structure.
       x       : short name for x-values in netCDF-file or vector of x-values
       y       : short name for y-values in netCDF-file or vector of y-values
       if x and y are vectors then keyword file can be skipped

 OUTPUTS:

 COMMON BLOCKS:
       plots

 SIDE EFFECTS:

 RESTRICTIONS:
      minimum calling sequence must be ( x and y are predifined vectors ) :
           @init
           plotinit,plot
           plotxy,plot,x=x,y=y
           plotend,plot

 EXAMPLE:
           ;plot of two datasets, one in red, the other in green, data-points connected by lines, grafic-output directed into a PostScript-file
           @init
            plot.psflag=1
            x=findgen(100) & y1=x & y2=x^2
           plotinit,plot
            plot.psym=0
            plot.color=color_nc.red
           plotxy,plot,x=x,y=y1
            plot.color=color_nc.green
           plotxy,plot,x=x,y=y2
           plotend,plot
           end

 REVISION HISTORY:
       Written         Franz Rohrer, June 1997
       Corrected
;Aenderungen;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21. 4.97 : linestyle=plot.linestyle bei jsplot und oplot eingefuehrt
22. 4.97 : Parameter framethick fuer die Dicke der x/y-Achsen zur Unterscheidung von thick fuer die Dicke der Linien eingefuehrt
23. 4.97 : find_tag(inhalt,'inhalt') eingebaut zur Ueberpruefung, ob ueberhaupt zulaessige Werte vorhanden sind
23. 4.97 : xtype, ytype und prozedur Achsenformat eingefuehrt
 2. 5.97 : xrange/yrange bei deltax/deltay=0 definiert
 2. 5.97 : Das Einlesen der Daten wurde in die Prozedur fileles ausgelagert
 2. 5.97 : Jetzt ist auch die Übergabe eines Feldes von Files möglich, aus denen dann jeweils der gewünschte Parameter zu einem Gesamt-x/y-Vektor zusammengesetzt wird
 9. 5.97 : wird ein Feld von Files eingelesen, aber nur ein Teil der Daten im y-Bereich angefordert, werden nur diese daten genommen, Filter im Anschluß an fileles
12. 5.97 : Gitternetzlinien durch plot.grid, plot.xgrid, plot.ygrid eingefuehrt
12. 5.97 : ticklen fuer portrait und landscape auf 4mm gesetzt
13. 5.97 : in Aufruf JSPLOT labeloff von 3 auf 0 geaendert
20. 5.97 : xticks=plot.xticks in Aufruf JSPLOT eingefuehrt
22. 5.97 : ist plot.legend_name besetzt, wird dieser Text in plot.legend eingesetzt und plot.legend_name auf '' zurueckgesetzt
26. 5.97 : Es können nun auch Datenreihen übergeben werden. Dann wird kein File eingelesen, x und y-Titel müssen über plot.xtitel etc. übergeben werden.
           Bei Schluesselwort time wird Zeitachse angefordert
27. 5.97 : plot.beschriftungeingefuehrt; Filenamen werden in PS-Plot ausgegeben, wenn plot.stamp gt 1
29. 5.97 : plot.timeformat eingefuehrt
29. 5.97 : Hilfeausgabe bei /help eingefuehrt
 1. 7.97 : Yaxis 0,1,2 eingeführt  0:Box-Style Achse links 1:Achse rechts 2:Achse links
29. 7.97 : xtitle,ytitle zu Feldern gemacht, so dass jetzt auch geschachtelte plots mit mehreren Achsenbezeichnungen möglich sind
 1. 8.97 : plot.current_charsize eingeführt
11. 8.97 : if xn eq 'time' then xn='time' + if yn eq 'time' then yn='time' eingeführt, damit auch 'time' eine Zeitachse plottet
17. 8.97 : die gesamte Behandlung von Arrays bei der Übergabe von x,y-Feldern wurde verändert
17. 8.97 : zweite X-Achse eingeführt
20. 8.97 : Übergabe einer Struktur zur Steuerung von row/column-Plots eingebaut
29. 8.97 : plot.xtype und plot.ytype als Felder eingeführt
           i_xn und i_yn im Prozeduraufruf aformat eingeführt
29. 8.97 : ytickformat='' und xtickformat='' vor plotaufruf eingeführt, damit bei logarithmischen Achsen nicht 'emensch' ins Format geschrieben wird und alle Achsen beschriftet werden. Workaround. Muß noch sauber gelöst werden.
29. 8.97 : Plazierung von xtitle bei xtype=1 (logarithmische Achse) und 2. X-Achse geändert. Wird jetzt auf der Hälfte des logarithmisch gemittelten xrange ausgegeben.
 1. 9.97 : Bei xaxis=2 und time wird jetzt in der Achse oben Sekunden minus Anfang des Tages angezeigt
 2. 9.97 : Plazierung des x-Titels der x-Achse bei xaxis=2 auf Normalkoordinaten umgestellt
 2. 9.97 : plot.distance_x2 zur Steuerung des Abstandes Titel-Achse bei x-Achse 2 eingeführt
 2. 9.97 : plot_breite etc. aus der Struktur als wählbaren Parameter entnommen
 3. 9.97 : plot.breite etc. gegen englische Ausdrücke umgetauscht
24. 9.97 : Positionsberechnung für den plot nach get_pos ausgelagert
13.10.97 : Steuerung von Bildnummer und neuer_Seite neu programmiert
14.10.97 : Umsetzen von xn='TIME' nach 'time' nach vorn zur Belegung von xn verschoben, dito für yn
22.10.97 : Steuerung der Legendenausgabe bei Anforderung eines neuen plots verbessert
12.11.97 : Untersuchung von plot.beschriftung count + if-Abfrage eingefügt
18.11.97 : plot.xgap zur Steuerung von gaps bei Zeitreihen eingeführt: wenn Zeit zwischen zwei Punkten größer xgap, wird Linie unterbrochen
22.11.97 : symsize und thick an Legende übergeben
 4.12.97 : bildstep eingeführt zur Steuerung der Legendenausgabe
17.12.97 : linestyle an Legende übergeben
 6. 1.98 : pl_xy bei Aufruf fileles übergeben
10. 1.98 : Diverse Abfragen auf time wurden auf Abfragen von time_units umgesetzt
26. 5.98 : plot.xticks und plot.yticks bei x/y plot benutzt
04.06.98 : if plot.xticks eq 0 then plot.xticks=4 eingeführt, damit bei Zeitreihen maximal 4 Ticks gesetzt werden
03.07.98 : Fehler korrigiert, wenn xaxis1 dann xaxis2 angefordert wird, Zeile 731 (vorher fehlten beide Achsen)
16.09.98 : Steuerung im Zusammenhang mit plotneu an 2 Stellen verbessert
17.09.98 : Steuerung im Zusammenhang mit noerase an 2 Stellen verbessert
08.02.99 : nolabels=1 für time-plot bei xtickname(*)=' ' eingeführt
18.03.99 : alle for-Schleifen mit long variablen
14.04.99 : if-Abfrage in 'if n_elements(position) gt 0 then plot.current_position=position'
07.05.99 : feature icg_struct added
25.05.99 ; ytickname='' kommentiert in Zeile 735, 786
26.05.99 ; xtickformat=plot.xtickformat und ytickformat=plot.ytickformat in Zeile 518 eingefügt,
           damit bei der zweiten geplotteten Achse ytickname genommen wird und nicht ytickformat='emensch' gesetzt wird
27.05.99 : Änderungen im Zusammenhang mit Z-device, Abfragen bezüglich plot.psflag gesäubert
06.06.99 : plot.new=3 : nächsten plot nicht in Legende aufnehmen, aber vorhandene Legenden nicht löschen
18.09.99 ; set_range zur Behandlung des ranges von x,y,sx und sy zugefügt.
23.09.99 ; if fileles or input of x and y vectors are having only one element they are now a vector of two elements
25.04.99 : set_frame added
03.06.00 : plot.spalten+plot.zeilen nach plot.columns+plot.rows umbenannt
03.06.00 : plot=reorganize_plot(plot) eingeführt; setzt plot.zeilen/spalten nach plot.rows/columns um
Aenderungen;;ENDE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Dieses Unterprogramm soll den X/Y-Plot einer X/Y-Datenreihe durchführen.
Dies betrifft :
 Öffnen des Datenfiles
 Finden der x/y-Datenreihe
 oplot der x/y-Werte
 Schließen des Datenfiles
 etc.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plotxy.pro)


PLOTXY_2D

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

 USERLEVEL:
   TOPLEVEL

 NAME:
	plotxy_2d

 PURPOSE:
   This procedure is a combination between plotxy and plot2d

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d,plot,x=x,y=y,z=z,[file=file],[icg_struct=icg_struct],[/time]

 INPUTS:
  plot: The predefined Structure PLOT by get_plot_Struct()

 KEYWORD PARAMETERS:
   x:    The x-Parameter Array or a parameter name from a netCDF file
   y:    The y-Parameter Array or a parameter name from a netCDF file
   z:    The z-Parameter Array or a parameter name from a netCDF file

   file: The name of the netCDF File, if you like to have dirctly access to data in files
   icg_Struct: the defined icg_struct, if used x,y,z hat to be short_names of this structure

   time: If x is a vector of Julian Seconds then with switch time plotxy will show a time formatted X Axis


 OUTPUTS:
   You get a plot on screen or ps file


 EXAMPLE:
   pro ct_test
    data=makez(3,200)
    z=fix(data[2,*]*10)
    x=findgen(200)
    y=sin(x/10.)

   @init
      color_scheme,plot,scheme=1,max_colors=20
   plotinit,plot
     plot.xtitle='X' & plot.ytitle='Y'
     plot.nlevels=0
     defp2d,plot,'levels',findgen(20)
     plot.title='Titel 1'
     plotxy_2d,plot,z=z,x=x,y=y
     page_title,plot,'ct_test'
   plotend,plot
   end

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 5. Oct 1997
 1998-06-15 plot.map_set.axis_label request added
 1999-11-22 intern_x,intern_y,intern_z defined

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotxy_2d.pro)


PLOTXY_2D_D_BSP1_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_2d_d_bsp1_d

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d_d_bsp1_d

 EXAMPLE:
   plotxy_2d_d_bsp1_d
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy_2d\plotxy_2d_d_bsp1_d.pro)


PLOTXY_2D_D_BSP1_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_2d_d_bsp1_e

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d_d_bsp1_e

 EXAMPLE:
   plotxy_2d_d_bsp1_e
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy_2d\plotxy_2d_d_bsp1_e.pro)


PLOTXY_2D_D_BSP1_F

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_2d_d_bsp1_f

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d_d_bsp1_f

 EXAMPLE:
   plotxy_2d_d_bsp1_f
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy_2d\plotxy_2d_d_bsp1_f.pro)


PLOTXY_2D_D_BSP1_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_2d_d_bsp1_g

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d_d_bsp1_g

 EXAMPLE:
   plotxy_2d_d_bsp1_g
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy_2d\plotxy_2d_d_bsp1_g.pro)


PLOTXY_2D_D_BSP1_H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_2d_d_bsp1_h

 PURPOSE:
 

 CATEGORY:
   EXAMPLES/PLOT/PLOT2D

 CALLING SEQUENCE:
   plotxy_2d_d_bsp1_h

 EXAMPLE:
   plotxy_2d_d_bsp1_h
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy_2d\plotxy_2d_d_bsp1_h.pro)


PLOTXY_D_BSP1_A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_a

 PURPOSE:
 
data from netCDF File
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_a EXAMPLE: plotxy_d_bsp1_a gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_a.pro)


PLOTXY_D_BSP1_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_b

 PURPOSE:
 
range is used (data from netCDF File)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_b EXAMPLE: plotxy_d_bsp1_b gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_b.pro)


PLOTXY_D_BSP1_C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_c

 PURPOSE:
 
2 Parameter on 1 Y-Axis (data from netCDF File)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_c EXAMPLE: plotxy_d_bsp1_c gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_c.pro)


PLOTXY_D_BSP1_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_d

 PURPOSE:
 
2 Y axis (data from netCDF File)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_d EXAMPLE: plotxy_d_bsp1_d gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_d.pro)


PLOTXY_D_BSP1_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_e

 PURPOSE:
 
2 plots in rows (data from netCDF File)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_e EXAMPLE: plotxy_d_bsp1_e gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_e.pro)


PLOTXY_D_BSP1_F

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp1_f

 PURPOSE:
 
2 plots connected on X Axis (data from netCDF File)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_f EXAMPLE: plotxy_d_bsp1_f gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_f.pro)


PLOTXY_D_BSP1_N

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy_d_bsp1_n

 PURPOSE:
 
2 Parameter on 1 Y-Axis inserted to a plot with one param
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp1_n EXAMPLE: plotxy_d_bsp1_n

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp1_n.pro)


PLOTXY_D_BSP2_A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_a

 PURPOSE:
   Simple plot - data from variables

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_a

 EXAMPLE:
   plotxy_d_bsp2_a
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_a.pro)


PLOTXY_D_BSP2_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_b

 PURPOSE:
   Simple plot (range is used) - data from variables;
 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_b

 EXAMPLE:
   plotxy_d_bsp2_a
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_b.pro)


PLOTXY_D_BSP2_C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_c

 PURPOSE:
   Simple plot (2 Parameters on 1 y-axis) - data from variables;
 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_c

 EXAMPLE:
   plotxy_d_bsp2_c
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_c.pro)


PLOTXY_D_BSP2_D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_d

 PURPOSE:
   Simple plot ( 2 y-axis) - data from variables

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_d

 EXAMPLE:
   plotxy_d_bsp2_d
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_d.pro)


PLOTXY_D_BSP2_E

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_e

 PURPOSE:
   Simple plot (2 plots in rows) - data from variables

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_e

 EXAMPLE:
   plotxy_d_bsp2_e
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_e.pro)


PLOTXY_D_BSP2_F

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_f

 PURPOSE:
   Simple plot (2 plots connected on x-axis) - data from variables

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_f

 EXAMPLE:
   plotxy_d_bsp2_f
   gif picture 


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_f.pro)


PLOTXY_D_BSP2_G

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_g

 PURPOSE:
 
error_bars are used (data from variables)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_b EXAMPLE: plotxy_d_bsp2_b gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Apr. 9. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_g.pro)


PLOTXY_D_BSP2_H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy_d_bsp2_h

 PURPOSE:
   Simple plot data from icg_Struct

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_h

 EXAMPLE:
   plotxy_d_bsp2_h


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-05-07

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_h.pro)


PLOTXY_D_BSP2_I[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_i

 PURPOSE:
 
assymetrical errors (data from variables)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_b EXAMPLE: plotxy_d_bsp2_b MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Apr. 9. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_i.pro)


PLOTXY_D_BSP2_I[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_i

 PURPOSE:
 
assymetrical errors (data from variables)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_b EXAMPLE: plotxy_d_bsp2_b MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Apr. 9. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotxy_d_bsp2_i.pro)


PLOTXY_D_BSP2_K

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy_d_bsp2_k

 PURPOSE:
 
two X axes
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_k EXAMPLE: plotxy_d_bsp2_k MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-09-23

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_k.pro)


PLOTXY_D_BSP2_L

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy_d_bsp2_l

 PURPOSE:
 
new values on second axis
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_l EXAMPLE: plotxy_d_bsp2_l MODIFICATION HISTORY: Written by: J.Ankenbrand 1999-09-23

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_l.pro)


PLOTXY_D_BSP2_M

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_m

 PURPOSE:
 
test of range(data from variables)
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_m EXAMPLE: plotxy_d_bsp2_m MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Oct-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_m.pro)


PLOTXY_D_BSP2_O

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plotxy_d_bsp2_o

 PURPOSE:
 
How did I use polyfill with plotxy?
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_o EXAMPLE: plotxy_d_bsp1_a gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-12

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plotxy_d_bsp2_o.pro)


PLOTXY_D_BSP2_P

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_p

 PURPOSE:
 
shows formatting of legend
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_d_bsp2_p EXAMPLE: plotxy_d_bsp2_p MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_p.pro)


PLOTXY_D_BSP2_Q

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plotxy_d_bsp2_q

 PURPOSE:
  shows formatting of legend by xp_legend

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   plotxy_d_bsp2_q

 EXAMPLE:
   plotxy_d_bsp2_q



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct. 5. 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\plotxy_d_bsp2_q.pro)


PLOTXY_FZJ_LOGO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   plotxy_fzj_logo

 PURPOSE:
 
shows usage of the fzj logo and plotxy
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_fzj_logo EXAMPLE: plotxy_fzj_logo gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1),1999-May-26

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\fzj_logo\plotxy_fzj_logo.pro)


PLOTXY_Z_BUFFER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   plotxy_z_buffer

 PURPOSE:
 
shows usage of Z buffer with plotxy to write a multiple gif
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: plotxy_z_buffer EXAMPLE: plotxy_z_buffer gif picture MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-May-26

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\z_buffer\plotxy_z_buffer.pro)


PLOT_2C

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot_2c

 PURPOSE:
	This procedure acts like the IDL PLOT command with several useful new keywords:

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	PLOT_2C, [X,] Y

 INPUTS:
	Y:	see IDL PLOT command

 OPTIONAL INPUTS:
	X:	see IDL PLOT command

 KEYWORD PARAMETERS:
	AXIS_COLOR: Color to be used for axes and annotation (default: !P.COLOR)
	/NO_XANNOTATION: If set no annotation of the x axis will be plotted
	/NO_YANNOTATION: If set no annotation of the y axis will be plotted
	/NO_TITLE: If set no title will be plotted
	/NO_SUBTITLE: If set no sub title will be plotted
	/HLINE: horizontal line will be plotted with the following defaults:
		HL_VALUE = 0.0 (e.g. @ y = 0). Entry may also be a vector to plot more than one horizontal line.
		HL_STYLE = 2
		HL_THICK = 1.0
		HL_COLOR = axis_color
	/VLINE: vertical line will be plotted with the following defaults:
		VL_VALUE = 0.0 (e.g. @ x = 0). Entry may also be a vector to plot more than one vertical line.
		VL_STYLE = 2
		VL_THICK = 1.0
		VL_COLOR = axis_color
	/DLINE: arbitrary line will be plotted with the following defaults:
		DL_VALUE = Coordinates of plot to yield 1:1 straight line
		DL_STYLE = 2
		DL_THICK = 1.0
		DL_COLOR = axis_color
	/TIMEAXIS: The x axis is formatted as a time axis with the following optional keyword parameters:
		TIMEFORMAT = tf where tf may be any meaningfull sub string of 'dd.mm.yy hh:mm:ss'
		TIMESTEP = ts (major time intervall in seconds)
		/NO_DATE: If set, no date information is appended to the ticknames even if the
			displayed time range covers a change of date.
	MY_PLOTSTR = my_pls: name of structure with default settings for any number of plot keywords.
	XERR = x_err_data: array of X error bar values.
	YERR = y_err_data: array of Y error bar values.
	/TAX_BREAK: Applies to time axis only. If set, data points which are further apart
		then 1/24 of the data time range are not connected by a line.
	TBREAK_INTV = tbi: Time interval in sec to be used by TAX_BREAK.
	[XY]RANGE = [low, high]:
		low, high can either be float numbers (standard IDL)
		or can be set to !VALUES.F_NAN (NaN). If an entry is
		specified as NaN its translated into a float number
		using the following convention:
		low = MIN(0., MIN(x|y)), high = MAX(0., MAX(x|y))
	/SHARE_AXIS_RANGE: If set x and y axis cover the same data range.
	/XNOZERO:	Same as IDL plot keyword parameter /YNOZERO but for x axis
	MISSING_VALUE = miss_value: Missing data value (Skalar must be of same type as y-data value).
	/OVERPLOT: If set data will be plotted onto previous plot (OPLOT).
	/YTCOLOR: If set the y axis title will be plotted in the color of the data

	any other keywords which are excepted by the IDL PLOT command

 OPTIONAL OUTPUTS:
	X_OFFSET = js_offset: On return js_offset holds the offset of the time axis in Js to adopt
		actual time range to the precision of a floating point number (XRANGE is of type float).

 EXAMPLE:
	see ex_plot_2c.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 16. Dec. 97.
	18.01.1998:	All keyword parameters are passed into _EXTRA
	21.01.1998:	New keyword: NO_XANNOTATION
	09.02.1998:	Handling of false calls to plot_2c
	3./4. 1998:	New keywords: H_LINE, V_LINE and TIMEAXIS
	01.05.1998:	New keyword: MY_PLOTSTR
	08.06.1998:	New keyword: X_OFFSET
	09.11.1998:	New keyword: NO_YANNOTATION
	28.04.1999:	Header edited
	29.04.1999:	Routine tag_defined wurde durch is_tag ersetzt
					Routine concat_str2 wurde durch concat_str mit Keyword /PARSE ersetzt
	30.04.1999:	Removed bug due to missing xtickname, xtickv
	05.05.1999:	Header edited
	06.05.1999:	Automatic setting of [XY]RANGE changed
					New keyword parameter: /XNOZERO, /DLINE
	10.05.1999:	New keyword parameter: MISSING_VALUE
	18.05.1999:	Removed bug when drawing time axis due to presetting js_offset
					with 0.D0 before calling setup_time_axis
	21.05.1999:	Keyword parameter /NO_DATE passed on into setup_time_axis
	21.06.1999:	Keyword parameters TIMEFORMAT = tf and TIMESTEP = ts are now
					passed on into setup_time_axis.
	25.06.1999:	Removed bug when handling missing value.
	20.07.1999:	Removed bug when passing xrange variable into plot_2c in time axis mode.
	29.07.1999:	New keyword parameter: /OVERPLOT
	03.08.1999:	Bug removed when x_data and y_data are scalars.
	26.10.1999:	New keyword parameter: /NO_SUBTITLE
	27.10.1999:	New keyword parameter: YTCOLOR = ytcolor
	28.10.1999:	Bug removed if two positional arguments were passed
					but one was not defined.
	05.11.1999:	Now handles also user-defined symbols.
	08.11.1999:	Now allowed call to plot_2c includes: plot_2c, , y_data
					All but y data of type double are explicetly converted to type float.
	01.12.1999:	Included IDL Graphics Keyword Parameter /NODATA in PRO definition.
					Removed bug when calling plot_2c with keyword parameter /NODATA.
	01.02.2000:	New keyword parameter: /SHARE_AXIS_RANGE
	22.02.2000: Bug removed in call to axis_2c (YRANGE was undefined)
	01.03.2000:	Time axis breaks are now handled correctly if keyword /OVERPLOT is set.
	03.03.2000:	Bug removed if all elements of error vector were !VALUES.F_NAN
	04.04.2000:	Bug removed if keyword parameter 'thick' was quoted together wit a user defined symbol.
	05.04.2000:	Keyword parameter 'thick' will now be passed into error_plot
	12.05.2000:	Changed keyword parameter YTCOLOR = ytcolor to flag /YTCOLOR

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\plot_2c.pro)


PLOT_ALL_COLUMNS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   plot_all_columns

 PURPOSE:
   This function plots all columns of a matrix versus 1 vector

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   PLOT_ALL_COLUMNS, X, Value, Text

 INPUTS:
   Xvalue:     vector of N elements
   Yvalue:     array of [N, M] elements

 OPTIONAL INPUTS:
   Text:   column header(title) for input array

 KEYWORD PARAMETERS:
   MISSING_VALUE:  if set to a single number these values will be excluded from calculation
   PLOT_ROWS, PLOT_COLS    number of rows and columns in plot
   PSFILE:         postscript filename for plotting (def: idl.ps)
   MESSAGE:        if set messages will beprinted
   ERR:            if set to a named variable an error is indicated (OK:0, error:1)
   _EXTRA:         additional keywords can be provided for plot, init_dev, init_mplot

 EXAMPLE:
   nr=100 & nc=3
   v = FINDGEN(nr,nc)+nr*RANDOMU(s,nr,nc)
   plot_all_columns(v[*,0], v, /MESSAGE)

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-DEC-1

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\plot_all_columns.pro)


PLOT_CYCLE

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

 PURPOSE:
   set the position of new plots so that they fill the frame in a given
   order.  New plots cause only a single subframe to be overwritten.  Old
   frames are left for comparison.

 USEAGE:	
   plot_cycle,nx,ny,icycle,i

 INPUT:
   nx       
    number of horizontal frames

   ny
     number of vertical frames 

   icycle
     index array specifying the order frames are overwritten, upper left
     frame is 1.

   i
     index into icycle (incremented after each call)

 OUTPUT: i

 EXAMPLE:	

     !p.multi=[0,1,2]
     f=randata(128,128,s=3)
     tvim,f,/interp
     xw=!x.window & xr=!x.crange
     yw=!y.window & yr=!y.crange
      
     x1=60 & x2=80 & y1=60 & y2=80
     !p.charsize=2
     while y1 gt 0 do begin &$
       plot_cycle,2,4,[5,6,7,8],i &$
       xx=x1+indgen(x2-x1+1) &$
       yy=y1+indgen(y2-y1+1) &$
       contour,f(x1:x2,y1:y2),xx,yy &$
       wait,.5 &$
       curbox,x1,x2,y1,y2,xw,yw,xr,yr,/init,inc=4,/mess &$
     endwhile
      
      

 REVISIONS:

  author:  Paul Ricchiazzi                            date>
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\plot_cycle.pro)


PLOT_GET_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot_get_data

 PURPOSE:
	This routine is used by plot2d, plotxy_2d, plotcell, plot3d to read data from icg_struct to the plot interface

 CATEGORY:
	PLOT/PLOTXY

 CALLING SEQUENCE:
     plot_get_data,PLOT,[x=x],[y=y],[z=z],[file=file],[icg_struct=icg_struct]

 INPUTS:
      plot: the defined plot structure (get_plot_struct()


 KEYWORD PARAMETERS:
       x:          the short name of the x parameter or x data
       y:          the short name of the y parameter or y data
       z:          the short name of the z parameter or y data
       file:       if set the netCDF File name, x,y,z short names belonging to this file
       icg_struct: if set the defined icg struct, x,y,z short names belonging to this structure


 OUTPUTS:
     plot:          the titles are defined
       x:           x parameters
       y:           y parameters
       z:           z parametes

 EXAMPLE:
     plot_get_data,PLOT,x=x,y=y,z=z,file=file,icg_struct=icg_struct

 MODIFICATION HISTORY:
 	Written by:	R.Bauer 1999-Nov-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot_get_data.pro)


PLOT_LABEL

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

 NAME:
   plot_label

 PURPOSE:
	This writes a label on a given frame_fix_position.

 CATEGORY:
   PLOT/PLOTXY

 CALLING SEQUENCE:
   plot_label,plot

 INPUTS:
   plot                 : the defined plot structure



 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Apr-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot_label.pro)


PLOT_N

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
       plot_n

 PURPOSE:
 
Creator for plotxy Scripts reading data from netCDF Files
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: plot_n COMMON BLOCKS: plot_n, interne_struct holds the initializing structure plot_select,pl_sel=pl_sel holds the actual defined plot MODIFICATION HISTORY: R.Bauer 18.5.1997 R.Bauer 28.8.1997 size of colorbar extended R.Bauer 4.9.1997 erste Versuche delOverlay einzufuegen, noch kleine Fehler mit dem xmanager R.Bauer 13.10.1997 included cw_symbols and positionreader for trajectory data R.Bauer 02.01.1998 now 2 x and 2 y axises are available R.Bauer 11.03.1998 Mouse functions now better R.Bauer 25.03.1998 Help for unix now included for PC later R.Bauer 04.10.1999 some parts now handled by read_ncdf

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot_n.pro)


PLOT_PRINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
          PLOT_PRINT


 PURPOSE:
 
          A widget-based interface for creating and printing IDL
          graphics output files.  The widget allows the user to
          select an output device type (PS, PCL, or HP), and specify
          whether or not to use color, the color depth (for PS), the
          plot orientation (landscape or portrait), the size of the
          plot, whether or not to use Vector or PS fonts, the name of
          the file to create, whether to send the file to a printer,
          and the print command.

 CALLING SEQUENCE:
 
          PLOT_PRINT,PLOT_PROCEDURE
 
 INPUTS:
          PLOT_PROCEDURE - A string containing the name of the
                           procedure - or the executable IDL code - that
                           creates the desire graphics. See EXAMPLE
                           below for more details.


 KEYWORD PARAMETERS:
 
          PRINTPARS - a structure of the following form (default
                      values indicated), whose values are used to
                      set the initial value of this quasi-compound widget:

          PRINTPARS={ $
                      device:0, $  ; 0=PS, 1=HP, 2=PCL, 3=CGM
                      psfont:0, $  ; 0=use vector fonts, 1=use PS fonts.
                      color:1, $   ; 0=B&W, 1=color
                      depth:2, $   ; PS resolution: 0=>1, 1=>2, 2=>4, 4=>8.
                      orient:0, $  ; 0=portrait, 1=landscape
                      size:1, $    ; 0=small, 1=large, 2=custom (i.e., use
                                     plotsize)
                      plotsize:[xsize,ysize,xoffset,yoffset], $
                                   ; keyword to the DEVICE command,
                                   ; in inches. only used if size=2.
                      file_name:'idl.ps', $ ; default file name
                      print:1, $   ; 0=print only to file, 1=send to printer.
                      command:'lpr -Plp'} ; print command

          GROUP - the standard GROUP_LEADER keyword, which is passed directly
                  to XMANAGER when the PLOT_PRINT widget is created.

 COMMON BLOCKS:
 
          PLOT_PRINT, plot_printpars
 
                     where plot_printpars = the current state of
                     the printpars structure.

 SIDE EFFECTS:
 
          The returned value of the printpars structure, if passed,
          is changed to reflect the settings changes made by the
          user.  Thus, settings shown in the widget upon subsequent
          calls to plot_print with the same printpars structure will
          show the same settings as the last call to PLOT_PRINT.

 RESTRICTIONS:
 
          Requires widgets.  Requires several programs in the windt
          library, including a modified version of CW_FIELD!
 
          The PLOT_PRINT widget is modal.

 EXAMPLE:
 
         This program is intended to be used from within another
         widget application, where a procedure is already defined
         that creates the graphics.  You can then add a WIDGET_BUTTON
         to this application, labelled "Print", for example, that
         when pressed calls PLOT_PRINT, with the name of the plot
         creation procedure as the input. i.e., pressing the "Print"
         button would execute the IDL code < PLOT_PRINT,"myplot" >.

         For example:

         PRO MYPLOT_EV,event

         widget_control,event.id,get_uvalue=eventval
         if eventval eq 'print' then plot_print,'myplot_plot'
         if eventval eq 'done' then widget_control,event.top,/destroy
         return
         end

         PRO MYPLOT_PLOT

         plot,[1,2],title='My Plot'
         return
         end

         PRO MYPLOT

         base=widget_base(mbar=menubar)
         file=widget_button(menubar,/menu,value='File')
         print=widget_button(file,value='Print...',uvalue='print')
         done=widget_button(file,value='Quit',uvalue='done')
         window=widget_draw(base,xsize=400,ysize=300)
         widget_control,base,/realize
         myplot_plot
         xmanager,'myplot',base,event='myplot_ev'
         return
         end
 
         Of course, you can call the program right from the command
         line too, as in

         IDL> plot_print,'x=vector(0.,!pi,100) & y=sin(5*x) & plot,x,y,/xstyle'

 MODIFICATION HISTORY:
 
         David L. Windt, Bell Labs, March 1997

         May 1997 - Modified use of MODAL keyword to work with
                    changes in IDL V5.0.

         June 1997 - Changed text and field widgets so that it's no
                     longer necessary to hit  after entering
                     text.  But this requires use of the modified
                     CW_FIELD widget.

         January 1998 - Added support for CGM graphics; switched
                        plot_print.device values for HP and PCL
                        output, to be consistent with the SP.PRO
                        routine.

         March 1998 - Made some attempt to include a better default
                      print command for HP-UX and Win95 platforms.

         May 1998 - The user is now prompted before attempting to
                    write over an existing file.

         windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\plot_print.pro)


PLOT_PROBABILITY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  plot_probability

 PURPOSE:
  This procedure plots the cumulative frequency distribution of a data series on probability paper.

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
  plot_probability,plot,x=x

 INPUTS:
  plot: The plot structure defined by pl_init

 KEYWORD PARAMETERS:
  x : data series for which the cumulative frequency distribution should be evaluated

 EXAMPLE:
  plot_probability,plot,x=randomn(seed,300)

 MODIFICATION HISTORY:
  Written by: Franz Rohrer Feb 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\plot_probability.pro)


PLOT_STAMP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   plot_stamp

 PURPOSE:
   writes a time and calling routine stamp

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   PLOT_STAMP

 INPUTS:
   none

 KEYWORD PARAMETERS:
   PSFILE:    filename of the postscriptfile
   PAGE:      page number (integer)
   TOP:       if set stamp on top of page
   BOTTOM:    if set stamp on bottom of page
   DELTA:     distance from margin in normal coordinates
   COLOR:     color of text (def: (black))
   USERNAME:  if set username and host will be printed
   CALLFILENAME: (String scalar) If provided this string is quoted instead of the
              name of the calling procedure. May be usefull if plot_stamp is called
              from within a general plot routine whose name doesn't tell you
              anything about the routine which actually was set up to generate the plot.

 OUTPUTS:
   a stamp on the plot

 EXAMPLE:
   PLOT_STAMP, /TOP, /USERNAME, PAGE=5

 REVISION HISTORY:
   Written   Theo Brauers, June 1997
   Corrected
   Revised   Theo Brauers 1997 Aug  color keyword
             Theo Brauers 1997 Oct 26   output of user and host
             Theo Brauers 1997 DEC 18   _extra, new style
             Theo Brauers 1999 JAN 18   user_at_host + '/'
             Frank Holland 2000 MAY 11: Added keyword parameter CALLFILENAME

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\plot_stamp.pro)


PLOT_S_CLR_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot_s_clr_index

 PURPOSE:
	plot_s_clr_index is a compound widget for the selection of a color
	index. A horizontal color bar is displayed. Clicking on the bar sets
	the color index.

 CATEGORY:
	PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
	Widget = CW_CLR_INDEX(Parent)

 INPUTS:
	Parent:	      ID of the parent widget.

 KEYWORD PARAMETERS:
	COLOR_VALUES: A vector of color indices containing the colors to
		      be displayed in the color bar. If omitted, NCOLORS
		      and START_COLOR specify the range of color indices.
	EVENT_FUNCT:  The name of an optional user-supplied event function.
		      This function is called with the return value structure
		      whenever a button is pressed, and follows the conventions ;		      for user-written event functions.
	FRAME:        If set, a frame will be drawn around the widget.
	LABEL:        A text label that appears to the left of the color bar.
	NCOLORS:      The number of colors to place in the color bar.
		      The default = def_n_colors().
	START_COLOR:  The starting color index, placed at the left of the bar.
	UVALUE:       The user value to be associated with the widget.
	XSIZE:        The width of the color bar in pixels. The default =192.
	YSIZE:        The height of the color bar in pixels. The default = 12.

 OUTPUTS:
       The ID of the created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures with the following definition:

	Event = { CW_COLOR_INDEX, ID: base, TOP: ev.top, HANDLER: 0L, VALUE: c}
	Value is the color index selected.

 PROCEDURE:
	Standard Compound widget.  Use WIDGET_CONTROL, SET_VALUE and GET_VALUE
	to change/read the widget's value.

 EXAMPLE:
	A = WIDGET_BASE(TITLE='Example', /COLUMN)
	B = CW_CLR_INDEX(A, LABEL='Color:')

 MODIFICATION HISTORY:
	DMS,	June, 1993.	Written.
	TAC,	Oct, 1993.	Changed name to plot_s_clr_index
   R.Bauer 1996   removed color indexfield
   1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot_s_clr_index.pro)


PLOT_TEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	plot_text

 PURPOSE:
   This procedure does the annotation of text as title

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   plot_text,plot

 INPUTS:
  plot: The predefined Structure PLOT by pl_init


 OUTPUTS:
  the title is plotted


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-OCT-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\plot_text.pro)


PLOT_VER2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		PLOT_VER2
 VERSION:
		4.0
 PURPOSE:
		Draws 2 plots, vertically spaced, with a possibility of multiple curves
		on each plot.
 CATEGORY:
		Plotting.
 CALLING SEQUENCE:
		PLOT_VER2, [X,] Y0, Y1 [, optional keywords]
 INPUTS:
	Y0
		A numeric vector or 2 dimensional array containing the Y coordinates of
		the data for the top plot.  If Y is a 2-dim.array, each row is ploted
		separately.  It is assumed that the number of points per plot is larger
		than the number of plots so that if Y is an (M*N) array with N > M, it
		will be transposed prior to plotting.
	Y1
		Same as Y0 for the bottom plot.
 OPTIONAL INPUT PARAMETERS:
	X
		A numeric vector containing the X coordinates of the data.  If absent
		it is replaced by the vector [0, 1, 2 ...].
 KEYWORD PARAMETERS:
	RATIO
		Size ratio between top and bottom plot.  Default is 1.
	GAP
		Width of the gap between the plots in character units.  Default is 0.1
	XMARGIN
		Standard IDL plotting interpretation.
	YMARGIN
		Ditto.
	XTYPE
		Ditto.
	YTYPE
		Ditto.  If given as 2-element vector, elements 0 and 1 apply to top and
		bottom plots, respectively.
	YNOZERO
		Ditto.  If given as 2-element vector, elements 0 and 1 apply to top and
		bottom plots, respectively.
	TITLE
		Ditto.
	XTITLE
		Ditto.
	YTITLE
		Ditto.  If given as 2-element vector, elements 0 and 1 apply to top and
		bottom plots, respectively.
	PSYM
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive curves on each plot.
	LINESTYLE
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive curves on each plot.
	COLOR
		Ditto.  If given as a vector consecutive elements are applied to
		consecutive curves on each plot.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses calls to DEFAULT, PLOTOT and PLVAR_KEEP, from
		MIDL.
 MODIFICATION HISTORY:
		Created 30-JUL-1991 by Mati Meron.
		Modified 15-JAN-1994 by Mati Meron.  Now PLOT_VER2 takes advantage of
		the keyword inheritance property and accepts all IDL plotting keywords.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\plot_ver2.pro)


PLTCRV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLTCRV
 PURPOSE:
       Edit curve points with mouse.  Overlay spline.
 CATEGORY:
 CALLING SEQUENCE:
       pltcrv, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         XRANGE=xran   Range to allow in X.
         YRANGE=yran   Range to allow in Y.
           Points are not allowed outside these ranges.
         /XFIX prevents x from being changed.
         /LOG  means plot log Y axis.
         /NORMALIZE  means keep max at 1.0
         X2=x2, Y2=y2  Optional reference curve to plot.
         SPLINE=n  Display n point spline curve.  n must
           be more than the number of elements in x and y.
         SX=sx, SY=sy  Returned spline curve points.
         ERROR=err  Error flag: 0=ok, 1=aborted.
         PLOT keywords also allowed.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Call pltcrv with initial x and y arrays.
         These will be updated on exit.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 13
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1998 May 20 --- Added X and YRANGE.
       R. Sterner, 1998 May 21 --- Fixed blowup if lastx eq last-1x.
       Added /XFIX so x cannot be changed.  Added /LOG.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pltcrv.pro)


PLTSTAMP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  pltstamp

 PURPOSE:
       This procedure is used to create a time stamp on a postcript file

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
       pltstamp,plot

 INPUTS:
       plot:  The plot structure defined by pl_init

PROCEDURE:
      if plot.stamp ge 1 this routine will place an information holding time,
      filename and postscriptname on each postscript file

 EXAMPLE:
       pltstamp,plot

 MODIFICATION HISTORY:
  Written by: Franz Rohrer May 1997

27. 5.97 : plot.beschriftungeingefuehrt; Filenamen werden in PS-Plot ausgegeben, wenn plot.stamp gt 1
15.12.97 : do_page_title,plot eingefügt
19. 1.98 : wenn die Beschriftung aus immer gleichen Angaben besteht, wird nur eine Angabe ausgegeben (programmiert ueber text2)
07.03.98 ; Aufruf do_page_title verschoben, so dass der page_title nur ausgegeben wird, wenn auch ein stamp geschrieben wird

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\pltstamp.pro)


PLURAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PLURAL
 PURPOSE:
       Plural function: returns 's' if arg > 1, else ''.
 CATEGORY:
 CALLING SEQUENCE:
       c = plural(n,s,p)
 INPUTS:
       n = a number.                                       in
       s = optional item to return if singlular (def='').  in
       p = optional item to return if plural (def='s').    in
       c = returned item (def: '' if n is 1, else 's').    out'
 KEYWORD PARAMETERS:
       Keywords:
         /NUMBER means return n as a word: no,one,two,...
           s may be given to change the returned word for 1.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Useful for generating numeric related messages.
       Examples: print,strtrim(n,2)+' cow'+plural(n)
        print,strtrim(n,2)+' '+plural(n,'ox','oxen')
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 14

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\plural.pro)


PLVAR_KEEP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		PLVAR_KEEP
 VERSION:
		4.0
 PURPOSE:
		Saves or restores the values of system variables.
 CATEGORY:
		Input/output.
 CALLING SEQUENCE:
		PLVAR_KEEP, ACTION = ACT [, /RESET]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	ACTION
		Specifies the action to take.  Two possible values, 'SAVE' and
		'RESTORE' (only first three characters count).
	/RESET
		Switch.  Protection bypass.  Normally multiple calls to PLVAR_KEEP are
		counted but no action is taken after the first.  For example, if 3
		consecutive calls with ACTION = 'SAVE' were issued then the system
		variables are saved on the first call and nothing happens on the next
		two.  Then, when calls with ACTION = 'RESTORE' are issued, only the
		third call will have an effect.  This mechanism allows using 'SAVE' and
		'RESTORE' calls as pairs of braces around program sections.  For the
		(rare) cases when one wants to save or restore regardless of previously
		issued calls, setting RESET disables the protection mechanism.
	/SHOW
		Switch.  If set, calls WSHOW to display the graphics window (when
		applicable.
	INDEX
		Optional, the value of the window index to be used with WSHOW.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		M_PLVARS
 SIDE EFFECTS:
		None when used properly.  If the numbers of SAVEs and RESTOREs are not
		equal, either due to an omission or to an error in a called routine,
		the settings won't be restored to their initial state.  In this case
		the cure is to execute
			PLVAR_KEEP, ACTION = 'RESTORE', /RESET
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses a common block (M_PLVARS) to save and restore the values of:
		!P, !X, !Y, !Z, !D.NAME.  Also uses the routines DEFAULT, STRMATCH_MM
		and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created by 15-JUL-1991 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 30-SEP-2001 by Mati Meron.  Added keywords SHOW and INDEX.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\plvar_keep.pro)


PLX_HYPLT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plx_hyplt

 PURPOSE:
       plot a data set of x and y and a histogram of the y values

 CATEGORY:
       PLOT/MPLOT

 CALLING SEQUENCE:
       PLX_HYPLT, x, y, plx=plx, framepos=fpos

 INPUTS:
       plot structure plx (see jx_init for definition)
       2 arrays in x and y

 OUTPUTS:
       a plot of the data set using the settings in the

 PROCEDURE:
       Uses the build-in histogram function

 REVISION HISTORY:
       Written   Theo Brauers, June 1997
       Corrected F.R. jun 97
       Revised   T.B. Jun 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\plx_hyplt.pro)


PLX_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plx_plot

 PURPOSE:
       plot a data set of x and y  using the setting in the
       plot structure plx

 CATEGORY:
       PLOT/MPLOT

 CALLING SEQUENCE:
       PLX_PLOT, X, Y, plx=plx, framepos=fpos

 INPUTS:
       Plx:    plot structure defined in PLX_INIT
       X:      array containing data x
       Y:      array containing data y

 OUTPUTS:
       a plot of the data

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\plx_plot.pro)


PLX_RESET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       plx_reset

 PURPOSE:
       reset the plot structure to default values

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
       Result = PLX_RESET(plx)

 INPUTS:
       plot structure plx

 OUTPUTS:
       plot structure

 REVISION HISTORY:
       Written   Theo Brauers, June 1997
       Corrected
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\plx_reset.pro)


PL_AV_COLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	pl_av_cols

 PURPOSE:
   This routine manages the colors for the colortable.

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   pl_av_cols,plot

 INPUTS:
   The by pl_init predefined structure PLOT

 OUTPUTS:
   plot: defined by pl_init but now c_colors is actualized
   plot.c_colors holds the actual indices for use by a 2D Plot

 EXAMPLE:
   pl_av_cols,plot

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct 5. 1997
   1998-Jul-08 feature multiple color tables added
   1999-Jul-29 feature predefined c_colors_user added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\pl_av_cols.pro)


PL_INIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       pl_init

 PURPOSE:
       This procedure set up the environment structer plot for standardized plotting

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
      pl_init,plot,color_nc,p_colors

 OUTPUTS:
     plot  : structure with plot-options
           (plot2d,plot2d_bar)
           .c_annotation    : The label to be drawn on each contour.
           .c_charsize      : The size of the characters used to annotate contour labels.
           .c_colors        : The color index used to draw each contour.
           .c_lables        : Specifies which contour levels should be labeled.
           .c_linestyle     : The line style used to draw each contour.
           .c_line_color    : predefined
           .c_marker        : If you want to show where in real are values on X
           .c_orientation   : If the FILL keyword is set, this keyword can be set to the angle, in degrees counterclockwise from the horizontal, of the lines used to fill contours.
           .c_spacing       : If the FILL keyword is set, this keyword can be used to control the distance, in centimeters, between the lines used to fill the contours.
           .c_thick         : The line used to draw each contour level.
           .cache_data      : default = 0 if 1 the last data of the last plot are cached
           .cache_clear     : default = 0 if 1 the cache will be cleared before taking new data
           .cbar            : flag to get colorbar or not
           .cbar_labels     : Specifies which color in the colorbar shold be labeld
           .cbar_min_value  : The minimum value for the colorbar
           .cbar_max_value  : The maximum value for the colorbar
           .cbar_spacing    : The space between colorbar and the axis
           .cbar_title      : The title of the colorbar
           .cbar_position   : The position 'right','left','top','bot' of the colorbar
           .cbar_values     : needed by nlevels>0 , the contourlabels
           .cbar_width      : The width of the colorbar
           .closed          : Set this keyword to close contours that intersect the plot boundaries.
           .downhill        : Set this keyword to label each contour with short, perpendicular tick marks that point in the "downhill" direction, making the direction of the grade readily apparent.
           .fill            : Set this keyword to produce a filled contour plot.
           .follow          : In IDL version 5, CONTOUR always uses a line-following method.
           .framethick      : The thickness of the frames (x and y axis and the colorbar)
           .irregular       : Set this keyword to indicate that the input data is irregularly gridded.
           .levels          : Specifies a vector containing the contour levels drawn by the CONTOUR procedure.
           .max_value       : Data points with values equal to or above this value are ignored (i.e., treated as missing data) when contouring.
           .min_value       : Data points with values less than this value are ignored (i.e., treated as missing data) when contouring.
           .nlevels         : The number of equally spaced contour levels that are produced by CONTOUR. If it is not 0 the levels will be ignored
           .xgridstyle      : The gridstyle of a x axis
           .xstyle          : The style of a x axis
           .ygridstyle      : The gridstyle of a y axis
           .ystyle          : The style of a y axis
           .zstyle          : The style of a possible z axis
           .ztitle          : The title of the z dataset
 = =  = = = = = = = =  = = = = = === = = = = = == === ==  == = = = == =
 (plotxy und plot2d)
           .psflag     : 0:Bildschirmausgabe  1:PS-File   2:EPS-File
           .landscape  : 0:portrait    1:landscape    2:portrait quadratisch
           .stamp      : im PS-File  0:keine Ausgabe  1:Ausgabe von Programmnamen/Datum/PSFile  2:zus„tzliche Ausgebe der beteiligten Filenamen
           .xrange     : Bereich der x-Werte           -999 : MIN/MAX aus Datenreihe nehmen
           .xtitle     : Titel fr die x-Achse         ''   : wird aus Datenfile genommen
           .sprache    : Sprache fr den x/y-Titel     d    : deutsch  e:englisch
           .new        : 0:oplot ausfhren  1:neuen plot ausfhren  2:oplot ausfhren, keine Legende
           .xaxis      : 0:normale Achse , 1:nur Achse unten 2:nur Achse oben
           .xtype      : 0:normale Achse , <>0 logarithmische Achse (wenn nicht Zeitachse)
           .yaxis      : 0:normale Achse , 1:Achse links 2:Achse rechts
           .ytype      : 0:normale Achse , <>0 logarithmische Achse (wenn nicht Zeitachse)
           .grid       : 0:kein Grid  1:Grid bei Haupteinteilung
           .timeformat : legt Ausgabeformat der Zeitachse fest, Voreinstellung bei Uebergabe '' ist !h$:m$:s$@!d$.nn$.Y$
           .x_interstice: to adjust the space between to plots
           .y_interstice: to adjust the space between to plots

       color_nc : structure with predifined color indices (should be used instead pconst_xxx)
       p_colors : array containing information about color-names and indices (for internal use in plot-widget)

 SIDE EFFECTS:
         !p.thick    is set to 1
         !p.charsize is set to 1
         !x.charsize is set to 1
         !y.charsize is set to 1
 EXAMPLE:
           @init
           plotinit,plot
           plotxy,plot,x=[0,1],y=[0,1]
           plotend,plot

 MODIFICATION HISTORY:
       Written         Franz Rohrer, June 1997
       Corrected
21. 4.97 : plot.symsize von 1 auf 1. gesetzt
21. 4.97 : plot.zeilen von 1. auf 1 gesetzt
21. 4.97 : plot.spalten von 1. auf 1 gesetzt
21. 4.97 : plot.linestyle eingefuehrt
21. 4.97 : Definition des str-Feldes p_colors eingefuehrt, das jeweils die gueltigen Farben mit ihren Namen enthalten soll
22. 4.97 : plot.window eingefuehrt, bestimmt im Screen-Modus die Nummer des aktiven Fensters
23. 4.97 : plot.xtype und plot.ytype eingefuehrt
27. 4.97 : Aufruf von debug eingefuehrt
12. 5.97 : plot.grid eingefuehrt
20. 5.97 : plot.xticks fuer JSPLOT-Aufruf in Plotxy eingefuehrt
22. 5.97 : !version auch auf WIN95 eingerichtet
22. 5.97 : Farben violett und orange eingefuehrt
22, 5.97 : plot.legend_name eingefuehrt, soll im Fall, dass es gesetzt wurde, in die Legende anstatt long_name eingesetzt werden
27. 5.97 : plot.beschriftung eingefuehrt; Filenamen werden in PS-Plot ausgegeben, wenn plot.stamp gt 1
29. 5.97 : timeformat eingefuehrt
18. 6.97 : legend_position : 0:Links oben neben dem Plot 1:rechts oben im plot
 1. 7.97 : Yaxis 0,1,2 eingefuehrt  0:Box-Style Achse links 1:Achse rechts 2:Achse links
29. 7.97 : xtitle,ytitle zu Feldern gemacht, so dass jetzt auch geschachtelte plots mit mehreren Achsenbezeichnungen m÷glich sind
 1. 8.97 : current_charsize : aktueller charsize des plot's (aus plotxy) zur Uebergabe an andere Programme
 1. 8.97 : current_position : aktuelle Positon des plot's (aus plotxy) zur Uebergabe an andere Programme
20. 8.97 : neue Farben nach Vorgabe von Oliver eingefuehrt
29. 8.97 : plot.xtype und plot.ytype als Felder eingefuehrt
 2. 9.97 : distance_x2 als Abstand des x-Titels der x-Achse 2 zur Achse in Zeilen
 2. 9.97 : plot_breite etc. in die Struktur als waehlbaren Parameter uebernommen
 2. 9.97 : Struktur colors_ncdf in color_nc umbenannt, color_nc als ersatz fuer pconst_xxx aufgebaut, Belegung von p_colors(1,*) automatisiert
 3. 9.97 : xrange und yrang vom fltarr zum dblarr deklariert, damit xrange bei Zeitachse genau genug ist
 3. 9.97 : plot.breite etc. gegen englische Ausdruecke umgetauscht
10. 9.97 : pconst_white eingefuehrt
11. 9.97 : tickv und tickname auf 25 Eintraege pro Achse geaendert
30. 9.97 : all indicated tags by plot2d and plot2dbar added
18.11.97 : plot.xgap zur Steuerung von gaps bei Zeitreihen eingefuehrt: wenn Zeit zwischen zwei Punkten gr÷˜er xgap, wird Linie unterbrochen
19.11.97 ; x_interstice and y_interstice added
20.11.97 : page_title etc. eingefuehrt
21.11.97 : xgap von double(3600*24) auf double(3600.*24.) gesetzt
22.11.97 : symsize und thick zur Uebergabe an Legende vorbereitet
12.12.97 : Voreinstellung plot.window von 0 auf 1 geaendert
17.12.97 : linestyle zur Uebergabe an Legende vorbereitet
22.12.97 : cbar_boxstyle eingefuehrt umzeichnet jedes einzelne Farbkaestchens des Farbbalkens
30.12.97 : cbar_labels_format erlaubt die Formatierung z.B. mit 'F6.2' der Labels am Farbbalken
30.12.97 : cbar_labels_align fuer die Ausrichtung der Labels am Farbbalken ('r)igh','l)eft','c)enter')
30.12.97 : cbar_labels_step mit Beginn und Schritt variable Bezeichnung des Farbbalkens m÷glich
30.12.97 : cbar_show_max_value um den echten H÷chstwert am Farbbalken zu zeigen
30.12.97 : x_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
30.12.97 : y_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
30.12.97 : z_use_units wird von nc_read_p und cache verwendet um direkt Daten auf andere Einheiten umzurechnen
11.01.98 : charsize_norm_factor zur Normierung der Schriftgroesse eingefuehrt
14.01.98 : plot.legend_framepostion und plot.legend_align eingefuehrt  mb
18.05.98 ; Struktur map_set fuer plotmap implementiert
25.05.98 ; yticks eingefuehrt
26.05.98 ; xticks und yticks auf 0 gesetzt
16.07.98 ; active_color_scheme: und color_table_positions: definiert wird fuer die Benutzung von mehreren gleichzeitig definierten colortables benoetigt
         ; active_color_table: der index des zu benutzenden colortables entspricht der Reihenfolge des Uebergabefeldes von color_scheme,plot,scheme_code=[1,2]
         ; color_table_positions: ist ein 2D-Feld der Laenge n colortables das die jeweiligen Start und Endpositionen der Farbsysteme enthaelt (wird von color_scheme definiert)
13.08.98 ; if def_n_colors() gt 256 then message,'Number of colors ('+strtrim(string(def_n_colors()),2)+') greater than 256'
         ; av_colors=def_n_colors()-1<255
1999-Feb-05; because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
1999-Mar-03: legend_title added
1999-Mar-29: plot.plot_frameposition added; FR
1999-May-05: plot.cbar_show_minvalue:1  default 1 to show lower value on plot2d_bar
1999-May-27: FR clolor_nc mit in plot-Struktur übernommen
24.09.1999 : legend_charsize :1. eingeführt, FR
21.10.1999 : plot=get_plot_struct() eingeführt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\pl_init.pro)


PL_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	pl_test

 PURPOSE:
	This procedure is an example for the use of icgsym_n
       It will create a PS file and launchs ghostview to view it

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   pl_test



 EXAMPLE:
   pl_test

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\pl_test.pro)


PM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PM

 PURPOSE:
       Shorthand way of setting !p.multi.

 CALLING SEQUENCE:
       PM,1,2

 INPUTS:

 OPTIONAL INPUTS:
   row     Sets number of plots per row
   col     Sets number of plots per col

 OUTPUTS:

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES

 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/03/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pm.pro)


PMATCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PMATCH
 PURPOSE:
       Find a given pattern in a 1-d array.
 CATEGORY:
 CALLING SEQUENCE:
       pmatch, s, p, in
 INPUTS:
       s = array to search.         in
       p = pattern array.           in
 KEYWORD PARAMETERS:
       Keywords:
         /ALL means return index of all matches, else just first.
 OUTPUTS:
       in = index of match.         out
          -1 means no match found.
 COMMON BLOCKS:
 NOTES:
       Notes: useful if you need to find a sequence of values
         occuring somewhere in an array.  Longer pattern
         arrays give slower searches.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Apr 30

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pmatch.pro)


PMOD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PMOD
 PURPOSE:
       Find the positive modulo value of a number.
 CATEGORY:
 CALLING SEQUENCE:
       out = pmod(in,m)
 INPUTS:
       in = input value (may be an array).   in
       m = divisor.                          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = Remainder of in divided by m.   out
 COMMON BLOCKS:
 NOTES:
       Notes: output is always in the range 0 to m-1.
         To see the difference between mod and pmod try:
         plot,(indgen(500)-250) mod 50, yran=[-60,60]
         plot,pmod(indgen(500)-250, 50), yran=[-60,60]
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 12

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pmod.pro)


PMOM

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  pmom

 PURPOSE:  compute legendre moments of scattering phase function

 USEAGE:   pmom,mu,phase,nm,pm,f,view=view,angcut=angcut,deltam=deltam

 INPUT:    

   mu      cosine of polar angle, in range -1, 1 

   phase   phase function at each polar angle, normalization is arbitrary
           
           NOTE: the accuracy of the integration depends on the
                 number of values provided for mu and phase.  For
                 example, 10000 steps were required to obtain better
                 than 1% accuracy for all 21 moments of the
                 Henyey-Greenstein function with g=0.7.  More steps
                 may be required when higher moments or more sharply
                 peaked functions are considered.  Since a simple
                 trapazoidal integration is used, a uniform spacing
                 in mu is desirable.

   nm      number of of legendre moments. moments are numbered from 0 to nm
           for a total of nm+1 values.

 KEYWORD INPUT

   view    if set, PMOM draws a plot of the original phase function,
           the truncated phase function (if angcut is set), and the
           legendre fit to the (possibly truncated) phase function.

   angcut  if set, forward scattering peak of the phase function will
           be truncated as,

             angle > angcut:  phase = original phase function

             angle < angcut:  phase = extrapolation of phase function from
                                      last two points with angle > angcut

   deltam  use the deltam method of wiscombe, 1977, JGR 34 1408-1422 
           shape of truncated part of phase function determined by 
           highest included legendre polynomial.

 OUTPUT:

   pm      legendre moments (nm+1) values

   f       when angcut or deltam is set, a part of the forward 
           scattering peak is lopped off.  1-f is the ratio of
           the total scattering without and with the truncated
           portion of the phase function, i.e.,

             f=  1 - integral( phase_truncated dmu)/ integral( phase dmu)

           The f factor should be used to rescale the optical depth,
           dtau, and single scattering albedo, w (Wiscombe, 1977):

             dtau'= dtau*(q_ext*w*(1-f) + (1-w)q_ext)/q_ext

             dtau'= dtau*(1-w*f)

             w' = q_ext*w*(1-f)/(q_ext*w*(1-f)+(1-w)*q_ext)

             w' = w*(1-f)/(1-w*f)

           For phase functions with large forward scattering, 1-f << 1


 DISCUSSION:
   This procedure generates legendre moments of an arbitrary
   function defined in the range -1 to 1.  These coefficients are
   the input quantities required by DISORT for the specification of 
   of scattering phase function or BRDF.  The output quantity, pm,
   is defined as,

           /                      /  /
   pm(i) = | f(mu) P(i,mu) d mu  /   | f(mu) d mu
           /                    /    /

   where P(i,mu) is the legendre polynomial, f is the phase function, and
   the range of the integrals are from -1 to 1.


 LIMITATIONS:

   Some phase functions may require an impractically large number 
   of moments to resolve the forward scattering peak.  In these cases
   it may be desirable to lop off the forward peak using the ANGCUT
   or DELTAM keyword parameters, in order to fit the phase function
   with fewer legendre moments.  If this is done, be sure to also
   rescale optical depth and single scattering albedo, as discussed
   above, in the radiative transfer model.
   

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  find moments of Henyey-Greenstein phase function
           The analytic result has pmom=1/g^indgen(nm+1)
           
           ns=10000 & g=.85 & nm=20

           mu=findrng(-1,1,ns)
           phase=(1.-g^2)/(1.+g^2-2*g*mu)^1.5
           !p.multi=[0,1,2]
           pmom,mu,phase,nm,pm,f,/view
           print,f='(a/(10f8.4))','pmom',pm(1:*)
           print,f='(a/(10f8.4))','pmom/g^i',pm(1:*)/g^(1+indgen(nm))
           pmom,mu,phase,nm,pm,f,/deltam,/view
           print,f='(a/(10f8.4))','pmom',pm(1:*)
           print,f='(a/(10f8.4))','pmom/g^i',pm(1:*)/g^(1+indgen(nm))


 EXAMPLE:  find moments of Rayleigh scattering phase function
           the analytic result has pmom(0)=1 and pmom(2)=.1
           
           ns=1000 & nm=10

           mu=findrng(-1,1,ns)
           phase=(1.+mu^2)
           pmom,mu,phase,nm,pm
           print,f='(a/10f8.4)','pmom',pm

           phs=phase<0.
           norm=integral(mu,phase)
           for i=0,nm do phs=phs+.5*norm*(2*i+1)*pm(i)*legendre(i,mu)
           plot,mu,phase
           oplot,mu,phs

 AUTHOR:   Paul Ricchiazzi                        29 Jul 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pmom.pro)


PNTS_NEAR

[Previous Routine] [Next Routine] [List of Routines]
 routine:       pnts_near
 purpose:       return index array of points within radius

 useage:        pnts_near,plon,plat,lonrng,latrng,nx,ny,radius,ii,nc

 input:
   plon         longitude of point
   plat         latitude of point
   lonrng       longitude range (two element vector)
   latrng       latitude range
   nx           number of points across lonrng
   ny           number of points across latrng
   radius       radius of region
 
 output:
   ii           index array of point within disk
   nc           number of points within disk

  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pnts_near.pro)


POINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POINT
 PURPOSE:
       Plot a filled point at given position.
 CATEGORY:
 CALLING SEQUENCE:
       point, x, y, [z]
 INPUTS:
       x,y = position of point.  May be arrays.   in
       z = optional z coordinate (def=0).         in
         If z is given /T3D must also be used.
 KEYWORD PARAMETERS:
       Keywords:
         SIZE=sz     Size of point symbol (like symsize).
         COLOR=clr   Fill color.
         OCOLOR=oclr Outline color (def=COLOR).
         THICK=thk   Outline thickness (def=1).
         /DATA       Use data coordinates (default).
         /DEVICE     Use device coordinates.
         /NORMAL     Use normalized coordinates.
         /CLIP	clip to clipping window.
         /T3D        Use 3-d coordinate system.
 OUTPUTS:
 COMMON BLOCKS:
       point_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Aug 17

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\point.pro)


POINTER

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  pointer

 PURPOSE:  

 USEAGE:   pointer,x,y,a,size=size,vsize=vsize,color=color, $
              norm=norm,subnorm=subnorm,device=device,scale=scale

 INPUT:    

   x       x coordinate values (default data coordinates)

   y       y coordinate values

   a       angle of pointer (increases clockwise, zero is up)
           "a" may be set to atan(xvec,yvec) where xvec and yvec 
           are vector components in the x and y directions.

 KEYWORD INPUT:
   size    size of circle part of pointer symbol in character units (scalor)

   vsize   size of arrow part of pointer symbol in character units
           or in data units (if scale set). If VSIZE is not set it
           is set to a 3 times the radius of the circle part of the 
           pointer symbol.  VSIZE can be specified as a scalor or
           vector of values.

   scale   if non-zero the size of the arrow part of the pointer
           symbol is scaled to the units used for the vertical axis,
           multiplied by the value SCALE.  For example, if the units
           of the vertical axis is degrees latitude then setting
           SCALE to 111.2 causes VSIZE to be interpreted as
           kilometers.

   norm    x and y in normalized coordinates

   subnorm x and y in subnormalized coordinate (0 - 1 in plot frame)

   device  x and y in device coordinates

 OUTPUT: none
  
 EXAMPLE:  

           map_set3,0,0,/cont
           lon=findrng(-180,180,20)
           lat=findrng(-90,90,15)
           gengrid,lon,lat
           x=randata(20,15,s=4)
           y=randata(20,15,s=4)
           pointer,lon,lat,atan(x,y)

 AUTHOR:   Paul Ricchiazzi                        01 Mar 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pointer.pro)


POINTER_IS_VALID_AND_DEFINED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	pointer_is_valid_and_defined

 PURPOSE:
	Use this function to test if a pointer is valid and the corresponding
	heap variable is defined.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = pointer_is_valid_and_defined(pointer)

 INPUTS:
	pointer: pointer to be tested (scalar or array of pointers)

 OUTPUTS:
	This function returns 1 if the pointer is valid
	and if the corresponding heap variable is defined. Otherwise 0 is returned.
	If an array of pointers was passed then an array of 1's and 0's is returned.

 EXAMPLE:
	a = PTR_NEW(3)
	PRINT, pointer_is_valid_and_defined(a) --> 1

	b = PTR_NEW(/ALLOCATE_HEAP)
	PRINT, pointer_is_valid_and_defined(b) --> 0 (Heap variable undefined)

	c = PTR_NEW()
	PRINT, pointer_is_valid_and_defined(c) --> 0 (NULL pointer)

	PRINT, pointer_is_valid_and_defined([a, b, c]) --> 1  0  0

	PTR_FREE, a, b, c (Free pointers)

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 29.11.1999
	16.03.2000:	Function returns 0 if input is not of type pointer

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\pointer_is_valid_and_defined.pro)


POINTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POINTS
 PURPOSE:
       Convert from size in points to IDL charsize or pixels.
 CATEGORY:
 CALLING SEQUENCE:
       sz = points(n)
 INPUTS:
       n = Size in points (1/72 inch).            in
 KEYWORD PARAMETERS:
       Keywords:
         /PIXELS means convert from size in points to size
           in pixels.  Returned value sz is then a 2 element
           array: [nxpix, nypix].
         /NORMALIZED means convert from size in points to size
           in normalized coord.  Returned value sz is then a
           2 element array: [dx, dy].
 OUTPUTS:
       sz = Value for IDL charsize.               out
 COMMON BLOCKS:
 NOTES:
       Notes: Should be very close for PS Helvetica.
         Not well tested with other fonts.  Assumes
         character font size is the distance in points
         from the bottom of the descenders to the top
         of capital letters in units of 1/72 ".
 MODIFICATION HISTORY:
       R. Sterner, 27 Jul, 1993
       R. Sterner, 1998 Feb 5 --- Added /NORMALIZED keyword.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\points.pro)


POLAR_HISTOGRAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   polar_histogram

 PURPOSE:
   This function plots a histogram in polra coordinates

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   POLAR_HISTOGRAM, Yvalue

 INPUTS:
   Yvalue:     array of data with angles in DEGREES [0...360.]

 KEYWORD PARAMETERS:
   BINSIZE     size of bins in DEGREES
   OFFSET      offset to turn the histogram in DEGREES
   NORTH_ZERO  eq to OFFSET=90. (wind histogram)
   CLOCK_WISE  clock wise (meteorological) instead of CCW (mathematical)
   ISO_LINES   array of values where isolines(circles) should appear
   ISO_LINE_COLOR  color of isolines
   ISO_LINE_THICK  thickness of iso lines
   ISO_DOTS    array of values where dotted isolines(circles) should appear
   POLY_FILL   fillpattern for histogram area
   ARROWS      if set arrow are plotted as axis
   ARROW_LENGTH    length of arrow in terms of rmax
   RMAX        maximum radius
   _EXTRA      transports more keywords to PLOT, /POLAR

 EXAMPLE:
   b = RANDOMU(s, 5000)* 360.
   polar_histogram, b, /NORTH, ISO_D=FINDGEN(10)*20, /POLY_FILL $
       , RMAX=200, /ARROWS, ARROW_L=.9, /XST, /yst, ORIENT=45

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-DEC-1

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\polar_histogram.pro)


POLAR_ORTHO

[Previous Routine] [Next Routine] [List of Routines]
 routine          polar_ortho
 input:
   alat           latitude array
   alon           longitude array
   outer_lat      outer latitude limit

 output:
   xn       x coordinate to which (alat,alon) maps (normalized 0-1)
   yn       y coordinate to which (alat,alon) maps (normalized 0-1)

 purpose:         use this map projection procedure with regrid.pro

 EXAMPLE:

; polar projection
  
  window,/free,xs=400,ys=1000
  !p.multi=[0,1,3]
  latrng=[30,70] & lonrng=[-110,-70] & nnx=200 & nny=150
  alon=(float(c)-min(float(c)))/(max(float(c))-min(float(c)))
  alat=(imaginary(c)-min(imaginary(c)))/(max(imaginary(c))-min(imaginary(c)))
  alon=lonrng(0)+(lonrng(1)-lonrng(0))*alon
  alat=latrng(0)+(latrng(1)-latrng(0))*alat
  im=sqrt(abs(sin(alon*!pi)*sin(alat*!pi)))^.3
  tvim,im,/scale,title='image'
  contour,alat,/overplot,levels=[40,60],thick=4,color=0
  contour,alon,/overplot,levels=[-100,-80],thick=4,color=0

  regrid,alat,alon,nnx,nny,kx,ky,proj='polar_ortho',extras=30,degree=2
  imm=poly_2d(im,kx,ky,0,nnx,nny,missing=0)
  tvim,imm,/scale,xr=[-5517,5517],yr=[5517,5517],title='regrided image, d=2'

  regrid,alat,alon,nnx,nny,kx,ky,proj='polar_ortho',extras=30,degree=3
  imm=poly_2d(im,kx,ky,0,nnx,nny,missing=0)
  tvim,imm,/scale,xr=[-5517,5517],yr=[5517,5517],title='regrided image, d=3'
  
 AUTHOR:       Paul Ricchiazzi    feb94 
               Earth Space Research Group, UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\polar_ortho.pro)


POLEVAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		POLEVAL
 VERSION:
		4.0
 PURPOSE:
		Evaluates a polynomial function according to the formula:
			F = c(0) + c(1)*X + ... + c(n)*X^N
		Similar to the library routine POLY.  The difference is that when the
		keyword QUOTIENT is used, the routine returns, in QCOEF, the values of
		the coefficients of the quotient polynomial.  In other words, given the
		coefficients of a polynomial P, and a value Xc, the function returns
		the value P(Xc), and in QCOEF are returned the coefficients of the
		polynomial Q(X) = P(X)/(X - Xc).  Note that unless P(Xc) is 0, the
		division has a remainder.
 CATEGORY:
		Mathemetical function (general).
 CALLING SEQUENCE:
		Result = POLEVAL( X, COEF [, QUOTIENT = QCOEF])
 INPUTS:
	X
		Numeric, otherwise arbitrary.
	COEF
		Numeric vector.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	QUOTIENT
		An optional output parameter.  See below.
 OUTPUTS:
		Returns the value of the polynomial at X.  The result has the same
		structure and number of elements as X and the same type as the higher
		of X and COEF.
 OPTIONAL OUTPUT PARAMETERS:
	QUOTIENT
		The name of the variable to receive the quotient polynomial.  The
		quotient is an array with one more dimension than X.  For example, if
		X is given as an array with dimensions (10,8,64) and the order of the
		polynomial is 4 then the dimensions of the quotient will be (10,8,64,4).
		QCOEF(4,5,6,*) will then contain the coefs. of P(X)/(X - X(4,5,6)), etc.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Standard Horner evaluation.  Uses the functions DEFAULT and FPU_FIX
		from MIDL.
 MODIFICATION HISTORY:
		Created 15-NOV-1991 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\poleval.pro)


POLREC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POLREC
 PURPOSE:
       Convert 2-d polar coordinates to rectangular coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       polrec, r, a, x, y
 INPUTS:
       r, a = vector in polar form: radius, angle (radians).  in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       x, y = vector in rectangular form.                     out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 13 Feb, 1991 --- added /degrees.
       1999 May 03 --- Made double precision.  R. Sterner.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\polrec.pro)


POLREC3D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POLREC3D
 PURPOSE:
       Convert vector(s) from spherical polar to rectangular form.
 CATEGORY:
 CALLING SEQUENCE:
       polrec3d, r, az, ax, x, y, z
 INPUTS:
       r = Radius.              in
       az = angle from Z axis.  in
       ax = angle from X axis.  in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angles are in degrees, else radians.
 OUTPUTS:
       x = x component.         out
       y = y component.         out
       z = z component.         out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 31 Aug, 1989 --- converted to SUN.
       RES 13 Feb, 1991 --- added /degrees.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\polrec3d.pro)


POLYSTAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POLYSTAT
 PURPOSE:
       Compute polygon statistics (# vertices, area, perimeter).
 CATEGORY:
 CALLING SEQUENCE:
       polystat, x, y, s
 INPUTS:
       x,y = polygon vertices.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = statistics.           out
         s = [n_vertices, area, perimeter].
 COMMON BLOCKS:
 NOTES:
       Notes: See also convexhull.
 MODIFICATION HISTORY:
       R. Sterner, 30 Oct, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\polystat.pro)


POLY_FIT2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POLY_FIT2
 PURPOSE:
       Returns fitted Y values for each given X value.
 CATEGORY:
 CALLING SEQUENCE:
       yfit = poly_fit2(x, y, ndeg)
 INPUTS:
       x, y = curve points to fit.		in.
       ndeg = degree of polynomial to fit.	in.
 KEYWORD PARAMETERS:
       Keywords:
         XFIT=xfit  X values for fitted Y (def=x).
 OUTPUTS:
       yfit = fitted Y values for each X.	out.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 13 Oct, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\poly_fit2.pro)


POLY_FIT_ORTHO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        POLY_FIT_ORTHO

 PURPOSE:
        Perform a least squares polynomial fit using orthonormal polynomials
   and return a vector of coefficients of length NDEGREE + 1.

   As an alternative to the IDL function POLY_FIT, POLY_FIT_ORTHO is capable
   of performing very high degree polynomial fits (exact fits are possible)
   to an independent variable Y-vector using an arbitrary independent
   variable X-vector. The function POLY_FIT is more limited in spanning
   possible values of NDEGREE and X.

   Execution time can be optimized for repeated calls to POLY_FIT_ORTHO
   when the independent variable X vector remains the same between calls.

   Other IDL curve fitting routines include SVDFIT, which uses Singular Value
   Decomposition and allows the user to specify the bases used to perform the fit,
   POLYFITW, which performs a weighted least squares fit and CURVEFIT which uses a
   gradient-expansion algorithm to compute a non-linear least squares fit to a
   user-supplied function.

 CATEGORY:
        Curve fitting.

 CALLING SEQUENCE:
   C = POLY_FIT_ORTHO( X, Y, NDEGREE, [YFIT, POLYVAR, SIGMA, Corrm,] TYPE=TYPE,$
                       ORPOLY=ORPOLY, XINTERP=XIN, YINTERP=YIN, INPOLY=INPOLY,$
                       C_O=C_O, C_X=C_X, C_T=C_T, XAVG=XAVG,XRANGE=XRANGE,$
                       QX=QX, QT=QT, RMS=RMS, STD=STD, FIT=FIT, DOUBLE=DOUBLE.$
                       WARNMSSG=WM )

 EXAMPLE:
    X = FINDGEN(101)
    Y = SIN(12.*!PI*X/100.) + RANDOMN(SEED, 101)
    NDEGREE = 19
    YFIT = POLY_FIT_ORTHO(X, Y, NDEGREE, /FIT)
    PLOT, X, Y, LINESTYLE = 1
    OPLOT, X, YFIT, THICK = 2
    END


 INPUT:
   X:  The independent variable vector of the same length as Y or longer.
       If there are more elements in X than Y, then only the first N_ELEMENTS(Y)
       elements in X are used.

        Y:        The dependent variable vector of the same length as X.
       If there are more elements in Y than X, then an error will occur.

   NDEGREE:  The degree of the polynomial fit.

 OUTPUT:
        POLY_FIT returns a coefficient vector of length NDEGREE + 1.
   If the keyword FIT is specified and non-zero then POLY_FIT
   returns the polynomial fit vector, YFIT, which is removed from
   argument list.


 OPTIONAL OUTPUT:
   YFIT:  Set on output to the polynomial fit vector of the same length as Y.

   POLYVAR: Set on output to the distribution of variance in Y explained versus
            degree of polynomial 0,...,NDEGREE where POLYVAR[0] includes the average
            value of Y while  POLYVAR[J] J = 1, ..., NDEGREE is a monotonic sequence
            with POLYVAR(NDEGREE) approaching the variance of Y
            as NDEGREE increases toward N_ELEMENTS(Y) - 1.

   SIGMA: Set on output to a vector of length NDEGREE + 1 containing error
          estimates of the return coefficients.

   Corrm: This argument is ignored by POLY_FIT_ORTHO and is present
          to ensure that previously valid calls to POLY_FIT are compatible.

 KEYWORD PARAMETERS:

   TYPE:  If this keyword is present then ...
   TYPE=0 (default) leads to POLY_FIT_ORTHO returning
          coefficient vector C_O of length NDEGREE + 1 where
          YFIT = C_O[0] * ORPOLY[*,0] + . . . + C_O[NDEGREE] * ORPOLY[*,NDEGREE]

   TYPE=1 leads to POLY_FIT_ORTHO returning
          coefficient vector C_X of length NDEGREE + 1 where
          YFIT = C_X[0] * X^0 + . . . + C_X[NDEGREE] * X^NDEGREE

   TYPE=2 leads to POLY_FIT_ORTHO returning
          coefficient vector C_T of length NDEGREE + 1 where
          YFIT = C_T[0] * T^0 + . . . + C_T[NDEGREE] * T^NDEGREE
          and T = (X - XAVG) / XRANGE

   ORPOLY: Keyword set on output to an N_ELEMENTS(Y) x NDEGREE+1 array
           containing the orthonormal polynomials evaluated at X.
           The rows contain the polynomial vectors, so ORPOLY[*,0] is
           the 0th degree polynomial, ORPOLY[*,1] is the 1st degree (linear)
           polynomial, ORPOLY[*,2] the 2nd degree (quadratic) polynomial, and so on.

   XINTERP: Keyword set on input to a vector of additional independent
            variable values for calculation of the polynomial fit.
            For predictable results, the values of XINTERP should be
            bounded such that
            MIN(X) LE MIN(XINTERP) and MAX(XINTERP) LE MAX(X)

   YINTERP: Keyword set on output to the vector of same length as XINTERP
            with the polynomial fit values calculated at XINTERP.

   INPOLY: If the keyword XINTERP is specified then this keyword is set on
           output to an N_ELEMENTS(XINTERP) x NDEGREE+1 array
           containing the orthonormal polynomials evaluated at XINTERP.
           The rows contain the polynomial vectors, so INPOLY[*,0] is
           the 0th degree polynomial, INPOLY[*,1] is the 1st degree(linear)
           polynomial, INPOLY[*,2] the 2nd degree (quadratic) polynomial, and so on.

        C_O:        Keyword set on output to the vector of orthonormal polynomial
           coefficients of length NDEGREE + 1 such that
           YFIT = C_O[0] * ORPOLY[*,0] + . . . + C_O[NDEGREE] * ORPOLY[*,NDEGREE]

        C_X:        Keyword set to a named array which on output is the vector of
           X^P polynomial coefficients of length NDEGREE + 1 such that
           YFIT = C_X[0] + C_X[1] * X + . . . + C_X[NDEGREE] * X^NDEGREE

        C_T:        Keyword set to a named array which on output is the vector of
           T^P polynomial coefficients of length NDEGREE + 1 where
           T[J] = (X[J] - XAVG) / XRANGE corresponds to the independent
           variable X-vector mapped into the interval [-0.5,0.5], and
           YFIT = C_T[0] + C_T[1] * T + . . . + C_T[NDEGREE] * T^NDEGREE

   XAVG:   Keyword set on output to a scalar corresponding to the
           arithmetic average of the independent variable X-vector.

   XRANGE: Keyword set on output to a scalar corresponding to the
           difference between the maximum and minimum values of the
           independent variable X-vector.

   QX:     If this keyword is set to a named array or TYPE=1 then this
           keyword is set on output to an NEDGREE + 1 x NDEGREE + 1 array
           containing the coefficients of X^P, P = 0,...NDEGREE
           for the NDEGREE + 1 orthonormal polynomials. The rows of
           QX correspond to the different polynomials so, for example,
           a 3rd degree orthonormal polynomial is
           ORPOLY(*,3) = QX[0,3] + QX[1,3]*X + QX[2,3]*X^2 + QX[3,3]*X^3

   QT:     If this keyword is set to a named array or TYPE=2 then this
           keyword is set on output to an NEDGREE + 1 x NDEGREE + 1 array
           containing the coefficients of T^P, P = 0,...NDEGREE
           for the NDEGREE + 1 orthonormal polynomials where T = (X - XAVG)/XRANGE.
           The rows of QT correspond to the different polynomials so,
           for example, a 3rd degree orthonormal polynomial is
           ORPOLY(*,3) = QT[0,3] + QT[1,3]*T + QT[2,3]*T^2 + QT[3,3]*T^3

        RMS:        Keyword set on output to a scalar corresponding to the
           root mean square of the difference between the
           polynomial fit and the input dependent variable vector.
           This is the value that is minimized for a given NDEGREE.

        STD:        Keyword set on output to a scalar corresponding to the
           statistical standard deviation between the polynomial fit
           and the input dependent variable Y-vector. For NDEGREE much less
           than the length of Y, STD is approximately equal to RMS.
           The optional output Sigma in POLY_FIT is equivalent to STD.

   FIT:    If this keyword is present and non-zero then the return value
           of the POLY_FIT_ORTHO is the polynomial fit, equivalent to YFIT.
           The keyword FIT over-rides the keyword TYPE and the optional
           output YFIT is removed from argument list (i.e. POLYVAR becomes
           the fourth argument and SIGMA becomes the fifth argument).

   DOUBLE: If this keyword is present and non-zero then calculations
           are done in double precision and output is of type DOUBLE.

  WARNMSSG: If this keyword is present and non-zero then warning messages
           will be issued if the number of calculations, based on the size of  NDEGREE
            and the number of data, is  very large. When this keyword is set the user has
            the  opportunity  to stop the calculations and have POLY_FIT_ORTHO return
            using the last calculated NDEGREE polynomial.

  REPEAT CALL SEQUENCE: If POLY_FIT_ORTHO is called repeatedly with the same
                        X-vector then the keyword ORPOLY should be set to a named
                        variable, unaltered, throughout the calling sequence for
                        optimum efficiency. This applies to TYPE = 0 (default).
                        For repeat calls with the same X-vector and TYPE = 1 and/or
                        keyword C_X specified then keywords ORPOLY and QX should
                        be set to named variables, and if TYPE = 2 and/or C_T
                        is specified then ORPOLY and QT should be named variables.


 COMMON BLOCKS:
OMMON RANDOM_SEED, SEED ; Used for calculating coefficient error estimates.

 SIDE EFFECTS:
        None.

 MODIFICATION HISTORY:
        MARCH, 1999: Written by James F. Howell, Research Systems, Inc.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\poly_fit_ortho.pro)


POLY_XY

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          poly_xy

 CALLING SEQUENCE:
                   RESULT=POLY_XY(X,Y,K)
 
 PURPOSE:     Evaluate the bivariate polynomial function of x and y
              where poly_xy = SUM [ k(i,j) * x^i * y^j ]
              the sum extends over i and j

 INPUT:  x    Vector of x values
         y    Vector of y values
         k    Array of polynomial coefficients (as computed by the
              the companion procedure POLY_XY_FIT.PRO)

  author:  Paul Ricchiazzi                            1mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\poly_xy.pro)


POLY_XYZ

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          poly_xyz

 CALLING SEQUENCE:
                   RESULT=POLY_XY(X,Y,Z,K)
 
 PURPOSE:     Evaluate the trivariate polynomial function of x,y,z
              where poly_xyz = SUM [ k(i,j,k) * x^i * y^j * z^k]
              the sum extends over i,j,k

 INPUT:  x    Vector of x independent variable
         y    Vector of y independent variable
         z    Vector of z independent variable
         k    Array of polynomial coefficients (as computed by the
              the companion procedure POLY_XYZ_FIT.PRO)

  author:  Paul Ricchiazzi                            1mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\poly_xyz.pro)


POLY_XYZ_FIT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          poly_xyz_fit

 CALLING SEQUENCE:
                   result=poly_xyz_fit(x,y,z,u,degree)
                   result=poly_xyz_fit(x,y,z,u,degree,ufit)
 
 PURPOSE:     Find the least square polynomial coefficients fitting the 
              dependent variable u to three independent variables x,y and z.
              The trivariate polynomial function of x,y,z is defined as
              ufit=SUM [ k(i,j,k) * x^i * y^j * z^k] (summed over i,j and k)

 INPUT:  
  x           Vector of x values (independent variable)
  y           Vector of y values (independent variable)
  z           Vector of z values (independent variable)
  u           vector of u values (dependent variable)
  degree      3 element vector specifying polynomial order.
              The fitting polynomial will be of order DEGREE(0) in x
              DEGREE(1) in y and DEGREE(2) in z

 OUTPUT:
  result      Array of polynomial coefficients (can be used directly
              in the companion procedure POLY_XYZ)

 Optional OUTPUT:
  ufit        polynomial evaluated at (x,y,z) input points

  author:  Paul Ricchiazzi                            1mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\poly_xyz_fit.pro)


POLY_XY_FIT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:          poly_xy_fit

 CALLING SEQUENCE:
                   result=poly_xy_fit(x,y,u,degree)
                   result=poly_xy_fit(x,y,u,degree,ufit)
 
 PURPOSE:     Find the least square polynomial coefficients fitting the 
              dependent variable u to the independent variables x and y.
              The bivariate polynomial function of x and y is defined as
              ufit=SUM [ k(i,j) * x^i * y^j ] (summed over i and j)

 INPUT:  
  x           Vector of x independent variable
  y           Vector of y independent variable
  u           Vector of dependent variable
  degree      2 element vector polynomial order.
              The fitting polynomial will be of order DEGREE(0) in x
              and of order DEGREE(1) in y

 OUTPUT:
  result      Array of polynomial coefficients (can be used directly
              in the companion procedure POLY_XY)

 Optional OUTPUT:
  ufit        polynomial evaluated at x and y points
  usig        standard deviation of (u-ufit)

 Example:

    x=randomu(iseed,100)
    y=randomu(iseed,100)
    u=1.+x+y+x*y+x^2+y^2
    k=poly_xy_fit(x,y,u,[2,2],ufit,usig)
    print, usig
    print, k
    

    xx=double(x)
    yy=double(y)
    uu=1.+xx+yy+xx*yy+xx^2+yy^2
    kk=poly_xy_fit(xx,yy,uu,[2,2],ufit,usig)
    print,usig,kk

  author:  Paul Ricchiazzi                            1mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\poly_xy_fit.pro)


POL_COEFFS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		POL_COEFFS
 VERSION:
		4.3
 PURPOSE:
		Finding the coefficient of a polynomial.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = POL_COEFFS( X [, Y] [,/SVD])
 INPUTS:
	X
		Numeric, Either a vector (scalar is considered to be a vector of
		length 1) or an [2,*] array.
 OPTIONAL INPUT PARAMETERS:
	Y
		Numeric, acceptable only when X is a vector, in which case Y has to be
		a vector of same length.

		Note:	Processing of the X and Y variables follows the same rules as
				in the SPLIT_XY routine.  See there.
 KEYWORD PARAMETERS:
	/SVD
		Switch.  Specifies solution using the Singular Value Decomposition
		method.  Default is LU decomposition.
 OUTPUTS:
		Returns a vector of length N (where N is the length of the X and Y
		inputs), containing the coefficients of the unique polynomial of order
		N-1 passing through all the points.  The coefficients are in order from
		lowest to highest.  If no input is given, returns zero.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses SPLIT_XY from MIDL to process the input and
		SOLVE_LINSYS (also from MIDL) to find the coefficients.  ALSO calls
		TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 10-AUG-2002 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\polcoeffs.pro)


POSBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POSBOX
 PURPOSE:
       Test for a box drawn around the screen position, or plot one.
 CATEGORY:
 CALLING SEQUENCE:
       posbox
 INPUTS:
 KEYWORD PARAMETERS:
       keyword was given to map_set.  If any inside pixels
       touch where outline would be then vis is returned as 1.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: main purpose is to see if the screen position has
         been outlined.  One use is to determine if the /noborder
 MODIFICATION HISTORY:
       R. Sterner, 1999 Sep 9  (9/9/99)

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\posbox.pro)


POS_CM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POS_CM
 PURPOSE:
       Convert keyword POSITION for PLOT from cm to norm. coords.
 CATEGORY:
 CALLING SEQUENCE:
       out = pos_cm(in)
 INPUTS:
       in = the array [x1,y1,x2,y2]              in
          where (x1,y1) = lower left corner,
          and (x2,y2) = upper right corner of plot area in cm.
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = normalized coordinates.             out
 COMMON BLOCKS:
 NOTES:
       Note: if used to convert the position array before call
         to plot, be sure plot device is set first.
         For PostScript plots call psinit first.
 MODIFICATION HISTORY:
       R. Sterner, 22 Sep, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pos_cm.pro)


POS_ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   pos_icg_struct

 PURPOSE:
   This function returns the position of one or many tag_names of the icg_struct belonging to the short_name

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   pos=pos_icg_struct(icg_struct,name,[/ignore_case],[valid=valid],[/tag_name],[_extra=extra])

 INPUTS:
    icg_struct: the defined icg structure
    name: the name defined for a param in icg_struct

 KEYWORD PARAMETERS:
   ignore_case: if is set no case senstive name(s) are necessary
   valid: if arg_present the valid indices are returned in valid
   tag_name: if set to 1 name is interpreted as tag_name

 PROCEDURE:
  On default result is the position of the short_name from the structure
  The keyword ignore_case is only usefull without /tag_name
  If tag_name is set to 1  result is the position of the tag_name from the structure

 EXAMPLE:
     pos=pos_icg_struct(struct,'O3(1)')

     pi={name:'P.Mustermann',organisation:'FZ Jülich'}
     platform={name:'cessna',type:'AIRCRAFT'}
     dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT', $
               experiment:'GHOST',title:'validation', $
               type_of_data:'MEASUREMENTS'}
     global=CREATE_STRUCT('pi',pi,'platform',platform, $
                           'dataset',dataset)
     dim_press={name:'press'}
     status_press={dim:dim_press}
     press={param:findgen(10),units:'hPa',long_name:'pressure', $
             sample_interval:1.0,$
             short_name:'press',flag:'NONE',status:status_press}
     press=create_struct(press,valid_param(press))
     dim_temp={name:'temp'}
     status_temp={dim:dim_temp}
     temp={param:findgen(100),units:'hPa',long_name:'pressure', $
            sample_interval:1.0,$
            short_name:'press',flag:'NONE',status:status_temp}
     temp=create_struct(temp,valid_param(temp))
     dim_n2o={name:['press','temp']}
     status_n2o={dim:dim_n2o}
     n2o={param:FINDGEN(10,100),units:'ppm',long_name:'N2O', $
           sample_interval:1.0,$
           short_name:'N2O(1)',flag:'NONE',status:status_n2o}
     n2o=create_struct(n2o,valid_param(n2o))
     struct=CREATE_STRUCT('!global',global,'press',press,'temp',temp,$
            text2tagname('n2o(1)'),n2o)

     PRINT,pos_icg_struct(struct,'N2O(1)')
     3

     PRINT,pos_icg_struct(struct,'N2O_1_',/tag_name)
     3

     PRINT,pos_icg_struct(struct,'Temp',/tag_name)
     2

     PRINT,pos_icg_struct(struct,'Temp')
     2


 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-11
   1999-June-30 many shortnames possible by now and argument valid added
   1999-Nov-15  keyword tag_name added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\pos_icg_struct.pro)


POWER_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		POWER_MM
 VERSION:
		4.2
 PURPOSE:
		Calculating the power of whatever, named replacement for ^.
 CATEGORY:
		Mathematical
 CALLING SEQUENCE:
		Result = POWER_MM( X, N)
 INPUTS:
	X
		The argument.  Numeric, otherwise arbitrary.
	N
		The exponent.  Numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns X^N.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Serves as replacement for the ususal X^N in cases
		where a "named function" is needed.  Calls FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 20-OCT-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\power_mm.pro)


PRANK

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    prank

 PURPOSE:    compute the value in ARRAY which is at a given 
             percentile ranking within ARRAY.  For example,
             median_of_array=prank(array,50)

 USEAGE:     result=prank(array,percentile)

 INPUT:
   array     an array of values, any type but string or complex
   p         percentile rank (0-100), may be a vector of ranks


 OUTPUT:     result=prank(array,percentile)
             result=value within array which is at the specified percentile
             rank

 EXAMPLE:	

    	 	r=10.^(randf(1000,2))*randomn(seed,1000)
               
               plot,r,psym=3
               plot,r,yrange=prank(r,[5,95]),psym=3

; print a set of percentile rankings within r

;      percentile rank 0   =>  min
;      percentile rank 50  =>  median
;      percentile rank 100 =>  max

               print,prank(r,[0,5,50,95,100])
               

 REVISIONS:

  author:  Paul Ricchiazzi                            feb95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\prank.pro)


PRECESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRECESS
 PURPOSE:
       Precess celestial coordinates to a new date.
 CATEGORY:
 CALLING SEQUENCE:
       precess, date1, ra1, dec1, date2, ra2, dec2
 INPUTS:
       date1 = original date (like 1 Jan, 1950).   in.
       ra1 = original R.A. in hrs.                 in.
       dec1 = original Dec in deg.                 in.
       date2 = new date (like 25 Nov, 1987).       in.
 KEYWORD PARAMETERS:
 OUTPUTS:
       ra2 = new R.A. in hrs.                      out.
       dec2 = new Dec in deg.                      out.
       
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 25 Nov, 1987.
       Johns Hopkins University Applied Physics Laboratory.
       RES 17 Oct, 1989 --- converted to SUN.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\precess.pro)


PREPARE_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  prepare_window

 PURPOSE:
       This procedure initializes the window with a scalable draw_window

 CATEGORY:
  PLOT/PLOTXY

 CALLING SEQUENCE:
  prepare_window,plot,[zoom_factor=zoom_factor],[/destroy]

 INPUTS:
  plot:  The plot structure defined by pl_init

 OPTIONAL INPUTS:
  zoom_factor: the scaling factor of the plot window

 KEYWORD PARAMETERS:
  destroy: to destroy the window

 RESTRICTIONS:
  At the moment every time it creates a new window. This will be changed soon.


 EXAMPLE:
       prepare_window,plot

 MODIFICATION HISTORY:
  Written by: R.Bauer 1998-May-19
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\prepare_window.pro)


PRIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRIME
 PURPOSE:
       Return an array with the specified number of prime numbers.
 CATEGORY:
 CALLING SEQUENCE:
       p = prime(n)
 INPUTS:
       n = desired number of primes.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       p = resulting array of primes.   out
 COMMON BLOCKS:
       prime_com
 NOTES:
       Note: Primes that have been found in previous calls are
         remembered and are not regenerated.
 MODIFICATION HISTORY:
       R. Sterner  17 Oct, 1985.
       R. Sterner,  5 Feb, 1993 --- fixed a bug that missed a few primes.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\prime.pro)


PRINCAX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:         princax

 PURPOSE:      principle axis decomposion of a 2d distribution of points

 USEAGE:       princax,xx,yy,ev1,ev2,v1,v2
 
 INPUTS:       
  xx, yy       coordinate posititions

 KEYWORD INPUTS:
  view         if set, draw a scatter plot and draw the major and minor
               axis of the characteristic elipsoid with the half length
               of the axis equal to the square root of the eigenvalue
               
 
 OUTPUTS:      
  xcm,ycm      coordinates of the center of mass

  ev1,ev2      eigenvalues

  v1,v2        principle axis

 PROCEDURE:    solves the following eigenvalue equation
 
               A v = L v        where A is the moment of inertia tensor
                                of the object, and L are the eigenvalues.

                                /      \
                         A =    |               |          
                                \      /

                                the angled brackets indicate averages over
                                the point distribution
 EXAMPLE:      

 u=5*randomn(iseed,50)
 v=randomn(iseed,50)
 x=u-v
 y=u+v
 princax,x,y,xcen,ycen,ev1,ev2,v1,v2,/view

 AUTHOR:       Paul Ricchiazzi                                nov93
               Earth Space Research Group, UC Santa Barabara

 REVISIONS:    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\princax.pro)


PRINTAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRINTAT
 PURPOSE:
       Print given items at specified screen column and line.
 CATEGORY:
 CALLING SEQUENCE:
       printat,C,L,itm1,itm2,itm3,...itm9
 INPUTS:
       C = column (1 - 80).                     in
       L = line (1 - 24).                       in
       itm1,itm2,... = up to 9 items to print.  in
         Items may be text strings or numbers.
 KEYWORD PARAMETERS:
       Keywords:
         /BOLD gives bold text.
         /UNDERLINE gives underlined text.
         /BLINK gives blinking text.
         /NEGATIVE gives negative text.
         Any combination of the above keywords are allowed.
         /CLEAR clears the screen from given position to end.
         CLEAR=n clears the next n characters (vt200 mode only).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner  26 Nov, 1985.
       R. Sterner, 27 Jan, 1992 --- rewrote.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\printat.pro)


PRINTLOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PRINTLOG

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Captures transcript of console output

 CALLING SEQUENCE:
   PRINTLOG, d1, d2, ..., FORMAT=, LOG=LOG, /ONLYLOG, UNIT=UNIT

 DESCRIPTION: 

   The PRINTLOG procedure provides the ability to print an arbitrary
   expression to the console or an open file UNIT, and also to
   capture the text in a "log" or archive.  This archive can be used
   as a verbatim record of console output, which is especially useful
   when transactional history records must be maintained.

   The log itself is stored as an array of strings which is passed
   via the LOG keyword.  PRINTLOG simply adds the current output to
   the existing array and returns.  When the transaction is complete,
   the resulting array may be saved or printed as appropriate.  For
   example, the following set of commands will accumulate a log which
   can be saved later:

     IDL> x = 0 & y = 1 & u = -17. & v = 12.    ;;; CREATE A LOG
     IDL> PRINTLOG, X, Y, LOG=LOG
            0       1
     IDL> PRINTLOG, U, V, LOG=LOG
          -17.0000      12.0000
     IDL> PRINTLOG, 'Computation done.', LOG=LOG
     Computation done.

     IDL> print, log, format='(A)'              ;;; PRINT THE LOG
            0       1
          -17.0000      12.0000
     Computation done.
     

 INPUTS:

   d1, d2, ... - the variables or expressions to be printed, as in
                 the PRINT or PRINTF commands.  A maximum of twenty
                 parameters are allowed.

 KEYWORDS:

   LOG - input/output keyword, containing the accumulated transaction
         log.  Upon input, LOG should be an array of strings
         containing previously accumulated log.  Upon return, LOG
         will have any new output appended.  If, upon input, LOG is
         undefined, or contains a single element (-1L or ''), then
         LOG will be initialized.

   FORMAT - a standard format statement, as used by STRING, PRINT or
            PRINTF.
            Default: default output formatting is used.

   UNIT - a file unit to be used for output.  If UNIT is undefined or
          0, then output is made to the console.
          Default: undefined (console output).

   ONLYLOG - if set, then output will not be made to the screen, but
             it will still be archived to LOG.  This may useful to
             record archane but important dianostic information that
             normally would not appear to the user.

 EXAMPLE:
   See above.

 SEE ALSO:
   PRINT, PRINTF, STRING
   STATUSLINE - To print temporary status messages to console

 MODIFICATION HISTORY:
   Written, CM, June 1999
   Documented, CM, 25 Feb 2000
   Added STATUSLINE to "SEE ALSO," CM, 22 Jun 2000

 TODO:
   Have a way to internally store the log, rather than the LOG
   keyword.

  $Id: printlog.pro,v 1.2 2001/03/25 18:10:43 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\printlog.pro)


PRINTPATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	printpath

 PURPOSE:
       This procedure prints !path as a vector

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
       printpath

 KEYWORD PARAMETERS
       path   : !path separated into a stringvector
       noprint: supresses printout of path, default:0

 EXAMPLE:
       printpath,path=path

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer Januar 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\printpath.pro)


PRINTTAB

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
	printtab

 PURPOSE:
   This procedure will print the contents of a string-array in tabular form

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   printtab,array[,/noprint][,result=result]

 KEYWORD PARAMETERS:
 noprint: suppress printout
 result : strarr containing the result; each element contains one row of printout

 EXAMPLE:
   printtab,[['abc','bcaaad'],['defgh','r']]
   will generate the following output in the command log window:
   abc    bcaaad
   defgh  r

   printtab,['abc','bcaaad']
   will generate the following output in the command log window:
   abc
   bcaaad

   printtab,[['abc','bcaaad'],['defgh','r'],['defgh','r']],/noprint,result=r
   will return the output in r

 SIDE EFFECTS
   a non-proportinal font is needed for the command log window if the array is multidimensional
   1-dimensional arrays will be transposed internally to optimize readability

 MODIFICATION HISTORY:
 	Written by Franz Rohrer Aug 1998
   Modified 11.02.2000 t=[t_in] instead of t=t_in
            04.06.2000 optional return of result implemented

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\printtab.pro)


PRINTWINDOW[1]

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

    This program sends the contents of the specified
    window to the default printer. The current window
    is used if a window index number is not provided.

 POSITIONAL PARAMETERS:

   WID       The window index number of the window to send to the
             printer. !D.Window used by default.

 KEYWORD PARAMETERS:

   LANDSCAPE  If this keyword is set, the output is in Landscape
              mode. Otherwise, Portrait mode is used.

   PAGESIZE: Set this keyword to a string indicating the type
             of PostScript page size you want. Current values are "LETTER",
             "LEGAL", and "A4". Default is "LETTER".

 Written by David Fanning based on previous PRINT_IT program. 29 July 2000.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\printwindow.pro)


PRINTWINDOW[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRINTWINDOW

 PURPOSE:
       The purpose of this program is to provide a quick-and-easy way to print
       the current IDL Direct Graphics window (!D.WINDOW) to the printer device
       centered on a 8.5" x 11" piece of paper with 1" margins (if needed). These
       margins will only be accurate if the unprintable area for the printer
       is set to zero. If the printer and/or its driver has margins (i.e.
       unprintable area) already specified this will offset the IDL output.
       This routine attempts to match the size of the print to the size of
       the graphics window on the monitor.

 CATEGORY:
       Visual

 CALLING SEQUENCE:
       PRINTWINDOW

 INPUT PARAMETERS:
       None.

 KEYWORD PARAMETERS:
       None.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 DISCLAIMER:
       This procedure is provided "as is" and is not supported or
       maintained by Research Systems Inc.

 MODIFICATION HISTORY:
       Written by: Adam Bielecki, April 2000.
       Added support for 8-bit color and Landscape orientation
            printing: Adam Bielecki, January 2002.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\printwindow.pro)


PRINT_FACT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRINT_FACT
 PURPOSE:
       Print prime factors found by the factor routine.
 CATEGORY:
 CALLING SEQUENCE:
       print_fact, p, n
 INPUTS:
       p = prime factors.          in
       n = number of each factor.  in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner  4 Oct, 1988.
       RES 25 Oct, 1990 --- converted to IDL V2.
       R. Sterner, 26 Feb, 1991 --- Renamed from print_factors.pro
       R. Sterner, 1999 Jun 30 --- Better output format.
       R. Sterner, 1999 Jul  7 --- Bigger values (used unsigned).
       R. Sterner, 1999 Jul  9 --- Made backward compatable.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\print_fact.pro)


PRINT_HISTORY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	print_history

 PURPOSE:
	This procedure prints the history entry of an ICG structure or a NCDF file to the screen.

 CATEGORY:
	ICG_STRUCT

 CALLING SEQUENCE:
	print_history, icg_struc

 INPUTS:
	icg_struc: ICG structure OR name of NCDF file

 OUTPUTS:
	The history entry of an ICG structure (or NCDF file) is printed to the screen.

 EXAMPLE:
	icgs = read_nc('berlioz.nc')
	print_history, icgs

	OR

	print_history, 'berlioz.nc'

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 13.03.2000
	14.03.2000:	File name of NCDF file may be passed as an argument

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\print_history.pro)


PRINT_PSFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	print_psfile

 PURPOSE:
  This procedure prints a postscriptfile to a given queue

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   print_psfile,file,queue

 INPUTS:
   file: the name of the idl script
   queue: the print spooling queue


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-21
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\print_psfile.pro)


PRINUMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		PRINUMS
 VERSION:
		4.0
 PURPOSE:
		Calculates a table of prime numbers in the range NLO - NHI.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		List = PRINUMS( [NLO,] NHI)
 INPUTS:
	NHI
		Upper limit of the range of the primes table.  Converted to long
		integer on input.
 OPTIONAL INPUT PARAMETERS:
	NLO
		Lower limit of the prime table range.  Converted to long integer on
		input.If not provided, i.e. if only one input parameter is provided,
		NLO defaults to 1.
 KEYWORD PARAMETERS:
	/BYPASS
		Switch.  Used only on internal calls.
 OUTPUTS:
		Returns the list of primes between NLO and NHI (inclusive), as long
		integer.  If no primes are found, returns 0.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Inputs must be positive.  If both NLO and NHI are given, NHI >= NLO.
 PROCEDURE:
		Uses the Sieve of Erasthotenes algorithm.  Generates the primes table
		calling itself recursively.
 MODIFICATION HISTORY:
		Created 15-NOV-1991 by Mati Meron.
		Modified 15-DEC-1993 by Mati Meron.  Combined previous PRIMES and
		PR_SIEVE in a single routine.
		Modified 20-JUN-1995 by Mati Meron.  Renamed PRINUMS to avoid conflict
		with an IDL routine bearing the same name.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\prinums.pro)


PROBABILITYPLOT

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
  probabilityplot

 PURPOSE:
  This procedure plots the cumulative frequency distribution of a data series on probability paper.

 CATEGORY:
  PLOT

 CALLING SEQUENCE:
  probabilityplot,x

 INPUTS:
  x : data series for which the cumulative frequency distribution should be evaluated

 EXAMPLE:
  x=randomn(seed,1000)
  probabilityplot,x

 MODIFICATION HISTORY:
  Written by: Franz Rohrer Feb 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\probabilityplot.pro)


PROCESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PROCESS

 PURPOSE:
       The purpose of this routine is to demonstrate a simple
       image processing program that runs as a "color aware"
       application. The program works on 8-bit, 16-bit, and
       24-bit displays. The image is displayed in a resizeable
       graphics window and the window contents can be saved as
       GIF or JPEG images. The application can "protect" its
       colors from other applications that change colors. The
       color protection is implemented via draw widget EXPOSE
       events or the Refresh Colors button in the menubar.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets.

 CALLING SEQUENCE:
       PROCESS

 INPUTS:
       image: An optional 2D image. The image is always scaled.

 KEYWORD PARAMETERS:
       BOTTOM: The lowest color index of the colors to be changed.

       GROUP: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       NCOLORS: This is the number of colors to load when a color table
       is selected.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       This is a non-blocking widget.

 RESTRICTIONS:
       The GETIMAGE and XCOLORS programs from the Fanning Consulting
       web page are required: http://www.dfanning.com/.

 EXAMPLE:
       To run the program, type:

       PROCESS

 MODIFICATION HISTORY:
       Written by:     David Fanning, 13 April 97.
       Fixed a bug in the TVImage call. 25 June 97. DWF.
       Extensively modified to incorporate changing ideas
         about color protection and operation on 8-bit and
         24-bit displays. 19 Oct 97. DWF.
       Whoops. Forgot to make *this* draw widget the current
         graphics window. 15 Nov 97. DWF.
       IDL 5.1 changed the way color decomposition works. Had
         to find a fix for this. 25 May 98. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\process.pro)


PROCESS_DATAFILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   process_datafiles

 PURPOSE:
   This procedure will make information html and savinfo files for given search mask of data-files

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   process_datafiles,filename

 INPUTS:
   filename: scalar/array of search masks

 KEYWORD PARAMETERS:
   Keywords:
      level     : number of subdirectory levels followed down, default:100
      path      : scalar searchpath, default:''
      filetype  : type of data file ('', 'nc','enz','zus'), default ''
      fill_value: fill_value for irzn
      nocache   : to supress generation of *.sav-file
      extra     : to submit keywords

 OUTPUTS:

 EXAMPLE:
   process_datafiles,'*.enz',filetype='enz',level=3,path='d:\temp'

 SIDE EFFECTS:
   will create file.html and file.savinfo files

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified 25.9.1998 by FR : fill_value,nocache included

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\process_datafiles.pro)


PROFREE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PROFREE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Free the pointers associated with an PRODIS abstract syntax tree

 CALLING SEQUENCE:
   PROFREE, TREE
   
 DESCRIPTION: 

   PROFREE frees the memory and pointers associated with an abstract
   syntax tree, as returned by PRODIS.  Users should use this
   procedure when they are finished with an abstract syntax tree and
   want to release its resources.  The procedure frees all pointers
   in the tree recursively.

 INPUTS:

   TREE - the abstract syntax tree to be freed.  Upon return the
          contents of TREE will be undefined.
  

 SEE ALSO:

   PRODIS, PROREND, CMSAVEDIR, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000-2002, CM
   Documented, 19 Mar 2002, CM
   

 $Id: profree.pro,v 1.3 2002/03/19 21:45:02 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\profree.pro)


PROREND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PROREND

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Render a PRODIS abstract syntax tree into IDL Language Text

 CALLING SEQUENCE:
   PROREND, TREE, TEXT, [ /INIT ]

 DESCRIPTION: 

   PROREND converts an abstract syntax tree as returned by PRODIS,
   into a human-readable form, written in the IDL programming
   language.  The abstract syntax tree format is a set of linked data
   structures, and is derived from the raw data on disk.  The human
   readable form is returned as an array of strings that can be
   printed to the console or a file.

   The abstract syntax tree is generated by PRODIS, an external
   procedure in the same library.  The standard approach is to use
   the following steps:

       1. Use PRODIS to convert raw bytes to abstract syntax tree
       2. Use PROREND to convert abstract syntax tree to IDL language

   The external routine PROTRANS does the end-to-end conversion steps
   of both PRODIS and PROREND for you.

   At the moment there is relatively little flexibility in how the
   IDL code is rendered to text.  For example, all reserved keywords
   and variables appear in upper-case letters, and array indexing
   syntax is expressed with round ()'s instead of square []'s.
   Suggestions on how to achieve this are solicited.

   PROREND does not free the TREE structure.  The user is responsible
   to do this using the PROFREE procedure.
   

 COMPATIBILITY:

   -- File Format --

   PROREND accepts any tree provided by PRODIS.  PRODIS cannot
   examine compressed save files.  It is able to read and translate
   SAVE files produced by IDL 4, and IDL versions 5.0 through 5.5.
   The output of PROREND should be compatible with IDL 4 and 5.

   This procedure is part of the CMSVLIB SAVE library for IDL by
   Craig Markwardt.  You must have the full CMSVLIB core package
   installed in order for this procedure to function properly.

 INPUTS:

   TREE - the abstract syntax tree, as returned by PRODIS.  This
          structure is unmodified by PROREND.

   TEXT - upon output, the IDL code is placed in as an array of
          strings in TEXT.  By default, any new IDL code will be
          *appended* to TEXT.  Use the /INIT keyword to overwrite the
          existing contents of TEXT.


 KEYWORDS:

   INIT - if set, then overwrite the TEXT array with the new IDL
          code.  By default (INIT not set), any new IDL code is
          *appended* to TEXT.
  
 EXAMPLE:

   This example compiles a test function, saves it to a file called
   test_pro.sav, and then disassembles the save file into a syntax
   tree using PRODIS.  Finally, the syntax tree is converted to IDL
   text, which is printed to the console.

     IDL> .comp 
     - pro test_pro, x
     -   x = x + 1
     -   return
     - end
     % Compiled module: TEST_PRO.
     IDL> save, 'test_pro', /routine, file='test_pro.sav'
     IDL> prodis, 'test_pro.sav', prodecl, tree
     IDL> prorend, tree, text
     IDL> print, text, format='(A)'
     PRO TEST_PRO, X
       ;; Beginning of code
       X = X+1
       RETURN
     END


 SEE ALSO:

   PRODIS, PROREND, CMSAVEDIR, CMSVLIB

 MODIFICATION HISTORY:
   Written, 2000-2002, CM
   Documented, 19 Mar 2002, CM
   Added PRN_STRCAT, to avoid an internal library function, 22 Mar
     2002, CM
   

 $Id: prorend.pro,v 1.13 2002/03/22 22:01:11 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\prorend.pro)


PROTRACTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PROTRACTOR
 PURPOSE:
       Measure angles on the screen.
 CATEGORY:
 CALLING SEQUENCE:
       protractor
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         ANGLE=a     measured angle returned.
         LENGTH=len  measured lengths returned as 2 element array.
         FACTOR=f    Length conversion factor (def=1).
         COLOR=c     Plot color to use (def=!p.color).
         /QUIET      suppresses messages.
 OUTPUTS:
 COMMON BLOCKS:
       protractor_com
 NOTES:
       Notes: lengths are listed and returned in pixels unless
         over-ridden by FACTOR.
 MODIFICATION HISTORY:
       R. Sterner, 12 Feb, 1993 (inspired by Bob Taylor's angle.pro).
       R. Sterner, 16 Mar, 1993 --- added no erase exit.
       R. Sterner, 16 Mar, 1993 --- added exit coordinate list.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\protractor.pro)


PRWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRWINDOW
 PURPOSE:
       Print current window or gif image on color printer.
 CATEGORY:
 CALLING SEQUENCE:
       prwindow, pnum
 INPUTS:
       pnum = optional PS printer numer or tag.   in
         This may be determined from psinit,/list.
 KEYWORD PARAMETERS:
       Keywords:
         FACTOR=fct  Image size factor (default=1.0).
         GIF=gif  Print the specified gif image instead of the
           screen window.
         COMMENT=txt  Optional comment text (printed as small
           text on side of printout).
         CHARSIZE=csz  Character size for comment.
         /TWO  Split image into two printout sheets.
         /FOUR  Split image into four printout sheets.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: the currect window is captured and printed to
         the specifed or default PS printer.
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 4
       R. Sterner, 1995 Aug 7 --- Added gif image support.
       R. Sterner, 1995 Aug 29 --- Added comment.
       R. Sterner, 1997 Jun 30 --- Added FACTOR=fct.
       R. Sterner, 1998 Jun 04 --- Added CHARSIZE.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\prwindow.pro)


PSCONCAT

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   psconcat

 PURPOSE:
   This procedure concatenates single page postscript files into
   one file. Option OVERLAY and PSNUP

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   PSCONCAT, Outfiles, Infiles [, /PSNUP] [, FRAMES_PER_PAGE=n] [, /OVERLAY] [, /VERBOSE] [,/NO_DIALOG]

 INPUTS:
   Outfile:  filename for output
   Infiles:  string array with input files

 KEYWORD PARAMETERS:
   VERBOSE:    print messages


 OUTPUTS:
   This procedure creates a postscript file containing the plots of all
   input files

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-FEB-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\psconcat.pro)


PSCONFIG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PSCONFIG

 PURPOSE:

   This program is simply a function wrapper for the FSC_PSCONFIG
   object program (fsc_psconfig__define.pro). It was written so
   that it could serve as a drop-in replacement for the PS_FORM
   program it replaces. It calls the object program's graphical
   user interface as a modal widget and returns the DEVICE keywords
   collected from the form in a form that is appropriate for
   configuring the PostScript device.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CALLING SEQUENCE:

   psKeywords = PSConfig()

 CATEGORY:

   Configuring PostScript output.

 DOCUMENTATION:

   Complete documentation for the FSC_PSCONFIG object, including
   keyword and method descriptions, and example programs using the object
   can be found on the Coyote's Guide to IDL Programming web page:

     http://www.dfanning.com/programs/docs/fsc_psconfig.html

 INPUT:

    psConfigObject -- An optional FSC_PSCONFIG object reference can be
       passed as an argument to the function. The object is not destroyed
       if passed in as an argument.

       psObject = Obj_New("FSC_PSCONFIG")
       keywords = PSConfig(psObject)

    Having the object means that you have an on-going and current record
    of exactly how your PostScript device is configured. Be sure to destroy
    the object when you are finished with it.

 KEYWORDS:

   Any keyword accepted by the FSC_PSCONFIG object can be used with
   this program. Here are a few of the most popular keywords.

   Bits_per_Pixel - The number of image bits saved for each image pixel: 2, 4, or 8. The default is 8.
   Color - Set this keyword to select Color PostScript output. Turned on by default.
   DefaultSetup - Set this keyword to the "name" of a default style. Current styles (you can easily
     create and add your own to the source code) are the following:

       "System (Portrait)" - The normal "default" system set-up. Also, "System".
       "System (Landcape)" - The normal "default" landscape system set-up.
       "Centered (Portrait)" - The window centered on the page. Also, "Center" or "Centered".
       "Centered (Landscape)" - The window centered on the landscape page. Also, "Landscape".
       "Square (Portrait)" - A square plot, centered on the page.
       "Square (Landscape)" - A square plot, centered on the landscape page.
       "Figure (Small)" - A small encapsulated figure size, centered on page. Also, "Encapsulated" or "Encapsulate".
       "Figure (Large)" - A larger encapsulated figure size, centered on page. Also, "Figure".
       "Color (Portrait)" - A "centered" plot, with color turned on. Also, "Color".
       "Color (Landscape)" - A "centered" landscape plot, with color turned on.

   Directory - Set this keyword to the name of the starting directory. The current directory is used by default.
   Encapsulate - Set this keyword to select Encapsulated PostScript output. Turned off by default.
   European - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). Turned off by default.
   Filename - Set thie keyword to the name of the PostScript file. The default is "idl.ps".
   Inches - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters. Set by European keyword by default.
   Landscape - Set this keyword to select Landscape page output. Portrait page output is the default.
   PageType - Set this keyword to the "type" of page. Possible values are:
       "Letter" - 8.5 by 11 inches. (Default, unless the European keyword is set.)
       "Legal" - 8.5 by 14 inches.
       "Ledger" - 11 by 17 inches.
       "A4" - 21.0 by 29.7 centimeters. (Default, if the European keyword is set.)
   XOffset - Set this keyword to the X Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
   XSize - Set this keyword to the X size of the PostScript "window". Uses "System (Portrait)" defaults.
   YOffset - Set this keyword to the Y Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
   YSize - Set this keyword to the Y size of the PostScript "window". Uses "System (Portrait)" defaults.

   In addition, the following keywords can be used:

   CANCEL -- An output keyword that will be set to 1 if the user
   chooses the Cancel button on the form. It will be 0 otherwise.

   FONTINFO -- Set this keyword is you wish to have font information
   appear on the form. The default is to not include font information.

   FONTTYPE -- Set this keyword to a named variable that will indicate
   the user's preference for font type. Values will be -1 (Hershey fonts),
   0 (hardware fonts), and 1 (true-type fonts). This keyword will always
   return -1 unless the FONTINFO keyword has also been set.

   GROUP_LEADER -- Set this keyword to a widget identifier of the widget
   you wish to be a group leader for this program.

 EXAMPLE:

   To have the user specify PostScript configuration parameters, use
   the program like this:

     keywords = PSConfig(Cancel=cancelled)
     IF cancelled THEN RETURN
     thisDevice = !D.Name
     Set_Plot, 'PS'
     Device, _Extra=keywords
     Plot, findgen(11) ; Or whatever graphics commands you use.
     Device, /Close_File
     Set_Plot, thisDevice

 OTHER PROGRAMS NEEDED:

   The following programs are required to run this one:

     fsc_droplist.pro
     fsc_fileselect.pro
     fsc_inputfield.pro
     fsc_plotwindow
     fsc_psconfig__define.pro

 MODIFICATIONS:

   Written by David Fanning, 31 January 2000.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\psconfig.pro)


PSD

[Previous Routine] [Next Routine] [List of Routines]
ROUTINE:      psd
               
USEAGE:       psd,image,wavenum,power,scale=scale,view=view,$
                      unit=unit,title=title,binpower=binpower,$
                      xrange=xrange,density=density

               
PURPOSE:      compute angle averaged power spectral density of an image
               
INPUT:        

   image
       a one or two dimensional data array
               
OUTPUT:
       
   wavenum     
       The spatial wave number of the scene (averaged over angle if
       image is 2-D).  WAVENUM ranges from a minimum value of about
       2/max(NX,NY) cycle/pixel (i.e., the zero frequency component
       should not be included) to a maximum value of 1 cycle/pixel,
       i.e, the Nyquist frequency of the scene.  If SCALE is set,
       WAVENUM has units of cycles/unit where unit is the physical
       units used to set SCALE (see UNIT and SCALE, below).  If you
       want to have WAVENUM expressed in units of cycles/frame,
       (which only makes sense when NX=NY) set
       SCALE=[1./fix(NX/2),1./fix(NY/2)]
               
               
   power       
       energy spectra of scene.  if image has only one dimension POWER
       is the squared modulus of the fourier transform.  If image is
       two dimensional POWER is the angular integration of the
       squared modulus of fourier transform coeficients, P, over the
       anulus defined by a given value of k=sqrt(kx^2+ky^2).
               
       total power = integral(2 pi P k dk) = integral(POWER(k) dk),

KEYWORD INPUT:

   scale
       physical resolution of image, i.e., the size of a single picture
       element in physical units such as kilometers.  If SCALE is set
       to a two element vector, the two values specify the resolution
       in the x and y directions, respectively.  When SCALE is set, the
       units of WAVENUM are cycles/unit where UNIT are the physical
       units (see below) in which SCALE is specified.
               
   unit
       string variable specifying the physical units used to specify
       SCALE (used in xtitle of plot)
               
   view
       if set, plot log-log plot of psd
               
       if VIEW=2, WAVENUM and POWER are taken as input parameters
       (i.e., psd is not computed) for the PSD plot option.  In this
       case the IMAGE parameter is not used, but a dummy value must be
       supplied.
               
   title
       plot title
               
   binpower
       If set, changes the default bin size used for 2-D wavevector
       binning.  Normally wavevector binning is set up to put one
       unit of the scalor wavevector in each wavenumber bin:
     
             k = sqrt(kx^2+ky^2)         scalor wavenumber
       
             n < k < n+1
     
       where n is an integer index for each wavenuber bin.  anulus. The
       kx and ky wavenumbers run from 0 to NX/2 and 0 to NY/2,
       respectively, (NX/2 and NY/2 represent the Nyquist frequency) If
       BINPOWER is set, the size of the wavenumber bins can be made to
       increase as a power of the wavenumber so that
     
             binsize = wavenumber^BINPOWER
     
       for example setting binpower gt 0 causes more averaging at large
       wavenumber and can be used to smooth out noisy power spectra.
       A value of BINPOWER between .1 and .5 seems to be sufficient to
       smooth out high frequency noise.  (default: binpower=0)
               
   xrange
       XRANGE sets the min and max wavenumber included in power
       spectrum plot. XRANGE is used to clip off noisy high frequency
       part of psd which sometimes occurs beyond 1 cycle per pixel in
       the horizontal or vertical direction.  XRANGE does not affect
       the returned values of WAVENUM and POWER, but it does affect the
       value of BETA.
     
       NOTE: For a square uniform grid the maximum wavenumber is
       sqrt(2) x 1 cycle/pixel.
               
   density 
       if set, plot spectral power density instead of spectral power.
       This is equivalent to dividing the power spectra by the
       wavenumber.
               

EXAMPLE:

; PSD of a scaling field

     w8x11
     !p.multi=[0,1,2]
     n=512                                          ; 
     slope=3                                        ; power law slope
     power=1./(1.>(dist(n)^(slope+1)))
     gg=sqrt(power)                                 ; fourier modulus
     gg=gg*exp(complex(0,2*!pi*randomu(iseed,n,n))) ; randomized phase
     ff=float(fft(gg,1))                              ; realization
     tvim,ff
     psd,ff,/view

; Spectra of a 1-d data

     n=2^14
     f=randf(n,2)
     !p.multi=[0,1,2]
     plot,w,f
     psd,f,w,p,/view
                                        
     
; PSD of a submatrix of a scene with spatially varying spectral structure, 
;
;     1. lower left quandrant:  scaling scene (SS) with spectral slope -2.5
;     2. upper left quandrant:  SS plus structure at 0.125 nyq
;     3. upper right quandrant: SS plus structure at .25 and 0.125 nyq
;     4. upper left quandrant:  SS plus structure at .25  nyq
;
;        where nyq = 1.4141 cycles/(horizontal or vertical pixel)
;
;        to stop looping this example, put box in lower frame and click RMB

   w8x11
   !p.multi=[0,1,2]
   nx=512 & ny=512
   ff=randata(nx,ny,s=2.5)
   ff=5*cos(0.125*!pi*findgen(nx))#cos(0.125*!pi*findgen(ny))*$
       (((replicate(1,nx)#findgen(ny)/(ny-1))-.5)>0)+ff
   ff=5*cos(0.25*!pi*findgen(nx))#cos(0.25*!pi*findgen(ny))*$
       (((findgen(ny)/(ny-1))#replicate(1,ny)-.5)>0)+ff
   tvim,ff
   xwin=!x.window & xrng=!x.crange
   ywin=!y.window & yrng=!y.crange
   x1=nx/4 & x2=x1+nx/2
   y1=ny/4 & y2=y1+ny/2

   !p.multi=[4,2,4]
   curbox,x1,x2,y1,y2,xwin,ywin,xrng,yrng,inc=8,/init,/mess,label='region 1'
   psd,ff(x1:x2,y1:y2),/view,title='region 1'
   curbox,x1,x2,y1,y2,xwin,ywin,xrng,yrng,inc=8,/init,/mess,label='region 2'
   psd,ff(x1:x2,y1:y2),/view,title='region 2'
   curbox,x1,x2,y1,y2,xwin,ywin,xrng,yrng,inc=8,/init,/mess,label='region 3'
   psd,ff(x1:x2,y1:y2),/view,title='region 3'
   curbox,x1,x2,y1,y2,xwin,ywin,xrng,yrng,inc=8,/init,/mess,label='region 4'
   psd,ff(x1:x2,y1:y2),/view,title='region 4'

 

  author:  Paul Ricchiazzi                            may93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\psd.pro)


PSIMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSIMG
 PURPOSE:
       Display an image on postscript printer.
 CATEGORY:
 CALLING SEQUENCE:
       psimg, img
 INPUTS:
       img = image to display.       in
 KEYWORD PARAMETERS:
       Keywords:
         FACTOR=fct  Factor used to scale the image (def=1.0).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: img must be correctly scaled,
         tv is used (not tvscl).  psimg displays
         image at maximum size that shows entire image
         in the page window.
 MODIFICATION HISTORY:
       R. Sterner, 28 Aug, 1990
       R. Sterner, 1997 Jun 30

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\psimg.pro)


PSINIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSINIT
 PURPOSE:
       Redirect plots and images to postscript printer.
 CATEGORY:
 CALLING SEQUENCE:
       psinit [,num]
 INPUTS:
       num = Postscript printer number.           in
         This may alternately be any unique string in the
         printer description displayed using /LIST.
 KEYWORD PARAMETERS:
       Keywords:
         /FULL to use full page in portrait mode (def=top half).
         /LANDSCAPE to do plot in landscape mode.
         /COLOR means do color PostScript (def is B&W).
         /AUTOCOLOR means automatically set color mode for a
           color PS printer.  Must have the word color in the
           printer description line.
         CFLAG=flag  Returned color flag: 0=B&W, 1=Color mode.
         FILE=f redirect plot to a specified file.  The default
           is idl.ps in the local directory.
         DEFAULT=dn  Set default printer number (def=0).
           Stays in effect for IDL session.
         MARGIN = [left, right, bottom, top] sets margins (inches).
           May give as few values as needed.  For left margin only
           may just use MAR=xxx, otherwise give an array.
         WINDOW = [xmin, xmx, ymin, ymx] sets window (inches).
           Must give all 4 values.
         /CENTIMETERS  interpreted margin or window values in cm.
         /DOUBLE to do plot in double thickness.
         /VECTOR to use vector fonts instead of postscript fonts.
         /ORIGIN plots a mark at the page origin.
         /QUIET turns off psinit messages.
         /LIST_PRINTERS lists available printers and their numbers.
         COMMENT=txt  comment to print with the time stamp.
         CHARSIZE=csz Character size for comment (def=0.4).
 OUTPUTS:
 COMMON BLOCKS:
       ps_com,dname,xthick,ythick,pthick,pfont,defnum,num,comm
 NOTES:
       Notes:
         Default is portrait mode, top half of page.
         Related routines:
         psterm - terminate postscript output and make plots.
         pspaper - plot norm. coord. system for curr. page setup.
 MODIFICATION HISTORY:
       R. Sterner, 2 Aug, 1989.
       R. Sterner, 22 May, 1990 --- converted to VMS.
       R. Sterner, 12 Oct, 1990 --- WINDOW keyword.
       R. Sterner, 20 Dec, 1990 --- added COMMENT keyword.
       R. Sterner,  6 Dec, 1991 --- added FILE= keyword.
       R. Sterner, 1995 May 3 --- Added /COLOR.
       R. Sterner, 1995 May 4 --- Added /AUTOCOLOR.
       R. Sterner, 1998 Jun 4 --- Added CHARSIZE.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\psinit.pro)


PSPAPER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSPAPER
 PURPOSE:
       Plot a postscript layout sheet. Gives normalized coordinate system.
 CATEGORY:
 CALLING SEQUENCE:
       pspaper
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: Call psinit with desired page format and margin.
       Then call pspaper.
 MODIFICATION HISTORY:
       R. Sterner, 31 Aug, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\pspaper.pro)


PSTERM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSTERM
 PURPOSE:
       Terminate postscript plotting and send plots to printer.
 CATEGORY:
 CALLING SEQUENCE:
       psterm
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /NOPLOT terminates without plotting.
         /QUIET turns off psterm messages.
         /LAST plots existing idl.ps file (usually last plot).
         /NOSTAMP suppresses default user name and time stamp.
         /CLEAR_COMMENT  clears comment after listing it.
 OUTPUTS:
 COMMON BLOCKS:
       ps_com,dname,xthick,ythick,pthick,pfont,defnum,num,comm
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 Aug, 1989.
       R. Sterner, 23 May 1990 --- converted to VMS.
       R. Sterner, 23 Jul, 1990 --- added /nostamp.
       R. Sterner, 20 Dec, 1990 --- added comment to time stamp.
       R. Sterner, 1998 Jun  4 --- Added char size.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\psterm.pro)


PSWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    PSWINDOW

 PURPOSE:

    This function is used to calculate the size of a PostScript
    window that has the same aspect ratio (ratio of height to
    width) as the current display graphics window. It creates
    the largest possible PostScript output window with the
    desired aspect ratio. This assures that graphics output
    looks similar, if not identical, to PostScript output.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

    Graphics.

 CALLING SEQUENCE:

    pageInfo = PSWINDOW()

 INPUTS:

    None.

 KEYWORD PARAMETERS:

    CM: Normally the structure value that is returned from this
    function reports its values in inches. Setting this keyword
    causes the return values to be in units of centimeters.

    FUDGE: A quick way to set symetrical XFUDGE and YFUDGE factors.
    If this keyword is set to a value, XFUDGE and YFUDGE keywords are
    set to the same value.

    LANDSCAPE: Normally this function assumes a PostScript window
    in Portrait mode. Setting this keyword assumes you want
    the graphic in Landscape mode.

    MARGIN:  The margin around the edges of the plot. The value must be
    a floating point value between 0.0 and 0.5. It is expressed in
    normalized coordinate units. The default margin is 0.15.

    PAGESIZE: Set this keyword to a string indicating the type
    of PostScript page size you want. Current values are "LETTER",
    "LEGAL", and "A4". Default is "LETTER".

    PRINTER: Set this keyword if the output will be used to
    configure the PRINTER device, rather than the PS device.
    (In the PRINTER device, offsets are always calculated from
    the lower-left corner of the page and do not rotate in
    Landscape mode, as they do with the PS device.) Note that
    the PRINTER device is only able to accept these keywords
    in IDL 5.1 and higher.

    XFUDGE: Printers calculate the offset point from the printable
    edge of the paper (sometimes), rather from the corner of the paper.
    For example, on my Lexmark printer, both X and Y offsets are
    calculated from a point 0.25 inches in from the edge. This keyword
    allows you to set a "fudge" factor that will be subtracted from
    the XOFFSET that is returned to the user. This allows you to create
    output that is centered on the page. The fudge factor should be in
    the same units as the returned size and offset values.

    YFUDGE: Printers calculate the offset point from the printable
    edge of the paper (sometimes), rather from the corner of the paper.
    For example, on my Lexmark printer, both X and Y offsets are
    calculated from a point 0.25 inches in from the edge. This keyword
    allows you to set a "fudge" factor that will be subtracted from
    the YOFFSET that is returned to the user. This allows you to create
    output that is centered on the page. The fudge factor should be in
    the same units as the returned size and offset values.

 OUTPUTS:

    pageInfo: The output value is a named structure defined like
    this:

      pageInfo = {PSWINDOW_STRUCT, XSIZE:0.0, YSIZE:0.0, $
         XOFSET:0.0, YOFFSET:0.0, INCHES:0, PORTRAIT:0, LANDSCAPE:0}

    The units of the four size fields are inches unless the CM
    keyword is set.

    The output can be used to immediately configure the PostScript
    or Printer device, like this:

       Set_Plot, 'PS' ; or 'PRINTER'
       Device, _Extra=pageInfo

 RESTRICTIONS:

    The aspect ratio of the current graphics window is calculated
    like this:

       aspectRatio = FLOAT(!D.Y_VSIZE) / !D.X_VSIZE

 EXAMPLE:

    To create a PostScript output window with the same aspect
    ratio as the curently active display window, type:

     pageInfo = PSWINDOW()
     SET_PLOT, 'PS'
     DEVICE, _Extra=pageInfo

     To configure the PRINTER device:

     pageInfo = PSWINDOW(/Printer, Fudge=0.25)
     SET_PLOT, 'PRINTER'
     DEVICE, _Extra=pageInfo

 MODIFICATION HISTORY:

    Written by: David Fanning, November 1996.
       Fixed a bug in which the YOFFSET was calculated incorrectly
          in Landscape mode. 12 Feb 97.
       Took out a line of code that wasn't being used. 14 Mar 97.
       Added correct units keyword to return structure. 29 JUN 98. DWF
       Fixed a bug in how landscape offsets were calculated. 19 JUL 99. DWF.
       Fixed a bug in the way margins were used to conform to my
          original conception of the program. 19 JUL 99. DWF.
       Added Landscape and Portrait fields to the return structure. 19 JUL 99. DWF.
       Added PageSize keyword, changed MARGIN keyword, and completely
          rewrote most of the intenal code. 9 FEB 2000. DWF.
       Fixed a bug in how I calculated the aspect ratio. 1 MAR 2000. DWF.
       Added PRINTER keyword to return proper offset values for the
          PRINTER device, where the offset location is not rotated. 1 MAR 2000. DWF.
       Added PRINTER fudge factors to take into account that printer offsets are
          calculated from the printable area of the paper, rather than the corner
          of the paper. 8 AUG 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\pswindow.pro)


PS_FORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   PS_FORM

 PURPOSE:
   This function puts up a form the user can configure a PostScript
   device driver. The function result (if the user selects either the
   ACCEPT or CREATE FILE buttons) can be sent directly to the DEVICE
   procedure by means of its _Extra keyword.  User's predefined
   configurations may be retrieved from a common block.

 AUTHOR:
   *********** CM 01 Feb 2000 VERSION *************
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   $Id: ps_form.pro,v 1.4 2001/12/11 20:20:37 craigm Exp $

   Based almost entirely on, but a totally revamped version of, PS_FORM by 
   FANNING SOFTWARE CONSULTING (David Fanning Ph.D.) http://www.dfanning.com

 MAJOR TOPICS:
   Device Drivers, Hardcopy Output, PostScript Output

 PROCEDURE:
   This is a pop-up form widget. It is a modal or blocking widget.
   Keywords appropriate for the PostScript DEVICE command are returned.

   Use your LEFT mouse button to move the "Plot Window" around the page.
   Use your RIGHT mouse button to draw your own "Plot Window" on the page.

 HELP:
   formInfo = PS_FORM(/Help)

 CALLING SEQUENCE:
    formInfo = PS_FORM(xoffset, yoffset, Cancel=cancelButton)

 OPTIONAL INPUTS:

    XOFFSET -- Optional xoffset of the top-level base of ps_form. Default is
    to try to center the form on the display.

    YOFFSET -- Optional yoffset of the top-level base of ps_form. Default is
    to try to center the form on the display.

 INPUT KEYWORD PARAMETERS:

    BITS_PER_PIXEL -- The initial configuration of the bits per pixel button.

    BLOCKING -- Set this keyword to make this a blocking widget under IDL 5.0.
    (All widget programs block under IDL 4.0.)

    COLOR -- The initial configuration of the color switch.

    DEFAULTS -- A stucture variable of the same type and structure as the
    RETURN VALUE of ps_form. It will set initial conditions. This makes
    it possible to start ps_form up again with the same values it had the
    last time it was called. For example:

       mysetup = ps_form()
       newsetup = ps_form(Defaults=mysetup)

    ENCAPSULATED -- The initial configuration of the encapsulated switch.

    FILENAME -- The initial filename to be used on the form.

    HELP -- Prints a helpful message in the output log.

    INCHES -- The initial configuration of the inches/cm switch.

    INITIALIZE -- If this keyword is set, the program immediately returns the
    "localdefaults" structure. This gives you the means to configue the
    PostScript device without interrupting the user.

    SELECT -- used only when INITIALIZE is set.  Set SELECT to a
              string which identifies the predefined configuration to
              be returned by ps_form when INITIALIZE is set.  This is
              a convenient way to select a predefined config
              non-interactively.

    LANDSCAPE -- The initial configuration of the landscape/portrait switch.

    LOCALDEFAULTS -- A structure like the DEFAULTS structure. If specified,
    then it is added as a predefined configuration entry called "Local".
    See below for a further discussion of predefined configurations.

    PREDEFINED -- An alternate way to specify predefined
                  configurations.  Pass an array of structures to
                  populate the "predefined" dropbox in the
                  dialog. This array, if specified, overrides the the
                  common block technique.

    XOFFSET -- The initial XOffSet of the PostScript window.

    YOFFSET -- The initial YOffSet of the PostScript window.

    XSIZE -- The initial XSize of the PostScript window.

    YSIZE -- The initial YSize of the PostScript window.

    ASPECT -- The aspect ratio of the window (Y/X).  This keyword can
              substitute for one of XSIZE or YSIZE.
 
    PRESERVE_ASPECT -- Set this keyword if you want to hold the
                       aspect ratio constant.

    PAPERSIZE -- If set, allows user to specify the size of the paper
                 media to be printed on, as a scalar string.  NOTE:
                 this specification cannot be passed to DEVICE, but
                 can be selected for completeness's sake.  Default is
                 'Letter'.

    MARGINSIZE -- Size of the margins on all sides.  Default is 0.25 inches.
                  When MARGINSIZE is non-zero, a graphic cannot directly
                  abut the edge of the page.  This is normally a good thing,
                  since there is often a  non-printable region which borders
                  the page.

   DEFAULTPAPER -- Default paper size to use, when it is unspecified
                   in a predefined, "local", or "default"
                   configuration.  This value also overrides any
                   configuration from common blocks.  European users
                   will probably set this to 'A4'.

   PARENT -- if this widget is invoked by another widget program,
             then this keyword parameter must be set to the top level
             widget which is to serve as the group leader.  Failure
             to do so will result in unexpected behavior.  IDL 4
             programs do not need to pass this parameter.  Default:
             NONE.

 OUTPUT KEYWORD PARAMETERS

    CANCEL -- This is an OUTPUT keyword. It is used to check if the user
    selected the "Cancel" button on the form. Check this variable rather
    than the return value of the function, since the return value is designed
    to be sent directly to the DEVICE procedure. The varible is set to 1 if
    the user selected the "Cancel" button. Otherwise, it is set to 0.

    CREATE -- This output keyword can be used to determine if the user
    selected the 'Create File' button rather than the 'Accept' button.
    The value is 1 if selected, and 0 otherwise.

    PAPERSIZE -- If set to a named variable, any newly selected paper
    size is returned in that variable.

    XPAGESIZE -- Size of paper in "X" dimension, in units given by
                 the returned config structure.

    YPAGESIZE -- Size of paper in "Y" dimension, in units given by
                 the returned config structure.

    PAGEBOX -- specifies the page rectangle relative to the plot
               window, in normalized units.  A 4-vector of the form
               [XLL, YLL, XUR, YUR] is returned, giving the positions
               of the lower left (LL) and upper right (UR) corners of
               the page with respect to the plot window.  Thus, the
               following command:

                    PLOT, x, y, position=PAGEBOX

               will construct a graphic whose plot region exactly
               fills the page (with no margin around the edges).

               Naturally, the page is usually larger than the
               graphics window, so the normalized coordinates will
               usually fall outside the range [0,1].

               However, the bounding box constructed by the
               Postscript driver includes only the graphics window.
               Anything drawn outside of it may be clipped or
               discarded.

 RETURN VALUE:

     formInfo = { ps_form_INFO, $
                  xsize:0.0, $        ; The x size of the plot
                  xoff:0.0, $         ; The x offset of the plot
                  ysize:0.0, $        ; The y size of the plot
                  yoff:0.0 $          ; The y offset of the plot
                  filename:'', $      ; The name of the output file
                  inches:0 $          ; Inches or centimeters?
                  color:0, $          ; Color on or off?
                  bits_per_pixel:0, $ ; How many bits per image pixel?
                  encapsulated:0,$    ; Encapsulated or regular PostScript?
                  isolatin1:0,$       ; Encoded with ISOLATIN1?
                  landscape:0 }       ; Landscape or portrait mode?

 USAGE:

  The calling procedure for this function in a widget program will
  look something like this:

     info.ps_config = ps_form(/Initialize)

     formInfo = ps_form(Cancel=canceled, Create=create, $
                          Defaults=info.ps_config)

     IF NOT canceled THEN BEGIN
        IF create THEN BEGIN
           thisDevice = !D.Name
           Set_Plot, "PS"
           Device, _Extra=formInfo

           Enter Your Graphics Commands Here!

           Device, /Close
           Set_Plot, thisDevice
           info.ps_config = formInfo
        ENDIF ELSE
           info.ps_config = formInfo
     ENDIF

 MAJOR FUNCTIONS and PROCEDURES:

   None. Designed to work originally in conjunction with XWindow, a
   resizable graphics window.  [ NOTE: this modified version of
   ps_form, by Craig Markwardt, is incompatible with the original
   version of XWINDOW. ]

 MODIFICATION HISTORY:

   Based on ps_form of : David Fanning, RSI, March 1995.
   Major rewrite by: Craig Markwardt, October 1997.
     - Drawing and updating of form and sample box are now modular
     - Option of storing more than one predefined postscript configuration
     - Selection of paper size by name
     - Access to predfined configurations through (optional) common
       block
   Several additions, CM, April 1998  VERSION CM2.0
     - better integration of paper sizes throughout program.
       Predefined configurations now also know about paper.
     - allow passing predefined configurations instead of using
       common block
     - addition of ISOLATIN selection, and streamlining of dialog
       appearance
   Fixed bug in INITIALIZE w.r.t. paper sizes, CM, Nov 1998
   Added SELECT keyword, CM, 09 Dec 1998
   Added Parent keyword to allow modal widgets in IDL 5, 19 Jan 1999
   Added "Choose" button for filename selection, 19 Sep 1999
   Added ability to program different button names, 19 Sep 1999
   Added ASPECT and PRESERVE_ASPECT, based on work by Aaron Barth, 18
     Oct 1999
   Removed NOCOMMON documentation and logic, 19 Oct 1999, CM
   Added aspect to ps_form_numevents (per Aaron Barth), 18 Oct 1999
   Corrected small bug under Initialize keyword (inches), 18 Oct 1999
   Made call to *_pscoord more consistent, 18 Oct 1999
   Added XPAGESIZE, YPAGESIZE and PAGEBOX keywords, 19 Oct 1999
   Small cosmetic cleanup, CM, 01 Feb 2000
   Fix for IDL 5.5's handling of structures with arrays, CM, 11 Dec 2001

 COMMON BLOCKS:
 
   The user may store frequently used or helpful configurations in a 
   common block, and ps_form() will attempt to access them.  This
   provides a way for the user to have persistent, named,
   configurations.

   NOTE: this format has changed since the last version.  You may
   have to quit your IDL session for the changes to take effect
   properly.  If you have place a predefined configuration in your
   startup file, you should review the new format.
   
     COMMON PS_FORM_CONFIGS, ps_form_DEFAULT_PAPERSIZE, $
                               ps_form_STDCONFIGS

        ps_form_DEFAULT_PAPERSIZE - a string designating the default
                                    paper size, when none is given.
                                    The predefined configurations
                                    offerred by this program will
                                    respect the default value.  (See
                                    also the DEFAULTPAPER keyword.)

        ps_form_STDCONFIGS - An array of ps_form_CONFIG structures,
                             each containing information about one
                             predefined configuration, such as its
                             name and size of paper.  Each "config"
                             element is a ps_form_INFO structure,
                             which contains the actual postscript
                             configuration.

   See the IDL source code ps_form_LOAD_CONFIGS for an example of how
   to make a list of configurations.  One possibility would be to
   declare and populate the common block from within the user's
   start-up script, allowing the same configurations to appear in
   every session.

   ps_form() takes its initial list of configurations from this
   common block if it exists.  A default list is provided ala the
   procedure ps_form_LOAD_CONFIGS.  Any modifications that take place
   during the ps_form() widget session are not transferred back to
   the common block upon return.  It might be useful to be able to do
   this, through some form of 'save' procedure.

   Also, if the PREDEFINED keyword is used, then the common block is
   not consulted.

  $Id: ps_form.pro,v 1.4 2001/12/11 20:20:37 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\ps_form.pro)


PUTBITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PUTBITS
 PURPOSE:
       Insert specified bits in a target.
 CATEGORY:
 CALLING SEQUENCE:
       out = putbits(src, tar, s, n)
 INPUTS:
       src = integer scalar value to get bits from.    in
       tar = integer scalar value to insert bits in.   in
       s = bit number in tar to start at (LSB is 0).   in
       n = number of bits to insert.                   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = returned value.                           out
 COMMON BLOCKS:
 NOTES:
       Notes: source and target must be a single scalars of
         one of the integer data types (byte, int, u_int,
         long, u_long, long_64, u_long_64).
         Returned value is same data type as target.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 7

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\putbits.pro)


PUTFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PUTFILE
 PURPOSE:
       Write a text file from a string array.
 CATEGORY:
 CALLING SEQUENCE:
       putfile, f, s
 INPUTS:
       f = text file name.      in
       s = string array.        in
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  error flag: 0=ok, 1=invalid string array.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 20 Mar, 1990
       R. Sterner,  4 Nov, 1992 --- allowed scalar strings.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\putfile.pro)


PUTSTR

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:
   putstr
 
 PURPOSE:
   use cursor to position and orient text on a plot

 USEAGE:
   putstr,label,xs,ys,orient=orient,charsize=charsize,color=color,$
           subnorm=subnorm,norm=norm,align=align,contrast=contrast, $
           bg_color=bg_color,box=box,valign=valign

 INPUT:

  label
    text label, type string

  xs
    x position of string (data coordinates, default)

  ys
    y position of string (data coordinates, default)


 KEYWORD INPUT:

  orient
    orientation in degrees

  charsize
    character size parameter.  The character size is the value of 
    CHARSIZE * !p.charsize.  (default=1)

  subnorm
    if set, x and y positions are specified in data window
    sub-normalized coordinates, i.e, the range 0 to 1 spans the entire
    data coordinate range.  Note that this is different then the
    usual IDL normalized coordinates.  When SUBNORM is set, a
    given x,y coordinate causes the text to appear in the same
    data window region regardless of how the x and y axes are
    scaled. LEGEND also uses this coordinate system.

  norm
    if set, x and y positions are specified in usual IDL normalized
    coordinates, i.e, the range 0 to 1 spans the entire window
    display range.

  align
    the text alignment point.  

    ALIGN=0.0 =>  text is left justified to x,y
    ALIGN=0.5 =>  text is centered at x,y
    ALIGN=1.0 =>  text is right justified to x,y
    
    The use of ALIGN is particularly useful to center or justify a
    multiline text string (see example).  Also, keep in mind the
    length of a string isn't always predictable when written to a
    hardcopy device. ALIGN should be used if you want to center or
    right justify a string to line up with something.
               
  valign
    vertical offset in character units. This keyword has no effect
    in interactive mode.
  
  contrast
    if set, PUTSTR writes the string twice; the first time the string
    will be drawn with very thick lines and in a contrasting color.
    The second time it will be drawn at the standard line thickness
    (from !p.thick) and with the color set by the color keyword.  You
    can control the thickness and the background color by setting
    CONTRAST to a two element vector, [thick,color]. This option
    should be used to draw annotation within image areas, where the
    legibility may otherwise suffer due to lack of contrast.

 KEYWORD INPUT:
 
 OUTPUT:
    none
 
 DESCRIPTION:
   Use PUTSTR to interactively position a text label on a plot.  The
   size and orientation of the text label are adjusted by pressing
   the left or middle mouse buttons.  Initially the LMB and MMB
   control the size of the label.  To enable the use of the LMB and
   MMB to control the label orientation angle, press the RMB and
   select the ANGLE menu item.
               
   To quit the proceedure press RMB and select the "QUIT" menu item.
   
   On exit, the PUTSTR command line options which will reproduce the
   text in the final position and orientation is printed to the
   terminal.  This string may be appended to the original PUTSTR
   comand using xwindows cut and paste.
   
   For similar text annotation capabiltiy see LEGEND.PRO

 EXAMPLE:

;; interactive placement of text strings:

 plot,randf(200,2)
 t1='Use PUTSTR to interactively position a text label!c'
 t2='on a plot.   The size and orientation of the text label!c'
 t3='are adjusted by pressing the left or middle mouse buttons.'
 text=t1+t2+t3
 putstr,text
 putstr,text,align=.5
 putstr,text,align=1

;; use putstr in non-interactive mode

 !p.multi=[0,1,2]
 window,0,xs=600,ys=900
 plot,randf(200,2),ymargin=[10,2]
 text='Figure 1. Dew point temperature as a function of!c' + $
      '          foobar position relative to mordant.'
 putstr,text,/subnorm,0.0,-0.2,charsize=2.0,orient=0.0
 plot,randf(200,3),ymargin=[10,2]
 text='Figure 2. Triple point temperature as a function of!c' + $
      '          mordant position relative to foobar.'
 putstr,text,/subnorm,0.0,-0.2,charsize=2.0,orient=0.0
 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\putstr.pro)


PUT_ASAD_INITIAL_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 put_asad_initial_data

 PURPOSE:
  Read  initial chemical values (for ASAD-model-runs ) 
  from an ascii-file (see example: initial.dat)  and  
  write them to a net-CDF-file (see example: initial.nc).

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   put_asad_inital_data,file.outfile


 INPUTS:
   file : input ASCII File
   outfile:  name of netCDF File

  PROCEDURE:
    Example Output file from get_asad_initial_data:


 EXAMPLE:
   put_asad_inital_data,'initial1.out','initial.nc'
   Syntax of ASCII file
   INPUT FILE FROM: initial1.nc
   LAT           12.000000
   LONG          4.3500671
   EQLAT         1.5379410
   TND           8.2151784e+17


 MODIFICATION HISTORY:
  R.Bauer 1998-Aug-04
  M.Kraemer 1998-Aug-04

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mk_lib\put_asad_initial_data.pro)


PUT_FILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
	put_file

 PURPOSE:
   This routine writes data to a file

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   put_file(file,array,[reform=reform],[separator=separator],[error=error],[/no_overwrite],[/transpose])

 INPUTS:
 file:  the filename to write to
 array: the array or vector to write

 OPTIONAL INPUTS:

 KEYWORD PARAMETERS:
 no_overwrite: if set text will not overwritten
 transpose:    if set text is transposed before writing
 APPEND:       if set text is appended to a given file
 reform:       if n_elements gt 0 and eq get_faktor(array) then the array will be reformed
 separator:    if set it is the separator instead of space between the values
 error:        A named variable to place the error status in (0: is good 1: is bad)

 EXAMPLE:
 put_file,'test.dat',sindgen(10,2)
 ==
 0 1 2 3 4 5 6 7 8 9
 10 11 12 13 14 15 16 17 18 19

 put_file,'test.dat',sindgen(10,2),separator=','
 ==
 0,1,2,3,4,5,6,7,8,9
 10,11,12,13,14,15,16,17,18,19

 put_file,'test.dat',sindgen(10,2),/transpose
 ==
 0 10
 1 11
 2 12
 3 13
 4 14
 5 15
 6 16
 7 17
 8 18
 9 19

 put_file,'test.dat',sindgen(10,2),reform=[4,5]
 ==
 0 1 2 3
 4 5 6 7
 8 9 10 11
 12 13 14 15
 16 17 18 19


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-05
   1998-10-27  feature append form Th.Brauers putfile2 appended
   1998-12-14  error handling implemented
   1999-06-19  bug with separator removed
   2000-Feb-20 get_faktor removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\put_file.pro)


PUT_FZJ_LOGO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	put_fzj_logo

 PURPOSE:
	This procedure draws the FZJ logo onto a PS plot.
	Optionally the phrase "Forschungszentrum Jülich" is printed as well.

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	put_fzj_logo [,image] [,HEIGHT = height] [,DISTANCE = dist] [,/BOTTOM]

 OPTIONAL INPUTS:
	image:	true color image of the FZJ logo (three-dimensional array of type byte)
		with optional phrase "Forschungszentrum Jülich"
	If this parameter is not supplied the routine 'image = get_fzj_logo()' is called.

 KEYWORD PARAMETERS:
	HEIGHT = height: Height of the image in cm (default: 2cm). A scalar of type float.
	DISTANCE = dist: Distance to the paper margin in cm (default: 1cm).
		A scalar of type float.
	/BOTTOM:	If set, the logo will be put at the bottom of the figure.

 	Only if the parameter image is not supplied:

	TIF_FILE = tif_file:	Name of the input image file in tif format.
		default logo: S:\links\idl_source\idl_work\fh_lib\data\fzj_logo.tif
		default header: S:\links\idl_source\idl_work\fh_lib\data\fzj_header.tif
	Keyword parameters which are passed into the routine get_fzj_logo:
		/HEADER, DATFILE = datfile

 RESTRICTIONS:
	This routine does only work with the plot device 'PS'.
	If another plot device was chosen the routine returns with a message.

 EXAMPLE:
	put_fzj_logo

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05.03.99

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\put_fzj_logo.pro)


PUT_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PUT_SCALE
 PURPOSE:
       Embed in current image values needed to restore scaling.
 CATEGORY:
 CALLING SEQUENCE:
       put_scale
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         The following are only used to add scaling to an
         existing image not easily regenerated:
         IX=[ix1,ix2]  Plot window x device coordinates.
         IY=[iy1,iy2]  Plot window y device coordinates.
         X = [x1,x2]   Plot window x data coordinates.
         Y = [y1,y2]   Plot window y data coordinates.
         TYPE_X=xtyp    X axis type: 0=linear, 1=log.
         TYPE_Y=ytyp    Y axis type: 0=linear, 1=log.
         LOG=name  Logs values to $HOME/put_scale.txt under
           name (anything, but image name is useful).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Embeds in dispayed image the following values:
         1234567890 - Used to determine if scaling available (I10).
         ix1, ix2 - Plot window device coordinates in X (2I6).
         iy1, iy2 - Plot window device coordinates in Y (2I6).
         x1, x2 - Plot window data coordinates in X (2G13.6).
         y1, y2 - Plot window data coordinates in Y (2G13.6).
         xtype, ytype - X and Y axis type: 0=linear, 1=log (2I2).
         For type=1 the data range is really the log10 of
         the actual data range for that axis.
       
         Use set_scale to read these values and set scaling.
         May also read 90 bytes and convert to string:
           print,string(tvrd(0,0,90,1))
         Only works if image stored in non-lossy format.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Feb 28
       R. Sterner, 1995 Aug 24 --- Added keywords.
       R. Sterner, 1999 Jul  8 --- Added LOG=name keyword.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\put_scale.pro)


PWD[1]

[Previous Routine] [Next Routine] [List of Routines]
 routine    pwd
 purpose    print the current working directory

 output:
   cwd     directory name string. if present in argument list
           directory string is not printed to terminal.

  author:  Paul Ricchiazzi                            jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\pwd.pro)


PWD[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        PWD

 PURPOSE:
        Print current working directory, Just shorter than
        cd,current=cur & print,cur.

 CATEGORY:
        General programming.

 CALLING SEQUENCE:
        PWD [,result]

 INPUTS:
        none

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        RESULT -> (optional) string containing the current directory

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        Set !QUIET to 1 if you only want to return the working directory
        but no screen output.

 EXAMPLE:
        pwd

 MODIFICATION HISTORY:
        mgs, 23 Dec 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\pwd.pro)


P_H2O

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	p_H2O

 PURPOSE:
	This function returns the saturation vapor pressure of water at a given temperature.

 CATEGORY:
	PHYSCHEM

 CALLING SEQUENCE:
	result = p_H2O(Temp, Pres [, /WATER] [, /ICE] [, /TORR] [, MIXING_RATIO = mr] [, ERROR_TEMP = sig_temp, ERROR_PH2O = sig_ph2o])

 INPUTS:
	Temp:	Scalar or array with temperature data [Grad C]
  Pres: Scalar or array with total pressure data [mbar]

 KEYWORD PARAMETERS:
	/ICE	:	If set the saturation water vapor pressure over ice is returned.
	/WATER:	If set the saturation water vapor pressure over liquide water is returned.
	/TORR:	If set the saturation water vapor pressure is returned in Torr.
	MIXING_RATIO: Set this keyword to a named variable in which to return the
					  the water vapor mixing ratio by volume.
	ERROR_TEMP = sig_temp	: Input  - Error of temp data [Grad C]
	ERROR_PH2O = sig_ph2o	: Output - Error of pH2O data [mbar] or [Torr] if /TORR

 OUTPUTS:
	result:	Scalar or array with the saturation water vapor pressure [mbar]
				at a given temperature and total pressure

 PROCEDURE:
  The calculation of the saturation water vapor pressure over liquide water
	or ice is based on the equations given in the manual of the General Eastern
	dew point hygrometer HYGRO M1 (Nov. 1989).
	The general form of the equation is:
					p_H2O = (a + b*P) * c * exp[d*T / (e+T)]
	The term (a + b*P) takes into account that the behavior of water vapor in air
	is slightly different from the ideal behavior of pure water vapor.

	The error calculation is limited to statistical errors in temp,
	i.e. based on an evaluation of the equation p_H2O = A * exp[d*T / (e+T)]
	Any statistical errors in pres are neglected.

 EXAMPLE:
	PRINT, p_H2O([-10., 20], 1013., /TORR, MIX = mix, ERROR_TEMP = 0.2, ERROR_PH2O = sig), mix, sig
  	->	p(H2O):		   1.95804      17.6111
  	-> x(H2O):		0.00193666    0.0176927
		-> s(pH2O):		 0.0347640     0.218169

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09. Feb. 1999
	19.03.99:	Header corrected
					New keyword parameters introduced: ERROR_TEMP, ERROR_PH2O

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\p_h2o.pro)


QAVER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		QAVER
 VERSION:
		4.0
 PURPOSE:
		Performs Q averaging which is the discrete equivalent of exponential
		averaging
 CATEGORY:
		Mathematical, array.
 CALLING SEQUENCE:
		Result = QAVER(ARR [,NAVER [,/INVERSE]])
 INPUTS:
	ARR
		Numerical vector.
 OPTIONAL INPUT PARAMETERS:
	NAVER
		Equivalent averaging length.  Default velue is one (in which case the
		output simply equals the input).
 KEYWORD PARAMETERS:
	/INVERSE
		Switch.  If set, the original vector is restored from the average.
 OUTPUTS:
		Returns a vector of the same length and type as ARR, such that
		RES[i] = (1 - Q)*Sum(ARR(i-j)*Q^j), where Q = 1 - 1/NAVER.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls DEFAULT from MIDL.
 MODIFICATION HISTORY:
		Created 25-JUN-2000 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\qaver.pro)


QPINT1D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QPINT1D

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   One dimensional numerical integration of IDL function or expression

 MAJOR TOPICS:
   Numerical Analysis.

 CALLING SEQUENCE:
   value = QPINT1D(FUNCT, A, B, [ PRIVATE, /EXPRESSION, FUNCTARGS=, 
                   ERROR=error, NFEV=nfev, STATUS=status, NSUBINTERVALS=nsub,
                   EPSABS=, EPSREL=, LIMIT=, BREAKPOINTS=, NPOINTS=
                   /SYMMETRIC, SYM_AXIS= ] )

 DESCRIPTION:

  QPINT1D adaptively calculates an approximation result to a given
  definite integral

       result = Integral[ f(x) dx ] over [a,b]

  hopefully satisfying a constraint on the accuracy of the solution.
  QPINT1D is based on the QUADPACK fortran package originally by
  Piessens, de Doncker, Ueberhuber and Kahaner (and implements
  equivalents to the QAGSE, QAGPE, QAGIE, and DQKxx fortran routines).

  The returned result is intended to satisfy the following claim for
  accuracy: ABS(result-value) LE MAX([epsabs, epsrel*ABS(value)]),
  where VALUE is the true value of the integral, and EPSABS and
  EPSREL are the absolute and relative error tolerances defined
  below.  An estimate of the error is returned in the ERROR keyword.
  Either A or B may be finite or infinite (i.e., an improper
  integral).

  QPINT1D is "adaptive" in the sense that it locates regions of the
  integration interval which contain the highest error, and focusses
  its efforts on those regions.  The algorithm locates these regions
  by successively bisecting the starting interval.  Each subinterval
  is assigned an error estimate, and the region with the largest
  error estimate is subdivided further, until each subinterval
  carries approximately the same amount of error.  Convergence of the
  procedure may be accelerated by the Epsilon algorithm due to Wynn.

  The estimate of the integral and the estimate of the error in each
  subinterval are computed using Gauss Kronrod quadrature.
  Integrators based on the 15-, 21-, 31-, 41-, 51- and 61-point
  Gauss-Kronrod rule are available, and selected using the NPOINTS
  keyword.  Generally, the more points the greater the precision,
  especially for rapidly varying functions.  However the default
  value of 21 is often sufficient, especially because of the adaptive
  nature of QPINT1D.

  In the following sections the requirements for the form of the
  integrand are established.  Also, a description of how QPINT1D
  handles singularities and discontinuities is presented.

 INTEGRAND is a FUNCTION

  The integrand can be specified in two forms, either as a standard
  IDL function, or as an IDL expression.  If integrating a function,
  then the FUNCT should be a string naming the function.  The
  function must be declared as following:

    FUNCTION MYFUNCT, X, P, KEYWORDS=...
      RETURN, (compute function of X and P)
    END

  The function must accept at least one, but optionally two,
  parameters.  The first, 'X', is a vector of abcissae where the
  function is to be computed.  The function must return the same
  number of function values as abcissae passed.  The second
  positional parameter, 'P', is a purely optional PRIVATE parameter
  as described below.  MYFUNCT may accept more positional parameters,
  but QPINT1D will not use them.  The difference between X and P is
  that X is the variable of integration, while P contains any other
  information expected to remain essentially constant over the
  integration.

 INTEGRAND is an EXPRESSION

  The integrand can also be specfied as an IDL expression and setting
  the EXPRESSION keyword.  Any expression that can accept a vector of
  abcissae named 'X' and produce a corresponding vector of output is
  a valid expression.  Here is an example:

    RESULT = QPINT1D('X^2 * EXP(-X)', /EXPRESSION, 0D, 10D)

  It is important to note that the variable of integration must
  always be named 'X', and the expression must be vectorizable.  The
  expression may also use the PRIVATE data, and as above, it would be
  referred to according to the variable 'P'.  For example, if the
  exponential decay constant is parameterized by PRIVATE(0), then the
  expression would be:

    RESULT = QPINT1D('X^2 * EXP(-X/P(0))', /EXPRESSION, 0D, 10D, PRIVATE)

  The user is solely responsible for defining and using the PRIVATE
  data.  QPINT1D does not access or modify PRIVATE / P; it only
  passes it on to the user routine for convenience.

 IMPROPER INTEGRALS and DISCONTINUITIES

  QPINT1D computes improper integrals, as well as integrands with
  discontinuities or singularities.  

  Improper integrals are integrals where one or both of the limits of
  integration are "infinity."  (Formally, these integrals are defined
  by taking the limit as the integration limit tends to infinity).
  QPINT1D handles a small class of such integrals, generally for
  integrands that are convergent and monotonic (i.e.,
  non-oscillatory, and falling off as 1/ABS(X)^2 or steeper).  Such
  integrals are handled by a transformation of the original interval
  into the interval [0,1].

  Integrals from negative infinity to positive infinity are done in
  two subintervals.  By default the interval is split at X EQ 0,
  however this can be controlled by using the SYM_AXIS keyword.
  Users should note that if the first subinterval fails the second is
  not attempted, and thus the return value VALUE should not be
  trusted in those cases.

  Infinite integration limits are specified by using the standard
  values !VALUES.F_INFINITY or !VALUES.D_INFINITY.  No other special
  invocation syntax is required.

  The integration routine is able to handle integrands which have
  integrable singularities at the endpoints.  For example, the
  integral:

    RESULT = QPINT1D('2*sqrt((1-x)/(1+x))/(1-x^2)', 0.0d, 1d, /expr)

  has a singularity at a value of X EQ 1.  Still, the singularity is
  integrable, and the value returned is a correct value of 2.

  If known singularities are present within the interval of
  integration, then users should pass the BREAKPOINTS keyword to list
  the locations of these points.  QPINT1D will then integrate each
  subinterval separately, while still maintaining an overall error
  budget.

  If known discontinuities exist in the integrand, then the user may
  additionally list those points using the BREAKPOINTS keyword.

  It should be noted that the algorithm used is different, depending
  on whether the BREAKPOINTS keyword has been specified or not (this
  is the difference between the QAGSE vs. QAGPE routines in the
  original FORTRAN).  The algorithm *without* BREAKPOINTS is
  generally thought to be more precise than *with*.  Thus, it may be
  worth splitting the original integration interval manually and
  invoking QPINT1D without BREAKPOINTS.


 INPUTS:

  FUNCT - by default, a scalar string containing the name of an IDL
          function to be integrated.  See above for the formal
          definition of MYFUNCT.  (No default).

          If the EXPRESSION keyword is set, then FUNCT is a scalar
          string containing an IDL expression to be evaluated, as
          described above.

  A, B - a scalar number indicating the lower and upper limits of the
         interval of integration (i.e., [A, B] is the interval of
         integration).

  PRIVATE - any optional variable to be passed on to the function to
            be integrated.  For functions, PRIVATE is passed as the
            second positional parameter; for expressions, PRIVATE can
            be referenced by the variable 'P'.   QPINT1D does not
            examine or alter PRIVATE.

 RETURNS:

   The value of the integral.  If either A or B are double precision,
   then the integral is computed in double precision; otherwise the
   result is returned in single precision floating point.

 KEYWORD PARAMETERS:

   BREAKPOINTS - an array of numbers specifying points within the
                 integration interval where the integrand is
                 discontinuous or singular.  Out of bounds points are
                 ignored.
                 Default: undefined, i.e., no such points

   EPSABS - a scalar number, the absolute error tolerance requested
            in the integral computation.  If less than or equal to
            zero, then the value is ignored.
            Default: 0

   EPSREL - a scalar number, the relative (i.e., fractional) error
            tolerance in the integral computation.  If less than or
            equal to zero, then the value is ignored.
            Default: 1e-4 for float, 1d-6 for double

   EXPRESSION - if set, then FUNCT is an IDL expression.  Otherwise,
                FUNCT is an IDL function.

   ERROR - upon return, this keyword contains an estimate of the
           error in the computation.

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by FUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.  By default, no extra parameters
               are passed to the user-supplied function.

   LIMIT - a scalar, the maximum number of subintervals to create
           before terminating execution.  Upon return, a STATUS value
           of 1 indicates such an overflow occurred.
           Default: 100

   NFEV - upon return, this keyword contains the number of function
          calls executed (i.e., the number of abcissae).

   NPOINTS - a scalar, the number of Gauss Kronrod points to use in
             computing the integral over a subinterval.  A larger
             number of points can in principle increase the precision
             of the integral, but also makes the computation take
             longer.  Possible values are 15, 21, 31, 41, 51, and 61.
             NPOINTS is rounded up to the next nearest available set,
             with a maximum of 61.
             Default: 21

   NSUBINTERVALS - upon return, this keyword contains the number of
                   subintervals the integration interval was divided
                   into.

   STATUS - upon return, the status of the integration operation is
            returned in this keyword as an integer value.  A value of
            zero indicates success; otherwise an abnormal condition
            has occurred and the returned value should be considered
            erroneous or less reliable according to STATUS:

                 any negative number - outright failure (reserved for
                                       future use).

                 -1 - the input parameters are invalid, because
                      epsabs LE 0 and epsrel LT max([50*EPS,0.5d-28]),
                      where EPS is the machine precision, or if LIMIT
                      is smaller than the number of BREAKPOINTS.

                  0 - success.

                  1 - maximum number of subdivisions allowed has been
                      achieved. One can allow more subdivisions by
                      increasing the value of limit (and taking the
                      according dimension adjustments into
                      account). However, if this yields no
                      improvement it is advised to analyze the
                      integrand in order to determine the integration
                      difficulties.  If the position of a local
                      difficulty can be determined (i.e. singularity,
                      discontinuity within the interval), it should
                      be supplied to the routine as an element of the
                      vector BREAKPOINTS.

                  2 - The occurrence of roundoff error is detected,
                      which prevents the requested tolerance from
                      being achieved.  The error may be
                      under-estimated.

                  3 - Extremely "bad" integrand behaviour occurs at
                      some points of the integration interval.

                  4 - The algorithm does not converge.  Roundoff
                      error is detected in the extrapolation table.
                      It is presumed that the requested tolerance
                      cannot be achieved, and that the returned
                      result is the best which can be obtained.

                  5 - The integral is probably divergent, or only
                      slowly convergent.  It must be noted that
                      divergence can occur with any other value of
                      ier GT 0.

   SYM_AXIS - a scalar number, the bisection point of the real line
              for improper integrals from negative infinity to
              positive infinity.  Otherwise ignored.
              Default: 0.

   
 EXAMPLES:

  Shows how function and expression can be used for exponential
  integrand:

    IDL> print, qpint1d('EXP(X)', 0D, 10D, /expr)
           22025.466
    IDL> print, qpint1d('EXP', 0D, 10D)
           22025.466

  Normal definite integral, and then parameterized using a PRIVATE
  value of 2.
    IDL> print, qpint1d('X^2*EXP(-X)', 0D, 10D, /expr)
           1.9944612
    IDL> print, qpint1d('X^2*EXP(-X/P(0))', 0D, 10D, 2D, /expr)
           14.005568

  Improper integrals of the gaussian function
    IDL> inf = !values.d_infinity
    IDL> print, qpint1d('EXP(-X^2)', 0D, +inf, 2D, /expr)
          0.88622693
    IDL> print, qpint1d('EXP(-X^2)', -inf, +inf, 2D, /expr), sqrt(!dpi)
           1.7724539       1.7724539
  The second integral shows the comparison to the analytic value of
  SQRT(!DPI).

 COMMON BLOCKS:

   COMMON QPINT1D_MACHAR
   COMMON QPINT1D_PROFILE_COMMON
   COMMON QPINT1D_QKEVAL_COMMON

   These common blocks are used internally only and should not be
   accessed or modified.

 REFERENCES:

    R. Piessens, E. deDoncker-Kapenga, C. Uberhuber, D. Kahaner
    Quadpack: a Subroutine Package for Automatic Integration
    Springer Verlag, 1983.    Series in Computational Mathematics v.1
    515.43/Q1S  100394Z

    Netlib repository: http://www.netlib.org/quadpack/

    SLATEC Common Mathematical Library, Version 4.1, July 1993
    a comprehensive software library containing over
    1400 general purpose mathematical and statistical routines
    written in Fortran 77.  (http://www.netlib.org/slatec/)

 MODIFICATION HISTORY:
   Written, Feb-Jun, 2001, CM
   Documented, 04 Jun, 2001, CM
   Add usage message, error checking, 15 Mar 2002, CM
   Correct usage message, 28 Apr 2002, CM

  $Id: qpint1d.pro,v 1.13 2002/05/02 07:00:43 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qpint1d.pro)


QQNORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    qqnorm

 PURPOSE:
    Compute the expected deviation from the mean probability
    distribution (or something of this sort).

 CATEGORY:
    Math

 MODIFICATION HISTORY:
    mgs, 14 Dec 1998: VERSION 1.00
    mgs, 26 Aug 2000: -added (dull) header and copyright

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\qqnorm.pro)


QRFAC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QRFAC

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Perform QR decomposition of a rectangular matrix

 MAJOR TOPICS:
   Linear Systems

 CALLING SEQUENCE:
   QRFAC, A, R, [ IPVT, /PIVOT ]

 DESCRIPTION:

  Given an MxN matrix A (M>N), the procedure QRFAC computes the QR
  decomposition (factorization) of A.  This factorization is useful
  in least squares applications solving the equation, A ## x = B.
  Together with the procedure QRSOLV, this equation can be solved in
  a least squares sense.

  The QR factorization produces two matrices, Q and R, such that

     A = Q ## R

  where Q is orthogonal such that TRANSPOSE(Q)##Q equals the identity
  matrix, and R is upper triangular.  This procedure does not compute
  Q directly, but returns the more-compact Householder reflectors,
  which QRSOLV applies in constructing the solution.

  Pivoting can be performed by setting the PIVOT keyword.  Rows with
  the largest L2-norm are pivoted into the top positions of the
  matrix.  The permutation matrix is returned in the IPVT parameter.


 PARAMETERS:

   A - upon input, an MxN matrix to be factored.

       Upon output, the upper triangular MxN matrix of Householder
       reflectors used in reconstructing Q.  Obviously the original
       matrix A is destroyed upon output.

       Note that the dimensions of A in this routine are the
       *TRANSPOSE* of the conventional appearance in the least
       squares matrix equation.

   R - upon ouptut, an upper triangular NxN matrix

   IPVT - upon output, the permutation indices used in partial
          pivoting.  If pivoting is used, this array should be passed
          to the PIVOTS keyword of QRSOLV.  If the PIVOT keyword is
          not set, then IPVT returns an unpermuted array of indices.

 KEYWORD PARAMETERS:

   PIVOT - if set, then partial pivoting is performed, to bring the
           rows with the largest norm to the top of the matrix.


 EXAMPLE:

  Decompose the 3x2 matrix [[9.,2.,6.],[4.,8.,7.]]
    aa = [[9.,2.,6.],[4.,8.,7.]]
    qrfac, aa, r, ipvt

     IDL> print, aa
          1.81818      0.181818      0.545455 
         XXXXXXXXX      1.90160      0.432573 
    (position marked with Xs is undefined)

  Construct the matrix Q by expanding the Householder reflectors
  returned in AA.  ( M = 3, N = 2 )

    ident = fltarr(m,m)  ;; Construct an identity matrix
    ident(lindgen(m),lindgen(m)) = 1

    q = ident
    for i = 0, n-1 do begin
     v = aa(*,i) & if i GT 0 then v(0:i-1) = 0  ;; extract reflector
     q = q ## (ident - 2*(v # v)/total(v * v))  ;; generate matrix
    endfor

  Verify that Q ## R returns to the original AA

     print, q(0:1,*) ## r
         9.00000      4.00000
         2.00000      8.00000
         6.00000      7.00000
     (transposed)

  See example in QRSOLV to solve a least squares problem.
   

 REFERENCES:

   More', Jorge J., "The Levenberg-Marquardt Algorithm:
     Implementation and Theory," in *Numerical Analysis*, ed. Watson,
     G. A., Lecture Notes in Mathematics 630, Springer-Verlag, 1977.

 MODIFICATION HISTORY:
   Written (taken from MPFIT), CM, Feb 2002
   Added usage message, error checking, CM 15 Mar 2002
   Corrected error in EXAMPLE, CM, 10 May 2002

  $Id: qrfac.pro,v 1.3 2002/05/10 18:41:44 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qrfac.pro)


QRSOLV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QRSOLV

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Solve a linear equation after performing QR factorization

 MAJOR TOPICS:
   Linear Systems

 CALLING SEQUENCE:
   X = QRSOLV(A, R, B, PIVOTS=IPVT)

 DESCRIPTION:

  The procedure QRSOLV completes the solution of a linear equation,

        A ## x = B

  after the MxN matrix has been factorized by QR decomposition.
  After being factorized once using QRFAC, the matrices can be used
  for multiple righthand sides (i.e., different B's).

  The solution technique is to first compute the factorization using
  QRFAC, which yields the orthogonal matrix Q and the upper
  triangular matrix R.  [ Actually, Q is represented by its
  Householder reflectors. ]  Then the solution vector, X, is computed
  using QRSOLV.

  If pivoting was performed in the factorization, the permutation
  vector IPVT returned by QRFAC must also be passed to QRSOLV.
  

 PARAMETERS:

   A - upon input, the factorized matrix A, returned by QRFAC.

   R - upon input, the upper diagonal matrix R, returned by QRFAC.

   B - upon input, the righthand vector B, which fits into the
       equation,  A ## x = B

   X - upon ouptut, the solution vector X, to the above linear
       equation.  For an overdetermined system, X is the least
       squares solution which minimizes TOTAL( (A ## X - B)^2 ).


 KEYWORD PARAMETERS:

   PIVOTS - upon input, the permutation matrix IPVT returned by
            QRFAC, if pivoting is to be performed.


 EXAMPLE:

  Solve the equation A ## X = B, in the least squares sense, where:

    A = [[1.0,1.0,1.0,1.0,1.0,1.0],$
         [0.6,0.8,0.5,0.8,0.7,0.9],$
         [0.2,0.3,0.1,0.4,0.3,0.4]]

  and B = [0.57E,0.69,0.5,0.7,0.6,0.8]

  qrfac, a, r, ipvt, /PIVOT
  x = qrsolv(a, r, b, PIVOTS=ipvt)

  print, x
       0.0834092     0.852273    -0.179545

 REFERENCES:

   More', Jorge J., "The Levenberg-Marquardt Algorithm:
     Implementation and Theory," in *Numerical Analysis*, ed. Watson,
     G. A., Lecture Notes in Mathematics 630, Springer-Verlag, 1977.

 MODIFICATION HISTORY:
   Written (taken from MPFIT), CM, Feb 2002
   Usage message, error checking, CM, 15 Mar 2002
   Error checking is fixed, CM, 10 May 2002

  $Id: qrsolv.pro,v 1.3 2002/05/10 18:41:31 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qrsolv.pro)


QTANG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTANG

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Find rotation angle(s) of unit quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   PHI = QTANG(Q)

 DESCRIPTION:

  The function QTANG accepts a unit quaternion Q and returns the
  rotation angle PHI of the quaternion.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.

 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.

 RETURNS:

  For a single quaternion, returns the scalar quaternion rotation
  angle in radians.  For N quaternions, returns an N-vector of
  rotation angles.

 KEYWORD PARAMETERS:

  NONE

 EXAMPLE:

   IDL> print, qtang(qtcompose([0d,1,0], !dpi/4))
         0.78539816

   Prints the angle part of the quaternion composed of a rotation of
   !dpi/4 radians around the axis [0,1,0]

 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtang.pro,v 1.5 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtang.pro)


QTAXIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTAXIS

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Find rotation axis of unit quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   VAXIS = QTAXIS(Q)

 DESCRIPTION:

  The function QTAXIS accepts a unit quaternion Q and returns the
  rotation axis VAXIS as a unit vector.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.

 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.

 RETURNS:

  For a single quaternion, returns the rotation axis unit vector in a
  3-vector. For N quaternions, returns a 3xN-vector of rotation
  axis unit vectors.

 KEYWORD PARAMETERS:

  NONE

 EXAMPLE:

   IDL> print, qaxis(qtcompose([0d,1,0], !dpi/4))
          0.0000000       1.0000000       0.0000000

   Prints the axis part of the quaternion composed of a rotation of
   !dpi/4 radians around the axis [0,1,0]


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Correct error in normalization, 26 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtaxis.pro,v 1.6 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtaxis.pro)


QTCOMPOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTCOMPOSE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Convert a rotation angle and axis into quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   Q = QTCOMPOSE(VAXIS, PHI)

 DESCRIPTION:

  The function QTCOMPOSE accepts a unit vector rotation axis VAXIS
  and a rotation angle PHI, and returns the corresponding quaternion.

  The user must take care to pass the same number of axes as rotation
  angles.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.

 INPUTS:

  VAXIS - array of one or more unit vectors specifying the rotation
          axes.  For a single rotation, VAXIS should be a 3-vector.
          For N vectors, VAXIS should be a 3xN array.

  PHI - one or more rotation angles, in radians.  For a single
        rotation, PHI should be a scalar.  For N rotations, PHI
        should be an N-vector.

 RETURNS:

  For a single rotation, returns a quaternion as a 4-vector.  For N
  rotations, returns a 4xN vector of quaternions.


 KEYWORD PARAMETERS:

  NONE

 EXAMPLE:

   IDL> print, qtcompose([0d,1,0], !dpi/4)
          0.0000000      0.38268343       0.0000000      0.92387953

   Prints the quaternion composed of a rotation of !dpi/4 radians
   around the axis [0,1,0]


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Allow output to be DOUBLE, 27 Jan 2002, CM
   Allow vector vs scalar arguments, 28 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtcompose.pro,v 1.10 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtcompose.pro)


QTERP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTERP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Smoothly interpolate from a grid of quaternions (spline or slerp)

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   QNEW = QTERP(TGRID, QGRID, TNEW, [/SLERP], QDIFF=, [/RESET])

 DESCRIPTION:

  The function QTERP is used to interplate from a set of known unit
  quaternions specified on a grid of independent values, to a new set
  of independent values.  For example, given a set of quaternions at
  specified key times, QTERP can interpolate at any points between
  those times.  This has applications for computer animation and
  spacecraft attitude control.

  The "grid" of quaternions can be regularly or irregularly sampled.
  The new values can also be regularly or irregularly sampled.

  The simplest case comes when one wants to interpolate between two
  quaternions Q1 and Q2.  In that case the user should specify the
  gridded quaterion as QGRID = [[Q1], [Q2]], with grid points at
  TGRID = [0d, 1d].  Then the user can sample any intermediate
  orientation by specifying TNEW anywhere between 0 and 1.

  The user has the option of performing pure spline interpolation of
  the quaternion components (the default technique).  The resulting
  interpolants are normalized to be unit quaternions.  This option is
  useful for fast interpolation of quaternions, but suffers if the
  grid is not well sampled enough.  Spline interpolation will not
  strictly find the shortest path between two orientations.

  The second option is to use Spherical Linear IntERPolation, or
  SLERPing, to interpolate between quaternions (by specifying the
  SLERP keyword).  This technique is guaranteed to find the shortest
  path between two orientations, but is somewhat slower than spline
  interpolation.  This approach involves computing a finite
  difference of the data.  To avoid repeated computation of the
  difference on every call, users can pass a named variable in the
  QDIFF keyword.  This value can be reset with the RESET keyword.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.

  Users must have the VALUE_LOCATE() function, available either in
  IDL 5.3 or later, or from the Markwardt web page.

 INPUTS:

   TGRID - a vector of N independent variable values.  In the
           simplest case, this can be [0, 1, ...] up to the number of
           quaternions in the grid.  The grid sampling does not have
           to be uniform.

   QGRID - an 4xN array of unit quaternions specified on the grid.

   TNEW - a vector of M desired independent variable values which
          sample the grid specified by TGRID.  The desired values do
          not have to be uniformly sampled.

 RETURNS:

   A 4xM array of unit quaternions, where is M is the number of
   desired samples.


 KEYWORD PARAMETERS:

   SLERP - if set, then spherical linear interpolation is performed.
           The default is to perform spline interpolation on the
           quaternion coefficients.

   QDIFF - upon return, QDIFF is filled with finite difference values
           which can be used to speed computations in subsequent
           calls.  Users should be aware that QDIFF may be
           inadvertently reused from one call to the next.  When the
           difference data should no longer be reused, the named
           variable passed to the QDIFF keyword should be set to a
           scalar, or the /RESET keyword should be used.

   RESET - if set, then the QDIFF finite difference will be forced to
           be recalculated, even if there is already data present and
           passed to the QDIFF keyword.


 EXAMPLE:

   This example starts with two quaternions representing rotations of
   0 degrees and 45 degrees, and forms 1001 quaternions which are
   smooth interpolations between 0 and 45 degrees.

   ;; Create a grid of two quaternions at times 0 and 1
   Q0 = qtcompose([1,0,0], 0D)       & T0 = 0D
   Q1 = qtcompose([1,0,0], !dpi/4)   & T1 = 1D

   ;; Put the grid elements into an array
   TGRID = [T0, T1]
   QGRID = [[Q0], [Q1]]

   ;; Make an array of 1001 values smoothly varying from 0 to 1
   TNEW = dindgen(1001)/1000d

   ;; Perform spherical linear interpolation
   QNEW = QTERP(TGRID, QGRID, TNEW, /SLERP)
   

 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Usage message; check for 0- and 1-length quaternions; handle case
      when quaternions are GE 180 degrees apart; handle case of
      interpolating beyond end of known grid, 15 Mar 2002, CM

  $Id: qterp.pro,v 1.6 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qterp.pro)


QTEULER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTEULER

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compose a series of euler-type rotations into a single quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   Q = QTEULER(AXES, ANG0, ANG1, ... )

 DESCRIPTION:

  The function QTEULER composes a series of Euler-type rotations into
  a single set of quaternion representations.

  The user specifies a set of axes, and the angles to rotation about
  those axes, and QTEULER constructs the corresponding quaternion.

  There must be a one-to-one correspondence between the elements of
  AXES and the number of rotations.  AXES specifies the rotation axes
  as an string, which must be one of 'X', 'Y', or 'Z'.  Other axes
  are invalid.  For example, the following call:

    QTEULER(['X','Z'], THETA, PHI)

  will rotate first about the *Z* axis by the angle PHI, and then
  around the *resulting X* axis by angle THETA.

  Several things are worth noting here.  First, rotations are applied
  first from the right, not the left.  This conforms to the usual
  matrix notation for applying rotations to a vector on the right
  hand side.  For example, in matrix notation,

      XNEW = A3 A2 A1 XOLD

  applies first A1, then A2 and finally A3 to the XOLD vector,
  resulting in the new vector XNEW.  The same semantics apply here.

  A second thing to bear in mind is that the axes themselves change
  during the rotations.  Thus, the coordinates specified in AXES
  should be considered attached to the "body" and not the inertial
  frame.


 INPUTS:

  AXES - a string array, specifies the rotation axes.  Rotations are
         applied last element first.  Each element of AXES must be
         one of 'X', 'Y' or 'Z'.

  ANG0, ..., ANGi - the successive rotation angles.  Angle ANGi
         corresponds to axis AXES(i).

         If ANGi is a scalar, then it will be promoted to a vector
         the same size as the other rotation angles being performed.
         Otherwise, if the angles ANGi are vectors, then they must
         all be of the same size.

 RETURNS:

  The resulting quaternion (or, if ANGi are vectors, array of
  quaternions), which represent the requested rotations.


 KEYWORD PARAMETERS:

  NONE

 EXAMPLE:

    ;;              Precession        Nutation    
    qtot = qteuler(['z','y','z',      'x','z','x'        ], $
                    -zeta, +theta, -z, +eps0, -dpsi, -eps)

   Applies a series of rotations to correct for earth nutation and
   precession.  The order of rotations on a vector would be
   X-Z-X-Z-Y-Z (i.e., the reverse order printed).

 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, 27 Jan 2002, CM
   More error checking, 03 Mar 2002, CM

  $Id: qteuler.pro,v 1.4 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qteuler.pro)


QTEXP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTEXP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute "exponentiation" of a non-unit quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   Q = QTEXP(QLOG)

 DESCRIPTION:

   The function QTEXP computes the "exponentiation" of a quaternion.

   The exponential is only defined for a non-unit quaternion with a
   *zero* rotation angle.  Specifically, the expression

      QTEXP([VAXIS * PHI/2, 0])    

   becomes
 
      [VAXIS*SIN(PHI/2), COS(PHI/2)]

   where VAXIS is the unit vector rotation axis and PHI is the
   rotation angle.  Note that since VAXIS is a unit vector, the
   product VAXIS*PHI can have an arbitrary direction and magnitude.

   Typically the input to QTEXP is found by taking the logarithm of a
   unit quaternion using QTLOG, and the identity QTEXP(QTLOG(Q)) is
   the same as Q.
   
  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.

 INPUTS:

   QLOG - a non-unit quaternion of the form [VX, VY, VZ, 0]; or,
          N quaternions of the same form, as a 4xN array.


 RETURNS:

   The exponentiated unit quaternion(s).  For a single input
   quaternion, returns a 4-vector; for N input quaternions, returns a
   4xN array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   IDL> print, qtlog(qtcompose([0d,1,0], !dpi/4))
         0.0000000      0.39269908       0.0000000       0.0000000

   Prints the logarithm of the quaternion composed of a rotation of
   !dpi/4 radians around the axis [0,1,0]


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Documentation corrected, 27 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtexp.pro,v 1.7 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtexp.pro)


QTFIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTFIND

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Find quaternion(s) from direction cosine matrix

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   Q = QTFIND(MATRIX)

 DESCRIPTION:

   The function QTFIND determines one or more unit quaternions from
   direction cosine matrices.

   This routine is optimized to avoid singularities which occur when
   any one of the quaternion components is nearly zero.  Up to four
   different transformations are attempted to maximize the precision
   of all four quaternion components.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

   MATRIX - array of one or more direction cosine matrices.  For a
            single matrix, MATRIX should be a 3x3 array.  For N
            matrices, MATRIX should be a 3x3xN array.  The arrays are
            assumed to be valid rotation matrices.


 RETURNS:

   The resulting unit quaternions.  For a single matrix, returns a
   single quaternion as a 4-vector.  For N matrices, returns N
   quaternions as a 4xN array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   ;; Form a rotation matrix about the Z axis by 32 degrees
   th1 = 32d*!dpi/180         
   mat1 = [[cos(th1),-sin(th1),0],[sin(th1),cos(th1),0],[0,0,1]]
   
   ;; Form a rotation matrix about the X axis by 116 degrees
   th2 = 116d*!dpi/180
   mat2 = [[1,0,0],[0,cos(th2),-sin(th2)],[0,sin(th2),cos(th2)]]

   ;; Find the quaternion that represents MAT1, MAT2 and the
   composition of the two, MAT2 ## MAT1.

    print, qtfind(mat1), qtfind(mat2), qtfind(mat2 ## mat1)
       0.0000000       0.0000000      0.27563736      0.96126170
      0.84804810       0.0000000       0.0000000      0.52991926
      0.81519615     -0.23375373      0.14606554      0.50939109


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Re-added check to enforce q(3) GE 0, 15 Mar 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtfind.pro,v 1.7 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtfind.pro)


QTINV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTINV

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute inverse of QUATERNION

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   QINV = QTINV(Q)

 DESCRIPTION:

   The function QTINV computes the inverse of the quaternion Q.  The
   inverse of a quaternion is equivalent to a rotation about the same
   axis but the opposite direction.

   The inverse is also defined mathematically such that

     QTMULT( Q, QTINV(Q) )   

   becomes [0, 0, 0, 1], which is the identity quaternion.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.


 RETURNS:

   The resulting inverse unit quaternions.  For a single input
   quaternion, returns a 4-vector.  For N input quaternions, returns
   N quaternions as a 4xN array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   IDL> print, qtcompose([0d,1,0], !dpi/4)
          0.0000000      0.38268343       0.0000000      0.92387953
   IDL> print, qtinv(qtcompose([0d,1,0], !dpi/4))
          0.0000000      0.38268343       0.0000000     -0.92387953

   Prints the quaternion composed of a rotation of !dpi/4 radians
   around the axis [0,1,0], then the inverse of the same quaternion.


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtinv.pro,v 1.6 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtinv.pro)


QTLOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTLOG

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute "logarithm" of a unit quaternion

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   QLOG = QTLOG(Q)

 DESCRIPTION:

   The function QTLOG computes the "logarithm" of a unit quaternion.

   The logarithm of a quaternion is defined for any unit quaternion,
   such that the expression

     QTLOG([VAXIS*SIN(PHI/2), COS(PHI/2)] 

   becomes

     [VAXIS * PHI/2, 0]

   where VAXIS is the unit vector rotation axis and PHI is the
   rotation angle.  Note that the output quaternion is not a *unit*
   quaternion.  The output of QTLOG is also commonly known as an
   *axial vector*, for a rotation axis VAXIS and rotation angle
   PHI/2.

   Typically the output to QTLOG is eventually exponentiated with the
   QTEXP function, and the identity QTEXP(QTLOG(Q)) is the same as Q.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.


 RETURNS:

   The non-unit quaternion logarithm(s).  For a single input
   quaternion, returns a 4-vector of the form [VX, VY, VZ, 0].  For N
   input quaternions, returns N quaternions of the same form as a 4xN
   array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   IDL> q = qtlog(qtcompose([0d,1,0], !dpi/4))
   IDL> print, qtexp(2 * q)
          0.0000000      0.70710678       0.0000000      0.70710678

   First, computes the logarithm Q of the quaternion composed of a
   rotation of !dpi/4 radians around the axis [0,1,0].  Second,
   computes the exponentiation of 2*Q.  This is the same as raising
   the original quaternion to the second power.


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Documentation clarified & corrected, 27 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtlog.pro,v 1.6 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtlog.pro)


QTMAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTMAT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Find direction cosine matrix from quaternion(s)

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   MATRIX = QTMAT(Q)

 DESCRIPTION:

  The function QTMAT computes one or more direction cosine matrices
  (i.e., rotation matrices) from unit quaternions.

  The usage of the resulting matrix on a 3-vector X is either 
  MATRIX # X, or MATRIX ## X, depdending on the meaning of the
  rotation (i.e., body-fixed or coordinate-fixed, see QTVROT).

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.


 RETURNS:

   The direction cosine matrices.  For a single input quaternion,
   retuns a 3x3 array.  For N input quaternions, returns a 3x3xN
   array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   print, qtmat(qtcompose([0d,1,0], !dpi/4)) 
        0.70710678       0.0000000      0.70710678
         0.0000000       1.0000000       0.0000000
       -0.70710678       0.0000000      0.70710678

   Form a quaternion composed of a rotation of !dpi/4 radians around
   the axis [0,1,0], and then print the corresponding rotation
   matrix.


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Documentation clarifications, 28 Jan 2002, CM
   Allow multiple quaternions, 28 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtmat.pro,v 1.6 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtmat.pro)


QTMULT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTMULT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Multiply quaternions

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   QRESULT = QTMULT(Q1, Q2)

 DESCRIPTION:

   The function QTMULT performs multiplication of quaternions.
   Quaternion multiplication is not component-by-component, but
   rather represents the composition of two rotations, namely Q2
   followed by Q1.

   More than one multiplication can be performed at one time if Q1
   and Q2 are 4xN arrays.  In that case both input arrays must be of
   the same dimension.

   Note that quaternion multiplication is not commutative.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  Q1 - array of one or more unit quaternions, the first operand in
       the multiplication.  For a single quaternion, Q1 should be a
       4-vector.  For N quaternions, Q1 should be a 4xN array.

  Q2 - same as Q1, for the second operand.


 RETURNS:

   The resulting multiplied unit quaternions.  For a single inputs,
   returns a 4-vector.  For N input quaternions, returns N
   quaternions as a 4xN array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   Q1 = qtcompose([0,0,1],  32d*!dpi/180d)
   Q2 = qtcompose([1,0,0], 116d*!dpi/180d)

   IDL> print, qtmult(q1, q2)
        0.81519615      0.23375373      0.14606554      0.50939109

   Form a rotation quaternion of 32 degrees around the Z axis, and 
   116 degrees around the X axis, then multiply the two quaternions.
   
 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Documentation, allow 1xN or Nx1 multiplies, 27 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtmult.pro,v 1.7 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtmult.pro)


QTPOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTPOW

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Raise quaternion Q to the "power" POW

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   QNEW = QTPOW(Q, POW)

 DESCRIPTION:

   The function QTPOW raises a quaterion Q to the power P.  The
   operation 

      QNEW = QTPOW(Q, POW)

   is equivalent to

      QNEW = QTEXP( POW * QTLOG(Q))

   which is the same as the definition of raising a real number to
   any power (however, QTPOW is faster than using QTLOG and QTEXP).

   For integer values of POW, this form of exponentiation is also
   directly equivalent to the multiplication of that many Q's
   together.

   Geometrically, raising Q to any power between 0 and 1 realizes a
   rotation that smoothly interpolates between the identity
   quaternion and Q.  Thus, QTPOW is useful for interpolation of
   quaternions or SLERPing (spherical linear interpolation).

   When raising more than one quaternion to a power at a time, the
   number of quaternions and powers must be equal.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.

  POW - array of N powers, where N is the number of quaternions.


 RETURNS:

   The resulting exponentiated unit quaternions.  For a single
   inputs, returns a 4-vector.  For N input quaternions, returns N
   quaternions as a 4xN array.


 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   ;; Form a rotation quaternion of 45 degrees about the X axis
   Q = qtcompose([1,0,0], !dpi/4)

   ;; Make an array of 1001 values smoothly varying from 0 to 1
   P = dindgen(1001)/1000d

   ;; Perform spherical linear interpolation
   QNEW = QTERP(Q, P)


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtpow.pro,v 1.5 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtpow.pro)


QTVROT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   QTVROT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Apply quaternion rotation to a 3-vector

 MAJOR TOPICS:
   Geometry

 CALLING SEQUENCE:
   VNEW = QTVROT(V, Q, [/INVERT])

 DESCRIPTION:

   The function QTVROT applies a quaternion rotation (or its inverse)
   to a 3-vector V to produce a new vector VNEW.

   If both V and VNEW are vector components measured in the same
   inertial coordinate system, then VNEW returns the components of
   the vector V rotated by quaternion Q.  I.e., the AXES stay fixed
   and the VECTOR rotates.  Replace Q by QTINV(Q) in the case of
   /INVERT.

   If V are components of a vector measured in the "body" coordinate
   frame, and Q represents the orientation of the body frame
   w.r.t. the inertial frame, then VNEW are the components of the
   same vector in the inertial frame.  I.e., the VECTOR stays fixed
   and the AXES rotate.  For /INVERT, the coordinate transformation
   is from inertial frame to body frame.

   If either Q is a single quaternion, or V is a single 3-vector,
   then QTVROT will expand the single to the number of elements of
   the other operand.  Otherwise, the number of quaternions and
   vectors must be equal.

  Conventions for storing quaternions vary in the literature and from
  library to library.  This library uses the convention that the
  first three components of each quaternion are the 3-vector axis of
  rotation, and the 4th component is the rotation angle.  Expressed
  in formulae, a single quaternion is given by:

     Q(0:2) = [VX, VY, VZ]*SIN(PHI/2)
     Q(3)   =              COS(PHI/2)

  where PHI is the rotation angle, and VAXIS = [VX, VY, VZ] is the
  rotation eigen axis expressed as a unit vector.  This library
  accepts quaternions of both signs, but by preference returns
  quaternions with a positive 4th component.


 INPUTS:

  V - array of one or more 3-vectors.  For a single vector, V should
      be a 3-vector.  For N vectors, V should be a 3xN array.

  Q - array of one or more unit quaternions.  For a single
      quaternion, Q should be a 4-vector.  For N quaternions, Q
      should be a 4xN array.


 RETURNS:

   The resulting rotated vectors.  For single inputs, returns a
   3-vector.  For N inputs, returns N vectors as a 3xN array.


 KEYWORD PARAMETERS:

   INVERT - if set, then the antirotation represented by QTINV(Q) is
            performed.


 EXAMPLE:

   Q1 = qtcompose([0,0,1],  32d*!dpi/180d)
   Q2 = qtcompose([1,0,0], 116d*!dpi/180d)
   Q = qtmult(Q1, Q2)

   V = [[1d,0,0],[0,1,0],[0,0,1]]

   IDL> print, qtvrot(v, q)
         0.84804810      0.52991926       0.0000000
         0.23230132     -0.37175982      0.89879405
         0.47628828     -0.76222058     -0.43837115


 SEE ALSO
   QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
   QTMAT, QTMULT, QTPOW, QTVROT

 MODIFICATION HISTORY:
   Written, July 2001, CM
   Documented, Dec 2001, CM
   Small changes, 28 Jan 2002, CM
   Usage message, error checking, 15 Mar 2002, CM

  $Id: qtvrot.pro,v 1.7 2002/05/09 23:03:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\qtvrot.pro)


QUERY_DATA_SEPARATOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   query_data_separator

 PURPOSE:
   This function tries to found the data separator of a given file

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=query_data_separator(file_name)

 INPUTS:
 strarr_data:  a string array of data


 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Nov-08
   1999-Mar-19 returns now 9b as separator if 32b is separator too

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\query_data_separator.pro)


QUERY_LAST_COMMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   query_last_comment

 PURPOSE:
   This function tries to found the last commentline from  ascii data file before data starts

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=query_last_comment(file_name)

 INPUTS:
 strarr_data:  a string array of data


 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Nov-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\query_last_comment.pro)


QUERY_LAST_DATA_LINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   query_last_data_line

 PURPOSE:
   This function tries to found the last data line from an ascii data file

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=query_last_data_line(file_name)

 INPUTS:
 strarr_data:  a string array of data


 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Nov-08
   1999-Mar-13
   Failure corrected If a data file has a lot of comments and only one dataline
   24                                 {NLHEAD FFI}
   Yasuhiro Sasano                    {ONAME}


   #TH(Km)  time(s)   values -error +error ###
   30.00  9778.071      0      0 286038

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\query_last_data_line.pro)


QUEUE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      queue

 PURPOSE:      display print queues

 USEAGE:       queue

 PROCEDURE:    choose print queue from pop up menu

 AUTHOR:   Paul Ricchiazzi                        01 Jun 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\queue.pro)


Q_DIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_dim

 PURPOSE:
   This function is used by ncdf_w for testing if a new parameter Structure
	which should be overwritten in a file has the same dimension as the old one

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result=q_dim(inhalt=inhalt,file=file)

  INPUTS:
	file: the existing file name
   inhalt:   the structure INHALT which should be tested whith file (Vergleich)

 OUTPUTS:
   The result of the function if the dimension matches is 1
   else 0

 EXAMPLE:
	Result=q_dim(file='test.nc',inhalt=F12)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  May 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_dim.pro)


Q_ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_icg_struct

 PURPOSE:
   This function is used by write_ncdf for testing if a the ICG Data Structure
	has all nececcary by ICG-1-2-3 defined globale and parameter attributes

 CATEGORY:
	ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
	Result=q_icg_struct(structure,[/quiet])

 INPUTS:
   structure: the ICG defined data structure

 KEYWORD PARAMETERS:
  quiet: if set no messages are prompted

 OUTPUTS:
   The result of the function if it's ok is 1
   else 0
   and on screen you get a summarize which attributes you have
   to include into the structure

 EXAMPLE:
	Result=q_icg_struct(structure)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer  (ICG-1),   1999-Mar-10
   1999-Aug-12 keyword quiet added
   2000-Jan-20 bug removed returns 0 if one of each defined attributes is missing


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_icg_struct.pro)


Q_INHALT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_inhalt

 PURPOSE:
   This function is used by ncdf_w for testing if a new parameter Structure
	has all nececcary by ICG-1-2-3 defined globale and parameter attributes

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result=q_inhalt(inhalt=inhalt)

 INPUTS:
   inhalt: the structure INHALT which should be tested
           for default entries.


 KEYWORDS:
   debug: [OBSOLETE] used for debugging

 OUTPUTS:
   The result of the function if it's ok is 1
   else 0
   and on screen you get a summarize which attributes you have
   to include into the structure

 EXAMPLE:
	Result=q_inhalt(inhalt=inhalt)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer  (ICG-1),   1996
               R.Bauer 1997, areal in type renamed
               F.Rohrer (ICG-3), new version
               R.Bauer  (ICG-1), May 27, 1997 2-dimesion question inserted
               R.Bauer  (ICG-1), June ,5 1997 n-dimesion question inserted
 1998-09-12 now param and time could be scalars
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_inhalt.pro)


Q_SHORT_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       q_short_name

 PURPOSE:
   This function is used by write_ncdf for testing if the ICG-Data-Structure
   has more then once defined the same short_name

 CATEGORY:
     ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
       Result=q_short_name(structure)

 INPUTS:
   structure: the ICG defined data structure


 OUTPUTS:
   The result of the function if it's ok is 1
   else 0
   and on screen you get a summarize which short_names you have
   to include into the structure

 EXAMPLE:
       Result=q_short_name(structure)

 MODIFICATION HISTORY:
       Written by:     R.Bauer  (ICG-1),   1999-Nov-18
   2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_short_name.pro)


Q_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_time

 PURPOSE:
   This function is used by ncdf_w for testing if a new parameter Structure
	which should be stored in a file whith parameters have the same time.

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result=qtime(file=file,inhalt=inhalt)

 INPUTS:
	file:   the existing file name
   inhalt: the structure INHALT which should be tested whith file (Vergleich)

 KEYWORD PARAMETERS:
   debug: [OBSOLETE] for debuging

 OUTPUTS:
   The result of the function if the time matches totally is 1
   else 0


 EXAMPLE:
	Result=q_time(file='test.nc',inhalt=F12)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  1996
                       R.Bauer July 1997 , time now by f_time
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_time.pro)


Q_TYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_type

 PURPOSE:
   This function is used by ncdf_wo for testing if the overwrite parameter has the same type as the old one

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result=q_type(inhalt=inhalt,file=file)

 INPUTS:
   inhalt:   the structure INHALT which should be tested

 OUTPUTS:
  result will be 1 if both are from the same type

 EXAMPLE:
	Result=q_type(file=file,inhalt=inhalt)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  1998-Sep-12
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_type.pro)


Q_TYPE_MISSING_FILL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	q_type_missing_fill

 PURPOSE:
   This function is used by ncdf_w for testing if param_missing_value or param_fill_value are from the same
	type as param

 CATEGORY:
	DATAFILES/NETCDF

 CALLING SEQUENCE:
	Result=q_type_missing_fill(inhalt=inhalt)

 INPUTS:
   inhalt:   the structure INHALT which should be tested

 OUTPUTS:
   The result of the function if all is ok is '11'
   if param_fill_value fails: '10'
   if missing_value fails: '01'
   if both fails: '00'

 EXAMPLE:
	Result=q_type_missing_fill(inhalt=inhalt)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),  Jun 1998
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\q_type_missing_fill.pro)


RADIAL_IMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RADIAL_IMG
 PURPOSE:
       Make an image array with a radial brightness distribution.
 CATEGORY:
 CALLING SEQUENCE:
       out = radial_image(y,n)
 INPUTS:
       y = brightness distribution curve (pixels from center). in
       n = side length of square output array.                 in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = resulting image array.                            out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 6 Jul, 1990
       R. Sterner, 27 Jan, 1993 --- cleaned up.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\radial_img.pro)


RADII

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RADII
 PURPOSE:
       Plot specified radii on the current plot device.
 CATEGORY:
 CALLING SEQUENCE:
       radii, r1, r2, a, [x0, y0]
 INPUTS:
       r1 = start radius of radius to draw (data units).   in
       r2 = end radius of radius to draw (data units).     in
       a = Angle of arc (deg CCW from X axis).             in
       [x0, y0] = optional arc center (def=0,0).           in
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means use device coordinates .
         /DATA means use data coordinates (default).
         /NORM means use normalized coordinates.
         /CLIP means clip radii to last plot window (if any).
         COLOR=c  plot color (scalar or array).
         LINESTYLE=l  linestyle (scalar or array).
         THICKNESS=t  line thickness (scalar or array).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: all parameters may be scalars or arrays.
 MODIFICATION HISTORY:
       Written by R. Sterner, 15 Sep, 1989.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 17 Jun, 1992 --- added coordinate systems, cleaned up.
       R. Sterner, 1998 May 12 --- Added /CLIP.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\radii.pro)


RADINT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  radint

 PURPOSE:  For a given solid angle compute the average radiance or
           or if FLUX is set, compute the normal flux contribution
           from that solid angle

 USEAGE:   result=radint(rad,phi,uzen,philim=philim,zenlim=zenlim,
                         omega=omega,flux=flux)


 INPUT:    
  rad      radiance arrray (phi,zen)
  phi      azimuth angle array (degrees)
  uzen     zenith angle array  (degrees)

  zenlim   2 element array: zenith angle limits (in any order)
  philim   2 element array: azimuth angle limits

 Keyword Input:
  flux     if set, flux integral is computed.  In this case the
           output is power/unit_area 

 Keyword Output:
  omega    the solid angle specified by philim and zenlim (steradians)

 OUTPUT:
  result   average radiance within given solid angle

 EXAMPLE:  

  phi=findrng(0,360,dx=10)
  uzen=findrng(0,90,dx=10)
  rad=phi#uzen
  rad(*,*)=1.
  print,radint(rad,phi,uzen),radint(rad,phi,uzen,/flux)

  rad=(1+.5*sin(phi*!dtor))#(1.+.2*cos(uzen*!dtor)) 

  print,radint(rad,phi,uzen) ; should be = 1.1

 AUTHOR:   Paul Ricchiazzi                        16 Apr 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\radint.pro)


RADON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RADON
 PURPOSE:
       Compute the Radon Transform using the FFT method.
 CATEGORY:
 CALLING SEQUENCE:
       t = radon(img)
 INPUTS:
       img = input image.  Must be square.   in
 KEYWORD PARAMETERS:
       Keywords:
         EMBED=n  size of zero image to embed given image in.
           Def=no embed.
         START=a1  start angle in degrees, default=0.
         STOP=a2  stop angle in degrees, default=179.
         STEP=da  angle step in degrees, default=1.
         ANGLES=ang  returned list of angles used.
         /DEBUG does a debug stop.
 OUTPUTS:
       t = Radon Transform of img.           out
 COMMON BLOCKS:
       radon_com
 NOTES:
       Notes: Images must be byte.
         No preprocessing is done.
         It may be useful to subtract the mean.
         Ref: Linear feature detection and enhancement in noisy
           images via the Radon transform,
           Lesley M. Murphy, Patt. Rec. Letters 4 (1986) 279.
 MODIFICATION HISTORY:
       R. Sterner, 16 Oct, 1990
       R. Sterner, 1998 Mar 10 --- Cleaned up a bit, no longer byte only.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\radon.pro)


RADTEMP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  radtemp

 PURPOSE:  compute radiation temperature from a radiance distribution

 USEAGE:   radtemp,w,r,microns=microns

 INPUT:    
   w       wavelength in microns or wavenumber in cm-1
   r       radiance in w/m2/um/str or w/m2/cm-1/str
           divide irradiance by pi 

 KEYWORD INPUT:

  microns  set to one for micron units

 OUTPUT:
   result  radiation temperature in kelvin

  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        20 Nov 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\radtemp.pro)


RANDATA

[Previous Routine] [Next Routine] [List of Routines]
 routine:      randata
 
 purpose:      generate a random field of data with given power spectrum
               and array size

 useage:       randata,n,slope,nx=nx,ny=ny

 inputs:
   nx          size of output grid in x direction

   ny          size of output grid in y direction, must be less than n.

               Since an FFT is used to create the random data,
               RANDATA runs faster if max(NX,NY) is a power of 2

 Keyword input:
   
   s           power law slope of power spectrum (default=4)
   
   locked      phases of fourier components locked to grid centers

 Keyword input/output

   iseed       the seed used to randomize the phases

 EXAMPLE:      
               n=64
               xs=sqrt(findgen(n))                  
               ys=sqrt(findgen(n))                  ; xss and yss are used
               xss=xs # replicate(1,n_elements(ys)) ; to give the random
               yss=replicate(1,n_elements(xs)) # ys ; data a nice shape

               shade_surf,randata(n,n,s=4)*xss*yss,az=10,ax=40

  author:  Paul Ricchiazzi                            27oct93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\randata.pro)


RANDCORR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		RANDCORR
 VERSION:
		4.0
 PURPOSE:
		Generates a set of correlated random variables.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = RANDCORR(SEED, LEN [, CLEN])
 INPUTS:
	SEED
		A named variable containing the seed value for random number generation.
		Does not need to be initialized prior to call.  For details see IDL
		routine RANDOMN.
	LEN
		Length of the random vector to be produced.
 OPTIONAL INPUT PARAMETERS:
	CLEN
		Correlation length.  Defaults to 1 (i.e. no correlation).
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns a vector of normally distributed random numbers with nonzero
		correlation (for CLEN > 1).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Performs Q_averaging of a standard normal sequence, using the routine
		QAVER from MIDL.  Also calls DEFAULT from MIDL.
 MODIFICATION HISTORY:
		Created 25-JUN-2000 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\randcorr.pro)


RANDF

[Previous Routine] [Next Routine] [List of Routines]
 routine:      randf
 
 purpose:      generate random time history data with given power spectrum

 useage:       randf,n,slope

 inputs:
   slope       power law slope of power spectrum (default=4)

   n           number of elements in time history. Since an fft is used
               to compute the random numbers powers of 2 are most efficient.

 EXAMPLE:      

; simple plot
               plot,randf(256,2)

; demonstrate use of frequency domain filtering

               f=randf(512,2)
               gf=exp(-.005*(findgen(256)-1)^2) & gf=[gf,reverse(gf)]
               ff=fft(gf*fft(f,1),-1)
               fac=total(abs(f))/total(abs(ff))
               plot,f
               oplot,ff*fac,color=100


 method:       a power law is used to set the spectral power as a
               function of frequency (i.e., p=1/w^s).  After the phase of
               the fourier components are randomized, the temporal
               realization is generated by taking the inverse FFT.
               

  author:  Paul Ricchiazzi                            27oct93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\randf.pro)


RANDGEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		RANDGEN
 VERSION:
		4.3
 PURPOSE:
		Generating arbitrary random distributions.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = RANDGEN (SEED [, LEN], DISTRIBUTION = DFUN [, keywords])
 INPUTS:
	SEED
		A named variable containing the seed value for random number generation.
		Does not need to be defined prior to call.  For details see IDL
		routines RANDOMN and RANDOMU.
 OPTIONAL INPUT PARAMETERS:
	LEN
		The length of the random vector to be generated.  Default value is 1.
 KEYWORD PARAMETERS:
	DISTRIBUTION
		Character value, name of an existing IDL function, representing the
		desired distribution.  The function must comply with the IDL standard
		of being able to accept an array input and return an array output.  The
		calling sequence for the function must be either

			Result = DISTRIBUTION( X)
		or
			Result = DISTRIBUTION( X, extra)

		where X is the variable and EXTRA may be any single entity (scalar,
		array, structure etc.) used to pass additional parameters to the
		function (see PARAMS, below).

		The function doesn't have to be normalized but should be non-negative.
		Negative values are treated as zero.
	PARAMS
		An arbitrary value or variable which is being passed to the function
		DISTRIBUTION.  May be an array or structure.
	COMPARS
		Parameters for the "comparison function".  This function is of the form:

			F = c/(b^2 + (x-a)^2)

		and the parameters are provided as a 3-element vector, [a,b,c].  It is
		possible to provide partial or no data.  The default values for compars
		are
			[0,1,1/pi]

		If partial data is provided, the remainder is filled, in order, from
		the list above.  Thus, if a call to RANDGEN includes COMPARS = [3,2]
		the the set used internally will be [3,2,1/pi]
	/INTEGER
		Switch.  If set, the result is a set of randomly distributed integers.
	/INFORM
		Switch.  If set, teh routine prints an informational message when the
		internal normalization parameters change.
 OUTPUTS:
		Returns a vector (length LEN) of values, randomly distributed according
		to DISTRIBUTION.  If the keyword /INTEGER is set, the result is of type
		LONG, else it is of type FLOAT or DOUBLE (when either PARAMS or COMPARS
		are DOUBLE).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the "rejection method" as outlined in Numerical Recipes.  Calls
		CALCTYPE, DEFAULT, FPU_FIX and TOLER from MIDL.
 MODIFICATION HISTORY:
		Created 10-JAN-2002 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\randgen.pro)


RANDISC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		RANDISC
 VERSION:
		4.0
 PURPOSE:
		Generates a set of discretely distributed random numbers.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = RANDISC (SEED,  [,parameters] [,keywords])
 INPUTS:
	SEED
		A named variable containing the seed value for random number generation.
		Does not need to be defined prior to call.  For details see IDL
		routines RANDOMN and RANDOMU.
 OPTIONAL INPUT PARAMETERS:
	D_0 through D_7
		Dimensions of the result.  All default to 1.  Trailing dimensions of 1
		are removed.
 KEYWORD PARAMETERS:
	AMPLITUDE
		Numerical value, rounded to long integer on input.  Specifies the
		output range.  Output values are randomly spread among AMP + 1 possible
		values ranging from -AMP to AMP (unless the keyword NORMALIZE is used),
		with a spacing of 2.  Default value of AMP is 1.
	/UNIFORM
		Switch.  Specifies uniform distribution.  This is the default.
	/BINOMIAL
		Switch.  Specifies binomial distribution.  For large values of AMP the
		result approaches a Gaussian with sigma = sqrt(AMP)
	/NORMALIZE
		Switch.  If set, the result is normalized to lie in the [-1,1] range,
		with a spacing of -2/AMP
 OUTPUTS:
		Returns number randomly distributed among the values
		-AMP, -AMP + 2 ... AMP or, if the keyword NORMALIZE is set, among
		-1, -1 + 2/AMP ... 1.  The distribution may be uniform (the default) or
		binomial (quasi gaussian).  The result can have any number (up to 8) of
		dimensions which are specified by the optional variables D_0, ... D_7.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		On return, SEED is replaced with the new value of the randomizer seed.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the system routine RANDOMU.  Also uses DEFAULT and ONE_OF from
		MIDL.
 MODIFICATION HISTORY:
		Created 20-APR-1995 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\randisc.pro)


RANDOM_HEX_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   random_hex_name

 PURPOSE:
   This function creates a random name

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = RANDOM_HEX_NAME([NCHAR=n], [/TIME])

 KEYWORD PARAMETERS:
   NCHAR:   number of char of the output string
   TIME:    if set add time to output

 OUTPUTS:
   This function returns a string

 EXAMPLE:
   print, random_hex_name(),' ', random_hex_name(/TIM), ' ',random_hex_name(NCH=5)
   IDL prints:
       AF269800 8EC1EA80933147649 BD83C

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-6

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\random_hex_name.pro)


RAOUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RAOUT
 PURPOSE:
       Write text along an arc in data coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       raout, r, a, text, [flag]
 INPUTS:
       r = radius of bottom of text.    in
       a = start angle of text.         in
         Degrees CCW from X axis.
       txt = text string to write.      in
       flag = direction flag, 0 or 1.   in
         0 = read CW (default), 1 = read CCW.
 KEYWORD PARAMETERS:
       Keywords:
         SIZE = sz.  Text size.
         COLOR = clr.  Text color.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Data coordinates are used, so if the X and Y
         scales differ the text will be written along an
         ellipse, with the spacing varying.
 MODIFICATION HISTORY:
       R. Sterner, 1 Jan, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\raout.pro)


RASCII

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		RASCII
 VERSION:
		4.1
 PURPOSE:
		Reads data from an ASCII file into an array.  It is assumed that the
		file contains columns of numbers, with the same number of entries in
		each row.  The numbers may be separated by commas, spaces and/or tabs.
		The file may contain a header.  The first line in which the first
		non-blank character is one of ".+-0123456789" will be considered the
		beginning of the data.  Text lines imbedded in the data are skipped.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		Result = RASCII( FILNAM [, optional keywords])
 INPUTS:
	FILNAM
		Char. value, the name of the data file.  Default extension on VMS
		is '.DAT'.  Elsewhere there is no default extension.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	BUFFER
		Initial number of data rows.  Default is 256.  In any case the result
		Is trimmed to the actual number.
	/DOUBLE
		Switch.  If set, the data is input as DOUBLE.  Default is FLOAT.
	/QUIET
		Switch.  If set, error messages are suppressed.
	/SHOW
		Switch.  If set, the header (if one exists) is printed to the screen.
	SKIP
		Number of lines to skip at the beginning of the file.  This keyword can
		be used if the header of the file contains lines beginning with
		".+-0123456789" which would otherwise be read as data.  Default is 0.
	FILE_NAME
		Optional output, see below.
	NPOINTS
		Optional output, see below.
	HEADER
		Optional output, see below.
	ERROR_STATUS
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass keywords to imbedded routines.  Not to
		be used directly.
 OUTPUTS:
		Returns the data in a (NC,NR) floating (or double precision if DOUBLE
		is set) array, where NC, NR, are the numbers of columns and rows,
		respectively.  In case of error returns 0.
 OPTIONAL OUTPUT PARAMETERS:
	FILE_NAME
		The name of a variable to receive the full name (including path) of
		the file used.  Doesn't need to be defined prior to the call.  In case
		of error returns null string.
	NPOINTS
		The name of a 2-dim vector to receive the values of NC, NR (see above).
		Doesn't need to be defined prior to the call.  In case of an error
		returns [0,0].
	HEADER
		The name of a character array to receive the header lines.  Doesn't
		need to be defined prior to the call.  In case of an error, or if no
		header exists, returns a zero length string.
	ERROR_STATUS
		The name of a variable to receive the I/O error code if one occurs.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses DEFAULT, FILE_GET, STREQ and STRPARSE_MM from
		MIDL.
 MODIFICATION HISTORY:
		Created 25-JAN-1992 by Mati Meron.
		Modified 25-MAY-1994 by Mati Meron.  Added buffering and DOUBLE option.
		Modified 14-FEB-1995 by Mark Rivers.  Added keyword SKIP.
		Modified 24-JUL-1995 by Mati Meron.  Removed a UNIX/VMS conflict in the
		file OPENR statement.
		Modified 10-JUL-1997 by Mati Meron.  Name changed from READ_ASCII to
		RASCII to avoid conflict with the READ_ASCII routine in IDL ver. 5.
		Modified 12-SEP-1997 by Mati Meron.  Added keyword ERROR_STATUS,
		following a modification by Roger Dejus, XFD/APS.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 10-MAY-2001 by Mati Meron.  Added interactive file pick.
		Modified 1-APR-2002 by Mati Meron.  Added keywords QUIET and FILE_NAME.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\rascii.pro)


RAYLEIGH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  rayleigh

 PURPOSE:  compute rayleigh optical depth at a give wavelength

 USEAGE:   result=rayleigh(wl,ps=ps,idatm=idatm)

 INPUT:    
   wl     wavelength in microns
 
 KEYWORD INPUT:
   ps       surface pressure in mb
   idatm    index of standard atmosphere
            1=tropical
            2=midlat summer
            3=midlat winter
            4=sub arctic summer
            5=sub arctic winter
            6=us62

 OUTPUT:   rayleigh optical depth

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

   wl=[.414,.499,.609,.665,.860,.938]
   print,rayleigh(wl,idatm=4)

;  0.311728     0.144443    0.0640821    0.0448406    0.0158600    0.0111786

 AUTHOR:   Paul Ricchiazzi                        13 Apr 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\rayleigh.pro)


RB2LL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RB2LL
 PURPOSE:
       From range, bearing compute latitude, longitude .
 CATEGORY:
 CALLING SEQUENCE:
       rb2ll, lng0, lat0, dist, azi, lng1, lat1
 INPUTS:
       lng0, lat0 = long, lat of starting point (deg).     in
       dist = range to point of interest in RADIANS.       in
       azi = azimuth to point of interest (degrees).       in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means distance is in degrees instead of radians.
 OUTPUTS:
       lng1, lat1 = long, lat of point of interest (deg).  out
 COMMON BLOCKS:
 NOTES:
       Notes: A unit sphere is assumed, thus dist is in radians.
         Useful constants:
         Radius of Earth (mean) = 6371.23 km = 3958.899 miles.
         Distance to horizon from height H above surface:
           For small H: dist = sqrt(2*H/R) in Radians
           For large H: dist = acos(R/(R+H)) in Radians
         To plot horizon from lat0, lng0, H:
           rb2ll,lng0,lat0,dist,makex(0,360,1),plng,plat
           plots,plng-360.,plat,psym=3
 MODIFICATION HISTORY:
       R. Sterner, 13 Feb,1991

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rb2ll.pro)


RB_LEGEND

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

 NAME:
   rb_legend

 PURPOSE:
	This procedure makes a legend for a plot.  The legend can contain
	a mixture of text, normal symbols and icg_symbols.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   rb_legend,[x],[y],legend_text=legend_text,[frame_fix_position=frame_fix_position]

 OPTINAL INPUTS:
   x                 : in norm coordinates the x position
   y                 : in norm coordinates the y position

 KEYWORD PARAMETERS:
  legend_text       : This variable holds the legend text. Symbols are defined in {}. see example
  frame_color        : color of frame default is transparent
  frame_fill_color   : fill color default is transparent
  frame_thick        : thick of frame
  frame_position     : position in frame coordinates of the frame
  frame_fix_position : fix frame position 0: outside 1: upper left corner 2: upper right corner 3: lower right corner 4: lower left corner
  frame_align        : xy alignment of the frame defualt [0,1]
  frame_as_circle    : is used for setting a label inside a circle
  text_charsize      : charsize of the legend text
  text_spacing       :
  symbol_linewidth   : width factor to expand the size of a line symbol
  recursive          : used internaly to remember it's rrecursive
  no_draw            : if it's set the legend is simulated on an outside position zo return the frame sizes
  size_frame         : returns the x and y size of the frame
  count              : is used internaly
  _extra             : all keywords which begins with symbol_ are defined as input for plots and
                       all keywords which begins with text_ are defined as input for xyouts



 EXAMPLE:
 ct_ncdf
 erase
 rb_legend, 0.3, 0.6,   legend_text=['FLUG:!C990423','{-1} longitude !CAVIONIK!Cdegree','{206} PV'],$
                        symbol_color=[1,3],$
                        frame_color=2,$
                        frame_fill_color=12,$
                        text_color=[2,1,3]
 

rb_legend, 0.3, 0.6, legend_text=['FLUG:!C990423','{-1} TEMP!Cdegree','{206} H2O','(FISH)'],$ symbol_color=[1,2],$ frame_color=0

erase plot,findgen(10) rb_legend,frame_fix_position=3,legend_text=['demo:','{0} line'],frame_color=0

erase plot,findgen(10) rb_legend,frame_fix_position=1,legend_text=['Zeile1','Zeile2','Zeile3'],frame_color=2,frame_fill_color=13

PROCEDURE: MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\rb_legend.pro)


RDCOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RDCOL
 PURPOSE:
       Read columns of numbers or times from a text file.
 CATEGORY:
 CALLING SEQUENCE:
       a = rdcol(file, rec1, rec2, cols)
 INPUTS:
       file = name of text file.                  in
       rec1, rec2 = file records to read.         in
         First record is number 1.
         To read to end of file set rec2 to a large value.
       cols = array of column numbers to read.    in
         First column is 1.  Use negatives for
         times. Ex: if column 2 is a time use -2.
 KEYWORD PARAMETERS:
       Keywords:
         /UNEVEN means file records have a variable number of
           columns. Process each record by itself.  Slower.
         /SIGN means return only arithmetic sign of each number.
           -1 if first char is -, else 1.
         ERR = e.  Error flag.  0=ok, 1=file not opened,
           2=probably didn't skip over header.
 OUTPUTS:
       a = array of selected columns.  Floating.  out
         There are as many columns as elements.
         in cols. There are rec2-rec1+1 rows.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 Jan, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rdcol.pro)


RDFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RDFILE
 PURPOSE:
       Read lines from a text file.
 CATEGORY:
 CALLING SEQUENCE:
       rdfile, file, rec1, rec2, out
 INPUTS:
       file = name of text file.                  in
       rec1, rec2 = file records to read.         in
         First record is number 1.
         To read to end of file set rec2 to a large value.
 KEYWORD PARAMETERS:
       Keywords:
         ERR = e.  Error flag.  0=ok, 1=file not opened.
 OUTPUTS:
       out = string array of selected records.    out
         Out is always an array, even for one line.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2 Jan, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rdfile.pro)


REAC2STRUC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  reac2struc

 PURPOSE:
   This function seperates a chemical reaction in the specific elements
   (names and stoichometry) and returns a structure containing all info
   about the reaction, '-->' or '-/->' seperate left from right side

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   Result=REAC2STRUC(str)

 INPUTS:
   str:    string containing the reaction (example: '2*NO2+O3-->N2O5' )

 KEYWORD PARAMETERS:
   NMAX:   max dimension of the arrays in the structure, if not given or
           less equal 0 the arrays will be allocated to the required size
   ALIAS:  if parameter is set to an string array [*,2], names found in
            alias[*,1] are substituted by the names in alias[*,0]
   STRUCT: if parameter is set to a strcuture on input, the form of this
           structure is used for the return structure

 OUTPUTS:
   Result:  strcuture containing the names of the species ( ['NO2','O3'] )
           and the stoichometry of the species ( [2.,1.] )

 EXAMPLE:
   str='NO2+NO2+O3-->N2O5'
   print, reac2struc(str)
   IDL prints:
           { -->
   NO2 O3     2.00000      1.00000
           2
    N2O5      1.00000
           1}

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1997-DEC-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\reac2struc.pro)


READBUF

[Previous Routine] [Next Routine] [List of Routines]
 purpose:    read a multi-dimension data buffer from a named ASCII file

 USEAGE:     readbuf,file,buf
             readbuf,file,buf,tag=tag,ntag=ntag,nskip=nskip,point=point,$
                     err=err,nc=nc,nl=nl,awk=awk, $
                     double=double,complex=complex,integer=integer
 input:  

   file      file name. If file name ends in a .gz or .Z suffix, the file
             is first uncompressed by running it through zcat.

             NOTE: make sure your shell knows where to find the zcat
                   utility.  Also note that the generic unix version
                   of zcat does not uncompress files created by the
                   gnu compression algorithm.  These files usually
                   have a .gz suffix.  The best bet is to set up a
                   link in your bin directory pointing to the gnu
                   version of zcat which uncompresses both .gz and .Z
                   type compressed files.  (e.g.,
                   /home/user13/frew/gnu/alpha-osf/bin/zcat)

   buf       a named array or structure set up to match the 
             data structure of FILE.
             

 optional keyword input:

   tag       string to search before reading begins.
             READBUF will scan through FILE looking for a line
             containing the string TAG. Data input starts on the
             next record (or NSKIP records later, if NSKIP is set)

   ntag      number of times TAG string is searched before reading input
             (default=1 when TAG is set, otherwise zero)

   nskip     number of records to skip before reading data.
             If TAG is set, data input starts NSKIP records after the 
             NTAG'th occurance of the TAG string in the file.
             If TAG is not set, data input starts NSKIP records 
             after the begining of the file. (default=0)

   point     byte offset into file after which reading begins

   nc        if set, buf is dimensioned fltarr(nc,nl) where nl is
             either set with the NL keyword, or is set automatically
             as the number of lines remaining in the file after tag,
             ntag and nskip actions.  This option doesn't work when
             POINT is specified.  Setting nc to zero causes both the
             number of columns and the number of lines to be set
             automatically by the file's line and word count (using the
             unix wc utility). This specification is only useful if the
             data is in the form of a rectangular array. The nc=0 option
             does not work with the nskip, point, ntag, and tag options.
             

   nl        if set buf is dimensioned fltarr(nc,nl) where nl is set
             with the NL keyword.

   awk       an awk command string used to preprocess the file.  if
             if the awk command string is prefixed with "-f" then the
             rest of the string is interpreted as the name of an
             file containing awk commands.  Otherwise the string itself is
             interpreted as an awk command.

             If the input file is compressed (indicated by a .gz or .Z
             suffix) the results of 'zcat file' is piped into awk.
             Otherwise, awk reads the input file directly.  In either
             case the awk command string is used by awk to extract
             information from file and write the results to
             readbuf_tmp~.  This temporary file is subsequently read
             by readbuf, and deleted after processing.

   double    read buffer is double precision
   complex   read buffer is complex
   integer   read buffer is integer
             
 output:

  buf        data array 

 keyword output:

  point      byte offset into file at which reading stopped,
             can be used as input to next call of READBUF

  err        returns 1 if an io read error is detected.
             returns 0 if read is successful.

 EXAMPLE:
;       After a bunch of uninteresting output, a fortran code 
;       writes to file junk.dat as follows:
;
;        write(*,'(a)') 'bufout:'
;        do 20 k=1,3
;         do 10 j=1,6
;           write(*,'(1p11e11.3)') (buf(i,j,k), i=1,11) 
;    10   continue
;    20 continue
;
;      the buf array could be read with
 
        buf=fltarr(11,6,3)
        readbuf,'junk.dat',buf,tag='bufout:'
 
;      if the fortran code listed above were executed twice
;      it is possible to read the second occurance of buf as follows
 
        point=0                              
        buf0=fltarr(1)
        readbuf,'junk.dat',buf0,tag='bufout:',point=point 
        buf=fltarr(11,6,3)
        readbuf,'junk.dat',buf,tag='bufout:',point=point
 
;      In this case the first call to READBUF is used to find the
;      point (byte offset) in the file just past the first instance
;      of the string 'bufout:'.  The second call to READBUF starts 
;      where the previous READBUF left off, scanning the file until
;      just after the second  occurance of 'bufout:'. At this point
;      the second buf is read.
 
;      another way of doing the same thing is with the NTAG parameter,
 
        buf=fltarr(11,6,3)
        readbuf,'junk.dat',buf,ntag=2,tag='bufout:',
       
       NOTE: care must be taken that the TAG string is unique.

; Use awk to preprocess a file (which happens to be compressed)
; The awk command does the following:
;
;  1. change the file seperator character to a comma
;  2. select records for which column three = 272,273,276 or 277
;  3. print columns 3,6,7,8 and 9

        awk='BEGIN {FS=","};int($3) ~ /27[2367]/ {print $3 $6 $7 $8 $9}'
        readbuf,'a_D97.sgp.gz',buf,nc=0,awk=awk
        print,buf

  author:  Paul Ricchiazzi                            8JAN93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\readbuf.pro)


READDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        READDATA

 PURPOSE:
        This subroutine reads in  almost any ASCII file
        and returns two arrays containing the names of the
        variables and their values.

        The data is read line by line or in one step if LINES is specified.

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
       READDATA,filename,data,header[,ncol,ndat][,keywords]

 INPUTS:
       FNAME   -> Name of fname to be read, e.g. 'flight12.dat'

 KEYWORD PARAMETERS:
       COLS   -> number of columns to be read (must be used if no header
                 is read in, i.e. /NOHEADER is specified). Can be used
                 to read in a subset of columns if the file contains a header
                 line with variable names (i.e. if *not* /NOHEADER).
       LINES  -> number of lines to be read (not much faster for large data
                 sets, but allows to read in a subset of the data)
       DELIM  -> Separator between names in the header (default=',')
       SKP1   -> Number of lines to be skipped before the variable definition
                 (default=0)
       SKP2   -> .. after the variable definition (default=0)
       SKIP   -> same as SKP1 (SKP1 will overwrite SKIP. SKIP may be
                 not longer supported in future versions !)
       AUTOSKIP  -> for files that state the number of comment lines in the
                 first line. If keyword NOHEADER is not set, READDATA expects
                 a list of variable names as last comment line.
                 AUTOSKIP overrides settings of SKP1 and SKP2.
       TRANSPOSE -> Normally, 1st array dimension is for variables, 2nd is for
                 observations. /TRANSPOSE will reverse that order (see note).
       NOHEADER -> don't read a header (COLS must be specified in this case !)
       NODATA   -> don't read data (stop after header). DATA parameter
                 must still be specified !
       COMMENTS -> returns string array of all the comment lines in the data
                 file for later use
       MAXCOMMENTS -> limits maximum number of comment lines to be retrieved
                (default: 255)
       QUIET  -> normally, READDATA prints the number of variables found and
                 the number of data lines read. Use this option to suppress
                 all output.
       VERBOSE -> produce extra output for debugging

 OUTPUTS:
       DATA   -> data array that was read in
       NAMES  -> string array of names in header
       NCOL   -> integer containing the number of columns
       NDAT   -> long integer containing the number of observations
       COMMENTS  -> string array containing all header lines
       If AUTOSKIP is set, skp1, and skp2 will contain the actual amount
       of lines to skip (e.g. for re-storing header information in EXPLORE)

 SUBROUTINES:

 REQUIREMENTS:
      Uses OPEN_FILE

 NOTES:
      Default of the returned DATA array is: 1st index = variable,
      2nd index = observation. Use the /TRANSPOSE option for reverse order

      If /NOHEADER is used, then COLS must specify the actual number of
      data columns in FNAME. Otherwise it can be used to read a subset of
      the data from 0 to cols-1 columns.

      IDL Parameters are optional. Of course, you should not readdata without
      passing a DATA argument, but you can ignore the HEADER,NCOL, and NDAT
      params.

 EXAMPLES:
      (1)
      READDATA,'mydata.dat',DATA,HEADER,DELIM=' ',SKIP=5

      ... will read in the ASCII file mydata.dat and store the data in DATA.
      The header information will be stored in HEADER. The header items are
      seperated by blank spaces, and the first 5 lines should be ignored.
      To pick a certain variable afterwards, type:
      VAR = DATA(WHERE HEADER EQ 'MYVAR'),*)

      (2)
      READDATA,'noheader.dat',DATA,DELIM=';',NCOLS=3

      ... will read a three column ASCII file with no header information.
      You can manually make up a header with
      HEADER = ['VAR1','VAR2','VAR3']
      or you can pass the HEADER argument and receive ['X1','X2','X3'] as
      header.

      (3)
      READDATA,'mydata.dat',DATA,HEADER,DELIM=' ',SKP1=5,LINES=60,COLS=4, $
         COMMENTS=COMMENTS

      ... will read in 60 lines and 4 columns of the ASCII file mydata.dat
      and return 6 comment lines in COMMENTS (5 + variable names)


 MODIFICATION HISTORY:
        mgs  03/12/1997   - last update : 05/22/97
        mgs 01 Aug 1997 : added template
        mgs 15 Sep 1997 : added LINES option and removed some twitch in the
                 handling of TRANSPOSE. Unfortunately, LINES does not improve
                 the speed as desired, but you can restrict the reading to
                 a smaller subset of the data.
        mgs 26 Sep 1997 : Major review
                 - bug fixes in noheader option
                 - bug fixes in COLS and NCOL handling
                 - removed units option and created comments keyword instead.
                   program now reads in all header lines into a string array
                   including the variable names line.
                 - automatic generation of a header if /NOHEADER is specified
        mgs 06 Nov 1997 : Added AUTOSKIP option for easier reading of e.g.
                 NASA formatted files.
        mgs 01 Dec 1997 : added MAXCOMMENTS keyword and limit
                 - skp1 now returns correct amount if autoskip is set
        mgs 30 Dec 1997 : added NODATA keyword
        mgs 21 Aug 1998 : now uses open_file routine to allow
                   wildcards
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\readdata.pro)


READS_FROM_STRINGARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   reads_from_stringarray

 PURPOSE:
   This functions reads one or more lines from a stringarray.
   After reading the input array is reduced to array=array[n_elements(readed):*]

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = reads_from_stringarray(array,read_lines)

 INPUTS:
   Array:  stringarray
   read_lines: A predefined empty variable, the dimension defines how much is readed from array

 OUTPUTS:
   read_lines: The reads result


 PROCEDURE:
   This function returns the reduced input array in that way thats the next reading command will get the next element
   pos=N_ELEMENTS(read_lines)
   RETURN ,array[pos:*]


 EXAMPLE:
  test=['a','b','c']
  line=''
  test=reads_from_stringarray(test,line)
  print,test
   b c
  print,line
  a

  line=strarr(2)
  test=reads_from_stringarray(test,line)
  print,test
   ''
  print,line
   b c


 MODIFICATION HISTORY:
   Written by: Reimar Bauer, 1998-Aug-29

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\reads_from_stringarray.pro)


READTOKEY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       READTOKEY
 PURPOSE:
       Read an open text file until a given key word is found.
 CATEGORY:
 CALLING SEQUENCE:
       readtokey, lun
 INPUTS:
       lun = unit number of an open text file.   in
 KEYWORD PARAMETERS:
       Keywords:
         KEY=K   Key word to search for.  First line in
           which key word K is found is return in OUT.
           File is searched up to line MAXLINE (def=1000).
           Next read gets the next file line.
         MAXLINE=M  max line to search to.
         START=S line to start key word search.
         OUT=txt line of text in which key word was found.
         ERROR=e error flag.  0=ok, 1=key word not found.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: This is used to skip to a certain line in a
         file.  Readtokey may be called again to skip to the
         next occurance of the key word (or another key word).
         The file line containing the key word may be obtained
         using the keyword OUT. Following lines in the file
         may be read using readf.
 MODIFICATION HISTORY:
       R. Sterner, 1 Feb, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\readtokey.pro)


READ_ASS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_ass

 PURPOSE:
   This functions reads a data files from KFA ASS Meteorological tower
   returns an array with the data and a structure of header

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result = READ_ASS(Filename)

 INPUTS:
   Filename:  string containing a filename incl. path

 KEYWORD PARAMETERS:
   MESSAGE:    if set a message is printed to screen before and after reading
   HEADER:     on return it contains a string array of the header
   STRUCT_INFO:    on return it contains the interpreted header
   TIME_OFFSET:    time zone setting in hours from UTC to be used
                   for the converion of the data to UTC
                   MESZ = UTC + 2  :   TIME_OFFSET=2
                   PST = UTC - 8  :   TIME_OFFSET=-8
   INTERVAL:   intergration interval of the data in the ass file (def: 600.)

 OUTPUTS:
   an array  w/ the data

 EXAMPLE:
   file='020716aa.d98'
   data=read_dap(file)

 REVISION HISTORY:
   Written         Theo Brauers, July 1998
   Modified        T.B.    Oct 1998 new keyword TIME_OFFSET

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\read_ass.pro)


READ_BDT0001

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        READ_BDT0001

 PURPOSE:
        Read a simple binary data file with size information
        and variable names and units (format BDT0001). 
        Note: I would now suggest to use netcdf instead or
        Liam Gumley's simpler binwrite/binread.

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        READ_BDT0001,filename,data,vardesc,nvars,nlines [,keywords]

 INPUTS:
        FILENAME -> Name of the file to read or a file mask that
            will be used in the PICKFILE dialog (see OPEN_FILE)
            If FILENAME is a named variable, the actual filename
            will be returned and replace a template.

 KEYWORD PARAMETERS:
        NAMES -> a named variable will contain a string array with
            NVARS variable names

        UNITS -> ... a string array with NVARS physical units

        COMMENTS -> A named variable that will return comment lines
            stored in the data file. NOTE that comments are not
            saved in vardesc.

        DEFAULTMASK -> Default mask for PICKFILE dialog (see
            OPEN_FILE).

        FILE_ID -> A named variable will return the file identifier
            string (80 characters). This string will be returned
            even if the file is of wrong type and no data was read.

        TYPE -> A named variable will contain the data type

        _EXTRA keywords are passed on to OPEN_FILE

 OUTPUTS:
        DATA -> an array with NLINES * NVARS values. The type of the
            data array depends on the information stored in the file.

        VARDESC -> A variable descriptor structure (see GTE_VARDESC)

        NVARS -> number of variables in file

        NLINES -> number of data lines


 SUBROUTINES:

 REQUIREMENTS:
        Uses OPEN_FILE

 NOTES:
        See also WRITE_BDT0001

        Format specification:
        file_ID  :      80 byte character string
        NVARS, NLINES, NCOMMENTS, TYPE : 4 byte integer (long)
        NAMES :         NVARS*40 byte character string
        UNITS :         NVARS*40 byte character string
        COMMENTS :      NCOMMENTS records of 80 byte length
        DATA  :         8 byte float (double) array NLINES*NVARS

 EXAMPLE:
        READ_BDT0001,'~/tmp/*.bdt',data,vardesc,comments=comments

        ; Will read a file that the user selects with the PICKFILE
        ; dialog. No information about the actual filename is
        ; returned.

        FILE = '~/tmp/*.bdt'
        READ_BDT0001,FILE,data,vardesc,nvars,nlines,file_id=file_id

        ; Does the same thing, but this time FILE will contain the
        ; actual filename. The number of variables and lines are
        ; returned in NVARS and NLINES, the file identifier string
        ; is returned in file_id

 MODIFICATION HISTORY:
        mgs, 24 Aug 1998: VERSION 1.00
        mgs, 23 Dec 1998: VERSION 1.10:
            - DATA now undefined if unsuccessful
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\read_bdt0001.pro)


READ_BERLIOZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_berlioz

 PURPOSE:
   This procedure will read BERLIOZ-type files and return the result in the form of enz-data (header, text, and dvalue).

 CATEGORY:
   PROG_TOOLS/FILES

 CALLING SEQUENCE:
   read_berlioz,file,header=header,text=text,dvalue=dvalue,outputfile=outputfile,zeiled=zeiled

 INPUTS:
   file   : BERLIOZ file
   zeiled ; format of line called 'D' in the BERLIOZ file; standard is [30,13,13]; reality has several possibilities.
            If omitted, format will be searched automatically.

 OUTPUTS:
   header, text, dvalue: enz-data
   outputfile          : standardised output file name to flag conversion but incorporates the version numbers also ( SFPO0720.201 -->SFPO0720.21C )

 EXAMPLE:
   file=DIALOG_PICKFILE(path=drivein,filter='SF*.*')
   read_berlioz,file[0],header=header,text=text,dvalue=dvalue,outputfile=outputfile
   IWZN,outputfile,dvalue,(size(dvalue))[1],(size(dvalue))[2],header,0,flag=1

 MODIFICATION HISTORY:
   Written by Franz Rohrer Nov 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\read_berlioz.pro)


READ_BIN AND PLOT_BIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        READ_BIN  and  PLOT_BIN

 PURPOSE:
        Read a simple binary 2-D file. The file must be F77 
        unformatted REAL and contain the XDIM and YDIM information
        as LONG integers in the first record.

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        READ_BIN,FILENAME,DATA [,keywords]
        PLOT_BIN,DATA [,keywords]

 INPUTS:
        FILENAME -> Name of the file to read

        DATA (for PLOT_BIN) -> The data array as read with READ_BIN 

 KEYWORD PARAMETERS:
        XDIM, YDIM -> return the dimensions of the data set.

        _EXTRA -> used to pass extra keywords to OPEN_FILE. Probably
              only useful with /SWAP_ENDIAN.

        /PLOT -> Call PLOT_BIN directly.

        (for PLOT_BIN)
        MIN, MAX -> minimum and maximum to be used for conversion of
              data to a byte array for display with TVIMAGE

        TOP -> top value for BYTSCL

        CT -> colortable numebr to use

        /MAP -> set this keyword to overlay a map (isotropic cylindrical
              projection)

 OUTPUTS:
        DATA -> The data array returned from READ_BIN

 SUBROUTINES:

 REQUIREMENTS:
        Uses OPEN_FILE and TVIMAGE

 NOTES:
        Rather primitive program but demonstrates the principle use
        of binary data files and TVIMAGE.

 EXAMPLE:
        READ_BIN,'~/mydata/*.bdat',data
        PLOT_BIN,data,min=min(data,max=m),max=m

        ; is equivalent to 
        READ_BIN,'~/mydata/*.bdat',dat,/PLOT

 MODIFICATION HISTORY:
        mgs, 15 Jan 1999: VERSION 1.00
        mgs, 15 Jun 1999: - added header
                          - added PLOT keyword and _EXTRA

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\read_bin.pro)


READ_CURSOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_cursor

 PURPOSE:
   This functions returns the position of the cursor in data coordinates.

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result = read_cursor([x_trans, y_trans])

 OPTIONAL INPUTS:
   x_trans, y_trans: 2-element arrays with the scaling factors for
		converting between data coordinates and normalized coordinates for the
		plot which has the focus.
		After issuing a plot command this information is stored in the
		system variables !X.S and !Y.S and has to be saved in an array
		before the next plot is done.

 OUTPUTS:
   This functions returns the position (a 2-element array - [x,y]) of the cursor in data coordinates
	If the left mouse button was pressed it reads the cursor position when
	the mouse button is released.

 OPTIONAL OUTPUTS:
	MOUSE_BUTTON = mb - On return the parameter mb will be 1
		if the left mouse button was pressed otherwise it will be 0.

 EXAMPLE:
	see test_interactive_cursor.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 03-Jun-1998.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\read_cursor.pro)


READ_DAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_dap

 PURPOSE:
   This functions reads a DAP file of the hetero group and
   returns an array with the data and a structure of header

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result = READ_DAP(Filename)

 INPUTS:
   Filename:  string containing a filename incl. path

 KEYWORD PARAMETERS:
   MESSAGE:    if set a message is printed to screen before and after reading
   HEADER:     on return it contains a string array of the header
   STRUCT_INFO:    on return it contains the interpreted header
   TIME_OFFSET:    time zone setting in hours from UTC to be used
                   for the converion of the data to UTC
                   MESZ = UTC + 2  :   TIME_OFFSET=2
                   PST = UTC - 8  :   TIME_OFFSET=-8

 OUTPUTS:
   an array  w/ the data

 EXAMPLE:
   file='020716aa.d98'
   data=read_dap(file)

 REVISION HISTORY:
   Written         Theo Brauers, July 1998
   Modified        T.B.    Oct 1998 new keyword TIME_OFFSET

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\read_dap.pro)


READ_DATA_FILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   read_data_file

 PURPOSE:
   This function reads different ASCII files into a structure (array orientated)

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=read_data_file(file_name)

 INPUTS:
   file_name:  the filename to read in

 KEYWORD PARAMETERS:
  integer: if set read type will be integer
  long:    if set read type will be long
  float:   if set read type will be float
  double:  if set read type will be double
  string:  if set read type will be string
 if no keyword_set read type is double
  assistant: if set x_get_file is used to show the data file

 OUTPUTS:
 The result is if not keyword_set(string) a sstructure with this tagnames:
   FILE:           the file name of the ASCII file
   separator       the used separator sign
   DATA            the data array
   COMMENTS        the number of comments
   HEADER          the stringarray of comment lines before the data
   TRAILER         the stringarray of comment lines behind the data
 If set type string a stringarray of the file is returned

 RESTRICTIONS:
 datasets which uses ';' as separator without a space behind like '; ' will not readed correctly
 possible separators: ' ', ',', ';'

 EXAMPLE:
  result=read_data_file('dat.txt')
  help,result,/str
** Structure <135d458>, 5 tags, length=104, refs=1:
   FILE            STRING    'dat.txt'
   separator       STRING    ','
   DATA            DOUBLE    Array[3, 3]
   COMMENTS        LONG                 1
   HEADER          STRING    Array[1]

 result=read_data_file('popjgr96.cs')
 help,result,/str
  ** Structure <1358528>, 5 tags, length=28992, refs=1:
   FILE            STRING    'popjgr96.cs'
   separator       STRING    ' '
   DATA            DOUBLE    Array[9, 401]
   COMMENTS        LONG                12
   HEADER          STRING    Array[12]

 result=read_data_file('ghost.nas')
 help,result,/str
 ** Structure <15f32c8>, 5 tags, length=1696, refs=1:
   FILE            STRING    'ghost.nas'
   separator       STRING    ' '
   DATA            DOUBLE    Array[3, 63]
   COMMENTS        LONG                20
   HEADER          STRING    Array[20]

 result=read_data_file('bi21.txt')
 help,result,/str
 ** Structure <13584b8>, 5 tags, length=1776, refs=1:
    FILE            STRING    'bi21.txt'
    separator       STRING    ' '
    DATA            DOUBLE    Array[16, 13]
    COMMENTS        LONG                11
    HEADER          STRING    Array[11]



 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1998-Nov-08

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\read_data_file.pro)


READ_DBD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_dbd

 PURPOSE:
   This function reads a database from the savinfo files

 CATEGORY:
   DATAFILES/DBD

 CALLING SEQUENCE:
   data=read_dbd(path,/final_base,/whole_base,/master_base)

 INPUTS:
   path: the start path of the datasets

 KEYWORD PARAMETERS:
  master_base: if set the master database is used.
  final_base: if set the final database is used.
  whole_base: if set the whole database is used.
              this is the default too.

  PROCEDURE:
  This function returns the database structure (dbd)
  The tags are:
    data: this is an arrayed structure named to the project:
      The tags are:
         PLATFORM_NAME     : name of the platform, e.g.'Cessna Citation II'
         EXPERIMENT        : name of the platform, e.g.'FISH_CESSNA'
         TYPE_OF_DATA      : the type of the data, e.g.'CALIBRATION'
         STATUS_OF_FILE    : the status of file,   e.g. 'finally'
         MISSION           : the mission name of the dataset, e.g. '0712_1'
         START_TIME        : the start time of the data, e.g. '1996-05-11 14:46:17'
         END_TIME          : the end time of the data, e.g.  '1996-05-11 17:35:49'
         NAMES             : the short_names of the parameter from the file, separator is '
' e.g. 'time
Frostpunkt
H2O[Pa]
H2O[ppm]<'... UNITS : the units of the parameter from the file, separator is '
' e.g. 'JSeconds
øC
Pa
ppm
hPa
hP'... IS_TIME_MONOTONIC : a scalar indicator if time is monotonicly increasing [0: not, 1: yes] LINKED_PATH* : if the file is linked this is the right location '../cessna/fish/bin/' * not used at the moment. REL_PATH : this is the relative path to the file belonging to dbd.db_path, e.g. '../cessna/fish/bin/' FILE : this is the name of the file, e.g. 'c1105_1.dat.MFD.bin.nc' db_path: this is the path where the dbase files are EXAMPLE: dbd=read_dbd('S:\links\daten\experiments\stream1996') MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-05-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\read_dbd.pro)


READ_ENZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_enz

 PURPOSE:
   This function reads an enz file and returns an ICG structure.

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   result = read_enz([enz_file])

 OPTIONAL INPUTS:
   enz_file: Name of the enz file. If omitted an open file dialog box appears.

 KEYWORD PARAMETERS:
   TAGNAMES = tagnames: string scalar or array. The number of elements of tagnames
       must match the number of parameters (not counting time) stored in the enz file.
   COLUMN_INDEX = column_index: If set to an integer scalar or array only the specified
       columns will be stored in the icg structure.
   DATE = date: scalar or 2-element vector of type string with date(s) of time window:
       'dd.mm.yy' or [dd1.mm1.yy1, dd2.mm2.yy2]
   TIME = time: 2-element vector of type string with time window: ['hh1:mm1:ss1', hh2:mm2:ss2']
           the default is ['00:00:00', '23:59:59']
           If date is a scalar then the resulting time window is ['date time_1', 'date time_2']
           If date is a 2-element vector then the time window is ['date_1 time_1', 'date_2 time_2']
   GLOBAL = global: Structure with global attributes:
       global = {'PI': pi_struc, 'DATASET': ds_struc, 'PLATFORM': pf_struc}
           pi_struc = {tagname_pi_attrib1: value_pi_attrib1, tagname_pi_attrib2: value_pi_attrib2, ...}
           ds_struc = {tagname_ds_attrib1: value_ds_attrib1, tagname_ds_attrib2: value_ds_attrib2, ...}
           pf_struc = {tagname_pf_attrib1: value_pf_attrib1, tagname_pf_attrib2: value_pf_attrib2, ...}
       If specified, this parameter will overwrite any global information read
       from the header of the enz file.
   /EASY: Set to handle enz files build by the EASY modelling environment.
   ENZ_HEADER = header: If set to a named variable the header of the enz file is returned.
   ENZ_TEXT   = text:   If set to a named variable the array of column names of the enz file is returned.
   ERROR = err: If set to a named variable the error status (0: no error) of the routine is returned.
   PATH = path: If set to a named variable, it will be used by the DIALOG_PICKFILE
       routine to set the initial path and to return the finally selected path.
   DVALUE = dvalue: If set to a named variable the array of enz data is returned.
   /IGNORE_ENZ_HEADER: If set the header of the enz file will be ignored

   Additional keyword parameters can be passed into the
   DIALOG_PICKFILE (e.g. FILTER = 'initial filter') and
   cache_enz (e.g. /NOCACHE) routines via the _EXTRA = e parameter.

 OUTPUTS:
   This function returns the data of an enz file as an ICG structure.

 RESTRICTIONS:
   This function requires that the format of enz file obeys the following rules:
       - the file must be readable by the cache_enz routine
       - the following data column structures are identified and stored in the icg structure
         using the appropriate flags:
           time [interval] data [stdev]
           time [interval] data [stdev detection_limit]
           time [interval] data [high_err low_err]
           time [interval] data [min max]
       - Time and interval data must be in the first and second column.
       - multiple data columns are allowed (all having the same structure).
       - If the structure does not match one of the above patterns
         all columns are read in as separate parameters.

 EXAMPLE:
   enz_file = 'S:\links\idl_source\easy\data\examples\example1\example1.cs'
   easy_data = read_enz(enz_file, /EASY)
   HELP, easy_data, /STR

   easy_data = read_enz(enz_file, /EASY, COLUMN_INDEX = [0, 2, 5])
   HELP, easy_data, /STR

 MODIFICATION HISTORY:
   Written by: Frank Holland, 24.06.1999
   25.06.1999: Time unit changed from 'UTC' to 'seconds since 2000-1-1 00:00:00 UTC'
   10.08.1999: Completely rewritten in order to treat multi-parameter enz files
  11.08.1999: read_enz_recstruct: Removed bug if enz file has only one
                   parameter column without additional error columns. (FR)
  12.08.1999: read_enz_recstruct: Changed SHORT_NAME of parameter time
                   from 'Time' to 'time'. (FR)
   23.08.1999: Analysis of column text with respect to error information was changed.
                   Valid error columns are recognised only if the column label includes
                   a valid NCDF error flag.
                   The routine v_struct2icg_struct is now called with /SET_FLAG.
   24.08.1999: read_enz_recstruct: Syntax bug removed.
   22.09.1999: read_enz_colheader2tagnames: All short names differ from each other.
   23.09.1999: read_enz: Bug removed if GLOBAL structure was passed into routine.
   25.10.1999: read_enz: Bug removed if VERBOSE keyword was set (for enz_header2ncdf_structure)
   11.01.2000: read_enz: New keyword parameter: COLUMN_INDEX
   13.01.2000: read_enz_recstruct: Bug removed if only one column was selected via COLUMN_INDEX.
   20.01.2000: read_enz: New keyword parameters: DATE, TIME
   23.01.2000: read_enz: New keyword parameter: ENZ_TEXT
	 03.02.2000: read_enz: New keyword parameter: DVALUE (FH)
	 02.03.2000: read_enz_colheader2tagnames: long_name wird ohne unit zurückgegeben.
   07.03.2000: read_enz_colheader2tagnames: STRTRIM wird auf head und tail durchgeführt.
   10.03.2000: read_enz: New keyword parameter: /IGNORE_ENZ_HEADER
   28.03.2000: read_enz_recstruct: Removed bug due to '@' sign in tag names under IDL 5.3

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\read_enz.pro)


READ_EROS_MAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   read_eros_map

 PURPOSE:
   This function reads a data file from the digital elevation model of
   EROS DATA CENTER

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result = READ_EROS_MAP(Drive)

 INPUTS:
   Drive:  specifies the path from which the data will be read

 KEYWORD PARAMETERS:
   HEADER_STRUCT:   if this key is set to a named variable a structure
       with header information will be returned

   MESSAGE:   if this keyword is set a messages wil be printed during
       reading of the input data

 OUTPUTS:
   This function returns the integer 2-dim-array of the elevation. It
   is already aligned for the byte order of the machine and for the
   longitude and latitude array in the header structure

 EXAMPLE:
   Assume the data CD is in drive R: and you want to use the Europe tile:

   drive='R:\w020n90\
   A = READ_EROS_MAP(drive, HEADER_STRUCT=hs, /MESSAGE)

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998 June 8

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\read_eros_map.pro)


READ_MLS_DATA

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1999, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.

 NAME:
      read_mls_data 

 PURPOSE:
   This function reads an META and PROD mls file into the ICG data structure

 CATEGORY:
    DATAFILES

 CALLING SEQUENCE:
   result=read_mls_data(file)

 INPUTS:
   File:   the file_name of the meta file

  RESTRICTIONS:
    The binary mls files are only readable on unix in the correct form.

 PROCEDURE:
  The result is the ICG defined data structure.

 EXAMPLE:
   result=read_mls_data(file)

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\read_mls_data.pro)


READ_MLS_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 Copyright (c) 1999, Forschungszentrum Juelich GmbH ICG-1
 All rights reserved.
 Unauthorized reproduction prohibited.
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.

 NAME:
      read_mls_param 

 PURPOSE:
   This function reads an META and PROD mls file into the ICG data structure

 CATEGORY:
    DATAFILES

 CALLING SEQUENCE:
   result=read_mls_meta(file)

 INPUTS:
   File:   the file_name of the meta file

  RESTRICTIONS:
    The binary mls files are only readable on unix in the correct form.

 PROCEDURE:
  The result is the ICG defined data structure.

 EXAMPLE:
   result=read_mls_meta(file)

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\read_mls_param.pro)


READ_NCDF

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

 USERLEVEL:
   TOPLEVEL

 NAME:
	read_ncdf

 PURPOSE:
   This procedure reads a netCDF File into the ICG structure

 CATEGORY:
   ICG_STRUCT/DATAFILES/NETCDF

 CALLING SEQUENCE:
   result=read_ncdf(file,[name],[/status],[/ignore_case],[_extra=p_key],[name_of_struct=name_of_struct],[error=error])

 INPUTS:
  file:  the file name of the netCDF File

 OPTIONAL INPUTS:
  name:  the name(s) of the parameter(s) to read from the netCDF file (time is included automaticly)

 KEYWORD PARAMETERS:
   status: if is set status structure is implemented to the DATA Structure
   ignore_case: if is set no case senstive name(s) are necessary
   name_of_struct: to create named structures with count_name(name_of_struct)
   error:     if is set to a named variable it returns an error code
              0: no error
              1: file not exist
              2: short name not in file

   no_cache:  if set no cache file is restored
   new_cache: if set no cache file is restored and a new cache file is created



 _extra:
     Keywords

      count:  An optional vector containing the counts to be used in reading Value.
              COUNT is a 1-based vector with an element for each dimension of the data to be written.
              The default matches the size of the variable so that all data is written out.

      offset: An optional vector containing the starting position for the read.
              The default start position is [0, 0, ...].

      stride: An optional vector containing the strides, or sampling intervals,
              between accessed values of the netCDF variable. The default stride vector is that for a contiguous read, [1, 1, ...].

      verbose: if set some informations are printed on screen
      alternative_path: if is set and no env Var: local_cache_path is defined then !data_access.alternative_cache_path is used

 OUTPUTS:
  result is a structure.
  In the substructures are only those tags are defined which are in the file and which are defined in alt_inhalt_def.
  Some tags are in every netCDF File are defined.
  The structure holds in minimum these tags.

  !filename: is the name of the file (always)
  !global:    is a tag holding a substructure with possible these substructures (always)
    pi:
     name:  name of the pi (always)
    dataset:
      campaign: name of the campain (always)
      data_category: the category (always)
      experiment:    the name of the experiment (always)
      type_of_data:  (always)
      title:         (always)
      creation_time:  (always)
      modification_time: (always)
      start_of_time:   (always)
    platform:
      type:   (always)
    exp:          (if given)
    history:   the history of the file (always)

  all other structures are parameter structures
   always in all parameter structures are:
   creator: the creator of the parameter
   creation_time: the time of creation of this parameter
   modification_time: the time when this parameter was modificated
   PARAM: the parameters
   sample_interval: in seconds
   valid: the valid index field
   flag:  the flags of additional arrays
   units: the units of PARAM
   long_name: the long_name of PARAM

 PROCEDURE:
  it is defined thats the dimension of time is the last dimension of a multi dimension array
  If short_names are including signes outside A..z, 0..9 and _ they are translated to _ for the tagname
  Cache files will be used if no short name is used.
   default a cache file is defined as:
   restore_file=default_cache_path()+file_ext.name+file_ext.ext+inhalt_def_version+'_'+creat_time+mod_time+'.sav'
   highest priority for the default_cache_path has an environmental variable named: local_cache_path
   if it is not set you can use the system variable !data_access.local_cache_path or !data_access.alternative_cache_path

 EXAMPLE:
  result=read_ncdf('ghost.nc')
  help,result,/str
  ** Structure <10b5508>, 7 tags, length=3072, refs=1:
     !FILENAME       STRING    'ghost.nc'
     !GLOBAL          STRUCT    ->  Array[1]
     TIME            STRUCT    ->  Array[1]
     N2O             STRUCT    ->  Array[1]
     F12             STRUCT    ->  Array[1]


  result=read_ncdf('ghost.nc','F12')
  ** Structure <10b25d4>, 6 tags, length=2256, refs=1:
   !FILENAME       STRING    'ghost.nc'
   !GLOBAL          STRUCT    ->  Array[1]
   TIME            STRUCT    ->  Array[1]
   F12             STRUCT    ->  Array[1]

  help,result.global,/str
  ** Structure <10b31b0>, 6 tags, length=268, refs=2:
    GPARAM          STRUCT    ->  Array[1]
    HISTORY         STRING    Array[1]
    PI              STRUCT    ->  Array[1]
    DATASET         STRUCT    ->  Array[1]
    PLATFORM        STRUCT    ->  Array[1]
    EXP             STRUCT    ->  Array[1]

 help,result.f12,/str
  ** Structure <10aa984>, 20 tags, length=808, refs=2:
     STATUS          STRUCT    ->  Array[1]
     SHORT_NAME      STRING    'F12'
     FLAG            STRING    'NONE'
     SAMPLE_INTERVAL FLOAT          0.000000
     ADD_OFFSET      FLOAT          0.000000
     SCALE_FACTOR    FLOAT           1.00000
     UNITS           STRING    'pptv'
     FORTRAN_FORMAT  STRING    'F6.2'
     LONG_NAME       STRING    'CF!I2!NCl!I2!N'
     DE_LONG_NAME    STRING    'CF!I2!NCl!I2!N'
     DESCRIPTION     STRING    'Data Retrieval via smoothed chromatogram (Gol'...
     DE_DESCRIPTION  STRING    'DE_DESCRIPTION= Auswertung per geglättetem Ch'...
     FILL_VALUE      FLOAT           999.900
     STDEV_REL       DOUBLE        0.0065000000
     PARAM               FLOAT     Array[87]
     PLOT_MIN        FLOAT           460.600
     PLOT_MAX        FLOAT           541.000
     VALID           LONG      Array[84]
     FILLED          LONG      Array[3]

  result=read_ncdf('ghost.nc','F12')
  ** Structure <10b25d4>, 6 tags, length=2256, refs=1:
   !FILENAME       STRING    'ghost.nc'
   !GLOBAL          STRUCT    ->  Array[1]
   TIME            STRUCT    ->  Array[1]
   F12             STRUCT    ->  Array[1]


 !QUIET=1
 FOR i=0,10 DO BEGIN
   a=read_ncdf('ghost.nc','F12',offset=i,count=1)
   PRINT,a.time.param, a.f12.param
 ENDFOR
      -88342665.      534.800
      -88342546.      541.000
      -88342426.      531.300
      -88342186.      533.900
      -88342066.      538.900
      -88341946.      530.900
      -88341706.      527.500
      -88341586.      513.000
      -88341466.      513.000
      -88341226.      508.400
      -88341106.      504.000

 !QUIET=0

  a=read_ncdf('ghost.nc','F12',count=5,offset=1)
  help,a.f12.param, a.time.param,/str
      FLOAT     = Array[5]
      DOUBLE    = Array[5]

  print,a.f12.param, a.time.param
      541.000      531.300      533.900      538.900      530.900
     -88342546.      -88342426.      -88342186.      -88342066.      -88341946.


  a=read_ncdf('ghost.nc',name='ghost')
  help,a
  A               STRUCT    = -> GHOST Array[1]
** Structure GHOST, 5 tags, length=2976:
   !FILENAME       STRING    'ghost.nc'
   !GLOBAL         STRUCT    -> GHOST_39 Array[1]
   TIME            STRUCT    -> GHOST_55 Array[1]
   N2O             STRUCT    -> GHOST_76 Array[1]
   F12             STRUCT    -> GHOST_97 Array[1]

   a=[a,read_ncdf('ghost.nc',name='ghost')]
   help,a
   A               STRUCT    = -> GHOST Array[2]

   a=read_ncdf('ghost.nc',/status)
   /status includes param and dim information to the parameter structures

  a=read_ncdf('ghost.nc',['f12','n2o'],/ignore_case)
  help,a,/str
  ** Structure <185cd28>, 5 tags, length=2976, refs=1:
     !FILENAME       STRING    'ghost.nc'
     !GLOBAL         STRUCT    ->  Array[1]
     F12             STRUCT    ->  Array[1]
     N2O             STRUCT    ->  Array[1]
     TIME            STRUCT    ->  Array[1]


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-11-16 11-20 11-21 11-22 12-14
   1999-01-13
   1999-02-08 cache removed
   1999-03-10 routine is good
   1999-03-16 keyword name_of_struct added
   1999-03-22 keyword ignore_case added
   1999-03-22 if valid_min and valid_max is given they are used to perform valid
   1999-03-22 error return code implemented
   1999-03-26 no_cache and new_cache implemented
   1999-04-22 dataset.start_of_time and -.end_of_time is defined as stringtime if time is double
 ;byte bei flags übertreffen
   1999-06-02 def_valid_for_param line 519 now used for time too
   1999-09-06 name of experiment structure is set to experiment name if the first word after a "_" is the beginning of the experiment name
   1999-09-28 bug removed now global attribute comments are readed too.

   während der runtime ist kein execute möglich daher muß es bei der exp_ definition entfernt werden.
   1999-10-14 if no experiment is defined no experimental Attributes exp_ are possible. These attributes now ignored
   1999-Nov-06 help added
   2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\read_ncdf.pro)


READ_NCDF_RESTORE_FILE_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	read_ncdf_restore_file_name

 PURPOSE:
   This procedure defines the ncdf retrore file name

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   result=read_ncdf_restore_file_name(file,[/status],_extra=pkey)

 INPUTS:
  file:  the file name of the netCDF File

  KEYWORD PARAMETERS:
  status: to add status_on or status_off to the file name
  _extra:
    to pass keywords to default_cache_path()

 EXAMPLE:
   print,read_ncdf_restore_file_name('ghost.nc')
    C:\temp/ghost.nc19990324132506__78910564._78910564.sav


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-04-01
   1999-04-21 keyword status added to file name
   1999-04-28 *link_file added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\read_ncdf_restore_file_name.pro)


READ_SONDE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        READ_SONDE

 PURPOSE:
        Read climatological ozone sonde data as compiled by 
        Jennifer A. Logan at Harvard University. Data available from
        ftp.as.harvard.edu/pub/exchange/sonde. Please read the README
        file.
        This procedure returns a structure with all information from
        a sondeXXX.* file. Ozone concentrations are automatically
        converted to ppbv. 

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        READ_SONDE,filename,data

 INPUTS:
        filename -> Name of the file containing the sonde data.
            This parameter can contain wildcards (*,?) in which case
            a file selection dialog will be displayed. If filename
            is a variable, it will be replaced by the actual filename
            that was opened.

 KEYWORD PARAMETERS:
        MBAR -> return ozone concentrations in mbar rather than ppbv

        STATIONS -> Can be used either as input or output for a list
            of station codes, locations and names as retrieved with
            procedure read_sondestations. STATIONS must be specified
            (or is returned) as an array of structures.

 OUTPUTS:
        DATA -> A structure containing the following fields:
                TITLE           STRING    'Ozone sonde data'
                STATION         STRING    
                STATIONCODE     INT       
                TIMERANGE       STRING    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\read_sonde.pro)


READ_SONDESTATIONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        READ_SONDESTATIONS

 PURPOSE:
        Retrieve station codes and geographical locations for 
        ozone sonding stations as listed in file station.codes
        from Jennifer A. Logan's ozone sonde climatology.
        This routine is called from procedure READ_SONDE, and
        only needs to be called explicitely if the station.codes
        file resides neither in the current directory nor the 
        directory of the sonde data files.
        The procedure will read the file station.codes once then
        store the information in a common block for later use.

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        READ_SONDESTATIONS,stations [,filename]

 INPUTS:
        FILENAME (optional) -> if given, it specifies the path and filename
              of the file that is normally called station.codes.
              FILENAME may contain wildcards (*,?) in which case a 
              file selector dialog is displayed. 

 KEYWORD PARAMETERS:

 OUTPUTS:
        STATIONS -> An array with structures containing the stations
              codes (integer), latitude, longitude, altitude (float),
              amd name (string). 

 SUBROUTINES:

 REQUIREMENTS:
        Uses OPEN_FILE and EXTRACT_FILENAME (used in OPEN_FILE)

 NOTES:

 EXAMPLE:
        read_sondestations,stations,'station.codes'
        ; if called for the first time, reads file station.codes
        ; and returns information for all stations in stations.
        ; NOTE: In this case, the filename argument could have been
        ; omitted.


 MODIFICATION HISTORY:
        mgs, 02 Nov 1998: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\read_sondestations.pro)


READ_TEXT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  read_text

 PURPOSE:  read text from a file

 USEAGE:   result=read_text(file,tag)

 INPUT:    
   file    name of input file (string).  if only one argument is
           supplied it is interpreted as the tag value and
           "captions.txt" is used as the default file.

   tag     Text tag number.  A text tag is of the form ;tag;. The return
           value is a string extending from tag to the first blank line.


       ;1;this is an example

       ;2;this is the second line 

          then read_text(FILE,1) would yield, "this is an example".

          NOTE: Since a semicolon is interpreted by IDL as a comment
                you can put your caption text inside your IDL scripts.


 OUTPUT:
   result  matched text in FILE.

 DISCUSSION:
   READ_TEXT can be used to read text blocks from a file.  READ_TEXT
   opens the named file and scans forward in the file until a line
   containing the TAG string is found.  READ_TEXT reads forward until
   until a record containing no characters is found. (i.e., a
   carriage return with no characters or spaces in the line).  All
   text between the TAGed record and the blank line are returned.
   READ_TEXT can be used with CAPTION to write figure captions onto
   plots.

 EXAMPLE:  

  suppose file captions.txt contains ("|" indicates zeroeth column):

  |figure 1. some stuff
  |
  |figure 2. some other stuff
  |test test test
  |
  |figure 3. some more stuff

 caption,read_text('captions.txt','figure 2.')

 AUTHOR:   Paul Ricchiazzi                        13 Mar 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\read_text.pro)


READ_TOMS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  read_toms,file,ozone

 PURPOSE:  read toms ascii data files 

 USEAGE:   read_toms,ozone,lons,lats

 INPUT:    
  file     Name of the toms archive data file.

 OUTPUT:
  ozone    ozone in dobson units in an global output grid
           Longitudes:  288 bins centered on 179.375 W to 179.375 E  
           (1.25 degree steps)  
           Latitudes :  180 bins centered on  89.5   S to  89.5   N  
           (1.00 degree steps)  

  lons     vector of longitudes (degrees)
  lats     vector of latitudes  (degrees)


 DISCUSSION:

   TOMS ozone data files from the Earth Probe satellite may be
   obtained via anonymous ftp from:

   /anonymous@jwocky.gsfc.nasa.gov:/pub/eptoms

   Each file contains global noon time measurements of total column 
   ozone for one day.  The data format is directly readable by this 
   procedure.  Data is available for 1996, 1997 and 1998 (in
   directories  oz96, oz97 and oz98)

 EXAMPLE:  

           read_toms,'ga970930.ept',ozone,lons,lats
           tvim,ozone,xrange=lons,yrange=lats,/scale
           map_set,0,0,/cont,/cyl,/noerase,pos=boxpos(/get)

; find toms ozone at sgp site for each day in
; september and october of 1997

           files=findfile('ozone/*.ept')
           lat=36.605 & lon=-97.485
           oz=fltarr(n_elements(files))
           for i=0,n_elements(files)-1 do begin &$
             print,files(i) &$
             read_toms,files(i),ozone,lons,lats &$
             fill_image,ozone,where(ozone eq 0.) &$
             oz(i)=interp(ozone,lons,lon,lats,lat) &$
           endfor


            

 AUTHOR:   Paul Ricchiazzi                        04 Jun 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\read_toms.pro)


READ_WRITE_MLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       read_write_mls

 PURPOSE:
       The routine reads a MLS-Data-set and converts it to one netCDF-file.

 CATEGORY:
       DATAFILES

 CALLING SEQUENCE:
       read_write_mls,file,parameters

 INPUTS:
       file: one MLS-Metafile (param or species file)

 KEYWORD PARAMETERS:
       press_index : you can choose the press level numbers (only datas on this 
                      level will be written in the netcdf-file)
       dir         : if you want to specify a directory of the input files

 OUTPUTS:
       a netCDF-file

 EXAMPLE:
       read_write_mls,'MLS_L3AT_SCLO_D1989.V0004_C01_META',[CLO,HNO3,TEMP]

 MODIFICATION HISTORY:
       Written by:     
        5. April 99   Juergen Ankenbrand

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\read_write_mls.pro)


REAL_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		REAL_MM
 VERSION:
		4.0
 PURPOSE:
		Returns real values.
 CATEGORY:
		Mathematical, general.
 CALLING SEQUENCE:
		Result = REAL_MM (X)
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the real value of the input, i.e. the input itself if its real
		the real part in FLOAT format for COMPLEX and the real part in DOUBLE
		format for DCOMPLEX.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calling CAST, FPU_FIX and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 5-MAY-1996 by Mati Meron as M_REAL.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Renamed 25-SEP-1999 by Mati Meron, to REAL_MM.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\real_mm.pro)


RECPOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RECPOL
 PURPOSE:
       Convert 2-d rectangular coordinates to polar coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       recpol, x, y, r, a
 INPUTS:
       x, y = vector in rectangular form.           in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       r, a = vector in polar form: radius, angle.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 13 Feb, 1991 --- added /degrees.
       R. Sterner, 30 Dec, 1991 --- simplified.
       R. Sterner, 25 May, 1993 --- Fixed atan (0,0) problem.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\recpol.pro)


RECPOL3D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RECPOL3D
 PURPOSE:
       Convert vector(s) from rectangular to spherical polar form.
 CATEGORY:
 CALLING SEQUENCE:
       recpol3d, x, y, z, r, az, ax
 INPUTS:
       x = X component.          in
       y = Y component.          in
       z = Z component.          in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angles are in degrees, else radians.
 OUTPUTS:
       r = Radius.               out
       az = angle from Z axis.   out
       ax = angle from X axis.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 31 Aug, 1989 --- converted to SUN.
       RES 13 Feb, 1991 --- added /degrees.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\recpol3d.pro)


RECTAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		RECTAN
 VERSION:
		4.0
 PURPOSE:
		Draws a rectangle between the limits specified by XLIMS and YLIMS,
		possibly rotated and/or rounded  The drawing is done in the currently
		defined plot area.  Alternatively, a *SHAPE* representation (see
		SHAPE_VER for definition) of the rectangle may be returned through the
		SHAPEOUT keyword.  DATA coordinate system is assumed unless specified
		otherwise by one of the keywords /DEVICE or /NORMAL.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		RECTAN, XLIMS = XLS, YLIMS = YLS [, optional keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	XLIMS
		2 dimensional vector, format [xmin,xmax], mandatory.
	YLIMS
		2 dimensional vector, format [xmin,xmax], mandatory.
	RADIUS
		Value of radius for rounded corners.
	/RELATIVE
		Switch.  Specifies that the radius value is relative to the shorter
		side of the rectangle.
	XWIGGLE
		Optional.  Allows to change the two sides parallel to the X-axis
		(before rotation, if any) into sinusoidal lines.  Can be given as
		scalar, 2D or 3D vector.  The first parameter is number of periods,
		the second is amplitude and the third phase (see the routine WIGGLINE
		for explanation).  Number of periods is always rounded to nearest
		integer or half integer and the phase is rounded to 0 or half period.
		Default for amplitude is 1, for phase is 0.

		Note:  If RADIUS (see above) is given, XWIGGLE is ignored.
	YWIGGLE
		Same as XWIGGLE, for the Y sides.
	ROTATE
		Optional.  Angle of rotation in the mathematical positive direction.
		Assumed in radians, unless DEGREES is set.  Rotation center is the
		center of the rectangle unless specified otherwise by the keyword
		ROTATION_CENTER (see below).
	ROTATION_CENTER
		Optional.  Accepts a two element vector specifying the center of
		rotation.  Ignored if ROTATE is not given.  Defaults to center of shape.
	/DEGREES
		Switch.  Specifies that the rotation angle is given in degrees.
	/FILL
		Switch.  Causes the rectangle to be filled with a solid pattern.
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable, on return the variable
		contains the *SHAPE* representation of the rectangle.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		RECTAN calls either PLOTS or (when /FILL is used) POLYFILL.  Since
		some graphics keywords work only with PLOTS, or only with POLYFILL,
		some care must be exercised.
 PROCEDURE:
		Uses calls to DEFAULT, HOW_MANY, ONE_OF, SHAPE_CLOSE, SHAPE_COCON,
		SHAPE_TRANS and WIGGLINE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-OCT-1991 by Mati Meron.  Added keyword COLOR.
		Modified 15-OCT-1992 by Mati Meron.  Added rotation capability.
		Modified 30-OCT-1992 by Mati Meron.  Added corner rounding capability.
		Modified 15-DEC-1993 by Mati Meron.  Now RECTAN takes advantage of the
		keyword inheritance property and accepts all IDL graphics keywords.
		Modified 25-JUL-1999 by Mati Meron.  Added keywords NO_SHOW and
		SHAPEOUT.
		Modified 20-SEP-1999 by Mati Meron.  Added possibility of wiggly
		borders through the keywords XWIGGLE and YWIGGLE.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\rectan.pro)


RECTANGLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    rectangle

 PURPOSE:
    This procedure converts a vector with rectangle corner
    coordinates into two vectors with x and y coordinates which can
    be used with PLOTS, POLYFILL etc. The corner coordinate must be
    given as [X0, Y0, X1, Y1]. The optional expand keyword allows to
    calculate a somewhat larger rectangle.

 USAGE:
    rectangle,corners,xvec,yvec,expand=expand

    Tip: to convert e.g. a limit vector from map_set, exchange the
    xvec and yvec results.

 CATEGORY:
    General Graphics

 MODIFICATION HISTORY:
    mgs, some time 1999: VERSION 1.0
    mgs, 26 Aug 2000: - added header and copyright

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\rectangle.pro)


REC_PTR_FREE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	rec_ptr_free

 PURPOSE:
	This procedure destroys the heap variables pointed at by its pointer argument.
	This procedure does recurse its pointer argument.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	rec_ptr_free, ptr

 INPUTS:
	ptr: pointer to be freed (scalar or array)

 EXAMPLE:
	a = PTR_NEW([PTR_NEW(4), PTR_NEW(FINDGEN(10)), PTR_NEW(PTR_NEW('ASD'))])
	HELP, /HEAP		--> List of heap variables
	rec_ptr_free, a
	HELP, /HEAP		--> Empty list

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 12.01.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\rec_ptr_free.pro)


REDUCE_IMAGE_SIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  reduce_image_size

 PURPOSE:
  This function returns the mask to reduce the white space around a given image

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=reduce_image_size(image,[border=border])

 KEYWORD PARAMETERS:
  image:      A two dimensional image

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999, June 16
   1999-Aug-09 keyword border added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\reduce_image_size.pro)


REDUNDANT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:	    redundant

 PURPOSE:	    returns the indicies of elements array which are non-unique

 USEAGE:	    result=redundant(array)

 INPUT:       
   array           a vector array


 KEYWORD INPUT:

   all             if set, return all elements which appear more than
                   once. The default is to return all but one of the
                   replicated elements

   non             If set, return all non-redundant elements.  If ALL
                   is also set, return those elements which appear
                   only once, (i.e., all replicated items are left off
                   the list).

   indecies        If set return array indecies instead of the array 
                   elements.
 EXAMPLE:
;
           array=[1,2,3,1,4,2,3,3,5]

           print,array
;       1       2       3       1       4       2       3       3       5

           print,redundant(array)
        1       2       3       3

           print,redundant(array,/non)
;       1       4       2       3       5

           print,redundant(array,/all)
;       1       2       3       1       2       3       3

           print,redundant(array,/all,/non)
;       4       5

           print,redundant(array,/all,/non,/indecies)
        4       8


  author:  Paul Ricchiazzi                            feb95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\redundant.pro)


REFICE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  refice

 PURPOSE:  compute complex refractive index of ice

 USEAGE:   result=refice(w)

 INPUT:    
   w       wavelength in microns 0.29 < w < 333.33 um
           if on input w=0, the entire lookup table contained in
           "refice.dat" is returned, and w is set to the
           corresponding wavelength vector which is
           w=.29*(333.33/.29)^(findgen(400)/399)

 KEYWORD INPUT: 
   none

 OUTPUT:
           complex refractive index

 DISCUSSION:
           uses table lookup

 EXAMPLE:  

           w8x11
           !p.multi=[0,1]
           w=.29*(333.33/.29)^(findgen(400)/399)
           plot_oi,w,float(refice(w))
           plot_oi,w,imaginary(refice(w))

 REVISIONS:

 AUTHOR:   Paul Ricchiazzi                        27 Jul 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\refice.pro)


REFORM_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   reform_struct

 PURPOSE:
   This function is used to reform a structure as tag array or struct array

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=reform_struct(structure,dim1,[dim2],[dim3],[dim4],[dim5],[dim6],[dim7],[dim8],[/struct_array],[/tag_array]

 INPUTS:
    structure: a structures
    dim1:  the new dimension of the input structure (1D to 8D)

 OPTIONAL INPUTS:
   dim2 to dim8: additional dimensions if not declared in dim1

 KEYWORD PARAMETERS:
   struct_array: if is set output structure is an array
   tag_array:    if is set output structure is 1D and tags are arrays
  You have to set one of these keywords

 EXAMPLE:
   data=create_struct('A',FINDGEN(15),'B',SIN(FINDGEN(15)))
   result=reform_struct(data,15,/struct_array)
   HELP,result
   RESULT          STRUCT    = ->  Array[15]

   
A B
0.0000000.000000
1.000000.841471
2.000000.909297
3.000000.141120
4.00000-0.756802
5.00000-0.958924
6.00000-0.279415
7.000000.656987
8.000000.989358
9.000000.412118
10.0000-0.544021
11.0000-0.999990
12.0000-0.536573
13.00000.420167
14.00000.990607

result=reform_struct(result,5,3,/tag_array) HELP,result RESULT STRUCT = -> Array[1] HELP,result,/str ** Structure <137dd68>, 2 tags, length=120, refs=1: A FLOAT Array[5, 3] B FLOAT Array[5, 3] MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Apr-23 2000-02-18 build_structure exchanged by reform_struct_create

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\reform_struct.pro)


REFRACT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REFRACT
 PURPOSE:
       Correct true altitudes to refracted altitudes.
 CATEGORY:
 CALLING SEQUENCE:
       altr = refract(alt)
 INPUTS:
       alt = true altitude(s).        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       altr = refracted altitude(s).  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 16

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\refract.pro)


REFRESH_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  refresh_window

 PURPOSE:
  This routine refreshes the given window, so it will loaded again from backing store

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   refresh_window,window_number

 INPUTS:
 window_number: the number of the window

 EXAMPLE:
  refresh_window,1


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-May-18

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\refresh_window.pro)


REGIONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REGIONS
 PURPOSE:
       Using specified breakpoints map image values into 0,1,2,...
 CATEGORY:
 CALLING SEQUENCE:
       b = regions(a,v)
 INPUTS:
       a = input image.                         in
       v = array of image value breakpoints.    in
 KEYWORD PARAMETERS:
       Keywords:
         /LIST lists processing progress.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: b is 0 where a lt v(0),
         b is 1 where v(0) le a lt v(1), . . .
 MODIFICATION HISTORY:
       R. Sterner. 1 Feb, 1987.
       R. Sterner, 6 Mar, 1990 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\regions.pro)


REGIONSBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REGIONSBAR
 PURPOSE:
       Plot a color bar for a regions type image.
 CATEGORY:
 CALLING SEQUENCE:
       regionsbar, v
 INPUTS:
       v = array of region breakpoints.     in
 KEYWORD PARAMETERS:
       Keywords:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 6 Mar, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\regionsbar.pro)


REGRID

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE: regrid,alat,alon,latrng=latrng,lonrng=lonrng,nnx,nny,kx,ky
 PURPOSE: Find polynomial coeffients to warp an irregular grid into
          a regular grid.  

 INPUT:   
  alat    array of pixel latitudes
  alon    array of pixel longitudes
  nnx     number of pixels in x direction of output array
  nny     number of pixels in y direction of output array

 OPTIONAL KEYWORD INPUT:
  latrng  range of output latitudes (default = [min(alat),max(alat)] )
          not used when projection_name is set

  lonrng  range of output longitudes (default = [min(alon),max(alon)] )
          not used when projection_name is set

  nsamp   number of sample points from which to
          generate warping polynomial (default = 400)

  degree  the degree of the warping polynomial (default = 2)

  extras  extra parameters (single value, array or structure) used in
          the user supplied projection procedure.  The defininition of 
          extras is completely up to the user.

  projection_name:
          The name of the user supplied procedure which computes the
          map projection.  if projection_name is not supplied a
          cylindrical projection is assumed.  The user supplied
          procedure must accept as arguments alat,alon,extras and
          return the normalized coordinates xnorm,ynorm which show
          where a given lat,lon map to on a unit grid.  Here is an
          example for polar orthographic projection.

            pro polar_orthographic,alat,alon,extras,xn,yn
            outer_lat=extras(0)             ; the outer latitude limit
            xmax=cos(outer_lat*!dtor)
            xmin=-xmax
            ymax=xmax
            ymin=xmin
            if outer_lat gt 0 then begin
              xn=cos(alat*!dtor)*cos(alon*!dtor)
              yn=cos(alat*!dtor)*sin(alon*!dtor)
            endif else begin
              xn=cos(alat*!dtor)*cos(-alon*!dtor)
              yn=cos(alat*!dtor)*sin(-alon*!dtor)
            endelse
            xn=(xn-xmin)/(xmax-xmin)       ; normalized coordinates
            yn=(yn-ymin)/(ymax-ymin)
            
            return 
            end

 OUTPUT:
  kx      polynomial coefficients relating indecies xold to (xnew,ynew)
  ky      polynomial coefficients relating indecies yold to (xnew,ynew)

 COMMON BLOCKS:   NONE
 SIDE EFFECTS:    NONE


 PROCEDURE:    Use together with POLY_2D to warp images to regular lat,lon
               grid.  

 EXAMPLE:

  c=complex(2,2)+cmplxgen(250,200,/center)/100         ; create alat & alon
  c=c+c^2
  alon=float(c)-100
  alat=20+imaginary(c)
  im=sqrt(abs(sin(alon*!pi)*sin(alat*!pi)))^.3 
  !p.multi=[0,1,2]                               
  window,/free,xs=400,ys=600                           ; create new window
  tvim,im,/scale,title='image'
  latrng=[28,34] & lonrng=[-100,-95] & nnx=200 & nny=150
  contour,alat,/overplot,levels=latrng,thick=4,color=0
  contour,alon,/overplot,levels=lonrng,thick=4,color=0

; regrid and display 

  regrid,alat,alon,latrng=latrng,lonrng=lonrng,nnx,nny,kx,ky
  imm=poly_2d(im,kx,ky,0,nnx,nny,missing=0)
  tvim,imm,/scale,xr=lonrng,yr=latrng,title='regrided image'

 
; polar projection
  
  window,/free,xs=400,ys=1000
  !p.multi=[0,1,3]
  c=complex(2,2)+cmplxgen(128,128,/center)/100         ; create alat & alon
  c=c+c^2
  latrng=[30,70] & lonrng=[-110,-70] & nnx=200 & nny=200
  alon=(float(c)-min(float(c)))/(max(float(c))-min(float(c)))
  alat=(imaginary(c)-min(imaginary(c)))/(max(imaginary(c))-min(imaginary(c)))
  alon=lonrng(0)+(lonrng(1)-lonrng(0))*alon
  alat=latrng(0)+(latrng(1)-latrng(0))*alat
  im=randata(128,128,s=4) gt 2
  tvim,im,/scale,title='image'
  tvlct,[0,255,0],[0,0,0],[0,0,255]
  contour,alat,/overplot,levels=[40,50,60],thick=4,color=1
  contour,alon,/overplot,levels=[-100,-90,-80],thick=4,color=2
  
  regrid,alat,alon,nnx,nny,kx,ky,proj='polar_ortho',extras=30,degree=2
  imm=poly_2d(im,kx,ky,0,nnx,nny,missing=0)
  tvim,imm,/scale,xr=[-5517,5517],yr=[-5517,5517],title='regrided image, d=2'
  r=cos([40,50,60]*!dtor)*6371
  a=(-70-indgen(41))*!dtor
  for i=0,2 do oplot,r(i)*cos(a),r(i)*sin(a),color=1
  
  a=[-100,-90,-80]*!dtor
  for i=0,2 do oplot,5517*[0,cos(a(i))],5517*[0,sin(a(i))],color=2

 NOTE: the bogus stuff in the upper half plane of the tvim image is
       due to the use of the polynomial expansion outside the range
       for which the fit is valid.  This only happens when the new
       grid extends far beyond the limits of the original irregular
       grid.  
       
  
  author:  Paul Ricchiazzi                            ESRG
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\regrid.pro)


REGRIDV (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        REGRIDV  (function)

 PURPOSE:
        Regrids a vertical profile of data from one
        pressure grid to another.

 CATEGORY:
        Regridding

 CALLING SEQUENCE:
        RESULT = REGRIDV( DATA, POLD, [ PNEW [ , KEYWORDS ] )

 INPUTS:
        DATA -> the 1-D vertical column of data to be regridded

        POLD -> The pressure centers (in mb) corresponding
             to each element of DATA.

        PNEW -> The pressure centers (in mb) that 
             defines the grid onto which DATA will be placed.
             PNEW is superseded by the ZEDGE keyword, which 
             contains pressure-altitude edges that will be
             used to define the output grid.
             
 KEYWORD PARAMETERS:
        PSURF -> Vector containing [ PSURFACE(old), PSURFACE(new) ]
             for the old and new grids.  If PSURF is passed as a
             scalar, then the same surface pressure will be used
             for both old and new grids.  Default is [ 1000.0, 1000.0 ].

        ZEDGE -> Contains pressure-altitude edges (see Note #1 below) 
             which define the output grid.  Regridded data will be 
             returned at the center point between successive
             pressure-altitude edges.

        MIN_VALID -> the minimum valid data value that shall be accepted.
             Values lower than MIN_VALID will be assigned a value of 
             MIN_VALID. Default is 0. (since this routine will be mostly
             used to regrid concentration data which shouldn't become
             negative).

        MAX_VALID -> the maximum valid data value that shall be accepted.
             (see MIN_VALID). Default for MAX_VALID is 9.99E30.

        /VERBOSE -> Prints detailed information.
        
        /TOTAL -> If set, will return the total of regridded data
              in each grid box, instead of the average.

        N_BINS -> Specifies the number of bins in an intermediate
              "fine" grid used for interpolating between the input and 
              output grids.  The fine grid will contain N_BINS
              equally spaced points between 0 and 48 km (pressure-alt
              coordinates).  Default is 100.

 OUTPUTS:
        RESULT contains the regridded data.

 SUBROUTINES:

 REQUIREMENTS:
        PEDGE
        ZMID
        ZSTAR

 NOTES: 
        (1) Regridding is done in pressure-altitude units, which are
            defined as:

                 Z* = 16 * log10[ 1000 / P(mb) ]

            which, by the laws of logarithms, is equivalent to:

                 Z* = 48 - ( 16 * log10[ P(mb) ] ).

        (2) REGRIDV only handles one column at a time.  One must loop 
            over the surface grid boxes to process the entire globe.

        (3) If the new grid has a higher top than the old grid,
            a linear extrapolation of the data is attempted. If
            the extrapolated data at the top is lower than MIN_VALID,
            these data are replaced by MIN_VALID.

        (4) It is adviseable to call REGRIDV to do vertical
            regridding before calling CTM_REGRID to do horizontal
            regridding.

        (5) The present algorithm is sure but slow.  To improve
            execution time, decrease the value of N_BINS.  The
            current value of NBINS=100 produces good results and is 
            relatively fast.
 
        (6) WARNING!  Repeated application of REGRIDV can produce a 
            vertical profile that diverges from the original profile,
            For example, if you do
 
                 D  = D0                    ; save for reference
                 D1 = REGRIDV( D0, P0, P1 )
                 D0 = REGRIDV( D1, P1, P0 ) ; one full cycle
                 D1 = REGRIDV( D0, P0, P1 )
                 D0 = REGRIDV( D1, P1, P0 ) ; two full cycles
                 D1 = REGRIDV( D0, P0, P1 )
                 D0 = REGRIDV( D1, P1, P0 ) ; three full cycles

            then the peak value of D0 will be lower than the
            original peak value in D.  Although, for most
            applications, one does not need repeated
            interpolation on the same array, the user should be
            aware of this. (bmy, 6/17/99)

                 
 EXAMPLES:
        (1) 
        OldGrid = CTM_GRID( CTM_TYPE( 'GEOS1',   NLayers=20, Psurf=1000.0 ) ) 
        NewGrid = CTM_GRID( CTM_TYPE( 'GISS_II', NLayers=9,  PSurf=1000.0 ) )
        Data    = FLTARR( OldGrid.LMX ) + 1
        NewData = REGRIDV( Data, OldGrid.PMID, NewGrid.PMID )
        print, NewData
            1.00000      1.00000      1.00000      1.00000      1.00000 
            1.00000      1.00000      1.00000      1.00000

            ; Regrids a vector containing all 1's from the 20-layer 
            ; GEOS-1 grid to the 9-layer GISS-II grid.  Returns the 
            ; average value in each GISS-II grid box.

        (2) 
        NewData = REGRIDV( Data, OldGrid.PMID, NewGrid.PMID, /Total )
        print, NewData
            10.2670      16.4270      27.5154      34.9076      32.8542 
            27.7208      21.5606      16.4270      11.3204

            ; Same grids as (1), but this time returns the total 
            ; of data in each GISS-II grid box.  

        (3)
        NewData = REGRIDV( Data, OldGrid.PMID, ZEDGE=[ 0, 4, 8, 12 ]  )
        print, Newdata
            1.0000000       1.0000000       1.0000000

            ; Same input grid as in (1), but this time returns
            ; regridded data on a pressure-altitude grid with
            ; centers at [ 2, 6, 10 ] km.

 MODIFICATION HISTORY:
        bmy, 18 Jun 1999: VERSION 1.00
        mgs, 21 Jun 1999: - minor header changes
                          - replaced QUIET keyword by VERBOSE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\regridv.pro)


REGSTAT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  regstat

 PURPOSE:  display regional statistics of an image.

 USEAGE:   regstat,im

 INPUT:    
  im       2-d array

 KEYWORD INPUT: none

 OUTPUT:   none

 DISCUSSION:
           Use REGSTAT to print the regional statistics of selected areas
           within a TVIM image.  The region is selected using CURBOX. 
           The left and middle mouse buttons reduce and increase the
           region size.  The right mouse button causes the region
           statistics to be printed to the terminal (mean, standard
           deviation, minimum, maximum and array indicies).  Exit the
           procedure by hitting the right mouse button while the the
           box is outside the plot area
  
 EXAMPLE:  
           im=randata(128,128,s=3)
           tvim,im
           regstat,im

 REVISIONS:

 AUTHOR:   Paul Ricchiazzi                        01 Jun 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\regstat.pro)


RELHUM

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      relhum

 PURPOSE:      compute relative humidity from wet and dry bulb temperature
               and pressure

 USEAGE:       result=relhum(td,tw,p) 

 INPUT:      
   t           ambient (dry bulb) temperature (celsius)
   tw          wet bulb temperatrue           (celsius)
   p           pressure                       (mb)

 OUTPUT:
   rh         relative humidity (partial pressure of water vapor divided
              by the saturated water vapor pressure)

 EXAMPLE:
   
               print,'the relative humidity is     ',relhum(29,20,980)

 References:

 Tetans, O. 1930. Uber emige meteorologische Begriffe. Z. Geophys. 6:297-309

 Weiss, A.1977. Algorithms for Calculation of Moist Air Properties on a Hand
 Calculator. Trans. ASAE 20:1133-1136

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\relhum.pro)


REMERR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	remerr

 PURPOSE:
       This procedure removes error information included in a zeichn-file by skipping each second and third line of line triples.

 CATEGORY:
	DATAFILES/ZCHN

 CALLING SEQUENCE:
       remerr,xin,xout

 INPUTS:
       xin : array(3*x,y) x: number of columns, y: number of rows

 OUTPUTS:
       xout: array(x,y); error information in x+1 and x+2 removed

 EXAMPLE:
       remerr,xin,xout

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer Januar 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\remerr.pro)


REM_INV_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rem_inv_index

 PURPOSE:
   This function returns a copy of the input array with the specified indices removed

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=rem_inv_index(array,indices,REMOVE)

 INPUTS:
   array   : input array
   indices : indices to be removed from the array
   remove  : function removes indices if this parameter is supplied

 OUTPUTS:
   result  : copy of array with specified indices removed

 EXAMPLE:
   a=[1,2,3,4,5] & i=where(a mod 2 eq 0)
   b=rem_inv_index(a,i,1)
   print,b
       1       3       5

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer August 1997
         modified:     T.B.    1997-JAN-20
                       return rs2 instead of rs to avoid change in rs
                       remove als keyword??
 FUNCTION rem_inv_index, rs, ix, REMOVE=REMOVE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\rem_inv_index.pro)


RENAME_TAG

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

 USERLEVEL:
   TOPLEVEL

 NAME:
    rename_tag

 PURPOSE:
   This functions renames a tag in a structure or sub structure.

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result = rename_tag(struct, tagname, new_tagname, [sub_structure=sub_structure])

 INPUTS:
   struct: the structure where tags will be renamed
   tagname: the old tag name
   new_tagname: the new tag name

 KEYWORD PARAMETERS:
   sub_structure: to define the sub structure where tag will be renamed
                  If not set tags on the main level will be renamed.
   /ALL: If set all tags which agree to tagname will be renamed starting from the
         main level or the level 'sub_structure' downwards.

 OUTPUTS:
   This function returns a structure with renamed tags.

 EXAMPLE:
   d = {A: 1, B: {B1: 0, B2: 1}, C: {B1: 0, B2: 1}}

   help,d,/str
   ** Structure <79b4a18>, 3 tags, length=10, refs=1:
   A               INT              1
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]

   help, rename_tag(d, 'A', 'XX'), /str
   ** Structure <46ace98>, 3 tags, length=10, refs=1:
   XX              INT              1
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]

   help, rename_tag(d, 'B', 'YY'), /str
   ** Structure <46ace98>, 3 tags, length=10, refs=1:
   A               INT              1
   YY              STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]

   result = rename_tag(d, 'B1', 'BY1', SUB = 'C')
   HELP, result.c, /STR
   ** Structure <133c8c8>, 2 tags, length=4, refs=1:
   BY1             INT              0
   B2              INT              1

   result = rename_tag(d, 'B1', 'BY1', /ALL)
   HELP, result.c, /STR
   ** Structure <10551e8>, 2 tags, length=4, refs=2:
   BY1             INT              0
   B2              INT              1

   HELP, result.b, /STR
   ** Structure <1055378>, 2 tags, length=4, refs=2:
   BY1             INT              0
   B2              INT              1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05
       14.03.2000: Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\rename_tag.pro)


REORGANIZE_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       reorganize_plot

 PURPOSE:
       This function reorganizes the plot-structure to enable the use of both plot.zeilen/spalten and plot.rows/columns

 CATEGORY:
       PLOT/PLOTXY

 CALLING SEQUENCE:
       plot=reorganize_plot(plot)

 INPUTS:
       plot: plot-structure for ICG-plot-modules

 OUTPUTS:
       plot: plot-structure for ICG-plot-modules

 MODIFICATION HISTORY:
       Written by Franz Rohrer, 03-Jun-2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\reorganize_plot.pro)


REORG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	reorg_struct

 PURPOSE:
	The result of this function is a reorganisated structure by a indexfield, e.g. result=reorg_struct({a:findgen(10),b:findgen(10)+5},[5,7])


 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=reorg_struct(structure,index)

 INPUTS:
   structure : the structure which should be reorganized
   index     : the sort or cutting index field


 OUTPUTS:
	result: The input structure but reorganized by index


 EXAMPLE:
   test={a:findgen(10),b:findgen(10)+5}
   result=reorg_struct(test,[5,7])
   IDL> print,result
   {      5.00000      7.00000
         10.0000      12.0000
   }


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\reorg_struct.pro)


REPAIR_COLUMN_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   repair_column_data

 PURPOSE:
   This procedure repairs column data by adding of a defined fill_value

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   repair_column_data,file,new_file,fill_value

 INPUTS:
  file: the file name of the ascii file to repair

 OPTIONAL INPUTS:
  new_file: the new file name of file, if not given the string 'new_' is added before file
  fill_value: the fill_value, if not given 9999.99 is used.


 EXAMPLE:
 If you have a data file holding these lines.

 time_GMT BSR_pol delta
 34790
 34792
 35417
 35419
 35421 1.36 1.26
 35423 1.47 1.27

 the result file is:

 time_GMT BSR_pol delta
 34790 9999.99 9999.99
 34792 9999.99 9999.99
 35417 9999.99 9999.99
 35419 9999.99 9999.99
 35421 1.36 1.26
 35423 1.47 1.27


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jun-21

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\repair_column_data.pro)


REPCHR[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REPCHR
 PURPOSE:
       Replace all occurrences of one character with another in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       new = repchr(old, c1, [c2])
 INPUTS:
       old = original text string.          in
       c1 = character to replace.           in
       c2 = character to replace it with.   in
            default is space.
 KEYWORD PARAMETERS:
 OUTPUTS:
       new = edited string.                 out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  28 Oct, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 1 Sep, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\repchr.pro)


REPCHR[2]

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    repchr

 PURPOSE:    produces a string composed of repititions of a given character

 USEAGE:     result=repchr(n,c)

 INPUT:
    n        number of repititions
    c        character to repeat

 EXAMPLE:
             print,repchr(20,'-')

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\repchr.pro)


REPLACE_STRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  replace_string

 PURPOSE:
   This function replaces in a given string or vector of strings all values by an other. Length or only one char didn't matter.
   It could also be used to delete a substring from a string.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=replace_string(text,in_string,rep_string,[no_of_replaces=no_of_replaces],[pos=pos],[count=count])

 INPUTS:
   text:       the text where to replace some informations
   in_string:  the search string
   rep_string: the string which should replace in_string

 KEYWORD PARAMETERS:
   no_of_replace: if set two a number, this means in text as many times of no_of_replace in_string is reaplced by rep_string
   pos:           if set to a number the replacement starts at this string position
   count:         this argument returns the number of replaces

 OUTPUTS:
   Result is the new text

 EXAMPLE:
   help,replace_string('Dies ist ein Test',' ','_')
       STRING    = 'Dies_ist_ein_Test'
   help,replace_string('Dies ist ein Test',' ','_',pos=5)
       STRING    = 'Dies ist_ein_Test'
   help,replace_string('Dies ist ein Test',' ','_',pos=5,no=1)
       STRING    = 'Dies ist_ein Test'
   help,replace_string('Dies ist ein Test','ist','ist')
       STRING    = 'Dies ist ein Test'
   help,replace_string('Dies ist ein Test, ist ein','ist','ist nicht')
       STRING    = 'Dies ist nicht ein Test, ist nicht ein'
   help,replace_string('\\\\\\\\\','\','/')
       STRING    = '/////////'
   help,replace_string('["..\idl_html\idl_work_cat.htm"]','cat','cat_org')
       STRING    = '["..\idl_html\idl_work_cat_org.htm"]'
   print,replace_string(['12:33:00','12:33:00','12:33:00'],':','')
   123300 123300 123300
   print,replace_string(['12:33:00','12:33:00','12:33:00'],':','',pos=5)
   12:3300 12:3300 12:3300
   print,replace_string( 'asdf___ertz_j','__', '')
   asdf_ertz_j
   print,replace_string(['12:33:00','12:33:00','12:33:00'],':','',pos=5,count=c),c
   12:3300 12:3300 12:3300
   3
   print,replace_string(['12:33:00','12:33:00','12:33:00'],':','',count=c),c
   123300 123300 123300
   6


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Sep-06
   1998-09-26 bug removed with start_pos and a vector of strings
   1998-09-26 special replacement include if a sign should be replaced by an other by n times
   1999-09-07 bug removed with replacing '___' by '_'
   1999-10-01 count added
   2000-03-08 bug with no_of_replaces removed
              if text is an array no_of_replaces is used for each element

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\replace_string.pro)


REPLACE_STRING_EXACTLY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  replace_string_exactly

 PURPOSE:
   This function replaces in a given string a master string by a client string if master string isn't part of an other string.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=replace_string(text,in_string,rep_string)

 INPUTS:
   text:       the text where to replace some informations
   in_string:  the search string
   rep_string: the string which should replace in_string

 OUTPUTS:
   Result will be the new text

 RESTRICTIONS:
   will not work with signs

 EXAMPLE:
   help,replace_string_exactly("This is a test isn't it or is it?",'is','was')
       STRING    = 'This was a test isn't it or was it?'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1) , 1998-Oct-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\replace_string_exactly.pro)


REPLACE_TAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       replace_tag

 PURPOSE:
  Replaces a tag in a structure by an other tag. This is necessary if you need other types or dimensions of a tag name

 CATEGORY:
  PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
  replace_tag, struct, old_tag, new_tag, value,[/first],[_extra=extra]

 INPUTS:
	struct		- the structure to be changed
	old_tag		- name of the tag to be changed
	new_tag		- name of the new tag
			      If set to '', old_tag is deleted from the structure
	value		- value of the new tag

 KEYWORD PARAMETERS:
  first: if set to 1 then replacement tag_name is set as first one.
  _extra: is used to submit first as part of a structure

 RESTRICTIONS:
	Does not work with named structures

 EXAMPLE:
  test={aa:'1',bb:2}
  replace_tag,test,'aa','ID',fltarr(10)
  help,test,/str
  ** Structure <1192ad8>, 2 tags, length=44, refs=1:
     BB              INT              2
     ID              FLOAT     Array[10]

  test={aa:'1',bb:2}
  replace_tag,test,'aa','aa',fltarr(10)
  help,test,/str
  ** Structure <1180518>, 2 tags, length=44, refs=1:
     BB              INT              2
     AA              FLOAT     Array[10]

  test={aa:'1',bb:2}
  replace_tag,test,'aa',''
  help,test,/str
  ** Structure <1193b18>, 1 tags, length=2, refs=1:
     BB              INT              2

 MODIFICATION HISTORY:
   Alex Schuster, MPIfnF, 8/97 - Written first
   R.Bauer 1998-09-26  The most syntax is replaced by del_tag (F.Holland) and tag_position (F.Rohrer)
                       Unfortunately did add_tag only work with named structures - should be discussed
                       so I used create_struct
   R.Bauer 1999-12-05  keyword first and _Extra added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\replace_tag.pro)


REPLACE_TAGVALUE

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

 USERLEVEL:
   TOPLEVEL

 NAME:
    replace_tagvalue

 PURPOSE:
   This functions replaces a tag in a structure or sub structure

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result = replace_tagvalue(struct, tagname, new_value [, NEW_TAGNAME = new_tagname, sub_structure = sub_structure])

 INPUTS:
   struct: the structure where to replace a tag
   tagname: the name of the tag to replace
   new_value: the value of the new tag

 KEYWORD PARAMETERS:
   new_tagname: A new name for the tag
   sub_structure: to define the sub structure where a tag should be replaced
         If not given tags on the main level will be replaced.
   /ALL: If set all tags which agree to tagname will be replaced starting from the
         main level or the level 'sub_structure' downwards.

 OUTPUTS:
   This function returns a structure with some tags replaced.

 EXAMPLE:
   d = {A: 1, B: {B1: 0, B2: 1}, C: {B1: 0, B2: 1}}

   help, replace_tagvalue(d, 'A', 2, NEW_TAGNAME = 'CC'),/str
   ** Structure <1056ea8>, 3 tags, length=10, refs=1:
   CC              INT              2
   B               STRUCT    ->  Array[1]
   C               STRUCT    ->  Array[1]

   result = replace_tagvalue(d, 'A', {A:2})
   HELP, result.a, /STR
   ** Structure <133aa58>, 1 tags, length=2, refs=2:
   A               INT              2

   result = replace_tagvalue(d, 'B1', {A:2}, NEW_TAGNAME = 'I', /ALL)
   help,result.b,/str
   ** Structure <1055248>, 2 tags, length=4, refs=2:
   I               STRUCT    ->  Array[1]
   B2              INT              1


   result = replace_tagvalue(d, 'B1', {A:2}, sub='B')
   HELP, result.b, /STR
   ** Structure <13243f8>, 2 tags, length=4, refs=2:
   B1              STRUCT    ->  Array[1]
   B2              INT              1
   HELP, result.b.b1, /STR
   ** Structure <1369998>, 1 tags, length=2, refs=2:
   A               INT              2

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05
       14.03.2000: Header edited

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\replace_tagvalue.pro)


REPLACE_TOKEN (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        REPLACE_TOKEN (function)

 PURPOSE:
        This function replaces placeholders in a string with their
        actual values. It can also be used to expand wildcards with a
        name list. The string must be a scalar, but there may be any
        number of placeholders and each occurence of these will be
        replaced in one call to this function. Placeholders are
        treated case-insensitive and may be surrounded by special
        delimiter characters.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        Result = REPLACE_TOKEN( Str, Token, Text, [, Keywords ] )

 INPUTS:
        STR     -> The string to be searched for tokens. This must be
                   a scalar string.

        TOKEN   -> A string or string array containing the token text
                   *OR* a structure. If TOKEN is a structure, the
                   tag names will be used as Tokens and the tag values
                   will be converted to string and used as TEXT.
                   TOKEN is case-insensitive and will always be
                   used as uppercase.
                   If keyword STRICT is set, tokens may not contain
                   ',' and may not exceed a length of 64 chars

        TEXT    -> A string or string array containing the replacement
                   text. TEXT may be some other type than string on
                   input. In this case it will be returned as string
                   and formatted according to the optional FORMAT keyword.
                   If TOKEN is provided as a structure, TEXT will return
                   the (formatted) tag values as strings.
                   TOKEN and TEXT must have the same number of elements
                   with one exception: If TOKEN contains only one element
                   while TEXT is an array, the result will be a string array
                   where each string has TOKEN replaced with the corresponding
                   TEXT value (wildcard replacement). [see example 6]

 KEYWORD PARAMETERS:
        DELIMITER  -> The delimiter character for TOKEN. Default is ''.
                   The delimiter will be automatically appended to the
                   beginning and end of TOKEN if not already there.

        COUNT   -> Number of tokens that were replaced. If TOKEN has more
                   than one element or tag, COUNT will be an integer array.

        VERBOSE -> Will print a warning message if no tokens are found.

        FORMAT  -> A string or string array containing format specifications
                   for each element of TEXT or each tag of the TOKEN
                   structure. If FORMAT contains only one element, this will
                   be used throughout. For wildcard replacement, the default
                   format is I14 (number will be trimmed).

        TFORMAT -> (type format) If TOKEN is provided as a structure, it
                   may contain data of various types. You can use TFORMAT
                   to specify a format code for each data type (see IDL
                   SIZE function) instead of each tag number as with
                   the FORMAT keyword. TFORMAT should contain at least
                   6 elements to allow formatting of double precision
                   data, or 8 elements if you want to output complex data.
        STRICT  -> don't allow ',' in tokens and no tokens longer than
                   64 chars.
        

 OUTPUTS:
        Returns string with replaced text as the value of the function.
        If TOKEN is a single string and TEXT is an array, then the result
        is an array with N(text) elements.
        In case of errors, an empty string is returned.

 SUBROUTINES:
        None.

 REQUIREMENTS:
        Uses CHKSTRU and STRRIGHT

 NOTES:
        The original input string (STR) is not altered.

        REPLACE_TOKEN will search for and replace multiple
        occurrences of the same token in the input string (STR).

        If no tokens are found in the input string, then
        REPLACE_TOKEN returns the original input string (STR)
        as the value of the function.

        The use of structures for TOKEN allows for different data
        types.
 EXAMPLE:
        (1): Replace multiple tokens in the input string

        Str     = 'Hello, My Name is %NAME% and %NAME%.'
        NewStr  = REPLACE_TOKEN( Str, 'NAME', 'Robert', delim='%' )
        print, NewStr
             ; prints:  Hello, my name is Robert and Robert.

        (2) Use a structure to replace several items at once

        Str = 'His name is $NAME$ and he lives in $STREET$, $CITY$'
        token = { name:'Henry', street:'29 Oxford St.', $
                  city:'Cambridge, MA', ZIP:'02138' }
        print,replace_token(Str,Token,delim='$')
             ; prints:  His name is Henry and he lives in
             ;          29 Oxford St., Cambridge, MA
             ; (Note: ZIP code is not used!)

        (3) Use of an empty delimiter (same TOKEN as above)
        Str = 'His name is NAME and he lives in STREET, CITY'
        print,replace_token(Str,Token)
             ; prints:  His Henry is Henry and he lives in ...
             ; (Exercise: what went wrong ?)

        (4) Use of FORMAT
        Str = 'She earns Salary.'
        Format = '("$",g0.10)'
        print,replace_token(Str,'SALARY',39000.,FORMAT=Format)
             ; prints:  She earns $39000.

        (5) Use of TFORMAT
        Str = 'Name earns Salary.'
        val = { name:'Sally', salary:39000. }
        TFormat = [ '(A)','','','','("$",g0.10)','("$",g0.10)' ]
             ; (format codes for string, float and double)
        print,replace_token(Str,val,TFORMAT=TFormat)
             ; prints: Sally earns $39000.

        (6) Wildcard replacement
        filemask = '~/data/cruise$$.dat'
        cruises = indgen(10)+1
        print,replace_token(filemask,'$$',cruises,format='(I2.2)')
             ; prints: ~/data/cruise01.dat ~/data/cruise02.dat ...
             ;         ... ~/data/cruise10.dat


 MODIFICATION HISTORY:
        bmy, 23 Sep 1998: VERSION 1.00
        bmy, 24 Sep 1998: - added VERBOSE keyword and improved comments
        mgs, 24 Sep 1998: - improved error handling
                          - TOKEN and TEXT may now be arrays
                          - *or* TOKEN may be a structure
                          - TEXT is trimmed
                          - added FORMAT and TFORMAT keywords
        mgs, 23 Dec 1998: - added wildcard (isarray) functionality
        mgs, 20 Feb 2000: - default delimiter now ''
        mgs, 26 Aug 2000: - changed copyright to open source
                          - changed loop variables to long

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\replace_token.pro)


REPL_CHARACTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   REPL_CHARACTER

 PURPOSE:
   this function replaces in a given string a single character to a new single character
   ( default: backslash to slash )

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   Result = REPL_CHARACTER(string)

 INPUTS:
   string: string variable or string array

 KEYWORD PARAMETERS:
   OLDSIGN: the sign which should be replaced in string (default= '\')
   NEWSIGN: the new sign  (default='/')
   LASTSIGN:the sign which should be the last sign

 OUTPUTS:
   string with replaced signs (default: path with slash)

 EXAMPLE:
   path=repl_character('\home3\ich388\IDL\')

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\repl_character.pro)


REPL_STR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   repl_str

 PURPOSE:
   replaces substrings with different length (but>1)of the
   same character contained in char_str with the string-
   variable 'fill_value' in a stringarray

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   REPL_STR, str_array, ix, char_str,fill_value,err

 INPUTS:
   str_array:   name of the stringarray
          ix:   number of elements of the stringarray
    char_str:   string that contains the character which
                occurs in the stringarray in different
                length (but>1)
  fill_value:   string which replaces the substrings
                of  zeichen

 OUTPUT:
   str_array:  stringarray with ix elements
         err:  message if number of parameter <4 or if the
               length of the substrings to be searched<1

 EXAMPLE:
   lines=STRARR(ix)
   char_str='=' & fill_value='123'
   REPL_STR,lines,ix,char_str,fill_value,err
   print,err,lines

 MODIFICATIO HISTORY:
       Written         Marsy Lisken, December 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\repl_str.pro)


REPWORD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REPWORD
 PURPOSE:
       Replace a word in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       txt2 = repword(txt1, n, new, [old])
 INPUTS:
       txt1 = original text string.             in
       n = word number to replace (0 = first).  in
       new = new word.                          in
 KEYWORD PARAMETERS:
       Keywords:
         /COMPRESS compress out all extra white space.
         /TRIM trim white space front front and back.
 OUTPUTS:
       old = optionally returned old word.      out
       txt2 = modified text string.             out
 COMMON BLOCKS:
 NOTES:
       Notes: if n lt 0 then txt1 is returned.
 MODIFICATION HISTORY:
       R. Sterner. 22 Apr, 1988.
       R. Sterner, 4 Feb 1990 --- converted to SUN.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\repword.pro)


RESCLOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESCLOSE
 PURPOSE:
       Close results file.
 CATEGORY:
 CALLING SEQUENCE:
       resclose
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET suppresses error messages.
 OUTPUTS:
 COMMON BLOCKS:
       results_common
 NOTES:
       Notes: one of the results file utilities.
         See also resopen, resput, resget, rescom.
 MODIFICATION HISTORY:
       R. Sterner, 19 Jun, 1991
       R. Sterner, 14 Feb, 1992 --- added /QUIET.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\resclose.pro)


RESCOM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESCOM
 PURPOSE:
       Display values from the results common and also file header.
 CATEGORY:
 CALLING SEQUENCE:
       rescom
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FILE=f    RES file to examine (def=one currently open).
         /NOHEADER skips display of file's header.
         /NOSTATUS skips display of status (read/write/lun/pointer).
         TAG=tag   Display only given tag (def=all).
 OUTPUTS:
 COMMON BLOCKS:
       results_common
 NOTES:
       Notes: one of the results file utilities.
         See also resopen, resput, resget, resclose.
 MODIFICATION HISTORY:
       R. Sterner, 18 Jun, 1991
       R. Sterner, 1994 Mar 29 --- added /NOSTATUS, TAG, and FILE keywords.
       R. Sterner, 2000 Apr 11 --- Handled endian problem.
       R. Sterner, 2000 Aug 14 --- Ignored r_swap if undefined.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rescom.pro)


RESGET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESGET
 PURPOSE:
       Get a variable from a results files.
 CATEGORY:
 CALLING SEQUENCE:
       resget, [name, val]
 INPUTS:
       name = string with name of value to get.         in
         May be truncated but will return first match.
         Case insensitive.
 KEYWORD PARAMETERS:
       Keywords:
         /EXACT   Only exact name will match.
         FOUND=i  Returned header index where match was found.
         FROM=s   Header index to start searching for name (def=0).
         HEADER=h Returned header as a string array.
         NUMBER=n Return both name and val for header
           entry number n.  In this case name must be a variable.
         FULL_NAME=txt  Returned full name.
         ADDRESS=pntr  Byte address in file (first is 0) for
           start of array (scalars have no address, return -1).
         ERROR = e error code:
           0 = OK. Value returned normally.
           1 = Given index (NUMBER) references a comment line.
               Comment line is returned in name.
           2 = Given index (NUMBER) references last header line.
           3 = Given index (NUMBER) is out of range.
           4 = Header line contained no = or ==.
           5 = Name not found.
           6 = Invalid array type specified in header.
           7 = No results file open.
 OUTPUTS:
       val = variable to contain results.               out
 COMMON BLOCKS:
       results_common
       resget_com
 NOTES:
       Notes: one of the results file utilities.
         See also resopen, resput, rescom, resclose.
         Must use resopen to open the file for read before
         using resget. Also must use resclose to close file.
 MODIFICATION HISTORY:
       R. Sterner, 18 Jun, 1991
       R. Sterner, 10 Dec, 1991 added HEADER=h and NUMBER=num.
       R. Sterner,  3 Jun, 1993 added FROM=s and FOUND=i.
       R. Sterner, 2000 Apr 11 --- Handled endian problem.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\resget.pro)


RESOLVE_CONTLINES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  resolve_contlines

 PURPOSE:
   This functions resolves continuation lines identified
   by the first or last character

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=RESOLVE_CONTLINES(str)

 INPUTS:
   str:    string array containing the text

 KEYWORD PARAMETERS:
   CHAR:   this is the continuation line char, last nonspace char
           default '$'
   EXCH:   char will be exchanged with space or with char given in exch
           default ' '
   SIDE:   default 'R' right = end of string
           'L' left, use resolve_cont_first

 OUTPUTS:
   Result: this function returns a string array where continuation
           lines are merged with the previous line. The size of the
           returned string array is reduced accordingly

 EXAMPLE:
   str=['123','$ 123', '456']
   print, resolve_cont_first(str, side='L')
   IDL prints:
       123  123
       456

 MODIFICATION HISTORY:
   Written by: Theo Brauers / Franz Rohrer 1997-JAN-28
   Modifications:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\resolve_contlines.pro)


RESOLVE_DEPENDENCIES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   resolve_dependencies

 PURPOSE:
   This procedure will resolve dependencies of a given IDL-procedure/function to the very end

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   resolve_dependencies,searchname

 KEYWORD PARAMETERS:
   Keywords:
      result          : string-array(6,x) with name, type, path, called userprocedures, called userfunctions, and time of processing
      clearbat        : when set will clear the batch-file executed to resolve routines
      clearsav        : when set will clear the sav-file for command- and data-transfer to the child-idl-process
      batfile         : name of batch-file, default dependency.bat.search
                        default:search_dependency.bat in the current directory
      savfile         : name of sav-file, default dependency.sav.search
                        default:search_dependency.sav in the current directory
      database        : database filename; information will be taken from database instead from test compilation if available; new information will be stored in database
      refresh_database: information about requested routines will be refreshed in database
      cleardatabase   : delete database file prior to processing of routines
      path            : path for batfile and savfile, default:''
      noprint         : disables printout of result

 OUTPUTS:
    result: name of routine, type, full path, dependant procedures, dependant fucntions, systime of processing
            results of processing are added to the prior contents of the sav-file
            prints contents of result in command log window

 EXAMPLE:
   resolve_dependencies,'combine_path_file',/clearsav,/clearbat,/noprint,result=result
   t=systime(1) & resolve_scripts,'c:\links\idl_source\idl_work\fr_lib',/clearsav,/clearbat,database='c:\temp\database.sav' & print,systime(1)-t
   resolve_dependencies,'combine_path_file',/clearsav,/clearbat,database='c:\temp\database.sav'

 SIDE EFFECTS:
   A child-idl-process is called to resolve routines.
   2 files are generated/needed, the batch- and the sav-file for command/data-transfer to the child-idl-process

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\resolve_dependencies.pro)


RESOLVE_FILE_PATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   resolve_file_path

 PURPOSE:
   This function will expand completely any relative path/file

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   resolve_file_path,file

 KEYWORD PARAMETERS:
   Keywords:
      start_dir: current directory befor start of the function
      path     : full path of file
      file_name: filename without path

 OUTPUTS:
   result: completely expanded filename including path

 EXAMPLE:
   file=resolve_file_path('..\daten\test.pro',start_dir=start_dir,path=path,file_name=file_name)
   will give file     :'d:/daten/test.pro'
             start_dir:'d:/temp'
             path     :'d:/daten'
             filename :'test.pro'

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\resolve_file_path.pro)


RESOLVE_SCRIPTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   resolve_scripts

 PURPOSE:
   This procedure will find all IDL-routines in a given path and resolve their dependencies

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   resolve_scripts,path

 INPUT PARAMETERS:
   searchpath: path to be processed, scalar, default:''

 KEYWORD PARAMETERS:
   Keywords:
      search          : search mask, scalar, default:'*.pro'
      level           : number of subdirectory levels followed down, default:100
      result          : string-array(6,x) with name, type, path, called userprocedures, called userfunctions, and time of processing
      clearbat        : when set will clear the batch-file executed to resolve routines
      clearsav        : when set will clear the sav-file for command- and data-transfer to the child-idl-process
      batfile         : name of batch-file, default dependency.bat.search
                        default:search_dependency.bat in the current directory
      savfile         : name of sav-file, default dependency.sav.search
                        default:search_dependency.sav in the current directory
      database        : database filename; information will be taken from database instead from test compilation if available; new information will be stored in database
      refresh_database: information about requested routines will be refreshed in database
      cleardatabase   : delete database file prior to processing of routines
      path            : path for batfile and savfile, default:''
      noprint         : disables printout of result

 OUTPUTS:
    result: name of routine, type, full path, dependant procedures, dependant fucntions, systime of processing
            results of processing are added to the prior contents of the sav-file
            prints contents of result in command log window

 EXAMPLE:
   resolve_scripts,'s:\links\idl_source\idl_work',/clearbat,/clearsav
   resolve_scripts,'s:\links\idl_source\idl_work\fr_lib\plotleg_control.pro',/clearbat,/clearsav
   resolve_scripts,'c:\links\idl_source\idl_work\fr_lib',/clearsav,/clearbat,database='c:\temp\database.sav'
;
 SIDE EFFECTS:
   A child-idl-process is called to resolve routines.
   2 files are generated/needed, the batch- and the sav-file for command/data-transfer to the child-idl-process

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\resolve_scripts.pro)


RESOPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESOPEN
 PURPOSE:
       Open a results file for reading or writing.
 CATEGORY:
 CALLING SEQUENCE:
       resopen, file
 INPUTS:
       file = results data file name.    in
 KEYWORD PARAMETERS:
       Keywords:
         /WRITE means open file for write.
         /APPEND used with /WRITE to append to a file.
         /XDR means use XDR.
         HEADER=h returned header array on open for read.
         FSTAT=fst returned file status structure.
         ERROR=e  error code:
           0 = OK.
           1 = File not found.
           2 = File not a results file.
           3 = File not opened.
         TEXT_ERROR=txterr returned error message.
         /QUIET means don't display any error messages.
         /SWAP force endian swap.
         /NOSWAP force no endian swap.
           Endian should be detected automatically and corrected.
 OUTPUTS:
 COMMON BLOCKS:
       results_common
 NOTES:
       Notes: one of the results file utilities.
         See also resput, resget, rescom, resclose.
       Error in resopen: IDL does not allow XDR files to be
         opened for both input and output simultaneously.
 MODIFICATION HISTORY:
       R. Sterner, 5 Jun, 1991
       R. Sterner, 2 Jan, 1992 --- added def='.' to open*
       R. Sterner, 1994 Jun 22 --- Added automatic close of an open file.
       R. Sterner, 1994 Jul 26 --- Modified automatic close.
       R. Sterner, 1994 Aug 11 --- Made sure r_open was defined.
       R. Sterner, 1994 Sep 12 --- Added /APPEND.
       R. Sterner, 1994 Sep 27 --- Fixed /XDR openu problem.
       R. Sterner, 2000 Mar 08 --- Fixed test for res file to compute expected file size.
       R. Sterner, 2000 Apr 11 --- Handled endian problem.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\resopen.pro)


RESPUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESPUT
 PURPOSE:
       Put values into a results file.
 CATEGORY:
 CALLING SEQUENCE:
       resput, [name, val]
 INPUTS:
       name = string with name to use as tag.            in
         May mix upper and lower case for better
         readability but readback is case
         insensitive.  No white space allowed in name.
       val  = variable to save.                          in
         Name and val are not needed if writing a comment.
 KEYWORD PARAMETERS:
       Keywords:
         COMMENT=c give a string or string array to
           place in the results header as comments.
         /SCALAR means convert one element arrays to scalars.
         ERROR=e  error code:
           0 = OK, data written.
           1 = File not changed.
 OUTPUTS:
 COMMON BLOCKS:
       results_common
 NOTES:
       Notes: one of the results file utilities.
         See also resopen, resget, rescom, resclose.
         Must use resopen to open the file for write before
         using resput. Also must use resclose to close file.
 MODIFICATION HISTORY:
       R. Sterner, 19 Jun, 1991
       R. Sterner, 13 Dec, 1992 --- increased the precision for
       floating and double scalars.
       R. Sterner, 1994 Mar 29 --- Made case sensitive for write.
       R. Sterner, 1994 May 16 --- Added /SCALAR keyword.
       R. Sterner, 1994 Jul 12 --- Added tag name check.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\resput.pro)


RESTORE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RESTORE2
 PURPOSE:
       Retrieve from a file IDL variables saved by save2.
 CATEGORY:
 CALLING SEQUENCE:
       restore2, filename, v1, v2, ..., v9
 INPUTS:
       filename = name of file to restore variable from.    in
 KEYWORD PARAMETERS:
       keywords:
         ERROR = err.  Error flag. 0=ok, 1=could not open file,
           2=restore incomplete,  3=not a save2 file.
         /XDR restore an XDR save2 file.
         /MORE will keep the file open so more variables may be restored.
            Restore2 may be called repeatedly if /MORE is
       used each time.
            A call to restore2 without /MORE closes the file.
            Ex: restore2, 'test.tmp', a, b, c, /more
                restore2, 'test.tmp', d, e, f
 OUTPUTS:
       v1, v2, ..., v9 = restored variables.                out
 COMMON BLOCKS:
       restore2_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 22 Jan, 1988.
       RES  14 Mar, 1988 --- multiple variables.
       RES  26 Jul, 1990 --- added XDR keyword.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\restore2.pro)


RESTORE_2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   restore_2

 PURPOSE:
   This function creates an HTML href from a file name

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=RESTORE_2(Filename, Restorename)

 INPUTS:
   File:   filename to restore
   Restorename: name of the variable to restore

 KEYWORD PARAMETERS:

 OUTPUTS:
   This function returns the requested variable from a saved file

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\restore_2.pro)


RESTORE_IDL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	restore_idl

 PURPOSE:
   This routine restores the precompiled idl libraries

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   restore_idl,image

 INPUTS:
 image:  the name of the image (the category name) which should be restored

 RESTRICTIONS:

 EXAMPLE:
    restore_idl,'compile_plot' or restore_idl,'plot'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997-Nov-05
 1998-Mar-12 Aenderung fuer WIN311 Benutzer
 1998-Jul-05 image files beginning with compile_ could be called without compile_
             e.g. restore_idl,'compile_plot' = restore_idl,'plot'
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\restore_idl.pro)


RESTSYSVAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       restsysvar

 PURPOSE:
       restores the settings of the !p, !x, !y, !z variables
       from a structure previously saved with savesyvar()

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       RESTSYSVAR, Save

 INPUTS:
       structure save, see savesysvar for definition

 SIDE EFFECTS:
       changes setting of system variables

 EXAMPLE:
       save = savesysvar()
       ..... plotting ....
       restore, save

 REVISION HISTORY:
       Written         Theo Brauers, Frank Holland, June 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\restsysvar.pro)


RETICK

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  retick,x=x,y=y,major=major,minor=minor,color=color,toggle=toggle

 PURPOSE:  draw tickmarks on plots

 USEAGE:   retick,x=x,y=y,ticklen=ticklen,color=color,
                toggle=toggle,thick=thick

 INPUT:    

 KEYWORD INPUT:
   x       x axis points
   y       y axis points
   ticklen length of ticks as a percentage of frame size
   toggle  x or y values at which to toggle color value (color=255-color)
   endpoints  if set draw endpoint tick marks 

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        14 Apr 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\retick.pro)


REV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REV
 PURPOSE:
       Reverse plot and background colors.
 CATEGORY:
 CALLING SEQUENCE:
       rev
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /PROMPT sets prompt to LDI> if color

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rev.pro)


REVERSE_AXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       REVERSE_AXES

 PURPOSE:

       The purpose of this program is to extend the SIMPLE_SURFACE
       program to demonstrate how to create reversible axes in
       object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       REVERSE_AXES, data, x, y

 REQUIRED INPUTS:

       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       EXACT:  Set this keyword to get exact axis scaling.

       _EXTRA: This keyword collects otherwise undefined keywords that are
        passed to the surface initialization routine.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       VECTOR: Set this keyword if you want vector printing (as opposed to
       the default bitmap printing).

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

       ZTITLE: A string used as the Z title of the plot.

 COMMON BLOCKS:

       None.

 EXAMPLE:

       To use this program with your 2D data, type:

        IDL> Reverse_Axes, data

 MODIFICATION HISTORY:

  Written by: David Fanning, October 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\reverse_axes.pro)


REVERSE_STRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   reverse_string

 PURPOSE:
   This function returns the string reversed

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = REVERSE_STRING(String)

 INPUTS:
   String:  Input string or string array

 OUTPUTS:
   This function returns the reversed string

 EXAMPLE:
   str=['{t}est[123]=5', 'test{[123456]}={1}']
   print, transpose(reverse_string(str))
   IDL prints:
       5=]321[tse}t{
       }1{=}]654321[{tset

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\reverse_string.pro)


REVISIONS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        REVISIONS

 PURPOSE:
        This routine collects the Modification history informations
        of all .pro files in a directory and creates a text file
        named REVISIONS listing the information in an orderly manner.

 CATEGORY:
        Administrative tools

 CALLING SEQUENCE:
        REVISIONS,dirname

 INPUTS:
        DIRNAME -> directory name to be searched for *.pro files

 KEYWORD PARAMETERS:
        none.

 OUTPUTS:

 SUBROUTINES:

 REQUIREMENTS:
        The program files must have a standard header with tag
        "MODIFICATION HISTORY" as last item. This must be followed
        with a ;- line (!! NOT ;----- !!).

        The REVISIONS file will be written in the directory DIRNAME,
        thus the user must have write permission.

 NOTES:
        All *.pro file in the given directory will be analyzed.

 EXAMPLE:
        revisions,'tools'

 MODIFICATION HISTORY:
        mgs, 16 Jun 1998: VERSION 1.00
        mgs, 25 May 1999: - added caution for tag detection in this
              routine itself.
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\revisions.pro)


REXEC_CHMOD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    rexec_chmod

 PURPOSE:
   This procedure uses rexec on a Woorkstation to change the owner rights

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   rexec_chmod,[file],[/dir],[rights=rights] ,[/recursive]

 OPTIONAL INPUTS:
     file: the file name which rights should be changed

 KEYWORD PARAMETERS:
   rights:      a string with the new rights for the file
   dir:         if is set and no file is given the dialog_pickfile is used to select a directory
   right:       if is set to the unix rights these rights will be used otherwise the group rights g+rwx is set
   recursive:   if is set chmod is used recursive
   WS:          the name of the Workstation on default ich230.ich.kfa-juelich.de is used

 EXAMPLE:
   rexec_chmod,'S:\links\daten\experiments\stream1998\',/recursive, rights='g+rwx'
   rexec_chmod,'S:\links\daten\experiments\stream1998\*',/recursive, rights='g-rwx'

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-04-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\rexec_chmod.pro)


REXEC_GET_LINK_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rexec_get_link_file

 PURPOSE:
   This function returns the original file position and file name from a linked file

 CATEGORY:
   DATAFILES/FILE

 CALLING SEQUENCE:
   Result=rexec_get_link_file(file_name,[/no_current],[WS=WS])

 INPUTS:
   file_name: The name of the File

 KEYWORD PARAMETERS:
   WS:   the name of the Workstation on default ich230.ich.kfa-juelich.de is used

 OUTPUTS:
   This function returns a string of the right file position


 EXAMPLE:
   result=rexec_get_link_file('S:\links\daten\experiments\stream1998\0719_1\ghost.nc')

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1), June, 30 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\rexec_get_link_file.pro)


REXEC_OWNER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    rexec_owner

 PURPOSE:
   This procedure uses rexec on a Woorkstation to get the owner of a file

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   result=rexec_owner(file,[WS=WS])

 OPTIONAL INPUTS:
     file: the file name to investigate

 KEYWORD PARAMETERS:
   WS:   the name of the Workstation on default ich230.ich.kfa-juelich.de is used

 EXAMPLE:
   result=rexec_owner('S:\.profile')

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-04-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\rexec_owner.pro)


RGB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RGB
 PURPOSE:
       Explore RGB color system.
 CATEGORY:
 CALLING SEQUENCE:
       rgb
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: R,G, and B may be varied by key presses.
         Has a simple color matching mode.
         Press ? for commands.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Jan 19

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rgb.pro)


RH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        RH     

 PURPOSE:
        Calculate relative humidity from temperature and
        dew/frostpoint

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        RH(DEWPOINT,TEMPERATURE [,/WATER] [,/ICE])

 INPUTS:
        DEWPOINT --> dewpoint (or frostpoint) temperature in K
        TEMPERATURE --> dry (or static) air temperature

 KEYWORD PARAMETERS:
        /WATER --> always calculate dewpoint temperature

        /ICE --> always calculate frostpoint temperature

 OUTPUTS:
        the relative humidity in percent   

 SUBROUTINES:

 REQUIREMENTS:
        function E_H2O is called

 NOTES:

 EXAMPLE:
        PRINT,RH(266.,278.)

        IDL prints:   41.4736

 MODIFICATION HISTORY:
        mgs, 23 Feb 1997: VERSION 1.00
        mgs, 03 Aug 1997: split e_h2o and rh, renamed, added template
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\rh.pro)


RHOZ

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   rhoz

 USEAGE:    result=rhoz(p0=p0,t0=t0,z=z,lr=lr)

 PURPOSE:   compute air density at altitude z

 KEYWORD_INPUTS:

   p0       surface pressure in mb        (default=1013.0 mb)
   t0       surface temperature in kelvin (default=273.0 K)
   z        alitude (km)                  (default=0 km)
   lr       lapse rate in kelvin/km       (default=6.5 K/km)
;
 KEYWORD_OUTPUT:
   
   pz       pressure at altitude  (mb)

 OUTPUT
   result   air density                   (kg/m3)


  EXAMPLE:  compute pressure at a given altitude 

  p=1013.0*rhoz(z=.440,t0=290.,lr=6.5)/rhoz(t0=290.,lr=6.5)

 
  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\rhoz.pro)


ROMBERG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    	ROMBERG
 VERSION:
		4.0
 PURPOSE:
		Performs high precision numerical integration.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = ROMBERG( FUN, RANGE [, EPS [, keywords]])
 INPUTS:
	FUN
		Character value representing an existing IDL function.  The function
		must comply with the IDL standard of being able to accept an array
		input and return an array output.  The calling sequence for the
		function must be either
			Result = FUN(x)
		or
			Result = FUN(x, extra)
		where X is the variable and EXTRA may be any single entity (scalar,
		array, structure etc.) used to pass additional parameters to the
		function.
	RANGE
		Two element vector, integration range.
 OPTIONAL INPUT PARAMETERS:
	EPS
		Allowed integration error.  Default is around 1e-7 for single-precision
		integration and 2e-16 for double-precision.  EPS is understood to
		represent absolute error unless the keyword RELATIVE is set.
 KEYWORD PARAMETERS:
	/RELATIVE
		If set, EPS represent the allowed relative integration error.
	PARAMS
		An arbitrary value or variable which is passed to the function FUN.
	TRY
		Normally ROMBERG exits, with STATUS = 2, if the calculation error
		starts to grow before the convergence criterion is satisfied.  Setting
		TRY to an integer > 0 specifies the number of additional attempts at
		convergence before exit (useful with ill-conditioned functions).  The
		default value is 0.
	ERROR
		Optional output, see below.
	STATUS
		Optional output, see below.
 OUTPUTS:
		Returns the value of the integral.  The result is always a scalar. The
		numerical type of the result (floating, double-precision or complex) is
		determined by the type of values returned by FUN.
 OPTIONAL OUTPUT PARAMETERS:
	ERROR
		The name of the variable to receive the estimated integration error.
		If RELATIVE is set the error returned is relative.
	STATUS
		The name of the variable to receive integration status information.
		Possible values are:
			0 - Integration didn't converge.
			1 - OK.
			2 - Integration converged, but with precision worse then specified.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Enhanced Romberg integration, using the extended midpoint rule and
		Neville's interpolation algorithm.  The process is iterated untill
		either the desired accuracy is achieved, the maximal allowed number of
		steps is exceeded or further iterations cause the error to grow instead
		of diminishing (the last can be postponed using the TRY keyword).  The
		procedure can handle functions with an integrable singularity at one
		(or both) end of the integration interval.
		Uses CAST, DEFAULT, FPU_FIX, ISNUM and TOLER from MIDL.
 MODIFICATION HISTORY:
		Created 15-FEB-92 by Mati Meron.
		Modified 20-JAN-1994 by Mati Meron.  Added keyword TRY.
		Modified 5-OCT-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\romberg.pro)


ROOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 		ROOT
 VERSION:
		4.0
 PURPOSE:
		Finds roots of real functions.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = ROOT( FUN, RANGE [, EPS [, keywords]])
 INPUTS:
	FUN
		Character value representing an existing IDL function.  The function
		must return scalar values, when provided with scalar input.  It is not
		necessary for FUN to be able to accept an array input and return an
		array output.  The calling sequence for the function must be either
			Result = FUN(x)
		or
			Result = FUN(x, extra)
		where X is the variable and EXTRA may be any single entity (scalar,
		array, or structure) used to pass additional parameters to the function.
	RANGE
		Two element vector, search range.
 OPTIONAL INPUT PARAMETERS:
	EPS
		Allowed error.  Default is machine precision, according to data type,
		as given by TOLER.  EPS is understood to represent absolute error
		unless the keyword RELATIVE is set.  The allowed error is dynamically
		adjusted during calculation.
 KEYWORD PARAMETERS:
	/RELATIVE
		If set, EPS represent the allowed relative (to the size of RANGE) error.
	PARAMS
		An arbitrary value or variable which is passed to the function FUN.
	MULTI
		Specifies multiplicity of search (i.e. what is the maximal number of
		roots to look for.  Default is 1.  If MULTI is set to -1 (or any
		negative number) the search is unlimited.
	ERROR
		Optional output, see below.
	STATUS
		Optional output, see below.
	DONE
		Optional output, see below.
 OUTPUTS:
		Returns a vector containing the location(s) of the root(s).  The
		numerical type of the result (floating, or double) is determined by the
		numerical type of RANGE.  If no root is found, returns machine max.
 OPTIONAL OUTPUT PARAMETERS:
	ERROR
		The name of the variable to receive the estimated error of the root
		location.  Returned as vector, same length as the function output.
	STATUS
		The name of the variable to receive search status information.
		Returned as vector, same length as the function output.
		Possible values are:
			0 - No root found.
			1 - OK.
			2 - Search converged, but the result appears to be a singularity.
				This may happen with nonsingular functions if the precision
				demands are set to high.
	DONE
		The name of the variable to receive search completion information.
		Possible values are:
			0 - Indicates that the number of roots prescribed by MULTI has been
				found without all of RANGE being searched.  This does not
				necessarily mean that there are more roots.  Disabled for
			MULTI = 1, or negative.
			1 - Indicates that search has been completed, i.e. all the roots
				that could be found have been found.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses Golden section search  for minima of ABS(FUN(X)).  When an
		interval where F(X) changes sign is identified, uses weighted interval
		halving to pinpoint the root.
		Uses CAST, DEFAULT, FPU_FIX, ISNUM and TOLER from MIDL.
 MODIFICATION HISTORY:
		Created 15-FEB-92 by Mati Meron.
		Modified 15-APR-92 by Mati Meron.  Added Quadratic Interpolation to
		speed up convergence for smooth functions.
		Modified 25-JAN-94 by Mati Meron.  Added multi-root search capability.
		Quadratic Interpolation replaced by a weighted halving to increase
		robustness without loosing speed.
		Modified 5-OCT-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\root.pro)


ROOT2D

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     root2d
 
 USEAGE:      root2d,utab,u,vtab,v,fx,fy,nc

 PURPOSE:     finds the floating point indices fx,fy such that 

                   u=interpolate(utab,fx,fy)
                   v=interpolate(vtab,fx,fy)

              i.e, it solves a set non-linear simulateous 
                   equations of the form

                   u=utab(x,y)
                   v=utab(x,y)

 INPUT:
    utab      2d array of values 
    u         scalor value found some where in utab
    vtab      2d array of values
    v         scalor value found some where in vtab
 
 OUTPUT:
    fx,fy     floating point interpolates into array utab and vtab
    nc        number of solutions

 AUTHOR:      Paul Ricchiazzi             jun99
              Earth Space Research Group, UCSB
 

 EXAMPLE:
	
  utab=randata(20,20,s=4,iseed=systime(1))
  wait,.5
  vtab=randata(20,20,s=3,iseed=systime(1)/100)
  !p.multi=[0,2,2]
  contour,utab,level=.5,/follow
  contour,vtab,level=.5,/follow,/over,color=100
  root2d,utab,.5,vtab,.5,fx,fy,nc
  if nc gt 0 then begin &$
    oplot,fx,fy,psym=4 &$
    for i=0,nc-1 do print,i,fx(i),fy(i), $
      interpolate(utab,fx(i),fy(i)),interpolate(vtab,fx(i),fy(i)) &$
  end
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\root2d.pro)


ROOTS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  roots

 PURPOSE:  find floating point index, f, such that x=interpolate(xx,f)
           where xx is a (possibly non-monotonic) table of values and 
           x is a scalor.  ROOTS returns -1 if no roots are found.

 USEAGE:   result=roots(xx,x)

 INPUT:    
  xx       a table of real numbers, need not be monotonic 
  x        a real number

 OUTPUT:
  nroot    number of roots

 DISCUSSION:
           Though ROOTS isn't sophisticated, it is thorough.  It
           checks all the places where ff=(x-xx)/(shift(xx,-1)-xx) is
           between [0,1).  and returns the value ii+ff, where ii is
           the index for which x is bounded by xx(ii) and xx(ii+1).
           NOTE: Sparsely populated tables may not produce a
           satisfactory accuracy.
           
           

 EXAMPLE:  

;  find the roots of the equation t^3-10*t^2-200*exp(-t)+100. = 0

   t=findrng(.0,10,1000)
   xx=t^3-10*t^2-200*exp(-t)+80.
   plot,t,xx 
   f=roots(xx,0)
   oplot,interpolate(t,f),interpolate(xx,f),psym=2
   oplot,!x.crange,[0,0],color=100
   print,'     t(f)     =',interpolate(t,f)


 AUTHOR:   Paul Ricchiazzi                        03 Apr 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\roots.pro)


ROTATE_XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ROTATE_XY
 PURPOSE:
       Rotate a set of X,Y points about a given point.
 CATEGORY:
 CALLING SEQUENCE:
       rotate_xy, x1, y1, ang, x0, y0, x2, y2
 INPUTS:
       x1, y1 = original points to rotate.          in
          Arrays or scalars.
       ang = angle to rotate by in radians (CCW).   in
       x0, y0 = center to rotate about.             in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       x2, y2 = rotated points.                     out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 22 Oct, 1986.
       R. Sterner, 22 Jan, 1990 --- converted to SUN.
       RES 13 Feb, 1991 --- added /degrees.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rotate_xy.pro)


ROTVLT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ROTVLT
 PURPOSE:
       Rotate current vlt or part of it.
 CATEGORY:
 CALLING SEQUENCE:
       rotvlt
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         STEP=value sets rotation step size.
         /REVERSE reverses rotation direction.
         RANGE=[lo,hi] sets rotation range (def = 1 to 255).
         WAIT = seconds sets wait time between color shifts.
         SOUND=time does sound effects, time 1/8192 sec long for each R,G,B.
         CHORD=time. Like SOUND but does R,G,B together.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Press any key to exit.
 MODIFICATION HISTORY:
       R. Sterner, 15 Aug, 1989
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rotvlt.pro)


ROT_3D

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ROT_3D
 PURPOSE:
       Rotate 3-d coordinate system.
 CATEGORY:
 CALLING SEQUENCE:
       rot_3d, axis, x1, y1, z1, ang, x2, y2, z2
 INPUTS:
       axis=Axis number to rotate about: 1=X, 2=Y, 3=Z.     in
       x1, y1, z1 = arrays of original x,y,z vector comp.   in
       ang = rotation angle in radians.                     in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       x2, y2, z2 = arrays of new x,y,z vector components.  out
 COMMON BLOCKS:
 NOTES:
       Note: Right-hand rule is used: Point thumb along +axis.
         Fingers curl in vector rotation direction (for +ang).
         This is for coordinate system rotation.  To rotate the
         vectors in a fixed coord. system use the left hand rule.
 MODIFICATION HISTORY:
       R. Sterner.  28 Jan, 1987.
       6 May, 1988 --- modified to work with any shape arrays.
       R. Sterner, 6 Nov, 1989 --- converted to SUN.
       RES 13 Feb, 1991 --- added /degrees.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rot_3d.pro)


ROUND2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ROUND2
 PURPOSE:
       Round that works for big double precision numbers.
 CATEGORY:
 CALLING SEQUENCE:
       out = round2(in)
 INPUTS:
       in = input number or array.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = Rounded result.         out
 COMMON BLOCKS:
 NOTES:
       Notes: works for both floats and doubles, returns
         long result for float and double for double.
         Example: round2(9000000001.4999d0) gives
         9000000001.00000
 MODIFICATION HISTORY:
       R. Sterner, 1997 Jun 4

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\round2.pro)


ROUTINE_NAME (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ROUTINE_NAME  (function)

 PURPOSE:
        This function returns the name of the routine which calls
        this function, or the name of its caller.

 CATEGORY
        General Programming

 CALLING SEQUENCE:
        rname = ROUTINE_NAME()

 INPUTS:
        none

 KEYWORD PARAMETERS:
        FILENAME -> returns the file in which the routine can be found

        /CALLER -> returns information about the caller of the routine
           instead of the routine itself

 OUTPUTS:
        The name of the caller routine is returned in lowercase
        characters (can be used to construct a filename by adding
        ".pro")

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        From the command line:
             print,routine_name()
        results in   $main$

        Very useful in conjunction with USAGE.PRO:
             usage,routine_name()
        displays help information on the current routine.

 MODIFICATION HISTORY:
        mgs, 27 Mar 1998: VERSION 1.00
        mgs, 22 Apr 1998: - added FILENAME and CALLER keywords
        mgs, 14 Jan 1998: - needed fix for filename when working on PC:
                $MAIN$ allows no str_sep
        mgs, 26 Aug 2000: - changed copyright to open source
                          - [] array notation

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\routine_name.pro)


ROUTINE_NAMES (DOCUMENTATION ONLY)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ROUTINE_NAMES  (DOCUMENTATION ONLY)

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Examine variables and parameters of procedures and call stack (OBSOLETE)

 CALLING SEQUENCE:
   Various, see USAGE VARIATIONS.

 DESCRIPTION: 

   ROUTINE_NAMES obtains information about routines, and their
   variables and keywords.  Using these functions, a subroutine can
   interrogate, and in some cases change, the values and names of
   variables and parameters in its calling routine, or at the $MAIN$
   level.  Some functionality of ROUTINE_NAMES is also in the IDL
   system function ROUTINE_INFO, and other functionality is exclusive
   to ROUTINE_NAMES.

   ROUTINE_NAMES has been designated as "OBSOLETE" by RSI, although
   it will probably not disappear soon since their own software
   appears to use it.

   ROUTINE_NAMES can be invoked in several different ways, which are
   detailed below, under USAGE VARIATIONS.

   ROUTINE_NAMES uses a notion of the current IDL "call level," which
   is the numerical stack depth of the currently executing routine.
   At each procedure or function call, the call level becomes one
   *deeper*, and upon each RETURN, the call level becomes one
   *shallower*.  The call stack always begins at the $MAIN$ level.
   The current call stack can always be printed by executing HELP.

   When specifying the call level to ROUTINE_NAMES, one can use one
   of two numbering systems, depending on whichever is most
   convenient.  In the *absolute* numbering system, the $MAIN$ level
   starts at number 1, and becomes deeper with increasing numbers.
   In the *relative* numbering system, the current (deepest) call
   level is number 0, and becomes shallower with more negative
   numbers.  Hence, if the deepest level is N, then the
   correspondence is thus:

      VALUE        MEANING
      --------------------------------
      1 or -N+1    $MAIN$ level
      2 or -N+2    NEXT deeper level
        ...           ...
      N or 0       DEEPEST (currently executing) level

 USAGE VARIATIONS:

   PROCS  = ROUTINE_NAMES(             [/UNRESOLVED])
   PROCS  = ROUTINE_NAMES(/PROCEDURES [,/UNRESOLVED])
   FUNCS  = ROUTINE_NAMES(/FUNCTIONS  [,/UNRESOLVED])

            The currently compiled procedures and functions are
            returned, respectively, as a string array.  Functions
            declared via FORWARD_FUNCTION are also returned.  If the
            UNRESOLVED keyword is set then the currently unresolved
            procedures and functions are returned.  These are known
            routines which have not yet been compiled.

   PROCS  = ROUTINE_NAMES(/S_PROCEDURES)
   FUNCS  = ROUTINE_NAMES(/S_FUNCTIONS)

            The lists of system procedures and functions is returned,
            as a string array.

   LEVNUM = ROUTINE_NAMES(/LEVEL)

            The call level of the calling routine is returned.

   NAMES  = ROUTINE_NAMES(ARG0, ARG1, ..., ARGN, ARG_NAME=LEVEL)

            The names of variables ARGi at call level LEVEL are
            returned, as a string array.  Note that ARGi are the
            actual parameters, not strings containing their names.
            ARGi must be parameters that have been passed to the
            calling procedure.  Variables that are unnamed at the
            specified call level will return the empty string.
            [IDL v5.0 and above only]
            

   VARS   = ROUTINE_NAMES(VARIABLES=LEVEL)

            The names of variables at call level LEVEL are returned,
            as a string array.

   VARS   = ROUTINE_NAMES(PROC, /P_VARIABLES, /P_PARAMETERS)
   VARS   = ROUTINE_NAMES(FUNC, /F_VARIABLES, /F_PARAMETERS)

            The names of the variables and parameters, respectively,
            defined in compiled procedure PROC, or compiled function
            FUNC, are returned as a string array.

   VALUE  = ROUTINE_NAMES(NAME, FETCH=LEVEL)

            The value of the named variable NAME at call level LEVEL
            is returned.  If the value is undefined, then the
            assignment will cause an error.  Therefore, the only safe
            way to retrieve a value is by using a variant of the
            following:
              IF N_ELEMENTS(ROUTINE_NAMES(NAME, FETCH=LEVEL)) GT 0 THEN $
                VALUE  = ROUTINE_NAMES(NAME, FETCH=LEVEL)

   DUMMY  = ROUTINE_NAMES(NAME, VALUE, STORE=LEVEL)

            The value VALUE is stored into the named variable NAME at
            call level LEVEL.  Note that there is no way to cause the
            named variable to become undefined.  The value returned
            in DUMMY can be ignored.
            [IDL v5.2 and earlier: new variables cannot be created]
            [IDL v5.3 and later: new variables can be created]

 SEE ALSO:

   ROUTINE_INFO, ARG_PRESENT, DXDEBUG (Markwardt Debug Library)

 MODIFICATION HISTORY:
   Written, 20 Jul 2000
   Documented differences between IDL versions, 21 Sep 2000, CM


  $Id: routine_names.pro,v 1.2 2001/03/25 18:10:43 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\routine_names.pro)


ROWCOL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  rowcol

 PURPOSE:  compute the plot frame position of next plot

 USEAGE:   result=rowcol(ix=ix,iy=iy)

 INPUT:    

 KEYWORD INPUT:

   ix      the x position index starting from 0 on left, 
           ix<0 indicates rightmost column of plots

   iy      the y position index starting from 0 on bottom
           iy<0 indicates top row of plots

 OUTPUT:
   result  1 if plot position matches ix or iy position index,
           otherwise zero

 DISCUSSION:
   This routine is intended to simplify labeling setup for multiframe
   plots.  Use ROWCOL in IF statements to set the XTITLE and YTITLE
   as appropriate for plots in the left or right column or bottom or
   top row.  Since ROWCOL interprets a negative IX or IY as the
   rightmost or top row of plots, respectively, you don't need to
   explicitly refer to !p.multi in your plot routines when all you
   want to do is set a special value of XTITLE for the right column
   or top row of plots.

 EXAMPLE:  

           !p.multi=[0,2,3]

; execute these lines four times:

           if rowcol(ix=0) then ytitle='ylabel' else ytitle=''
           if rowcol(iy=0) then xtitle='xlabel' else xtitle=''
           plot,dist(20),xtitle=xtitle,ytitle=ytitle

 AUTHOR:   Paul Ricchiazzi                        09 Apr 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:
 nov97: now works for column major ordering

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\rowcol.pro)


RSPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RSPEC
 PURPOSE:
       Compute an ensemble averaged frequency spectrum of real data.
 CATEGORY:
 CALLING SEQUENCE:
       sxx = rspec(x,n,sr,[freq])
 INPUTS:
       x = input signal.                               in
         If x has too few points, -1 is returned.
       n = number of points to use in each transform   in
         May be arbitrary.
       sr = sample rate in Hz (Def=1 Hz)               in
         Needed to get actual units.
 KEYWORD PARAMETERS:
       Keywords:
         OVERLAP=novr  number of points to overlap spectra (Def=0).
         ZEROPAD=zlen  length to zero pad out to (def=no 0 pad).
         N_ENSEMBLE=n  returned # spectra ensemble averaged.
         /ACCUMUALTE means accumulate the spectra, don't average.
         /NOTES lists some additional comments.
 OUTPUTS:
       sxx = spectral density in units of x^2/Hz.      out
         First value is DC, last is Nyquist.
       freq = optionally output frequency array.       out
 COMMON BLOCKS:
       rspec_com
 NOTES:
       Notes: Restricted to one dimensional data only.
         Reference: 
 MODIFICATION HISTORY:
       B. L. Gotwols Oct. 11, 1990.
       R. E. Sterner  7 Aug, 1991 --- return only 1-side (symetric)
       R. D. Chapman  2 Dec, 1992 --- fixed common blk reference to hannratio
       R. E. Sterner  1 Mar, 1993 --- tested for ntimes eq 0 sooner.
       R. Sterner, 19 May, 1993 --- forced correct data types.
       Rewrote from xspec.pro to get overlap.
       R. Sterner, 23 Nov, 1993 --- Added /ACCUMULATE keyword
       R. Sterner, 1994 Nov 10 --- Added ZEROPAD keyword.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rspec.pro)


RSTRPOS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rstrpos2

 PURPOSE:
   This function adds array functionality to RSI's rstrpos

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = RSTRPOS2(Expr, Search, [Pos])

 INPUTS:
   String:  Input string or string array
   Search:  Search string or string array

 OPTIONAL INPUTS:
   Pos:    Start position (skalar or array)

 OUTPUTS:
   This function returns the last position of search found in expr

 EXAMPLE:
   IDL>  print, rstrpos2(['abcdef','abcdef'], ['b','e'], [1,2])
          -1          -1
   IDL>  print, rstrpos2(['abcdef','abcdef'], ['b','e'])
           1           4
   IDL>  print, rstrpos2(['abcdef','abcdef'], ['b','e'], 1)
          -1          -1
   IDL>  print, rstrpos2(['abcdef','abcdef'], ['b','e'], 5)
          1           4

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-Nov-16

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\rstrpos2.pro)


RTICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RTICS
 PURPOSE:
       Plot labeled or unlabeled tic marks around a circular arc.
 CATEGORY:
 CALLING SEQUENCE:
       rtics, a1, a2, da, r1, r2, [rl, lb, sz, flg]
 INPUTS:
       a1, a2, da = tic mark start angle, end angle, step     in
          (deg CCW from X axis).
       r1, r2 = start and end radii of tic marks.             in
       rl = label radius.                                     in
       lb = string array of labels.                           in
       sz = Text size.                                        in
       flg = label angle flag.                                in
             0: read from outside circle (def),
             1: read labels from inside circle.
 KEYWORD PARAMETERS:
       Keywords:
         X0=x, Y0=y.  Offsets for center of circle.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 12 July, 1988.
       RES  18 July, 88 --- added reverse labels flag.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\rtics.pro)


RUBBERBANDDG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RubberBandDG

 PURPOSE:
	This is demo code to show some techinques
	o Rubberband box using a pixmap to redraw quickly

 CATEGORY:
       Image processing

 CALLING SEQUENCE:
       RubberBandOG

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\CODEBANK\rubberbanddg.pro)


RUNLENGTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RUNLENGTH
 PURPOSE:
       Give run lengths for array values.
 CATEGORY:
 CALLING SEQUENCE:
       y = runlength(x,[r])
 INPUTS:
       x = 1-d array of values.                  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = X with multiple values squeezed out.  out
       r = run length of each element in Y.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       RES  30 Jan, 1986.
       R. Sterner, 25 Sep, 1990 --- converted to IDL V2.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\runlength.pro)


RUN_AV (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        RUN_AV (function)

 PURPOSE:
        Compute running average or running total of a
        data vector. Compared to the IDL function TS_SMOOTH,
        this function takes into account missing values or
        gaps in an optional x vector, and it allows for 
        even bandwidths. It can also be used to compute cumulative
        totals.

 CATEGORY:
        math

 CALLING SEQUENCE:
        result = RUN_AV(Y [,X] [,keywords] )

 INPUTS:
        Y -> the data vector (a 2-D array will be treated as a vector)

        X -> an optional X vector defining e.g. the sample times.
             This only has an effect when the DELTAX keyword is specified.
             X must be monotonically increasing and have the same 
             number of elements as Y.

 KEYWORD PARAMETERS:
        WIDTH -> The number of points to use for the average or total
             Default is 1, i.e. Y is returned unchanged.

        MINWIDTH -> The minimum number of points that must be valid 
             in order to return a average or total for the given point.
             Default is MINWIDTH=WIDTH, i.e. all points must be valid
             (and if X and DELTAX are specified, all points must lie
             within WIDTH*DELTAX). 

        MIN_VALID -> The minimum value for valid data. Data with less than
             MIN_VALID will be considered missing. MIN_VALID is also used
             to indicate invalid totals or averages (1% is subtracted).

        DELTAX -> The maximum gap between two consecutive x values.
             Only effective when X is given.

        COUNT -> A named variable will return the number of points used 
             in each average or total.

        /TOTAL -> Set this keyword to compute running totals instead 
             of running averages.

 OUTPUTS:
        The function returns a vector with running averages or totals.
        The number of elements in the result vector always equals the 
        number of elements in Y (unless an error occurs). 

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        This function can also be used to compute accumulative totals.
        Simply set WIDTH to n_elements(Y) and MINWIDTH to 1 and use
        the /TOTAL keyword. However, this is very uneffective for large 
        data vectors!

 EXAMPLE:
        y = findgen(20)
        print,run_av(y,width=4)
        ; IDL prints: -1E31 -1E31 -1E31  1.5  2.5  3.5  4.5 ...

        print,run_av(y,width=4,/TOTAL)
        ; IDL prints: -1E31 -1E31 -1E31  6  10  14  18 ...

        ; (cumulative total)
        print,run_av(y,width=n_elements(y),minwidth=1,/TOTAL)
        ; IDL prints:  0  1  3  ...  190

        x = [ 0, 2, 4, 6, 16, 20, 24, 25, 26, 27, 28, 29, 30, 32, 33 ]
        y = fltarr(n_elements(x)) + 1.
        print,run_av(y,x,width=4,count=c)
        ; IDL prints: -1E31  -1E31  -1E31  1  1  1  1  ...
        print,c
        ; IDL prints:  1  2  3  4  4  4  4  4  4  4  4  4  4  4  4

        print,run_av(y,x,deltax=2,width=4,count=c)
        ; IDL prints: -1E31  -1E31  -1E31  1  -1E31  -1E31  -1E31
        ;             -1E31  -1E31  -1E31  1   1   1   1   1
        print,c
        ; IDL prints:  1  2  3  4  3  2  1  1  2  3  4  4  4  4  4

 MODIFICATION HISTORY:
        mgs, 21 Oct 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\run_av.pro)


SATGRID

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  satgrid

 PURPOSE:  compute data coordinates of scanning sensors deployed on 
           polar orbiting satellites

 USEAGE:   satgrid,nx,ny,alon,alat,lon0=lon0,lat0=lat0,inclin=inclin, $
            alt=alt,period=period,lres=lres,sres=sres,dmsp=dmsp, $
            descend=descend,time=time

 INPUT:    

  nx        number of samples, if nx le 1 then alon and alat
            are one dimensional vectors which specify the satellite
            ground track.  

  ny        number of lines


 KEYWORD INPUT:


  lon0      longitude of equator crossing     (degrees)
            the NOAA polar orbiters cross the equator at the same
            local time each day.  

            For example, if the ascending node crossing occurs at local
            time 10:30, or 1.5 hrs before noon, then the longitude offset
            from the sub-solar longitude is 

            lon0=(10.30-12.00)*15=-22.5 degrees

  inclin    orbital inclination               (degrees)  (default=98.9127)
            0 < inclin < 180
            (this is the angle between the north pole and the the
            satellite orbital axis. [Use right hand rule to establish
            direction of orbital axis.] The default value cooresponds to
            to a sun sychronous orbit. 

  alt       altitude of orbit                 (km)       (default=853. km)

  period    period of orbit                   (hours)    (default=1.6985 hrs)

            either alt or period may be specified and the other quantity is
            computed through the relation between orbital period and altitude.
            if neither parameter is set the indicated defaults are used.

  dmsp      set to 1 if satellite ground resolution is held constant
            in the crosstrack direction, as it is on the DMSP satellite,

  lres      along track resolution at nadir=0 (km)       (default=1.)

  sres      cross track resolution at nadir=0 (km)       (default=1.)

            NOTE: SRES is internally limited to less than
                  .999*2*nadrlim/(nx-1), where nadrlim is the 
                  maximum nadir angle for which the earth is 
                  still in the IFOV of the sensor.

  descend   if set, choose descending node.  This affects the
            ordering of the ALON and ALAT grids.

 OUTPUT:
  alon      longitude array

  alat      latitude array

            NOTE: when facing the direction of ground track motion the
            first array index of the alat and alon arrays are filled
            from left to right.
            
  time      time offset at which a given line of data is obtained (hours)
            The offset is respect to the time at which the first line
            of data is returned.

  swath     cross track swath width in km


 DISCUSSION:
  This routine is not intended to give precise satellite coordinates,
  rather it can be used to compute illustritive grids to test other
  routines.  A circular orbit is assumed and the earth is allowed to
  rotate during the period of the orbit.  In reality, NOAA polar
  orbiters have an eccentricity of about 0.0011. This has a very
  small impact on inter pixel spacing. The ordering of alat and alon
  may need to be transposed, reversed or rotated to account for
  satellite direction of motion i.e., ascending / descending node and
  for details of how a given satellite orders its output.

 LIMITATIONS:
  Should not be used to compute satelite ground track or data grids 
  when high accuracy is required.

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  
   
;; show satellite ground track   

   map_set,0,-120,/cyl,/cont,/grid
   satgrid,0,200,alon,alat,lres=240.
   oplot,alon,alat

;; show sensor samples, color indicates array ordering (dark=>start)

   loadct,5
   color=(!d.n_colors*findgen(100)/100.) # replicate(1,600)

   satgrid,100,600,alon,alat,lres=200,sres=16.5.,swath=swath
   print,swath
   plots,alon,alat,psym=3,color=color


 AUTHOR:   Paul Ricchiazzi                        20 Dec 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\satgrid.pro)


SATTRACKAZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SATTRACKAZ
 PURPOSE:
       Return the azimuth of a satellite track given inc and lat.
 CATEGORY:
 CALLING SEQUENCE:
       taz = sattrackaz(inc, lat)
 INPUTS:
       inc = Inclination of satellite orbit (degrees).     in
       lat = Latitude of subsatellite point (degrees).     in
 KEYWORD PARAMETERS:
       Keywords:
         /ASCENDING  Means satellite is in the ascending part
           of it's orbit (moving northward).
         /DESCENDING  Means satellite is in the descending part
           of it's orbit (moving southward).
 OUTPUTS:
       taz = Azimuth of forward satellite track (degrees). out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jan 17

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sattrackaz.pro)


SAVE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SAVE2
 PURPOSE:
       Save IDL vars in a file. Allows them to be renamed during restore2.
 CATEGORY:
 CALLING SEQUENCE:
       save2, filename, v1, [v2, v3, ... v9]
 INPUTS:
       filename = name of file to save variable in.     in
       v1, v2, ... = variables to save (up to 9).       in
 KEYWORD PARAMETERS:
       keywords:
         /XDR save using XDR format.
         /MORE will keep the file open so more variables may be saved.
            Save2 may be called repeatedly if /MORE is used each time.
            A call to save2 without /MORE closes the file.
            Ex: save2, 'test.tmp', a, b, c, /more
                save2, 'test.tmp', d, e, f
 OUTPUTS:
 COMMON BLOCKS:
       save2_com
 NOTES:
       Note: This should work for any data type but structure.
         See restore2.
 MODIFICATION HISTORY:
       R. Sterner. 22 Jan, 1988.
       RES  14 Mar, 1988 --- made for multiple variables.
       RES  26 Jul, 1990 --- added XDR keyword.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\save2.pro)


SAVEOUT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  saveout

 PURPOSE:  

 USEAGE:   saveout      ; start saving from this point (trash any prior stuff)
           saveout,file ; copy saved text to file (clean up too)

 INPUT:    
   file    name of file to which terminal output saved

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:
   save idlsave.pro output in a cleaned file (without extraneous semicolons
   and IDL blurb

 LIMITATIONS:

 COMMON BLOCKS:
   saveout_blk

 SIDE EFFECTS:
  
 EXAMPLE:  

     journal
     print,dist(20)
     saveout,'dist_numbers'

 AUTHOR:   Paul Ricchiazzi                        05 Jan 00
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\saveout.pro)


SAVESYSVAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       savesysvar

 PURPOSE:
       saves the settings of the !p, !x, !y, !z system
       variables in a structure

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       Result = SAVESYSVAR()

 OUTPUTS:
       a structure contianing the settings

 EXAMPLE:
       save = savesysvar()
       ..... plotting ....
       restore, save

 REVISION HISTORY:
       Written         Theo Brauers, Frank Holland, June 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\savesysvar.pro)


SAVINFO2HTML

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   savinfo2html

 PURPOSE:
   writes info about a file to a html_file
   restores a sav-file with info about a file (nc, zus, or enz) or if the sav-file does
   not exist, a sav-file will be created and then written to a html-file

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   savinfo2html, filename,filetype=filetype

 INPUTS:
   filename     : the name of the data file

 KEYWORD PARAMETERS:
    filetype=   ( if the sav-file exists the keyword can be omitted)
            'enz' : if it is an enz-file
            'zus' : if it is a  zus-file
            'nc'  : if it is a   nc-file
    fill_value: fill_value for irzn
    nocache   : to supress generation of *.sav-file
    delete_older_savinfo: if set the savinfo files is deleted if datafile is newer

 OUTPUTS:
    the info about a file (structure:file_contents) is written to a html-file :filename+.html

 EXAMPLE:
    savinfo2html,'/home3/ich388/IDL/enzlesen/t.enz',filetype='enz'
  or
    savinfo2html ,'/home3/ich388/IDL/enzlesen/test2.nc',filetype='nc'
  or
   savinfo2html ,'/home3/ich388/IDL/enzlesen/d170698.nox';,filetype='nc'

 MODIFICATION HISTORY:
   Written by:       Marsy Lisken  july 1998
   corrected :                10.7.98
   Modified  : 25.9.1998 by FR : fill_value,nocache included
  1998-9-26 file_exist included
  2000-05-24 delete_older_savinfo added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\savinfo2html.pro)


SCALEARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCALEARRAY
 PURPOSE:
       Linearly scale array values to specified range.
 CATEGORY:
 CALLING SEQUENCE:
       b = scalearray( a, in1, in2, [out1, out2])
 INPUTS:
       a = array to scale.                          in
       in1 = array value to scale to out1.          in
       in2 = array value to scale to out2.          in
       out1 = value in1 gets scaled to (def=0).     in
       out2 = value in2 gets scaled to (def=255).   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = scaled array.                             out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 12 Nov, 1986.
       RES 30 Aug, 1989 --- converted to SUN.
       R. Sterner, 26 Feb, 1991 --- Renamed from scale_array.pro

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\scalearray.pro)


SCALE_DB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCALE_DB
 PURPOSE:
       Scale given data to db (meant for images).
 CATEGORY:
 CALLING SEQUENCE:
       d = scale_db(p, db, pmax, minout, maxout)
 INPUTS:
       p = original data.                      in
       db = Decibel range to cover.            in
       pmax = reference value to map to 0 db.  in
       minout = value to map -DB db to.        in
       maxout = value to map 0 db to.          in
 KEYWORD PARAMETERS:
       Keywords:
         /NOCLIP means do not clip values to stay in
           range -db to 0.  This allows saturation for
           pmax < max(p).
         MAXDB=mxdb  Returned max db.  Useful with /NOCLIP.
 OUTPUTS:
       d = scaled values.                      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  3 Apr, 1987.
       R. Sterner, 15 Jul, 1991 --- updated to IDL V2.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\scale_db.pro)


SCALE_RGB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCALE_RGB
 PURPOSE:
       Interactively scale R,G,B image components.
 CATEGORY:
 CALLING SEQUENCE:
       scale_rgb, ri,gi,bi,ro,go,bo
 INPUTS:
       ri,gi,bi = Input Red, Green, Blue image arrays.   in
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  Error flag: 0=ok, 1=cancel.
         TOP=top  Max value for returned scaled images (def=255.
         BOT=bot  Min value for returned scaled images (def=0).
           TOP and/or BOT may be a 3 element array ([r,g,b]).
         INSCALE=isc, OUTSCALE=osc  2x3 arrays giving the
           input and output image ranges used to scale the R,G,B.
 OUTPUTS:
       ro,go,bo = Ouput Red, Green, Blue image arrays.   out
 COMMON BLOCKS:
 NOTES:
       Notes: All the image components are assumed to be the
         same size (not checked).  Intended for scaling image
         components to combine into a color result.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 25

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\scale_rgb.pro)


SCALE_VECTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCALE_VECTOR

 PURPOSE:

       This is a utility routine to scale the points of a vector
       (or an array) into a given data range. The minimum value of
       the vector (or array) is set equal to the minimum data range. And
       the maximum value of the vector (or array) is set equal to the
       maximum data range.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Utilities

 CALLING SEQUENCE:

       scaledVector = SCALE_VECTOR(vector, minRange, maxRange)

 INPUT POSITIONAL PARAMETERS:

       vector:   The vector (or array) to be scaled.
       minRange: The minimum value of the scaled vector. Set to 0 by default.
       maxRange: The maximum value of the scaled vector. Set to 1 by default.

 INPUT KEYWORD PARAMETERS:

       MAXVALUE: Any value in the input vector greater than this value is
                 set to this value before scaling.

       MINVALUE: Any value in the input vector less than this value is
                 set to this value before scaling.

       NAN:      Set this keyword to enable not-a-number checking. NANs
                 in vector will be ignored.

 RETURN VALUE:

       scaledVector: The vector (or array) values scaled into the data range.
           This is always at least a FLOAT value.

 COMMON BLOCKS:
       None.

 EXAMPLE:

       x = [3, 5, 0, 10]
       xscaled = SCALE_VECTOR(x, -50, 50)
       Print, xscaled
          -20.0000     0.000000     -50.0000      50.0000


 MODIFICATION HISTORY:

       Written by:  David Fanning, 12 Dec 1998.
       Added MAXVALUE and MINVALUE keywords. 5 Dec 1999. DWF.
       Added NAN keyword. 18 Sept 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\scale_vector.pro)


SCONVOL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  sconvol

 PURPOSE:  convolve a spectrum defined on an arbitrary 1-d grid
           with a response function.  

 USEAGE:   sconvol,x,y,fwhm,xx,yy,type=type,isample=isample,osample=osample

 INPUT:    

   x 
     x value 

   y 
     spectral values

   fwhm   
     filter width at half of maximum value in x units

 KEYWORD INPUT:
   type  
     filter type 
     0 = square      (default)
     1 = triangular

   isample
     number of pre-convolution samples taken within a given fwhm interval
     (default = 10) 

   osample
     number of output samples provided within a given fwhm interval
     (default = 1)

 OUTPUT:

   xx
      x values at sample points, output values will be at multiples of
      of OSAMPLE*FWHM starting at min(XX)+.5*FWHM

   yy
      response values at xx

 DISCUSSION:

 EXAMPLE: degrade MODTRAN spectral transmission to LOWTRAN resolution
 
      modtrns,buf,/noplot
      w=reform(buf(0,*))
      t=w & t(*)=1.
      for i=1,11 do t=t*reform(buf(i,*))
      sconvol,w,t,20,ww,tt,type=0
      plot,10000./ww,tt,xrange=[.25,1]


; show oxygen A line at 1 nm resolution

      sconvol,10000/w,t,.001,w1,t1
      plot,10000/w,t,xrange=[.755,.77]
      oplot,w1,t1,psym=10

; and at 20 cm-1 resolution
      sconvol,w,t,20,w20,t20
      plot,10000./w,t,xrange=[.755,.77]
      oplot,10000./w20,t20,psym=10


 AUTHOR:   Paul Ricchiazzi                        20 Nov 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\sconvol.pro)


SCRAMBLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCRAMBLE
 PURPOSE:
       Scrambles an array or returns an array scrambled indices.
 CATEGORY:
 CALLING SEQUENCE:
       r = scramble(in)
 INPUTS:
       in = array to scramble.                        in
         If in is a scalar integer then an array of
         indices from 0 to in-1 is returned in scrambled form.
 KEYWORD PARAMETERS:
 OUTPUTS:
       r = scrambled values returned.                 out
 COMMON BLOCKS:
       scramble_com
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 17 Dec, 1984.
       RES  10 Feb, 1987 --- allowed arrays.
       R. Sterner, 1999 Jun 9 --- Upgraded to long ints.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\scramble.pro)


SCREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCREEN
 PURPOSE:
       Print a terminal screen layout sheet on PS printer.
 CATEGORY:
 CALLING SEQUENCE:
       screen, [num]
 INPUTS:
       num = optional postscript printer number (def=0).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 10 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\screen.pro)


SCREENGIF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCREENGIF
 PURPOSE:
       Display a GIF image in a screen window.
 CATEGORY:
 CALLING SEQUENCE:
       screengif, [file]
 INPUTS:
       file = name of GIF file.   in
 KEYWORD PARAMETERS:
       Keywords:
         WINDOW=win  Returned index of display window.
            -2 means Z buffer.
         ERROR=err   Returned error flag: 0=ok, 1=not displayed.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Mar 1.
       R. Sterner, 2000 May 22 --- Fixed to work with Z buffer, set_scale.
       R. Sterner, 2000 Dec 26 --- Added image array return.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\screengif.pro)


SCREENJPEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCREENJPEG
 PURPOSE:
       Display a jpeg image in a screen window.
 CATEGORY:
 CALLING SEQUENCE:
       screenjpeg, [file]
 INPUTS:
       file = name of JPEG file.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jan 17
       R. Sterner, 2000 Jun 29 --- Modified for 24 bit color.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\screenjpeg.pro)


SCREENTIFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SCREENTIFF
 PURPOSE:
       Display a tiff image in a screen window.
 CATEGORY:
 CALLING SEQUENCE:
       screentiff, [file]
 INPUTS:
       file = name of TIFF file.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Feb 4

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\screentiff.pro)


SDEP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SDEP

 PURPOSE:
	Returns several System DEPendent parameters, like OS family (default),
	directory separator, path separator, etc.

 CATEGORY:
	General utilities

 CALLING SEQUENCE:

	Result = SDEP()

 INPUTS:
	None

 KEYWORD PARAMETERS:
	DS:	(Directory Separator) When set, SDEP returns the directory
		separator (i.e.
		/ (slash) under Unix or \ (backslash) under Windows).
	PS:	(Path Separator) When set, SDEP returns the path separator
		(i.e. :  under Unix or ; (backslash) under Windows).
	CD:	(Current directory) When set, SDEP returns the "current directory"
		shortcut, i.e. '.' under Unix and Windows, ':' under MACOS.
	VS:	(Version Short) returns the idl short-version (i.e.
		'5' for idl 5.0.2)
	VF:	(Version Full) returns the idl full versiom (i.e.
		'5.0.2' for idl 5.0.2)
	W:	(Widget allowed?) Returns 1 when widget are allowed (i.e.
		!d.nane is 'WIN','X' or 'MAC') otherwise returns 0 (i.e. 'PS').

 OUTPUTS:
	This function returns (with no keywords) the !version.os_family
	value in uppercase. If any keyword is set, the returned value
	is changed to the one described below.

 RESTRICTIONS:
	Never used under Mac

 PROCEDURE:
	Straightforward

 EXAMPLE:
	print,sdep()

 MODIFICATION HISTORY:
 	Written by:	srio@esrf.fr and dejus@aps.anl.gov
	Sept, 1997
	97/10/16 srio@esrf.fr adds /w keyword.
	Modified 15-AUG-2001 by Mati Meron.  Added keyword CD.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\sdep.pro)


SDEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SDEV
 PURPOSE:
       Returns standard deviation of an array.
 CATEGORY:
 CALLING SEQUENCE:
       s = sdev(a)
 INPUTS:
       a = input array.               in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = standard deviation of a.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by K. Kostoff, 1/16/85
       Johns Hopkins University Applied Physics Laboratory.
       Modified by B. Gotwols, R. Sterner --- 1 Oct, 1986.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sdev.pro)


SEARCH (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        SEARCH (function)

 PURPOSE:
        Perform a binary search for the data point closest
        to a given value. Data must be sorted.

 CATEGORY:
        Math

 CALLING SEQUENCE:
        index = SEARCH( DATA, VALUE )

 INPUTS:
        DATA -> a sorted data vector

        VALUE -> the value to look for

 KEYWORD PARAMETERS:
        none.

 OUTPUTS:
        The function returns the index of the nearest data
        point.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        This routine is much faster than WHERE or MIN for
        large arrays. It was written in response to a newsgroup
        request by K.P. Bowman.

 EXAMPLE:
        test = findgen(10000)
        print,search(test,532.3)
        ; prints 532

 MODIFICATION HISTORY:
        mgs, 21 Sep 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source
                          - changed int to long

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\search.pro)


SEARCH_CASE_SENSITIVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	search_case_sensitive

 PURPOSE:
	This function will give true if a client_string is equal master_string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=search_case_sensitive(master_string,client_string)

 INPUTS:
   master_string: The string on which the client string should be compared too
   client_string: The string which will be compared to master

 OUTPUTS:
   This function returns 1 if a string word is in a given string and 0 if not

 EXAMPLE:
   Result=search_case_sensitive('this is a test','this is a test')
   Result=1
   Result=search_case_sensitive('this is a test','his')
   Result=0

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-24
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\search_case_sensitive.pro)


SEARCH_DEPENDENCY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   search_dependency

 PURPOSE:
   This procedure will find dependant IDL-procedures/functions of a given IDL-procedure/function

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   search_dependency,procedure/function

 KEYWORD PARAMETERS:
   Keywords:
      result          : string-array(6,x) with name, type, path, called userprocedures, called userfunctions, and time of processing
      clearbat        : when set will clear the batch-file executed to resolve routines
      clearsav        : when set will clear the sav-file for command- and data-transfer to the child-idl-process
      batfile         : name of batch-file, default dependency.bat.search
                        default:search_dependency.bat in the current directory
      savfile         : name of sav-file, default dependency.sav.search
                        default:search_dependency.sav in the current directory
      database        : database filename; information will be taken from database instead from test compilation if available; new information will be stored in database
      refresh_database: information about requested routines will be refreshed in database
      cleardatabase   : delete database file prior to processing of routines
      path            : path for batfile and savfile, default:''
      noprint         : disables printout of result

 OUTPUTS:
    result: name of routine, type, full path, dependant procedures, dependant fucntions, systime of processing
            results of processing are added to the prior contents of the sav-file
            prints contents of result in command log window

 EXAMPLE:
   search_dependency,'plotend',/clearsav,/clearbat,database='c:\temp\database.sav'

   SEARCH          STRING    = 'plotend'
   RESULT          STRING    = Array[6, 1]
   plotend  P  S:\links\idl_source\idl_work\fr_lib\plotend.pro  DEBUG,PLOTLEG,PLTSTAMP

 SIDE EFFECTS:
   A child-idl-process is called to resolve the routine.
   2 files are generated/needed, the batch- and the sav-file for command/data-transfer to the child-idl-process

 MODIFICATION HISTORY:
   Written by Franz Rohrer Aug 1998
   Modified

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\search_dependency.pro)


SEARCH_EXTREME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   search_extreme

 PURPOSE:
   This function returns the index of minima or maxima in a given array

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result = SEARC_EXTREME(array, [start], [/MAX])

 INPUTS:
   array:  array of numbers

 OPTIONAL INPUT:
   start:  an index to array to find the clossest extremum

 KEYWORD PARAMETERS:
   MAXIMUM: if set search maxima rather than mimnima

 OUTPUTS:
   This function returns indices into the array where extrema occur

 EXAMPLE:
   print, search_extreme(SIN(FINDGEN(100)/5), /MAX)
   IDL prints:
        8          39          71

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JUL

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\search_extreme.pro)


SEARCH_MAP_CONTINENTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       search_map_continents

 PURPOSE:
 this routine is used to define wrong polygon lines in the hires maps

 CATEGORY:
  PLOT

 CALLING SEQUENCE:
  search_map_continents

 OUTPUTS:
       Draws continents, etc. over the current map display.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       See DESCRIPTION.

 DESCRIPTION:
 AT THE READ PROMPT
 ENTER: STEP FORWARD
 f: MARK FAILURE
 z: STEP BACKWARD

 At the end indices_failure will be saved to map_errors.sav



 EXAMPLES:
 This example is already cleaned!

 limit=[53,5,57,15]
 map_set, /MERCATOR, LIMIT=limit ,$
         /WHOLE_MAP, /NOERASE, /NOBORDER, XMARGIN=0.0, $
         YMARGIN=0.0, /GRID, COLOR=2,label=0


 search_map_continents, limit=limit,/hires

 end

 DEVELOPMENT NOTES:
         This version uses !type=3 and uses the NEW (IDL5) map software.
         requires map_struct_append in map_set.pro

 MODIFICATION HISTORY:
         SVP, 11/96 ;  Added header template.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\search_map_continents.pro)


SECHMS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SECHMS
 PURPOSE:
       Seconds after midnight to h, m, s, numbers and strings.
 CATEGORY:
 CALLING SEQUENCE:
       sechms, sec, h, [m, s, sh, sm, ss]
 INPUTS:
       sec = seconds after midnight.            in
 KEYWORD PARAMETERS:
       Keywords:
         FRAC=fr Returned fractional part of seconds.
         EPS=e  Small amount to add to allow for round off error
           Values eps < some integer will become integer.
           Default=1E-12
 OUTPUTS:
       h, m, s = Hrs, Min, Sec as numbers.      out
       sh, sm, ss = Hrs, Min, Sec as strings    out
             (with leading 0s where needed).
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 17 Nov, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 27 Sep, 1993 --- modified to handle arrays.
       R. Sterner, 1998 May 21 --- Fixed a bug found by Dave Watts and
       Damian Murphy that caused a lost second sometimes.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sechms.pro)


SECSTR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SECSTR
 PURPOSE:
       Convert a time string to seconds.
 CATEGORY:
 CALLING SEQUENCE:
       s = secstr(tstr)
 INPUTS:
       tstr = time string.          in
         Scalar or string array.
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = seconds after midnight.  out
 COMMON BLOCKS:
 NOTES:
       Note: time string must have the following format:
         [DDD/]hh:[mm[:ss[:nnn/ddd]]]
         where hh=hours, mm=minutes, ss=seconds, DDD=days,
         nnn/ddd=a fraction.
         Examples: 12:, 12:34, 12:34:10, 2/12:34:10,
         2/12:34:10:53/60, 12:34:10:53/60
 MODIFICATION HISTORY:
       Written R. Sterner, 10 Jan, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       Added day: 21 Feb, 1985.
       Added negative time: 16 Apr, 1985.
       RES 18 Sep, 1989 --- converted to SUN.
       R. Sterner 2 Jan, 1990 --- allowed arrays.
       R. Sterner 2 Nov, 1992 --- Handled null srtings.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner 9 Feb, 1993 --- Fixed to handle correctly both arrays
       and null strings.
       R. Sterner, 12 Feb, 1993 --- returned 1 element arrays as a scalar.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\secstr.pro)


SEEDFILL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SEEDFILL
 PURPOSE:
       For an array fill a connected region bounded by given values.
 CATEGORY:
 CALLING SEQUENCE:
       seedfill, img
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         SEED=s  Seed point as a 2 element array [ix,iy].
         FILL=f  Fill pixel value.
         BOUND=b Region boundary pixel value.
           May be an array of allowed boundary values.
         ERROR=err Error flag.  0=ok, else error.
 OUTPUTS:
       img = Image to process.    in, out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Mar 16
       R. Sterner, 1994 May 23 --- Converted to multiple boundary values.
       R. Sterner, 1995 May 17 --- Added keyboard abort.
       R. Sterner, 1995 Oct 18 --- Completely rewrote to vastly simplify
       and speed up.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\seedfill.pro)


SEEDFILLR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SEEDFILLR
 PURPOSE:
       For an array fill a connected region of constant pixel value.
 CATEGORY:
 CALLING SEQUENCE:
       seedfillr, img
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         SEED=s  Seed point as a 2 element array [ix,iy].
         FILL=f  Fill pixel value.
 OUTPUTS:
       img = Image to process.    in, out
 COMMON BLOCKS:
 NOTES:
       Notes: Fill connected region having pixel values equal
         to original seed pixel value.
 MODIFICATION HISTORY:
       R. Sterner, 1994 May 23 from seedfill.
       R. Sterner, R. Sterner, 1995 Oct 18 --- Completely rewritten
       using label_region.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\seedfillr.pro)


SEGMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SEGMENT
 PURPOSE:
       Set boundaries of constant value to 0.
 CATEGORY:
 CALLING SEQUENCE:
       b = segment(a)
 INPUTS:
       a = input image.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = output image.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 20 May, 1986.
       RES 22 Oct, 1989 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\segment.pro)


SELECTIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SELECTIMAGE

 PURPOSE:

   The purpose of this program is to allow the user to select
   an image file for reading. The image data is returned as the
   result of the function. The best feature of this program is
   the opportunity to browse the image before reading it.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

   General programming.

 CALLING SEQUENCE:

   image = SelectImage()

 INPUT PARAMETERS:

   None. All input is via keywords.

 INPUT KEYWORDS:

   BMP -- Set this keyword to select BMP files.

   DICOM -- Set this keyword to select DICOM files.

   DIRECTORY -- The initial input directory name. The current directory by default.

   FILENAME -- The initial filename. If the initial directory has image files of the
               correct type, the default is to display the first of these files. Otherwise, blank.

   _EXTRA -- This keyword is used to collect and pass keywords on to the FSC_FILESELECT object. See
             the code for FSC_FILESELECT for details.
   GIF -- Set this keyword to select GIF files. This capability is not available in IDL 5.4 and higher.

   GROUP_LEADER -- Set this keyword to a widget identifier group leader. This keyword MUST be
                   set when calling this program from another widget program to guarantee modal operation.

   JPEG -- Set this keyword to select JPEG files.

   PICT -- Set this keyword to select PICT files.

   PNG -- Set this keyword to select PNG files.

   PREVIEWSIZE -- Set this keyword to the maximum size (in pixels) of the preview window. Default is 150.

   TIFF -- Set this keyword to select TIFF files. (This is the default filter selection.)

 OUTPUT KEYWORDS:

   CANCEL -- This keyword is set to 1 if the user exits the program in any way except hitting the ACCEPT button.
             The ACCEPT button will set this keyword to 0.

   FILEINFO -- This keyword returns information about the selected file. Obtained from the QUERY_**** functions.

 COMMON BLOCKS:

   None.

 RESTRICTIONS:

   Probably doesn't work correctly on VMS systems :-( If you can help, please
   contact me. I don't have a VMS system to test on.

 OTHER COYOTE LIBRARY FILES REQUIRED:

  http://www.dfanning.com/programs/fsc_fileselect.pro
  http://www.dfanning.com/programs/tvimage.pro

 EXAMPLE:

   To read JPEG files from the directory:

      IDL> image = SelectImage(/JPEG)

 MODIFICATION HISTORY:

   Written by: David Fanning, 18 Jan 2001.
   Added modification to read both 8-bit and 24-bit BMP files. 27 Jan 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\selectimage.pro)


SELECT_INTERVALS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SELECT_INTERVALS
 PURPOSE:
       Select all intervals within a given range.
 CATEGORY:
 CALLING SEQUENCE:
       ind = select_intervals(rlo,rhi,ilo,ihi)
 INPUTS:
       rlo = start time of selection range.      in
       rhi = end time of selection range.        in
       ilo = array of interval start times.      in
       ihi = array of interval end times.        in
 KEYWORD PARAMETERS:
       Keywords:
         /ANY  return an interval if any of it is in range (def).
         /MOST return an interval if most of it is in range.
         /ALL  return an interval only if all of it is in range.
 OUTPUTS:
       ind = returned array of interval indices. out
         If no intervals are within selection range ind=-1.
 COMMON BLOCKS:
 NOTES:
       Notes: Values must be numeric.  May be used to select
         which of a list of short time intervals fall within
         a given time span.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Apr 3

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\select_intervals.pro)


SELECT_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   select_name

 PURPOSE:
   This function returns one name of a list of names by selcting of few characters

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
  result=select_name(array,name)

 OPTIONAL INPUTS:
    array: an array of strings e.g. short_names
    name:  a part of a string given in array

 PROCEDURE:

 EXAMPLE:
   print,select_name(['PR:N2O','N2O'],'N')
   N2O
   print,select_name(['N2O_2','N2O'],'N')

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-10

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\select_name.pro)


SELECT_OBJECTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SELECT_OBJECTS

 PURPOSE:
       The purpose of this program is to demonstrate how to select
       and move objects in an object graphics window. Once the objects
       appear in the window, use your mouse to select the objects and
       move them in the window. The window is resizeable.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Object Graphics.

 CALLING SEQUENCE:
       SELECT_OBJECTS

 REQUIRED INPUTS:
       None.

 KEYWORD PARAMETERS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       Requires VCOLORBAR from the Coyote Library:
           http://www.dfanning.com/programs/vcolorbar__define.pro.

 EXAMPLE:
       Select_Objects

 MODIFICATION HISTORY:
       Written by David Fanning, 21 September 98.
       Added the ability to shrink and expand the objects. 27 Sept 98. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\select_objects.pro)


SEP_PARAMETER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   sep_parameter
 PURPOSE:
   This function brakes an input string into pieces at separators defined in the list
 CATEGORY:
	PROG_TOOLS
 CALLING SEQUENCE:
   result=sep_parameter(str,list=list)
 INPUTS:
   str    : string scalar
 KEYWORD PARAMETERS:
   list   : list of separators
 OUTPUTS:
   result : string array made from pieces of str broken at separators in the list
 EXAMPLE:
   t='a=3 mod 5'
   printtab,sep_parameter(t,list='=')
   a      
   =      
   3 mod 5

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer January 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\sep_parameter.pro)


SEQLIM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SEQLIM
 VERSION:
		4.0
 PURPOSE:
		Estimates limits of infinite sequences.
 CATEGORY:
		Mathematical Function (General).
 CALLING SEQUENCE:
		Result = SEQLIM( SVL [, RVL ] [, keywords])
 INPUTS:
	SVL
		Numeric vector containing consecutive terms of the sequence.  At least
		two terms are needed.
 OPTIONAL INPUT PARAMETERS:
	RVL
		Numeric vector, same length as SVL.  Contains estimates of the
		deviations of the terms of SVL from the limit.  Usually RVL is
		generated internally, since if good estimates of the deviations from
		the limit do exist, SEQLIM is not needed.
 KEYWORD PARAMETERS:
	/ZERO_PAD
		Switch.  Used only when RVL is not provided, specifies how a difference
		series is generated from the terms of SVL.  When ZERO_PAD is set, it
		implies a zero term preceding the first term of SVL, i.e. SVL has the
		form of [0, SVL(0), SVL(1),...], giving rise to a difference series of
		the form [SVL(0), SVL(1) - SVL(0), ...].  If ZERO_PAD is not set, the
		difference series is [SVL(1) - SVL(0), ...].  Therefore, at least four
		sequence values are needed in the absence of ZERO_PAD but only 3 when
		ZERO_PAD is set.
	ERROR
		Optional output, see below.
	STATUS
		Ditto.
 OUTPUTS:
		Returns the limit estimate if one is found, otherwise returns machine
		maximum.
 OPTIONAL OUTPUT PARAMETERS:
	ERROR
		The name of the variable to receive the estimated error of the returned
		limit value.  If the sequence doesn't seem to converge, returns machine
		maximum.
	STATUS
		The name of the variable to receive convergence status information.
		Returns 1 if the sequence converges, 0 otherwise.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses Neville's interpolation algorithm.  Calls CAST, ISNUM and
		SERIES_SUM from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUN-1992 by Mati Meron.
		Completely rewritten 30-SEP-1998 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\seqlim.pro)


SERIES_SUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SERIES_SUM
 VERSION:
		4.0
 PURPOSE:
		Estimates sums of infinite series.
 CATEGORY:
		Mathematical Function (General).
 CALLING SEQUENCE:
		Result = SERIES_SUM( SVL [, keywords])
 INPUTS:
	SER
		Numeric vector containing consecutive terms of the series.  At least
		three terms are needed to get a result, 4 or more terms to get both
		result and error estimate.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	ERROR
		Optional output, see below.
	STATUS
		Ditto.
 OUTPUTS:
		Returns the sum estimate if one is found, otherwise returns machine
		maximum.
 OPTIONAL OUTPUT PARAMETERS:
	ERROR
		The name of the variable to receive the estimated error of the returned
		sum value.  If the series doesn't seem to converge, returns machine
		maximum.
	STATUS
		The name of the variable to receive convergence status information.
		Returns 1 if the series converges, 0 otherwise.  If the data is
		insufficient for error estimate, returns 3.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the routine SEQLIM from MIDL.  Also uses CAST, ISNUM and TOLER.
 MODIFICATION HISTORY:
		Created 15-JUN-1992 by Mati Meron.
		Completely rewritten 30-SEP-1998 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\series_sum.pro)


SETCOLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SETCOLOR
 PURPOSE:
       Set a single color table entry.
 CATEGORY:
 CALLING SEQUENCE:
       setclr, clr, indx
 INPUTS:
       clr = color specification.  May be in hex.     in
       indx = color index to set (def=last).          in
 KEYWORD PARAMETERS:
       Keywords:
         BRIGHTNESS=fact  Brightness factor, 0 to 1 (def=1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: colors are specified by giving R,G,B in that
         order.  Decimal numbers must be 3 3-digit values
         like 255255255 or 255255000 and may be a string.
         Colors given in hex must start with # like
         #ffffff or #ffff00 (case ignored).
         Spaces, tabs, and commas are allowed:
         # ff ff 00 or 255 255 000 or 100,050,000
         but all digits must be given.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Feb 13
       R. Sterner, 1998 Jan 23 --- Added BRIGHTNESS keyword.

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\setcolor.pro)


SETFITPARM.PRO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SetFitParm.pro

 AUTHOR:
	F.Bringezu, denet - Internetservice, Halle Germany,
	bringezu@denet.de

 PURPOSE:
   Provide a widget interface for creating a parinfo structure.
   This parinfo structure can by used by mpfit routines of Craig B. Markwardt.

 MAJOR TOPICS:
   Widget, mpfit.

 CALLING SEQUENCE:
   parinfo=SetFitParm(used_parinfo)

 DESCRIPTION:

   SetFitParm creates PARINFO using a widget interface.
   PARINFO provides constraints for paramters used by the mpfit routines.

   PARINFO is an array of structures, one for each parameter.

   A detailed description can be found in the documentation of mpcurvefit.pro
   This routine creates an array that contains a structure for each element.
   The structure has the following entries.

   - VALUE (DOUBLE): The starting parameter
   - FIXED (BOOLEAN): 1 fix the parameter, 0 don't fix it at the
     point given in VALUE.
   - LIMITS (DBLARRAY(2)): Set upper and lower limit.
   - LIMITED (BOOLEAN ARRAY 2):  Fix the limit.


   The parameter OLDPARINFO is optional. OLDPARINFO is used to set
   the default values in the widget.

   You can simply run:
   test=SetFitParm() to create the array for the first time.
   Once the array is created it can be used to set the default values
   in the widget by calling

   test2=SetFitParm(test)

 INPUTS:


 OPTIONAL INPUTS:

   OLDFITPARM - The default values of the new array

 INPUT KEYWORD PARAMETERS:

   PARENT - if this widget is to be a child, set this keyword to the
            parent widget ID.

 OUTPUT KEYWORD PARAMETERS:

   CANCEL - if the user selected the cancel button on the SETFITPARM
            widget, then this keyword will be set upon exit.

 OUTPUTS:
   PARINFO array of structures

 SEE ALSO:
   mpcurvefit

 MODIFICATION HISTORY:
   Written, FB, 12/1999
   Documented, FB, Jan 2000
   Generalized positioning code, CM 01 Feb 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\setfitparm.pro)


SETLOG

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       setlog
 
 PURPOSE: 
  dummy procedure for the one defined by VMS idl
 
 CATEGORY: 
   CASE_TOOLS
 
 CALLING SEQUENCE: 
   setlog,a,b

 MODIFICATION HISTORY: 
 R.Bauer 1998-Jul-24

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\setlog.pro)


SETMINUS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SETMINUS
 PURPOSE:
       Eliminate elements from a set that are also in another set.
 CATEGORY:
 CALLING SEQUENCE:
       c = setminus(a,b)
 INPUTS:
       a = set (array) to process.                in
       b = set (array) of elements to eliminate.  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       c = resulting set (array).                 out
 COMMON BLOCKS:
 NOTES:
       Notes: works for any type arrays.
         Will not remove the element of a one element array.
         This is because IDL does not have empty arrays
         (corresponding to empty sets).
 MODIFICATION HISTORY:
       R. Sterner, 7 Aug, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\setminus.pro)


SETUP_PSDEVICE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Setup_PSdevice

 PURPOSE:
	This procedure uses a widget to setup the PS device.

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	Setup_PSdevice [,ps_config] [,/CLOSE] [,/DONT_ASK_ME]

 OPTIONAL INPUTS:
	ps_config:	structure with a default configuration for the PS device.
					For information about this structure run the routine and set
					ps_config to a named variable.

 KEYWORD PARAMETERS:
	/CLOSE:			If set the ps device will be closed.
	/DONT_ASK_ME:	If set the dialog message box will not appear.
	Any keywords accepted by the routine dialog_pssetup

 OPTIONAL OUTPUTS:
	ps_config:	structure with the configuration of the PS device.

 EXAMPLE:
		save = savesysvar() ; Save the system variables !P, !X, !Y, !Z
		Setup_PSdevice, /DONT_ASK_ME
		PLOT, FINDGEN(10), PSYM = 4, TITLE = 'Test of Setup_PSdevice'
		Setup_PSdevice, /CLOSE
		restsysvar, save ; Restore system variables

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 13.11.98
	17.11.98:	Keyword handling improved
	18.11.98:	Check if is_write_access(ps_config.filename)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\setup_psdevice.pro)


SETUP_TIME_AXIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	setup_time_axis

 PURPOSE:
	This procedure sets up parameters to plot a time axis.

 CATEGORY:
	PLOT/MPLOT

 CALLING SEQUENCE:
	setup_time_axis, x, offset

 INPUTS:
	x: Vector with time elements in Js

 OUTPUTS:
	offset: Offset in Julian seconds for the current time axis to adopt time range
		to the precision of the IDL XRANGE keyword which is of type float.

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09. Jun 98.
	28.04.1999:	Header edited
					Changed name from prep_time_axis to setup_time_axis
					Included source code of setup_time_axis_format
						(formerly time_axis_format.pro) in this file.
	29.04.1999:	XRANGE keyword included in procedure definition.
	06.05.1999:	Changed text in message command.
	21.05.1999:	Keyword parameter /NO_DATE quoted in procedure definition of setup_time_axis
	14.06.1999:	Date format changed from DD-MM-YY to DD.MM.YY.
	21.06.1999:	TIMEFORMAT = tf, TIMESTEP = ts are now passed into setup_time_axis and forwarded
					to setup_time_axis_format
	03.08.1999:	Removed bug when dataset has only one data point
					setup_time_axis: Exchanged t0, tn nomenclature against trange
	03.02.2000:	Increased largest time step to 12 months.
	01.03.2000:	_EXTRA = e in call to setup_time_axis_format and in definition
					of that routine was commented out.
	21.03.2000:	Increased largest time step to 5 years.
	24.03.2000:	Removed bug for large time steps

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\setup_time_axis.pro)


SETWIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SETWIN
 PURPOSE:
       Set which window should be currently active window.
 CATEGORY:
 CALLING SEQUENCE:
       setwin
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         ERROR=err  Error flag: 0=ok, 1=abort.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 22

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\setwin.pro)


SET_BIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	set_bit

 PURPOSE:
	This function sets a bit in a given argument.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	result = set_bit(arg, bit)

 INPUTS:
	arg: Argument where the bit number 'bit' will be set.
	bit: Number of bit to set in arg (e.g. 0: 2^0, 1:2^1 etc.).

 KEYWORD PARAMETERS:
	/DECIMAL: If set bit will not be interpreted as bit number but as a decimal coded
		bit pattern (e.g. bit = 11: 1 0 1 1)
	/RESET: If set the bit will be reset rather than set.

 OUTPUTS:
	This function returns the number which results from setting (resetting) a certain
	bit or bit pattern in the binary representation of arg. If this bit is already set
	(reset) nothing is changed.

 EXAMPLE:
	PRINT, set_bit(3, 3)                   --> 11
	PRINT, set_bit(3, 5, /DEC)             --> 7
	PRINT, set_bit(8, 3, /DEC)             --> 11
	PRINT, set_bit(11, 3, /DEC)            --> 11
	PRINT, set_bit(11, 3, /RES)            --> 3
	PRINT, set_bit(11, 3, /DEC, /RES)      --> 8

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 09.02.2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\set_bit.pro)


SET_CHARSIZE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  set_charsize

 PURPOSE:  set default charactersize

 USEAGE:   set_charsize,charsize

 INPUT:    charsize

 DISCUSSION:
           This Routine sets the default character size to a fraction
           of the screen width so that 128 characters will fit across
           the entire screen.  The number 128 was chosen because
           that's how many standard size characters (!p.charsize=1)
           fit across an 8.5 inch x-window.  This routine can be used
           inside scripts intended for either X or PS output, and
           should make it easier to produce acceptable PS output
           based on X-window previews.

           NOTE: To take full advantage of this routine all character
                 size specifications should be multiples of
                 !p.charsize.  This means all calls to routines that
                 have charsize as an keyword argument (e.g., XYOUTS
                 and PLOT) should have the size specified as,
                 CHARSIZE=chs*!p.charsize.
                 
                 The character size argument in the PUTSTR routine, 
                 (which is similar to the XYOUTS routine), is already a
                 character size multiplier and does not need to be
                 multiplied by !p.charsize.  

 SIDE EFFECTS:
     sets the global variable !p.charsize to charsize*fac
     where fac=float(!d.x_vsize)/(128*!d.x_ch_size)

 AUTHOR:   Paul Ricchiazzi                        03 May 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\set_charsize.pro)


SET_FRAME

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

 NAME:
  set_frame

 PURPOSE:
   This procedure sets the frame for a plot

 CATEGORY:
   PLOT/PLOT2D

 CALLING SEQUENCE:
   set_frame,plot,x=x,y=y,[z=z],[file=file],[icg_struct=icg_struct],[/time]

 INPUTS:
  plot: The predefined Structure PLOT by get_plot_struct()

 KEYWORD PARAMETERS:
   x:    The x-Parameter Array or a parameter name from a netCDF file
   y:    The y-Parameter Array or a parameter name from a netCDF file
   z:    The z-Parameter Array or a parameter name from a netCDF file /not supported at the moment

   file: The name of the netCDF File, if you like to have dirctly access to data in files
   icg_struct: the defined icg_struct, if used x,y,z hat to be short_names of this structure

   time: If x is a vector of Julian Seconds then with switch time plotxy will show a time formatted X Axis

   type: A string indicator for the kind of plotsystem which is used
         at the moment 'XY' and '2D' is defined

 PROCEDURE:
  This procedure is under construction



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\set_frame.pro)


SET_ICG_STRUCT_FLAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   set_icg_struct_flag

 PURPOSE:
   The output of this routine is the input structure icg_struct. The flag attribute is set to the
   available flags.

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   set_icg_struct_flag,icg_struct,[short_name]

 INPUTS:
   icg_struct: the defined ICG data structure

 OPTIONAL INPUTS:
   short_name: to set the short_names which parameter flags should be defined

 OUTPUTS:
   icg_struct: the defined ICG data structure

 EXAMPLE:
  icg_struct=read_ncdf('ghost.nc')
  set_icg_struct_flag,icg_struct

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Aug-16
   2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\set_icg_struct_flag.pro)


SET_ISOXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SET_ISOXY
 PURPOSE:
       Set data window with equal x & y scales. Covers at least given range
 CATEGORY:
 CALLING SEQUENCE:
       set_isoxy, xmn, xmx, ymn, ymx
 INPUTS:
       xmn, xmx = desired min and max X.        in
       ymn, ymx = desired min and max Y.        in
 KEYWORD PARAMETERS:
       Keywords:
         CHARSIZE=csz  Character size for axis labels (def=1).
         /LIST = list actual window that is set.
         XLOCK = position where position is one of
                 'xmn' to extend window upward from the min x.
                 'xmd' to extend window outward from the mid x.
                 'xmx' to extend window downward from the max x.
         YLOCK = position where position is one of
                 'ymn' to extend window upward from the min y.
                 'ymd' to extend window outward from the mid y.
                 'ymx' to extend window downward from the max y.
         NXRANGE = [nx_min, nx_max] sets x pos. in norm. coord.
                 Min and max normalized x.  Def = [0., 1.]
         NYRANGE = [ny_min, ny_max] sets y pos. in norm. coord.
                 Min and max normalized y.  Def = [0., 1.]
         LATITUDE=lat If given will set equal scaling based on
           given latitude.  Expands X range by 1/cos(lat).
           Given latitudes not changed.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes:
         Either xmn, xmx or ymn, ymx will be adjusted to force
         equal scaling in X and Y in the current screen window.
         At least the specified range will be covered in both X
         and Y, but a greater range will be covered in one.
         The window middle or corners may be fixed.
         set_isoxy,0,0,0,0 (or set_isoxy,0) resets autoscaling.
 MODIFICATION HISTORY:
       R. Sterner.  3 Sep, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 10 Sep, 1989 --- converted to SUN.
       R. Sterner, 8 Nov, 1991 --- fixed !x.style,!y.style to
       be reset on set_isoxy,0,0,0,0 and also allowed set_isoxy,0.
       R. Sterner, 21 Apr, 1992 --- added a plot statement to
       set scaling.  No plot is output.
       R. Sterner, 1995 Jul 20 --- Added LATITUDE keyword.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\set_isoxy.pro)


SET_QUALITY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	set_quality

 PURPOSE:
	This procedure can be used to set (change) the quality flag of data in an ICG structure

 CATEGORY:
	ICG_STRUCT

 CALLING SEQUENCE:
	set_quality, icgs [, value, index]

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	value: value of quality flag (default: 0L)
	index: index vector pointing to thoese elements of quality which will be
		set to value (default: all elements of quality).

 KEYWORD PARAMETERS:
	NAME = name: Short name of parameter for which quality flag will be set (scalar or array).
		If not given quality will be set for all parameters.
	/TAG_NAME: If set name will be interpreted as tag name.
	/X: If set a procedure will start which allows the user to change the
		quality settings interactively.

 OUTPUTS:
	This procedure changes the quality flag for the specified parameter(s)
	in the ICG structure which was passed into the routine..
	If the flag quality is not defined it will be added to the parameter.
	The valid index will be updated.

 EXAMPLE:
	icgs = read_ncdf('berlioz.nc')
	index = icgs_filter(icgs, 'O3 LT 10')
	set_quality, icgs, 128L, index, NAME = ['OH', 'HO2']

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 14.03.2000
	15.03.2000: Adopted to new syntax of x_icgs_add_quality
	16.05.2000:	Removed keyword flag /NO_SORT in calls to add_tag

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\set_quality.pro)


SET_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   set_range

 PURPOSE:
   This function returns a structure of the values inside a range

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   Result=set_range(x,y,xrange=xrange,yrange=yrange,[sx],[sy])

 INPUTS:
   x: a vector of values
   y: a vector of values

 KEYWORD PARAMETERS:
   sx: the errors  for x as scalar vector or 2 dim array
   sy: the errors  for y as scalar vector or 2 dim array
   error_plot
   xrange: a two element vector of range of the x values, -999 as value means no range is used
   yrange: a two element vector of range of the y values, -999 as value means no range is used


 OUTPUTS:
   the basic return is a structure with the tagnames
   .x :  new x values
   .y :  new y values

   (for the x and y value both ranges are used if both are submitted)

   if sx or sy was given the results of them are added to the structure
   .sx : new sx values
   .sy : new sy values

  PROCEDURE:
  if sx or sy has only one element the result sx or sy has as many times this value as elements of x or y


 EXAMPLE:
  result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,3],yrange=[20,40])
  print,struct2htmltable(result,/sub,/border)
  
X Y
220
330

result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,3],yrange=[20,40],sx=[0.1,0.12,0.1,0.1]) print,struct2htmltable(result,/sub,/border)
X Y SX
2200.120000
3300.100000

result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,3],yrange=[20,40],sy=[1.1,2.12,1.1,1.1]) print,struct2htmltable(result,/sub,/border)
X Y SY
2202.12000
3301.10000

result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,3],yrange=[20,40],sx=[0.1,0.12,0.1,0.1],sy=[1.1,2.12,1.1,1.1]) print,struct2htmltable(result,/sub,/border)
X Y SX SY
2200.1200002.12000
3300.1000001.10000

result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,4],yrange=[20,40],sx=transpose([[0.9,1.8,2.9,3.5],[1.1,2.01,3.1,4.2]])) print,struct2htmltable(result,/sub,/border)
X Y SX
2201.80000
3302.01000
4402.90000
3.10000
3.50000
4.20000

result=set_range([1,2,3,4],[10,20,30,40],xrange=[2,3],yrange=[20,40],sx=0.2,sy=6) print,struct2htmltable(result,/sub,/border)
X Y SX SY
2200.200000006.0000000
3300.200000006.0000000

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Sep-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\set_range.pro)


SET_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SET_SCALE
 PURPOSE:
       Set scaling from currently displayed (or given) image.
 CATEGORY:
 CALLING SEQUENCE:
       set_scale
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET No message if scaling info not found.
         /LIST  lists screen and data windows.
         ERROR=err  0=ok, 1=no scaling info found.
         The items listed below may be returned using keywords:
         X1=x1, X2=x2, and so on.
         NX=nx, NY=ny also return the plot window size in pixels.
         IMAGE=img  Give image array instead of reading it from
           the display.
         /NOSET do not actually set scaling.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: current image must have scaling info embedded as
         expected by this routine.  The needed values are in the
         first 90 bytes of the bottom image line are are:
           m, ix1, ix2, iy1, iy2, x1, x2, y1, y2, xtyp, ytyp
         where m is 1234567890,
         ix1, ix2 is the image X range in screen coordinates,
         iy1, iy2 is the image Y range in screen coordinates,
         x1,x2 is the image X range in data coordinates,
         y1,y2 is the image Y range in data coordinates.
         xtyp, ytyp is the X and Y axis types: 0=linear, 1=log.
         The format for all these values is:
           I10,  4I6,  4G13.6, 2I2.
         This scaling info may be placed in the image by the
         routine put_scale.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Feb 28
       R. Sterner, 1995 Mar  7 --- Added /LIST keyword.
       R. Sterner, 1998 Jan  8 --- Forced floats for x1,x2,y1,y2.
       R. Sterner, 1999 Aug 09 --- Added /NOSET and IMAGE=img.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\set_scale.pro)


SET_WINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SET_WINDOW
 PURPOSE:
       Set data window.
 CATEGORY:
 CALLING SEQUENCE:
       set_window, x0, x1, y0, y1
 INPUTS:
       x0,x1 = x data min and max.    in
       y0,y1 = y data min and max.    in
 KEYWORD PARAMETERS:
       Keywords:
         NXRANGE = [nx0, nx1]: window x pos. in norm. coord.
         NYRANGE = [ny0, ny1]: window y pos. in norm. coord.
         Defaults for both are [0,1]
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: x0 maps to nx0, x1 maps to nx1, y0 maps to ny0, y1 maps to ny1.
         For oplot and plots only.  plot sets its own window.
 MODIFICATION HISTORY:
       R. Sterner, 10 Sep, 1989.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\set_window.pro)


SHADE_CLT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHADE_CLT
 PURPOSE:
       Sets up color table used for sun_shade shaded relief displays.
 CATEGORY:
 CALLING SEQUENCE:
       shade_clt, [ct]
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       ct = optionally returned color table (3X256: r,g,b).   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       J. Culbertson, 15 Feb, 1989.
       re-entered by RES.
       Johns Hopkins University Applied Physics Laboratory.
       RES 31 Aug, 1989 --- converted to SUN.
       R. Sterner, 26 Feb, 1991 --- Renamed from shade_colors.pro

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\shade_clt.pro)


SHADE_IMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHADE_IMG
 PURPOSE:
       Shade a given image based on a shading array.
 CATEGORY:
 CALLING SEQUENCE:
       shade_img, shd, c, r, g, b
 INPUTS:
       shd = shade at each image point (0.0 to 1.0).  in
 KEYWORD PARAMETERS:
       Keywords:
         IMAGE=img  Input image (def=current image).
         RIN=ri, GIN=gi, BIN=bi = input color table (def=current).
 OUTPUTS:
       c = resulting color image.                     out
       r,g,b = corresponding color table.             out
 COMMON BLOCKS:
 NOTES:
       Notes: The current color table is used to split the
         current image into r,g,b components.  These components
         are modified based on the given shading array and then
         recombined to form a new color image and color table.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Sep 27

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\shade_img.pro)


SHADE_SURF2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHADE_SURF2
 PURPOSE:
       Allow image overlay with surface shading.
 CATEGORY:
 CALLING SEQUENCE:
       shade_surf2, z, [x,y]
 INPUTS:
       z = Surface array.                in
       x,y = optional x and y arrays.    in
         (like shade_surf).
 KEYWORD PARAMETERS:
       Keywords:
         SHADES=img  Byte scaled image to map onto surface.
           Same size as z.  Default is byte scaled z.
         GAMMA=g  Brightness gamma exponent (def=0.3).
           Let s be the normal surface shading which ranges
           from 0 to 1.  s^g is the shading actually used.
           GAMMA = .3 seems to work well. Higher for more contrast.
         Other SHADE_SURF keywords are allowed.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 27
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\shade_surf2.pro)


SHADOW

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  shadow,g,sza,drad

 PURPOSE:  Compute and print fraction of total diffuse irradiance
           which is contained within a solid angle subtended by a
           small disk centered on the sun's disk and subtending a
           given half angle.  Multiple scattering effects are not
           included Output for Henyey-Greenstein and Rayleigh phase
           function.

 USEAGE:   shadow,g,sza,drad

 INPUT:    
   g       asymmetry factor used in Henyey-Greenstein phase function
   sza     solar zenith angle (degrees)
   drad    half angle of shading disk in radians

 keyword input:
   type    type of scatterer, accepted values of type
           "henyey-greenstein" (default)
           "rayleigh"

 OUTPUT:
   none
 
 PRINT OUT:

           three quantities:
           1) the ratio of upwelling to downwelling diffuse irradiance
              note that the up_diffuse + down_diffuse = direct*tau
              where tau is the optical depth (tau << 1).
           2) the fraction of downwelling diffuse irradiance obscured 
              by shading disk.
           3) the fraction of total diffuse radiance obscured by disk
           
 
  
 EXAMPLE:  compute fraction of all single scattered radiation 
           within a disk which subtends one degree of the of 
           the forward direction.

           drad=5.75*!dtor ; NIP FOV used to get direct beam
           shadow & for g=.5,.91,.1 do for sz=0,81,15 do shadow,g,sz,drad


           drad=5*2.25/20.      ; shaded PSP used to get diffuse 
           shadow & for g=.5,.91,.1 do for sz=0,81,15 do shadow,g,sz,drad

           
           

 AUTHOR:   Paul Ricchiazzi                        22 Apr 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\shadow.pro)


SHAPE_AREA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_AREA
 VERSION:
		4.0
 PURPOSE:
		Calculates the area enclosed by a 2-dimensional shape.
 CATEGORY:
		Mathematical Array function.
 CALLING SEQUENCE:
		Result = SHAPE_AREA( SHAPE)
 INPUTS:
	SHAPE
		A [2,*] numeric array.  3D shapes are not supported.
 OPTIONAL INPUT PARAMETERS:
		None.
 OUTPUTS:
		0 for failure (improper or 3D shape) else returns the area of the shape.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Limited to 2 dimensional shapes.
 PROCEDURE:
		Straightforward.  Calls FPU_FIX and SHAPE_VER from MIDL.
 MODIFICATION HISTORY:
		Created 10-NOV-1992 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_area.pro)


SHAPE_CLOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_CLOSE
 VERSION:
		4.0
 PURPOSE:
		Closes the shape, i.e. appends the first point to the end of the shape,
		unless the shape is already closed in which case nothing happens.
 CATEGORY:
		Array Manipulation / General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_CLOSE( SHAPE)
 INPUTS:
	SHAPE
		A [2,*] or [3,*] numeric array.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		0 for failure, i.e. a missing or invalid shape, otherwise returns the
		closed shape.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses calls to ARREQ and SHAPE_VER in MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_close.pro)


SHAPE_COCON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_COCON
 VERSION:
		4.0
 PURPOSE:
		Converts 2 or 3 dimensional shapes from the FROM to the TO coordinate
		system.  Allowed systems are DATA, DEVICE (only for 2-dim shapes) and
		NORMAL.  In principle identical to the system routine CONVERT_COORD,
		SHAPE_COCON is maintained for historical reasons.
 CATEGORY:
		Plotting / General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_COCON( SHAPE [,keywords])
 INPUTS:
	SHAPE
		A [2,*] or [3,*] array.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	FROM
		Specifies input coordinate system.  Possible values are 'DATA',
		'DEVICE' and 'NORMAL' (Only the first 3 characters matter).  Default
		is 'DATA'.
	TO
		Same as FROM for the output coordinate system.
 OUTPUTS:
		0 for failure (improper shape or bad keyword value) else returns the
		transformed shape.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses calls to CAST, COO_CONV, DEFAULT and SHAPE_VER, from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 30-JUL-1999 by Mati Meron.  Type conversion bug fixed.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_cocon.pro)


SHAPE_EDGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_EDGE
 VERSION:
		3.3
 PURPOSE:
		Modifies a SHAPE (see SHAPE_VER for a definition) by cutting it along
		a straight edge.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_EDGE( SHAPE, EDGE [, keywords])
 INPUTS:
	SHAPE
		Two dimensional shape i.e. a [2,*] numeric array.
	EDGE
		An (2,2) numeric array representing a straight line in the
		[[point],[direction]] format, i.e. EDGE[*,0] is a point on the line,
		EDGE[*,1] is a vector in the direction of the line.  This format can be
		changed using the SEGMENT keyword (see below).
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/SEGMENT
		Switch.  If set, the line provided by EDGE is assumed to be in a
		[[point1],[point2]] format, i.e. EDGE[*,0] and EDGE[*,1] are two
		different points on the line.
	/CLOSE
		Switch.  If set, forces closure of the output shape.  If the input
		shape happens to be closed, the output one is being closed
		automatically unless CLOSE is explicitly set to zero.
	EXISTS
		Optional output, see below.
 OUTPUTS:
		Returns a new shape, made of the points of the original shape which
		were not cut off by the edge, plus the points introduced by the edge
		line cutting through line segments of the original shape.
		Important:  The edge line is DIRECTED.  Its direction is the direction
		of the direction vector.  The points to the left of the line (relative
		to the line direction) are maintained, those to the right are cut off.
		This is consistent with viewing the edge line as part of a mathematical
		contour (in a mathematically positive direction) and keeping the points
		inside the contour.
		If there are no points left in the result shape, a single point (i.e.
		2D vector) with X and Y coordinates equal to the square root of the
		maximal floating value (machine dependent) is returned.
 OPTIONAL OUTPUT PARAMETERS:
	EXISTS
		The name of a variable to receive calculation status result.  Returns
		1b if the result shape is non-empty, 0b otherwise.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses LINCROSS from MIDL to find crossing points of the EDGE line and
		the shape and adjusts the shape appropriately.  Also calls ARREQ,
		DEFAULT, FPU_FIX, SHAPE_CLOSE, SHAPE_VER, VINP and VNORM from MIDL.
 MODIFICATION HISTORY:
		Created 10-NOV-1997 by Mati Meron.
		Modified 20-JUL-1999 by Mati Meron.  Added keywords SEGMENT and EXISTS.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_edge.pro)


SHAPE_OVERLAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_OVERLAP
 VERSION:
		4.0
 PURPOSE:
		Finds the SHAPE (see SHAPE_VER for a definition) resulting from the
		overlap of two given shapes.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_OVERLAP( SHAPE1, SHAPE2[, EXISTS = EXS])
 INPUTS:
	SHAPE1
		Two dimensional shape i.e. a [2,*] numeric array.
	SHAPE2
		Ditto
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	EXISTS
		Optional output, see below.
 OUTPUTS:
		Returns a new shape, which is the overlap of the original two shapes.
		Important:  For the purpose of the calculation the two shapes are
		assumed to have the same direction (even if they don't)
		If there are no points left in the result shape, a single point (i.e.
		2D vector) with X and Y coordinates equal to the square root of the
		maximal floating value (machine dependent) is returned.
 OPTIONAL OUTPUT PARAMETERS:
	EXISTS
		The name of a variable to receive calculation status result.  Returns
		1b if the result shape is non-empty, 0b otherwise.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Performs cuts on one shape with the lines of the other, using the
		routine SHAPE_EDGE from MIDL.  Also calls FPU_FIX, SHAPE_AREA,
		SHAPE_CLOSE and SHAPE_VER, from MIDL.
 MODIFICATION HISTORY:
		Created 20-JUL-1999 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_overlap.pro)


SHAPE_TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_TRANS
 VERSION:
		4.0
 PURPOSE:
		Performs a geometrical transformation of an arbitrary 2_dim shape.
		The transformation may include (in order):
			1)	Magnification by MAG.  If MAG is a 2-dim vector, X and Y
				coordinates are magnified by MAG[0] and MAG[1] respectively.
				If FLIP is set, the magnification will include inversion in
				the X or Y axis, according to the value of FLIP.
			2)	Rotation by the angle ANG.
			3)	Translation by ROFF.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_TRANS( SHAPE [,parameters] [,keywords])
 INPUTS:
	SHAPE
		A [2,*] numeric array.  Future support for 3D shapes is planned.
 OPTIONAL INPUT PARAMETERS:
	ANG
		Rotation angle, assumed to be measured in radians, unless /DEGREES is
		set.  Default value is 0, i.e. no rotation.
	MAG
		Magnification factor, can be given as a scalar (in which case both
		dimensions are multiplied by this scalar) or a 2 dimensional vector (in
		which case the X and Y dimensions are multiplied by MAG[0] and MAG[1]
		respectively.  Default value is 1, i.e. no magnification.
	ROFF
		Translation vector.  Can be given as a scalar (in which case same
		translation is applied to both dimensions) or as a 2 dimensional
		vector.  Default is [0,0], i.e. no translation.
 KEYWORD PARAMETERS:
	/DEGREES
		Switch.  If set, the angle value is given in degrees.
	FLIP
		Accepts a char value ('X' or 'Y').  Causes inversion in the
		appropriate axis.
	/CENTER
		Switch.  If set, the transformations are performed relative to the
		center of the shape, given by the average of the minimal and maximal
		value in each dimension.  By default the transformation center is [0,0].
 OUTPUTS:
		0 for failure (improper or 3D shape) else returns the transformed shape.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Currently limited to 2 dimensional shapes.
 PROCEDURE:
		Uses calls to DEFAULT, FPU_FIX, SHAPE_VER, STRMATCH_MM and TYPE from
		MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_trans.pro)


SHAPE_VER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHAPE_VER
 VERSION:
		4.0
 PURPOSE:
		Checks whether SHAPE is a proper shape, i.e. a [2,*] or [3,*] , numeric
		non-complex array.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		Result = SHAPE_VER( SHAPE [, LENGTH = LEN])
 INPUTS:
	SHAPE
		Arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	LENGTH
		Provides an optional output.  See below.
 OUTPUTS:
		If SHAPE fits the definition of a proper shape (see above), returns the
		number of dimensions (2 or 3) as floating, otherwise returns 0.
 OPTIONAL OUTPUT PARAMETERS:
	LENGTH
		The name of a variable to receive the length (number of points) of the
		shape.  If the shape isn't defined or isn't proper, the value is 0.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses information provided by the system function SIZE.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron under the name IS_SHAPE.
		Renamed SHAPE_VER, 25-NOV-1993 for consistency with other shape routines
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shape_ver.pro)


SHIFTF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHIFTF
 PURPOSE:
       Shift an array by a fractional number of indices.
 CATEGORY:
 CALLING SEQUENCE:
       b = shiftf(a,dx,dy)
 INPUTS:
       a = input array (1-d or 2-d).    in
       dx = shift data in X.            in
       dy = shift data in Y.            in
         dy only needed for 2-d data.
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes:  A positive shift shifts data in + direction.
         Like shift except generalized.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jul 2

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\shiftf.pro)


SHIFT_COR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	shift_cor

 PURPOSE:
       This procedure calculates correlation coefficients of two time shifted datasets

 CATEGORY:
	MATH

 CALLING SEQUENCE:
       shift_cor,x2,t2,x1,t1,lag,c

 INPUTS:
       x2 : low frequency data
       t2 : time of low frequency data
       x1 : high frequency data
       t1 : time of high frequency data
       lag: time lag

 OUTPUTS:
       c  : correlation coefficient

 EXAMPLE:
       shift_cor,x2,t2,x1,t1,lag,c

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer Jan 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\shift_cor.pro)


SHIFT_TAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   shift_tag

 PURPOSE:
   This function is used to shift a tagname of a structure

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=shift_tag(structure,tag_name,shift_val)

 INPUTS:
    structure: a structures
    tag_name:  the name of the tag which should be shifted
    shift_val: the value to shift (negativ: left, positiv: right)


 EXAMPLE:
   data={a:findgen(10),b:sin(findgen(10)),c:sin(findgen(10)*10)}
   result=shift_tag(data,'b',-1)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Apr-23

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\shift_tag.pro)


SHOWBITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHOWBITS
 PURPOSE:
       Shows bits of an integer data type.
 CATEGORY:
 CALLING SEQUENCE:
       showbits, num
 INPUTS:
       num = Integer data type (scalar or array).    in
 KEYWORD PARAMETERS:
       Keywords:
         GROUP=g  Group output into groups of g digits.
         /N       List each array value on a new line.
         /FULL    List number and data type with bit pattern.
         /QUIET   Do not list bit pattern on screen.
         OUT=out  Returned bit pattern.
         /BINARY  List bits in binary (default).
         /OCTAL   List bits in octal.
         /HEX     List bits in hexidecimal.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 7

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\showbits.pro)


SHOWPATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHOWPATH
 PURPOSE:
       Show the path of the calling routine.
 CATEGORY:
 CALLING SEQUENCE:
       showpath
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         ROUTINE=rt  optional routine name (input).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 26

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\showpath.pro)


SHOWPROGRESS__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHOWPROGRESS__DEFINE

 PURPOSE:

       An object for creating a progress bar.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Utilities

 CALLING SEQUENCE:

       progressBar = Obj_New("SHOWPROGRESS")

 INPUTS:

       parent: A widget identifier of the widget that will be the
           group leader for this program. It is *required* for modal
           operation. If missing, you are on your own. :-(

 KEYWORDS:

      CANCELBUTTON: Set this keyword if a Cancel button is desired.
      DELAY: The total time the widget should be on the display in AutoUpDate
           mode. The keyword applies only to AutoUpDate mode. Default is 5 seconds.
      STEPS: The number of steps to take in AutoUpDate mode. The keyword applies only
           to AutoUpDate mode.
      MESSAGE: The text of the label above the progress bar. Default is "Operation
           in Progress...".
      TITLE: ; The text of the top-level base title bar. Default is ""
      COLOR: The color to draw the progress bar.
      XSIZE: The XSize of the progress bar in Device coordinates. Default is 150.
      YSIZE: The YSize of the progress bar in Device coordinates. Default is 10.
      AUTOUPDATE: Set this keyword to be in AutoUpDate mode.


 PROCEDURE:
       There are two modes. In AutoUpDate mode, a delay and number of steps is
       required. The modal widget stays on the display until the total time
       exceeds the DELAY or the requested number of steps is taken. A TIMER
       widget is used to generate update events. Nothing can be going on
       concurrently in AutoUpDate mode. To enter AutoUpDate mode, type this:

          progressBar = Obj_New("SHOWPROGRESS", /AutoUpDate, Delay=2, Steps=10)
          progressBar->Start
          Obj_Destroy, progressBar

       The program will update and destroy itself automatically. (The object
       itself is not destroyed. You must do this explicitly, as in the example
       above.)

       In normal mode, the user is responsible for starting, updating, and
       destroying the progress indicator. The sequence of commands might look
       like this:

          progressBar = Obj_New("SHOWPROGRESS")
          progressBar->Start
          FOR j=0,9 DO BEGIN
             Wait, 0.5  ; Would probably be doing something ELSE here!
             progressBar->Update, (j+1)*10
          ENDFOR
          progressBar->Destroy
          Obj_Destroy, progressBar

       Normal mode gives you the opportunity to update the Progress Bar
       in a loop while something else is going on. See the example program
       at the end of this file.

       Note that the object itself is not destroyed when calling the DESTROY
       method. You must explicitly destroy the object, as in the example above.

 METHODS:

       CHECKCANCEL: This function method returns a 1 if the user has clicked
           the CANCEL button. Otherwise, it returns a 0.

          cancelled = progressBar->CheckCancel()
          IF cancelled THEN progressBar->Destroy

       DESTROY: Destroys the ShowProgress widgets. It does NOT destroy the object.

          progressBar->Destroy

       GETPROPERTY: Gets the properties that can be set in the INIT method, including
          the parent widget ID.

          progressBar->GetProperty, Steps=currentNSteps, Delay=currentDelay

       SETCOLOR: Changes the color of the progress bar.

           progressBar->SetColor, 'RED'

       SETLABEL: Changes the text on the widget label.

           progressBar->SetLabel, 'This text instead'

       SETPROPERTY: Allows the user to set the INIT parameter via keywords.

          progressBar->SetProperty, Color='RED', XSize=200, Message='Please Wait...'

       START: Puts the ShowProgress bar on the display. In AutoUpDate mode, the
          widget starts to automatically update.

          progressBar->Start

       UPDATE: Updates the progress bar. Requires on argument, a number between 0
          and 100 that indicates the percent of progress bar that should be filled
          with a color.

          progressBar->Update, 50

 EXAMPLE:

       See the example program at the bottom of this file.

 RESTRICTIONS:

       In contradiction to the IDL documentation, making the parent widget
          insensitive in normal mode does NOT prevent the parent widgets from
          receiving events on my Windows NT 4.0, SP 4 system running IDL 5.2,
          IDL 5.2.1, or IDL 5.3 (beta).

       Note that if you specify a CANCEL button the Show Progress program CANNOT
       run as a MODAL widget program. Thus, user *may* be able to generate events
       in the calling program while this program is running.

 MODIFICATION HISTORY:
       Written by:  David Fanning, 26 July 1999.
       Added code so that the current graphics window doesn't change. 1 September 1999. DWF.
       Added yet more code for the same purpose. 3 September 1999. DWF.
       Added a CANCEL button and made other minor modifications. 12 Oct 1999. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\showprogress__define.pro)


SHOWTEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHOWTEX
 PURPOSE:
       Display TeX sequence translation table on current graphics device.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       showtex
 INPUTS:
 KEYWORD PARAMETERS:
       /HELP -- print out info on use of the function
                and exit.
       FONT  -- Set to 0 to use hardware font, -1 to use vector.
                Note that the only hardware font supported is
                Postscript
 OUTPUTS:
 COMMON BLOCKS:
 SIDE EFFECTS:
       Plot is created.
 NOTES:
       Hardware fonts are supported only for device PS (PostScript)
 EXAMPLE:
 MODIFICATION HISTORY:
       $Id: showtex.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
       $Log: showtex.pro,v $
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Added error handling and updated built in help.

       Revision 1.1  1996/02/08 18:55:12  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\showtex.pro)


SHOW_BOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHOW_BOX
 PURPOSE:
       Used by MOVBOX to display current box size and position.
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  26 July, 1989.
	R. Sterner,  16 Mar, 1992 --- modified to use printat.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\show_box.pro)


SHUFFLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SHUFFLE
 VERSION:
		4.0
 PURPOSE:
		Randomizes an array.
 CATEGORY:
		Array function.
 CALLING SEQUENCE:
		Result = SHUFFLE( ARR [, SEED = SEED])
 INPUTS:
	ARR
		Array, arbitrary type.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	SEED
		Randomization seed, optional.
 OUTPUTS:
		Returns an array with the same values as the original one but in random
		order.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses the system routine RANDOMU.
 MODIFICATION HISTORY:
		Created 1-MAY-1995 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\shuffle.pro)


SIGNUM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   signum

 PURPOSE:
   This function calculates the sign of the input

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = signum(Data)

 INPUTS:
   Data:

 OUTPUTS:
   This function returns a byte [array] +1 /-1

 EXAMPLE:
   IDL> print, signum(dindgen(5)-3.)
         -1      -1      -1       1       1

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\signum.pro)


SIGN[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIGN
 PURPOSE:
       Return the mathematical sign of the argument.
 CATEGORY:
 CALLING SEQUENCE:
       s = sign(x)
 INPUTS:
       x = value of array of values.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = sign of value(s).             out
 COMMON BLOCKS:
 NOTES:
       Note:
         s = -1 for x < 0
         s =  0 for x = 0
         s =  1 for x > 0
 MODIFICATION HISTORY:
       R. Sterner, 7 May, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.
	RES 23 Sep, 1991 --- rewrote, reducing 11 lines of code to 1.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sign.pro)


SIGN[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SIGN
 VERSION:
		4.1
 PURPOSE:
		Gives the sign of X, i.e. 1 for positive, -1 for negative, 0 for 0.
 CATEGORY:
		Mathematical Function (General).
 CALLING SEQUENCE:
		Result = SIGN(X)
 INPUTS:
	X
		Numerical, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/NOZERO
		Switch.  If set, 0 is considered positive, i.e. Sign(0) = 1
 OUTPUTS:
		Returns the value of SIGN(X), see above, as an long integer.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		For complex X the result is SIGN(REAL(X)), the imaginary part is ignored
 PROCEDURE:
		Straightforward.  Using CAST from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 25-DEC-1991 by Mati Meron.
		Modified 5-DEC-1993 by Mati Meron.  Output type changed to LONG.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 1-MAY-2002 by Mati Meron.  Added keyword NOZERO.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\sign.pro)


SIGN[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIGN
 PURPOSE:
       Return the mathematical sign of the argument.
 CATEGORY:
 CALLING SEQUENCE:
       s = sign(x)
 INPUTS:
       x = value or array of values.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = sign of value(s).             out
 COMMON BLOCKS:
 NOTES:
       Note:
         s = -1 for x < 0
         s =  0 for x = 0
         s =  1 for x > 0
 MODIFICATION HISTORY:
       R. Sterner, 7 May, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.
	  RES 23 Sep, 1991 --- rewrote, reducing 11 lines of code to 1.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\sign.pro)


SIMP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIMP
 PURPOSE:
       Does Simpson numerical integration on an array of y values.
 CATEGORY:
 CALLING SEQUENCE:
       i = simp(y, h)
 INPUTS:
       y = array of y values of function.                 in
       h = separation between evenly spaced x values.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       i = value of integral.                             out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 19 Dec, 1984.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\simp.pro)


SIMPLE_PSPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	simple_psplot

 PURPOSE:
	This dialog and widget based procedure sends data to any user-defined plot
	routine which will display a diagram on the screen. Optionally the same plot
	is then send to the ps device.

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	simple_psplot [,x0, ... x9] [,PLOT_ROUTINE = plotr] [,SCREEN_OPTIONS = scopt] $
		[,PRINTER_OPTIONS = propt] [,PS_CONFIG = psconf] [,/QUIET] [,/DONT_ASK_ME]

 INPUTS:
	Either the name of a plot routine must be specified (keyword parameter PLOT_ROUTINE)
	or at least one data vector (positional parameters) has to be passed into simple_psplot.

 OPTIONAL INPUTS:
	x0 ... x9: data vectors

 KEYWORD PARAMETERS:
	PLOT_ROUTINE = plotr:		Name of the plot routine (default: IDL plot command).
	SCREEN_OPTIONS = scopt:		Structure with any keywords accepted by plotr which
										will be used when plotting on the screen.
	PRINTER_OPTIONS = propt:	Structure with any keywords accepted by plotr which
										will be used when plotting to the ps device.
	PS_CONFIG = psconf:			Default configuration for the ps device.
	/QUIET:							IF set don't show the ps-configuration widget
 										rather use the default ps configuration
	/DONT_ASK_ME:					If set don't display the message dialog box.
	PSFILE = psfile				The name of the PS file.
	/FUNCT:							Set this flag if plotr is a function rather than a procedure.
	/STAMP:							Set this flag to print some information into the PS plot.

	This routine accepts any other keywords which are accepted by plotr.
	However, any other keywords passed into simple_psplot via its _EXTRA parameter
	apply only to the plot into the PS file. If you wish to change the plot to
	the screen via the call of simple_psplot you have to use the keyword parameter
	SCREEN_OPTIONS = scopt (e.g. SCREEN_OPT = {THICK: 4.})

 OPTIONAL OUTPUTS:
	PS_CONFIG = ps_config:	structure with the configuration of the PS device.
	RESULT = result: 			If plotr is a function rather than a procedure the named variable
									result will hold the return value of the function.

 RESTRICTIONS:
	The plot routine plotr must except the _EXTRA keyword.
	Plot routines with more then 10 positional arguments are not accepted.

 EXAMPLE:
		see simple_psplot_simple_example
		see simple_psplot_complex_example

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 13.11.98
	17.11.98:	QUIET keyword enabled
	19.11.98:	Now working with local copies of plotr, scopt, propt
	17.02.99:	Handling of positional arguments was changed completely.
	02.06.1999:	Added keyword parameter /FUNCT and RESULT = result to allow
					plot FUNCTIONS to be	processed.
	21.06.1999:	Keyword parameters passed into simple_psplot via the _EXTRA parameter
					will now overwrite corresponding settings in PRINTER_OPTIONS = propt.
					These keyword parameters will not alter the output to the screen.
	26.07.1999:	Renamed easy_plot to simple_psplot
	10.04.2000:	Removed bug with handling of _EXTRA keywords

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\simple_psplot.pro)


SIMPLE_SURFACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIMPLE_SURFACE

 PURPOSE:

       The purpose of this program is to demonstrate how to
       create a simple surface plot with axes and rotational
       capability in object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       SIMPLE_SURFACE, data, x, y

 REQUIRED INPUTS:

       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       EXACT:  Set this keyword to get exact axis scaling.

       _EXTRA: This keyword collects otherwise undefined keywords that are
        passed to the surface initialization routine.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       VECTOR: Set this keyword if you want vector printing (as opposed to
       the default bitmap printing).

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

       ZTITLE: A string used as the Z title of the plot.

 COMMON BLOCKS:
       None.

 EXAMPLE:
       To use this program with your 2D data, type:

        IDL> Simple_Surface, data

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\simple_surface.pro)


SIMPLIFY_TREE_INFORMATION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  simplify_tree_information

 PURPOSE:
   This function returns the most extended braches of a tree.
   Each branch is follwed to its very end.
   If a tree consits of the braches a, a.b, a.b.c, d and d.e, the most extended branches are a.b.c and d.e .
   The other branches are ignored.

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   result=simplify_tree_information(array[,sep])

 INPUTS:
   array: string vector
   sep  : optional separator (default '.')

 OUTPUTS:
   result: index vector of the most extended braches.

 EXAMPLE:
   str=['a1','a1.a2','a1.a2.a3.a4','a2.a1','a4','a5','a3','a2']
   index=simplify_tree_information(str)
   print,str(index),format='(5a20)'
         a1.a2.a3.a4               a2.a1                  a4                  a5                  a3

 MODIFICATION HISTORY:
   Written by: Franz Rohrer March 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\simplify_tree_information.pro)


SIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIND

 PURPOSE:
       Return the sine of an angle specified in degrees rather than radians.

 CALLING SEQUENCE:
       x = sind(deg)

 INPUTS:
       angle   angle in degrees

 OPTIONAL INPUTS:

 OUTPUTS:
       Sine of angle returned.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/07/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\sind.pro_)


SIZE_IMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SIZE_IMG
 PURPOSE:
       Return image size and true value.
 CATEGORY:
 CALLING SEQUENCE:
       size_img, img
 INPUTS:
       img = Input image.           in
 KEYWORD PARAMETERS:
       Keywords:
         NX=nx, NY=ny  Image size.
         TRUE=tr  Interleave index for 3-D true color images.
           tr is 0 is 2-D image.
         ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
           2=wrong number of color channels for 3-D array.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2000 Sep 26

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\size_img.pro)


SIZE_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   size_struct

 PURPOSE:
   The result of this function is a structure with size informations about the input structure

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=size_struct(struct,[_extra=extra])

 INPUTS:
   struct: a structure whith tagnames (sub structures) is interpreted by the SIZE function

 KEYWORD PARAMETERS:
  _extra=extra:  All keyword of size() could be used

 EXAMPLE:
  test={a:1,b:2}
  result=size_struct(test,/TNAME)
  help,result,/str
  ** Structure <13b73b8>, 2 tags, length=16, refs=1:
     A               STRING    'INT'
     B               STRING    'INT'



 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Sep-06

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\size_struct.pro)


SKEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SKEW
 PURPOSE:
       Returns the skew of an array (3rd moment/2nd moment^3/2).
 CATEGORY:
 CALLING SEQUENCE:
       s = skew(a)
 INPUTS:
       a = input array.    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = skew of a.      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 23 Aug, 1990
       Johns Hopkins University Applied Physics Lab

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\skew.pro)


SKEWF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SKEWF
 PURPOSE:
       Computes skew inside a moving window.
 CATEGORY:
 CALLING SEQUENCE:
       s = skewf(x,w)
 INPUTS:
       x = array of input values.      in
       w = width of window.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s = resulting skew array.       out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 23 Aug, 1990.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\skewf.pro)


SKEWINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SKEWINT
 PURPOSE:
       Give the near-intersection point for two skew lines.
 CATEGORY:
 CALLING SEQUENCE:
       skewint, a, b, c, d, m, e
 INPUTS:
       a, b = two points on line 1.          in
       c, d = two points on line 2.          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       m = midpoint of closest approach.     out
       e = distance between lines.           out
           -1 for parallel lines.
 COMMON BLOCKS:
 NOTES:
       Notes: a,b,c,d,m are 3 element arrays (x,y,z),
         e is a scalar.  Two lines in 3-d that should
         intersect will, because of errors, in general
         miss.  This routine gives the point halfway
         between the two lines at closest approach.
 MODIFICATION HISTORY:
       R. Sterner. 30 Dec, 1986.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\skewint.pro)


SLOPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:         slope

 PURPOSE:      compute a two point fitting function, y=f(x)

 USEAGE:       slope,a,b
 
 INPUTS:       none

 KEYWORDS:     none

 OUTPUTS:      
   a           fit coefficients
   b           fit coefficients

 PROCEDURE:    use the LMB to specify two points on the plot.  
               The form of the fitting function depends on whether the plot 
               has log axis in either the x or y directions, as follows,

                       x          y
                      linear - linear           y=a+b*x
                      log    - linear           y=a+b*log(x)
                      linear -  log             y=a*exp(b*x)
                      log    -  log             y=a*x^b

               After two points are chosen SLOPE will show the form of the
               fitting function and the value of a and b in an XMESSAGE
               widget.  At this point the user can exit the procedure by
               hitting any of the mouse buttons.  The XMESSAGE widget is not
               not destroyed if the RMB is used to exit SLOPE.
                

  author:  Paul Ricchiazzi                            nov93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\slope.pro)


SLOWPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SLOWPLOT
 PURPOSE:
       Plot data slowly in fading colors.
 CATEGORY:
 CALLING SEQUENCE:
       slowplot, x, y, [n]
 INPUTS:
       x,y = x,y arrays to plot.                           in
       n = optional number of points displayed (def=50).   in
 KEYWORD PARAMETERS:
       Keywords:
         /FADE means use fade mode.
         /FAST_FADE means use fast fade mode.
         WAIT=w time delay in seconds between plotted points.
           Def = 0 sec.
         TITLE=tt plot title.
         XTITLE=tx x axis label.
         YTITLE=ty y axis label.
         CHARSIZE=cs character size.
         /OVER overplot using existing plot on screen.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Press the letter A to abort.
 MODIFICATION HISTORY:
       R. Sterner, 16 Aug, 1991
       R. Sterner, 24 Sep, 1991 --- cleaned up for library.
       R. Sterner, 15 Oct, 1991 --- added /FAST_FADE mode.
;       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\slowplot.pro)


SMOOTH2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SMOOTH2
 PURPOSE:
       Do multiple smoothing. Gives near Gaussian smoothing.
 CATEGORY:
 CALLING SEQUENCE:
       b = smooth2(a, w)
 INPUTS:
       a = array to smooth (1,2, or 3-d).  in
       w = smoothing window size.          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       b = smoothed array.                 out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  8 Jan, 1987.
       Johns Hopkins University Applied Physics Laboratory.
       RES  14 Jan, 1987 --- made both 2-d and 1-d.
       RES 30 Aug, 1989 --- converted to SUN.
       R. Sterner, 1994 Feb 22 --- cleaned up some.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\smooth2.pro)


SMOOTH_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SMOOTH_MM
 VERSION:
		4.0
 PURPOSE:
		Non broadening data smoothing.
 CATEGORY:
		Array function.
 CALLING SEQUENCE:
		Result = SMOOTH_MM( ARR, WID [keywords])
 INPUTS:
	ARR
		Array, numeric, no more than six dimensions.
	WID
		The width of the smoothing window.  Can be given either as a scalar (in
		which case it is applied to all the dimensions of the array, or as a
		vector (in which case each entry applies to one dimension).  The WIDTH
		entry(s) should be an odd number(s), if it is even the next higher odd
		number(s) will be used.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	DERIV
		Causes the smoothed derivative (first or second) of the data to be
		returned instead of the data itself.  Currently valid only for 1D
		arrays.
	/EDGE_TRUNCATE
		Switch.  Same as in the IDL version of SMOOTH.
 OUTPUTS:
		Returns the smoothed array or (optionally) its first or second
		derivative.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses a variation of the Savitzky-Golay procedure.  Superior to the IDL
		provided SMOOTH routine in the sense that it doesn't introduce peak
		broadening.  Note that:

		1)  The width needed obtain a given degree of smoothing is about twice
			as big as with SMOOTH (which isn't a problem since this extra width
			doesn't cause broadening.
		2)  Since the averaging kernel isn't positive definite, in some rare
			cases (high and very narrow peaks with little or no background)
			SMOOTH_MM may generate artifacts.

		Calls CAST, CONVOL_MM, DEFAULT, DIAGOARR, MAKE_GRID, SOLVE_LINSYS and
		TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 25-JAN-1997 by Mati Meron as M_SMOOTH.
		Renamed 25-SEP-1999 by Mati Meron, to SMOOTH_MM.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\smooth_mm.pro)


SOLVE2

[Previous Routine] [Next Routine] [List of Routines]
 routine    solve2
 purpose    solve two simultaneous non-linear equations for variables
            x and y.  In The non-linear equations are formally
            expressed as,
                           fu(x,y) = u
                           fv(x,y) = v
 input:
   fu       name of first non-linear function (string)
   fv       name of second non-linear function (string)
   u        rhs value of first non-linear function (scalor)
   v        rhs value of second non-linear function (scalor)
   x        first guess value for variable x (scalor)
   y        first guess value for variable y (scalor)
   xrange   reasonable range of x (i.e.,  [xmin, xmax] )
   yrange   reasonable range of y (i.e.,  [ymin, ymax] )

 keyword input
   view     plot convergence trace and print diagnostics
   tol      convergence criterium (see below).
   maxit    maximum number of iterations

            Iteration terminates when one of the following 
            conditions is true:

            1. number of iterations exceeds MAXIT

            2. x or y is pegged at their extreme values, 
               given by XRANGE or YRANGE.

            3. abs{fu(x,y)-u} lt TOL * u  and 
               abs{fv(x,y)-v} lt TOL * v
 
 output:
   x        converged value of x
   y        converged value of y

 
 PROCEDURE:  the functions fu and fv should return both the values
             of the non-linear function and their derivatives with respect
             to x and y.  SOLVE2 assumes that these quantities are actually
             implemented as procedures, so that all three values can be
             obtained simply.  The argument list of the fu or fv procedures
             should be set up as follows,

             pro fu,x,y,uu,dudx,dudy
               and
             pro fv,x,y,vv,dvdx,dvdy

             where uu    function value of fu at x,y
                   dudx  partial derivative of fu with respect to x
                   dudy  partial derivative of fu with respect to y
                   vv    function value of fv at x,y
                   dvdx  partial derivative of fv with respect to x
                   dvdy  partial derivative of fv with respect to y

             the equations are solved by newton-raphson iteration
             

  author:  Paul Ricchiazzi                            22mar93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\solve2.pro)


SOLVE_LINSYS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SOLVE_LINSYS
 VERSION:
		4.0
 PURPOSE:
		Solves the system of linear equations ARR*X = RHS
 CATEGORY:
		Mathematical Function /matrix manipulation.
 CALLING SEQUENCE:
		Result = SOLVE_LINSYS( ARR, RHS [, keywords])
 INPUTS:
	ARR
		Matrix, numeric.  Must be square, unless the keyword SVD is set.
	RHS
		Vector representing the right hand side of the equation.  Length should
		be compatible to the dimensions of the matrix.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	THRESHOLD
		Sets the threshold that's used to determine whether the matrix is
		regular.  Default value is 1e-20.  See OPTIONAL OUTPUT PARAMETERS for
		details.
	STATUS
		Optional output, see below.
	/ROW
		Switch.  If set, ARR is taken in a row major format.  Default is
		column major (IDL standard).
	/SVD
		Switch.  Specifies solution using the Singular Value Decomposition
		method.  Default is LU decomposition.
	UMAT
		Optional SVD output.  See below.
	VMAT
		Optional SVD output.  See below.
	DVEC
		Optional SVD output.  See below.
 OUTPUTS:
		Returns the solution of the linear system in a vector form, type
		floating or higher.
 OPTIONAL OUTPUT PARAMETERS:
	STATUS
		The name of the variable to receive the status flag for the operation.
		Possible values are 0 for a singular ARR, 1 for regular.  ARR is
		considered singular if the ratio of the smallest and largest diagonal
		element in the LU decomposition (or the diagonal part of the SVD
		decomposition) of ARR is less then THRESHOLD.
	UMAT
		SVD only.  The name of the variable to receive the U matrix from the
		SVD decomposition.  See SVD routine for more detail.
	VMAT
		SVD only.  The name of the variable to receive the V matrix from the
		SVD decomposition.  See SVD routine for more detail.
	DVEC
		Named variable.  Result depends on calculation mode, namely:
			LU	:	vector of the diagonal elements of the LU decomposition.
			SVD	:	vector of the diagonal elements of W (see the SVD routine).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Normally uses LU decomposition and backsubstitution, followed by LU
		correction.  These operations are perfomed by the system routines
		LUDC, LUSOL and LUMPROVE, based on routines from the book NUMERICAL
		RECIPES IN C.  If the keyword SVD is set, the solution is obtained
		using Singular Value Decomposition, and back-substitution performed by
		the system routines SVDC and SVSOL (same source).  Also uses the
		functions CAST, DEFAULT, DIAGOVEC, FPU_FIX, ISNUM and TOLER from MIDL.
 MODIFICATION HISTORY:
		Created 15-DEC-1991 by Mati Meron.
		Modified 25-MAY-1993 by Mati Meron.  SVD option added.
		Modified 30-JUN-1995 by Mati Meron.  Changed from the SVD and SVBKSB
		routines to the new SVDC and SVSOL.  The change is transparent to the
		user other than the fact that that it allows for a DOUBLE type SVD
		solution.
		Modified 25-MAR-1997 by Mati Meron.  Changed from LUDCMP, LUBKSB and
		MPROVE to the newer LUDC, LUSOL and LUMPROVE.  Same as with the
		previous change, it is transparent for the user other than the fact
		that it allows for a DOUBLE type solution.
		Also added the keyword ROW which allows for treating the input matrix
		in standard algebraic fashion, instead of the transposed IDL fashion.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\solve_linsys.pro)


SOPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SOPLOT
 PURPOSE:
       Make a shaded over plot.
 CATEGORY:
 CALLING SEQUENCE:
       soplot, x, y
 INPUTS:
       x, y = x and y arrays to plot (must have both).  in
 KEYWORD PARAMETERS:
       Keywords:
         SHADE=txt  Name of a color (like "red").
           Do color,/list for a list of available colors.
         STHICK=t   Thickness of shaded colors (def=1).
         COLOR=c  Color index to use for shade color.  Uses
           indices +/-1 also.
         + any keywords allowed to plot.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 7 Oct, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\soplot.pro)


SORPURGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SORPURGE
 VERSION:
		4.0
 PURPOSE:
		Similar to the SORT function, but ignores repeated values of elements.
 CATEGORY:
		Array Manipulation.
 CALLING SEQUENCE:
		Result = SORPURGE ( ARR [, keywords])
 INPUTS:
	ARR
		The array to be sorted (scalar is also accepted).
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	NETLEN
		Optional output, see below.
 OUTPUTS:
		Returns a vector of indices that allow access to all DIFFERENT elements
		of ARR in ascending order.
 OPTIONAL OUTPUT PARAMETERS:
	NETLEN
		The name of a variable to receive the number of elements .
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses SORT to order the array, then finds all the elements that differ
		from their predecessors.
 MODIFICATION HISTORY:
		Created 15-AUG-1992 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\sorpurge.pro)


SORT_BY_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   sort_by_name

 PURPOSE:
  The result of this function is an index array to sort an array by one or more given string names

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=sort_by_name(array,name,[/one_level])

 INPUTS:
   array:  The string values which should be sorted
   name:   a vector or a string of sort name

 KEYWORD PARAMETERS:
  one_level: if this keyword set no separtion in levels are done else all levels will be sorted as function of name too
             The level separator is '.'

 OUTPUTS:
  This function returns an index field

 EXAMPLE:
   array=['bb_aa','bb_cc','ff_gg','ff_ee']
   result=sort_by_name(array,['ff_*','bb_*'])
   print,result
       2           3           0           1

   print,array[result]
   ff_gg ff_ee bb_aa bb_cc

   non comparing strings are not removed

   result=sort_by_name(array,['ff_*'])
   print,array[result]
   ff_gg ff_ee bb_aa bb_cc

   array=['H2O.PARAM', 'O3', 'H2O.UNITS','H2O2.param','doof']
   name=['O3','H2O','H2O2']
   result=sort_by_name(array,name)
   PRINT,array[result]
   O3 H2O.PARAM H2O.UNITS H2O2.param doof


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),2000-Mar-14
   2000-Apr-11 bug removed
   2000-05-11 added mechanism to sort more than one level by a given name
              Level separator is '.'

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\sort_by_name.pro)


SORT_NAMES_AND_PTRS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    sort_names_and_ptrs

 PURPOSE:
   This functions returns an array of indices how to sort names and pointer values.
   The rules are: 1) alphabetical
                  2) each array to the end of a sub-structure
                  3) if a sub-structure array is of type string the whole sub-structure is the last tag of the structure

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=sort_names_and_ptrs(struct)

 INPUTS:
   struct: the meta-structure to transform to a structure

 PROCEDURE:
   This routine was written after a discussion of Frank Hollands Meta-Structure
   First idea Frank Holland, advanced idea Franz Rohrer, at last Reimar Bauer

 EXAMPLE:
   d={A:1,B:{B1:findgen(10),B2:1}}
   m_struct=struct2olfis(d)

   help,m_struct,/str
   ** Structure <7d56e38>, 3 tags, length=12, refs=1:
   A               POINTER   
   B$_$B1          POINTER   
   B$_$B2          POINTER   



   struct=sort_names_and_ptrs(m_struct)
   help,struct,/str
   ** Structure <7d567d8>, 2 tags, length=36, refs=1:
   NAMES           STRING    Array[3]
   PTR_VALUES      POINTER   Array[3]

   print,struct.names
   A B$_$B1 B$_$B2


   struct=sort_names_and_ptrs(m_struct)
   help,struct,/str
   ** Structure <7d567d8>, 2 tags, length=36, refs=1:
   NAMES           STRING    Array[3]
   PTR_VALUES      POINTER   Array[3]

   print,struct.names
   B$_$B2 A B$_$B1

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-05
       2000-Jan-19 der Sortieralg. ist vollständig implementiert.
                   getestet mit ICG-Struct und einfachen anderen Strukturen.


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\sort_names_and_ptrs.pro)


SOURCE_CLEANER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	source_cleaner

 PURPOSE:
	This routine cleans up sources by uppercasing of commands. It's in a beta state now.
   the html mechanism isn't good at the moment

 CATEGORY:
	CASE_TOOLS

 CALLING SEQUENCE:
   source_cleaner,file,[charsize=charsize],[/html],[/no_backup]

 INPUTS:
   file: the name of the idl Source File

 OPTIONAL INPUTS:
   charsize: relative Charsize e.g. +1 (only for html output)

 KEYWORD PARAMETERS:
   html: output file will be *.html with color coding of idlde
   no_backup: if is set no back up file should is created

 OUTPUTS:
   This routine did a bakup named file_name.scl of the old source
   The new source will be saved on the real name

 RESTRICTIONS:


 EXAMPLE:
   source_cleaner,'example.pro'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Oct 26 1997
                       1997-10-28 path of txt file changed to relative
                       not good is at the moment that's str replacement isn't absolute
   1998-Apr-2 independent_path included
   1998-Apr-18 html keyword included
   1998-Oct-15 some changes to better syntax
   1999-Jan-06 changed number colorcoding by /html
   2000-Feb-27 some colors changed by /html


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\source_cleaner.pro)


SPAWND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   spawnd

 PURPOSE:
   spawn with result for WIN and unix

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   SPAWND, command, result

 INPUTS:
   command:   OS command to be executed

 KEYWORD PARAMETERS:
   tempfile:  file for tempoary storage

 OUTPUTS:
   Result:

 SIDE EFFECTS:
   under Windows this routine writes a temporary file
   if tempfile is not given '%TEMP%\tmp.tmp' is used
   the file is deleted afterwards

 EXAMPLE:
   spawnd, 'DIR *.PRO', r & print, r

 REVISION HISTORY:
       Written         Theo Brauers, Nov 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\spawnd.pro)


SPC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPC
 PURPOSE:
       Return a string with the specified number of spaces (or other char).
 CATEGORY:
 CALLING SEQUENCE:
       s = spc(n, [text])
 INPUTS:
       n = number of spaces (= string length).   in 
        text = optional text string.              in
          # spaces returned is n-strlen(strtrim(text,2))
 KEYWORD PARAMETERS:
       Keywords:
         CHARACTER=ch  Character other than a space.
           Ex: CHAR='-'.
         /NOTRIM means do not do a strtrim on text.
 OUTPUTS:
       s = resulting string.                     out
 COMMON BLOCKS:
 NOTES:
       Note: Number of requested spaces is reduced by the
         length of given string.  Useful for text formatting.
 MODIFICATION HISTORY:
       Written by R. Sterner, 16 Dec, 1984.
       RES --- rewritten 14 Jan, 1986.
       R. Sterner, 27 Jun, 1990 --- added text.
       R. Sterner, 1994 Sep  7 --- Allowed text arrays.
       R. Sterner, 1999 Jul  2 --- Added /NOTRIM keyword.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\spc.pro)


SPHASE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  sphase,mu,g=g,type=type

 PURPOSE:  compute sphase greenstein phase function

 USEAGE:   sphase,mu,g=g,type=type

 INPUT:    
   mu      cosine of polar angle (mu=1 in forward direction)
   g       asymmetry factor 
 
 keywords
   rayleigh
           returns rayleigh phase function and ignors value of g
  
 EXAMPLE:  compute fraction of all single scattered radiation 
           within a disk which subtends one degree of the of 
           the forward direction.
;;
           mu=findrng(-1,1,1000)
           plot_io,acos(mu)/!dtor,sphase(mu),/xstyle
;;
;;         print angle and phase for sbdart input           
;;
   sangle=findrng(0,180,181) & sph=sphase(cos(sangle*!dtor),g=.8)

   print,f='(a,10(f6.2,","))','  sangle=',sangle(0:9)
   print,f='((9x,10(f6.2,",")))',sangle(10:*)
   print,f='(a,10(f8.5,","))','  sphase=',sph(0:9)
   print,f='((9x,10(f8.5,",")))',sph(10:*)
;;
           

 AUTHOR:   Paul Ricchiazzi                        22 Apr 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\sphase.pro)


SPHDIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHDIST
 PURPOSE:
       Angular distance between points on a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       d = sphdist(long1, lat1, long2, lat2)
 INPUTS:
       long1 = longitude of point 1.         in
       lat1 = latitude of point 1.           in
       long2 = longitude of point 2.         in
       lat2 = latitude of point 2.           in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angles are in degrees, else radians.
 OUTPUTS:
       d = angular distance between points.  out
 COMMON BLOCKS:
 NOTES:
       Notes: points 1 and 2 may be arrays.
 MODIFICATION HISTORY:
       R. Sterner, 5 Feb, 1991
       R. Sterner, 26 Feb, 1991 --- Renamed from sphere_dist.pro

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphdist.pro)


SPHGC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHGC
 PURPOSE:
       Find intersections of two great circles on sphere.
 CATEGORY:
 CALLING SEQUENCE:
       sphgc, an1,at1,an2,at2,bn1,bt1,bn2,bt2,pn1,pt1,pn2,pt2
 INPUTS:
       an1, at1 = Longitude and Latitude of point A1 on GC A.  in
       an2, at2 = Longitude and Latitude of point A2 on GC A.  in
       bn1, bt1 = Longitude and Latitude of point B1 on GC B.  in
       bn2, bt2 = Longitude and Latitude of point B2 on GC B.  in
 KEYWORD PARAMETERS:
       Keywords:
         flag=f  Flag: 0=no poles found, 1=OK.
 OUTPUTS:
       pn1, pt1 = Longitude and Latitude of pole 1.            out
       pn2, pt2 = Longitude and Latitude of pole 2.            out
 COMMON BLOCKS:
 NOTES:
       Notes: all coordinates in degrees.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Sep 20

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphgc.pro)


SPHIC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHIC
 PURPOSE:
       Compute intersection points of two circles on a unit sphere.
 CATEGORY:
 CALLING SEQUENCE:
       sphic, ln1,lt1,r1, ln2,lt2,r2, lnp1,ltp1, lnp2,ltp2, flag
 INPUTS:
       ln1 = longitude of circle 1 center.      in
       lt1 = latitude of circle 1 center.       in
       r1 = radius of circle 1.                 in
            Angle along sphere surface.
       ln2 = longitude of circle 2 center.      in
       lt2 = latitude of circle 2 center.       in
       r2 = radius of circle 2.                 in
            Angle along sphere surface.
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means all angles are in degrees, else radians.
 OUTPUTS:
       lnp1 = longitude of intersection 1.      out
       ltp1 = latitude of intersection 1.       out
       lnp2 = longitude of intersection 2.      out
       ltp2 = latitude of intersection 2.       out
       flag = -2: circles are the same, all points on both.
              -1: parallel circles, different radii, no int.
               0: non-parallel circles, no intersection.
               1: tangent circles, one intersection.
               2: circles intersect in two points.
 COMMON BLOCKS:
 NOTES:
       Notes: if flag < 1 then returned intersection points
         are meaningless and may be undefined.
         If flag = 1 then both points are the same.
 MODIFICATION HISTORY:
       R. Sterner. 13 Apr, 1988.
       R. Sterner. 14 Feb, 1991 --- to IDL V2 & slight changes.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphic.pro)


SPHINIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHINIT
 PURPOSE:
       Initialize sphere drawing package.
 CATEGORY:
 CALLING SEQUENCE:
       sphinit
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         --- Set values:
         LONG = central longitude (East is +, def=0).
         LAT = central latitude (def=0).
         PA = position angle of north pole (def=0).
         X = X position of sphere center (def=0).
         Y = Y position of sphere center (def=0).
         INC = angle increment (def=1).
         VPA = Position angle of visible hemisphere center (def=0).
         VAZ = Line of sight ang. of vis. hemisphere center (def=0).
         VIS_STYLE = def linestyle for sphere visible part (def=0).
         HID_STYLE = def linestyle for sphere hidden part (def=1).
         --- Actions:
         /LIST  list values.
         /FRONT set visible hemisphere to front of sphere.
         /TOP   set visible hemisphere to top of sphere.
         /DEVICE  work in device coordinates.
         RADIUS = r.  Plot outline of radius r.
         COLOR = c.  Outline plot color.
	  FILL = f. Fill color for inside radius (def = no fill).
         LINESTYLE = s.  Outline linestyle.
         THICK = t.  Outline plot thickness.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 25 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphinit.pro)


SPHLAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHLAT
 PURPOSE:
       Draw parallels of latitude on a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       sphlat, lat, rad, [lng1, lng2]
 INPUTS:
       lat = latitude of parallel.                in
       rad = radius of sphere.                    in
       lng1, lng2 = longitude range of parallel.  in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c  plot color.
         LINESTYLE=s  plot linestyle.
           Over-rides defaults for visible and hidden points.
         THICK=t  plot thickness.
         /HIDDEN plot hidden points.
         MAXRAD=r clip points using a sphere of radius r.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
       Notes: Call SPHINIT first to set sphere orientation and
         point clipping to the visible hemisphere (def=front).
         Point clipping may alternatively be done using a
         clipping sphere defined by MAXRAD.
 MODIFICATION HISTORY:
       R. Sterner, 25 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphlat.pro)


SPHLNG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHLNG
 PURPOSE:
       Draw meridians of longitude on a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       sphlng, lng, rad, [lat1, lat2]
 INPUTS:
       lng = longitude of meridian.              in
       rad = radius of sphere.                   in
       lat1, lat2 = latitude range of meridian.  in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c  plot color.
         LINESTYLE=s  plot linestyle.
           Over-rides defaults for visible and hidden points.
         THICK=t  plot thickness.
         /HIDDEN plot hidden points.
         MAXRAD=r clip points using a sphere of radius r.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
       Notes: Call SPHINIT first to set sphere orientation and
         point clipping to the visible hemisphere (def=front).
         Point clipping may alternatively be done using a
         clipping sphere defined by MAXRAD.
 MODIFICATION HISTORY:
       R. Sterner, 25 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphlng.pro)


SPHPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHPLOT
 PURPOSE:
       Plot a curve in spherical polar coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       sphplot, lng, lat, rad, [code]
 INPUTS:
       lng = array of longitudes.                in
       lat = array of latitudes                  in
       rad = array of radii (may be a scalar).   in
       code = optional curve break code.         in
         1=pen down, 0=pen up (don't connect to last point).
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c  plot color.
         LINESTYLE=s  plot linestyle.
           Over-rides defaults for visible and hidden points.
         THICK=t  plot thickness.
         /HIDDEN plot hidden points.
         /ALL ignore visible hemisphere clipping, plot all.
         MAXRAD=r clip points using a sphere of radius r.
         /XYZ  allows the call: sphplot, x, y, z, /xyz.
         PSYM=p  set plot symbol.
         SYMSIZE=s  set symbol size.
         XOUT=x  returns array of plotted data coordinate X.
         YOUT=y  returns array of plotted data coordinate Y.
         PEN=p   returns array of pen codes for XOUT, YOUT.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
       Notes: Call SPHINIT first to set sphere orientation and
         point clipping to the visible hemisphere (def=front).
         Point clipping may alternatively be done using a
         clipping sphere defined by MAXRAD.
 MODIFICATION HISTORY:
       R. Sterner, 6 Feb, 1991
       R. Sterner, 1994 Dec 22 --- Allowed pen up/down code.
       R. Sterner, 1999 May 03 --- Fixed plotted point array bug (for no pts).
       R. Sterner, 1999 May 03 --- Added new keyword: /ALL

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphplot.pro)


SPHRAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHRAD
 PURPOSE:
       Draw sphere radius.
 CATEGORY:
 CALLING SEQUENCE:
       sphrad, lng, lat, [r1, r2]
 INPUTS:
       lng = longitude of radius.     in
       lat = latitude of radius.      in
       r1, r2 = range of radius.      in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c  plot color.
         LINESTYLE=s  plot linestyle.
           Over-rides defaults for visible and hidden points.
         THICK=t  plot thickness.
         /HIDDEN  Plot hidden points.
         MAXRAD=r clip points using a sphere of radius r.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
       Notes: Call SPHINIT first to set sphere orientation and
         point clipping to the visible hemisphere (def=front).
         Point clipping may alternatively be done using a
         clipping sphere defined by MAXRAD.
 MODIFICATION HISTORY:
       R. Sterner, 25 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphrad.pro)


SPHTEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPHTEXT
 PURPOSE:
       Write text on a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       sphtext, text, rad, lng1, lng2, lat1, lat2
 INPUTS:
       text = text string to write.               in
       rad = radius of sphere.                    in
       lng1, lng2 = longitude range of text.      in
       lat1, lat2 = latitude range of text.       in
 KEYWORD PARAMETERS:
       Keywords:
         ANG=A text angle (deg CCW).
         COLOR=c  text color.
         LINESTYLE=s  text linestyle.
         /BACK  plot text on back of sphere.
 OUTPUTS:
 COMMON BLOCKS:
       sph_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 25 Jan, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sphtext.pro)


SPH_DEMO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPH_DEMO
 PURPOSE:
       Demonstrate some of the spherical plot (sph*) routines.
 CATEGORY:
 CALLING SEQUENCE:
       sph_demo
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /HARD means use colors appropriate to hardcopy.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sph_demo.pro)


SPH_RANGE_MAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPH_RANGE_MAP
 PURPOSE:
       Compute an array of ranges from a point on a sphere.
 CATEGORY:
 CALLING SEQUENCE:
       r = sph_range_map(lng0, lat0, res)
 INPUTS:
       lng0 = Longitude of starting point (deg).         in
       lat0 = Latitude of starting point (deg).          in
       res = resolution in degrees for lat and long.     in
 KEYWORD PARAMETERS:
       Keywords:
         NX=nx, NY=ny Number of elements in X and Y dimensions.
           Supercedes res.
 OUTPUTS:
       r = Returned distance array in degrees.           out
         r covers longitudes -180 to (+180-res) and
                   latitudes   -90 to (+90-res).
 COMMON BLOCKS:
 NOTES:
       Note: lng0,lat0 is the point at 0 range.  For example,
         if this is the subsolar point then ranges will be
         sun zenith distance in degrees.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Dec 01

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sph_range_map.pro)


SPLAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPLAT
 PURPOSE:
       Generate points on a splat curve.
 CATEGORY:
 CALLING SEQUENCE:
       splat, n, r1, r2, x, y
 INPUTS:
       n = number of points on curve.                        in
       r1, r2 = min and max distance of points from center.  in
 KEYWORD PARAMETERS:
       Keywords:
         SMOOTH=s smoothing window size (def = 5% of n).
 OUTPUTS:
       x, y = splat curve points.                            out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       RES  7 Feb, 1986.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\splat.pro)


SPLINROOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SPLINROOT
 VERSION:
		4.0
 PURPOSE:
		Finds roots of function provided as a set of spline coefficients.
 CATEGORY:
		Mathematical function (general).
 CALLING SEQUENCE:
		Result = SPLINROOT(SPC [,RANGE ] [, EPS] [, keywords])
 INPUTS:
	SPC
		An [n,3] array of spline coefficients, generated by SPLIN_COEFFS.
 OPTIONAL INPUT PARAMETERS:
	RANGE
		Search range.  Defaults to full range present in SPC.  If exceeding
		the range in SPC, a warning is issued.
	EPS
		Allowed error.  Default is machine precision (according to data type).
 KEYWORD PARAMETERS:
		All the keyword parameters of ROOT with the exception of PARAMS are
		accepted.
 OUTPUTS:
		Returns a vector containing the location(s) of the root(s).  If no root
		is found returns machine maximum.
 OPTIONAL OUTPUT PARAMETERS:
		Same as for the function ROOT, i.e. ERROR, STATUS and DONE.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Calls ROOT from MIDL, using SPLIN_EVAL (also from MIDL) as the function
		to provide the roots.  Also calls DEFAULT, from MIDL.
 MODIFICATION HISTORY:
		Created 25-NOV-1996 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\splinroot.pro)


SPLINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SPLINT
 VERSION:
		4.0
 PURPOSE:
		Integrates a function provided as a set of spline coefficients.
 CATEGORY:
		Mathematical Function (general).
 CALLING SEQUENCE:
		Result = SPLINT (X, SPC [/VALUE_ONLY])
 INPUTS:
	X
		Numeric vector, 2 or more points.  The X coordinates of the data.
	SPC
		An [n,3] array of spline coefficients, created by the function
		SPLIN_COEEFS.
 KEYWORD PARAMETERS:
	/VALUE_ONLY
		Switch.  Normally SPLINT returns the integral function of Y, as a vector
		(see OUTPUTS below).  If VALUE_ONLY is set, only the full value of the
		integral is returned as scalar.  This makes the execution faster.
 OUTPUTS:
		Normally returns the integral function of Y, i.e. a vector whose i-th
		entry is the integral of Y from X[0] to X[i] (and therefore the last
		entry is the full integral of Y.  If the optional keyword VALUE_ONLY is
		set, only the full integral is returned, as a scalar.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The X vector must be of length >= 2.
 PROCEDURE:
		Exact integration, of the cubic-spline approximation to the function.
		Uses FPU_FIX and SPLIN_EVAL from MIDL.
 MODIFICATION HISTORY:
		Created 20-FEB-1993 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\splint.pro)


SPLIN_COEFFS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SPLIN_COEFFS
 VERSION:
		4.0
 PURPOSE:
		Calculates cubic splines coefficients which are intended to be used by
		the supplementary function SPLIN_EVAL.  The combination of SPLIN_COEFFS
		and SPLIN_EVAL is more efficient than the library function SPLINE when
		repeated interpolations based on the same data set are performed.
 CATEGORY:
		Mathemetical Function (General).
 CALLING SEQUENCE:
		Result = SPLIN_COEFFS( X, Y [, /SEGMENTED] )
 INPUTS:
	X
		Vector, numeric, at least 2 elements.  Contains the X coordinates of
		the data, in arbitrary order.
	Y
		Vector, numeric, same length as X.  Contains the Y values corresponding
		to the values in X.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	/SEGMENTED
		Switch.  If set the input data is treated as segmented, where segment
		boundary is defined as two consecutive points with the same X
		coordinate.  Spline fitting is performed on each segment separately.
		In default operation, whenever multiple points with the same X
		coordinate are encountered, all but the first one are deleted.
 OUTPUTS:
		Returns an (n,3) array where n is the number of data points.  The
		columns of the result are:
			0 -	X values, sorted in increasing order.
			1 - Corresponding Y values.
			2 - Calculated corresponding spline coefficients.
		This array is intended to be used as an input to the function SPLIN_EVAL
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		As mentioned above, the X and Y arrays must have at least 2 elements.
		Also, if the keyword SEGMENTED is used, the arrays must be presorted in
		ascending order.  In normal (not SEGMENTED) evaluation the order
		doesn't matter.
 PROCEDURE:
		Standard Cubic spline evaluation (see Numerical Recipies, chapt. 3.3)
		with the boundary condition of 0 THIRD derivative (constant end
		curvature).  Calls itself recursively.  Also uses calls to CAST,
		FPU_FIX and SORPURGE in MIDL.  If X and Y have only 2 elements, the
		spline is a plain linear fit.
 MODIFICATION HISTORY:
		Created 15-APR-1992 by Mati Meron.
		Modified 15-AUG-1992 by Mati Meron.  Replaced SORT with SORPURGE in
		order to protect against a possible repetition of x values.
		Modified 10-FEB-1993 by Mati Meron.  Added SEGMENTED option.
		Modified 10-APR-1993 by Mati Meron.  Added acceptance of 2-point data.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\splin_coeffs.pro)


SPLIN_EVAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SPLIN_EVAL
 VERSION:
		4.0
 PURPOSE:
		Cubic spline evaluation using spline coefficients supplied by the
		supplementary function SPLIN_COEFFS.  The combination of SPLIN_COEFFS
		and SPLIN_EVAL is more efficient than the library function SPLINE when
		repeated interpolations based on the same data set are performed.
 CATEGORY:
		Mathematical Function (General).
 CALLING SEQUENCE:
		Result = SPLIN_EVAL( X, SPC [, DERIV = NDER)
 INPUTS:
	X
		Numeric, otherwise arbitrary.  The X value (or values) for which the
		spline interpolation is to be performed.
	SPC
		An (n,3) array of spline coefficients, created by the function
		SPLIN_COEEFS.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	DERIV
		Integer.  If provided and nonzero, an interpolated derivative of the
		order DERIV is returned.  Default value is 0.
 OUTPUTS:
		Returns the result of the interpolation, in the same form as X.  The
		type of the result is floating or higher, depending on X.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Standard Cubic spline evaluation (see Numerical Recipies, chapt. 3.3)
		with the boundary condition of 0 THIRD derivative (constant end
		curvature).  Uses DEFAULT and FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 15-APR-1992 by Mati Meron.
		Modified 15-MAY-1992 by Mati Meron.  Added derivative option.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\splin_eval.pro)


SPLIT_XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SPLIT_XY
 VERSION:
		4.1
 PURPOSE:
		Converting data into X and Y arrays, for processing purposes.
 CATEGORY:
		Utility
 CALLING SEQUENCE:
		Result = SPLIT_XY( X [, Y] [, keywords])
 INPUTS:
	X
		Numeric, Either a vector (scalar is considered to be a vector of
		length 1) or an [2,*] array.
 OPTIONAL INPUT PARAMETERS:
	Y
		Numeric, acceptable only when X is a vector, in which case Y has to be
		a vector of same length.
 KEYWORD PARAMETERS:
	X_RET
		Optional output, see below.
	Y_RET
		Optional output, see below.
	INPX
		Optional output, see below.
	MINTYP
		Sets minimal data type for the optional outputs X_RET and Y_RET.
		Default value is 4, i.e. type FLOAT.
	/WARN
		Switch.  If set, the function issues a warning message in case of bad or
		missing input, else it returns zero without warnings.
 OUTPUTS:
		Returns the length of the resulting X and Y vectors, as LONG.
 OPTIONAL OUTPUT PARAMETERS:
	X_RET
		The name of the variable to receive the resulting X vector.
	Y_RET
		The name of the variable to receive the resulting Y vector.
	INPX
		Returns 1 if X-values were present in the input, O otherwise (i.e. when
		the X-values were generated internally).
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than those specified in types and sizes of variables.
 PROCEDURE:
		The following cases are possible:
			1)  X is a [2,N] array, with Y undefined.  In this case the
				function returns N and the X_RET and Y_RET return variables are
				set to X[0,*] and X[1,*], respectively.
			2)  X is a 1D vector (scalar also qualifies, as vector of length 1)
				with Y undefined.  In this case the function returns N, X_RET
				is set to a vector of length N, same type as X and values
				of 0,...N-1, while Y_RET is set to X.
			3)	X and Y are both defined and are vectors of *same* length N.
				In this case, the function returns N, X_RET is set to X and
				Y_RET is set to Y.
			4)	In all other cases, the function returns 0 and X_RET, Y_RET
				are not defined.

		SPLIT_XY calls ARREQ, CAST, DEFAULT and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 10-MAY-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\split_xy.pro)


SPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPLOT
 PURPOSE:
       Make a shaded plot.
 CATEGORY:
 CALLING SEQUENCE:
       splot, x, y
 INPUTS:
       x, y = x and y arrays to plot (must have both).  in
 KEYWORD PARAMETERS:
       Keywords:
         SHADE=txt  Name of a color (like "red").
           Do color,/list for a list of available colors.
         STHICK=t   Thickness of shaded colors (def=1).
         POSITION=pos  Plot position array, must be in device
           coordinates.
         COLOR=c  Color index to use for shade color.  Uses
           indices +/-1 also.
         + any keywords allowed to plot.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 7 Oct, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\splot.pro)


SPL_ANGINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPL_ANGINT
 PURPOSE:
       Spline angular interpolation of a periodic function.
 CATEGORY:
 CALLING SEQUENCE:
       r2 = spl_angint(r, a, a2)
 INPUTS:
       r = Radii of spline anchor points.           in
       a = Angles of spline anchor points.          in
       a2 = Angles of desired interpolated points.  in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angles are in degrees, else radians.
         /CLOSED  means last point has already been repeated,
           else repeat it here before interpolating.
 OUTPUTS:
       r2 = Radii of desired interpolated points.   out
         Make sure a2 is in a range appropriate to a.
 COMMON BLOCKS:
 NOTES:
       Notes: If given curve has the first point repeated as
       the last it is closed.  This routine must be told if the
       curve is closed.  The given points are assumed to be not
       too non-uniform along the curve.
 MODIFICATION HISTORY:
       R. Sterner, 1998 May 14
       R. Sterner, 1998 May 18 --- Fixed angles.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\spl_angint.pro)


SPRINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SPRINT
 PURPOSE:
       Print text on screen, allows easy update.
 CATEGORY:
 CALLING SEQUENCE:
       sprint, n, txt
 INPUTS:
       n = text index number.    in
       txt = new text.           in
 KEYWORD PARAMETERS:
       Keywords:
         INDEX=in on text setup returned text index.
         SIZE=s text size (def=1).
         COLOR=c text color (def=max).
         ERASE=e erase color (def=0).
 OUTPUTS:
 COMMON BLOCKS:
       sprint_com
       sprint_com
 NOTES:
       Notes:
         To setup text do:
         sprint, x, y, txt
           x,y = screen coordinates of text.     in
           txt = initial text at that location.  in
         To display all current text do:
         sprint
 MODIFICATION HISTORY:
       R. Sterner, 6 Oct, 1991
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sprint.pro)


SPRITE

[Previous Routine] [Next Routine] [List of Routines]
ROUTINE:      sprite

PURPOSE:      
    interactive display of multi parameter correspondences.  Points
    corresponding to a single independent index variable is hilighted
    by a small "sprite" symbol on several plot frames simultaneously. 
    The sprite position is controlled by the master index, which can
    be incremented/decremented via the mouse.
                

USEAGE:
    plot,x1,y1 & sprite,x1,y1,/init
    plot,x2,y2 & sprite,x2,y2
    plot,x3,y3 & sprite,x3,y3
      ...
    sprite
               

INPUT:

  xvec
    x vector for current plot. Only required when accumulating the
    DATA and CONTROL info after each plot. If xvec and yvec are not
    set, SPRITE executes in interactive mode

  yvec 
    y vector for current plot. Only required when accumulating the
    DATA and CONTROL info after each plot.


KEYWORD INPUT:

  init
    Set the keyword to reinitialize SPRITE for a new set of plots.

  psym
    symbol used to indicate sprite

  color
    color index used to draw sprite

  xtitle
    title of x variable for current plot, used to label quantity in
    print out widget.  

  ytitle
    title of y variable for current plot, used to label quantity in
    print out widget.

  NOTE: Only those variables specified in a xtitle or ytitle label
        are displayed in the print out widget.  Just specify a 
        given variable once in xtitle or ytitle to avoid having
        it listed several times in the print out widget.

 DISCUSSION:   SPRITE operates in two modes:

    1. in accumulation mode SPRITE is called immediately after each
    plot is written to the screen.  Multiple plot frames can be
    accumulated because SPITE stores all the data and plot geometry
    information in an internal common block, SPRITE_BLK, for latter
    use. 
    
    NOTE:   SPRITE ignors the values of PSYM, COLOR and
            LABELS while in accumulation mode.
    
    2. In interactive mode a sprite control window is created with
    several mouse-sensitive areas defined.  Pressing a mouse button
    in one of these areas causes the following actions:
    
    control area    action
    ------------    ------
    QUIT            quit 
      <<            move sprite backward taking large steps
      <             move sprite backward one step
      >             move sprite forward one step
      >>            move sprite forward taking large steps
    
    Using the RMB in the "<", ">" areas causes the sprite to pause
    between steps and to update the print-out widget after each step.
    Otherwise, if the LMB or MMB is used, the print-out widget is
    updated only after the button is released.


 SIDE EFFECTS: 
    Draws a sprite on each of the plot frames

    While in operations the XOR graphics mode is set.

    If psym is not set, user symbol, psym=8, is redefined to a filled
    diamond

 COMMON BLOCKS:
    sprite_blk
  
 EXAMPLE:

; use sprite to show solar flux values :

       !p.multi=0
       solar,wv,f
       xtitle='wavenumber' & ytitle='W/m2' & title='irradiance'
       plot,wv,f,xtitle=xtitle,ytitle=ytitle,title=title
       sprite,wv,f,xtitle=xtitle,ytitle=title,/init
       sprite,color=150

; try a four frame plot 
 
       !p.multi=[0,2,2]
       time=findgen(100)*10 & tlab='Time (hours)'
       lon=-90+10*cos(!dtor*time)+randf(100,3)
       lat=30+5*sin(!dtor*time)+randf(100,3)
       alt=5000*sin(time*!pi/999)+2000*randf(100,3.3)
       ch1=10.+randf(100,3)
       ch2=25.+randf(100,2.5)^3
       plot,lon,lat,/yno,xtit='Longitude',ytit='Latitude',title='Flight path'
       sprite,lon,lat,xtit='Longitude',ytit='Latitude',/init     ; initialize 
       plot,time,alt,xtitle=tlab,title='Altitude',ytitle='meters'
       sprite,time,alt,xtitle=tlab,ytitle='Altitude'
       plot,time,ch1,xtitle=tlab,title='Ch1 flux'
       sprite,time,ch1,ytitle='Ch1 flux'  ; note xtitle not set
       plot,time,ch2,xtitle=tlab,title='Ch2 flux'
       sprite,time,ch2,ytitle='Ch2 flux'  ; note xtitle not set
       loadct,5
       sprite,color=150

; You can also have two sprites in one plot frame:

       !p.multi=[0,1,2]
       w8x11
       y2=randf(10000,3) & x1=indgen(10000)
       y1=y2+.5*randf(10000,2)
       !p.font=-1
       plot,x1,y1  ,xtitle='time',ytitle='ch1 and ch2 flux'
       sprite,x1,y1,xtitle='time',ytitle='ch1 flux',/init      ; initialize 
       oplot,x1,y2,li=3
       sprite,x1,y2,ytitle='ch2 flux' 
       sprite,color=150

 
 AUTHOR:   Paul Ricchiazzi                       2 March 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\sprite.pro)


SP_BESELJ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SP_BESELJ
 VERSION:
		4.0
 PURPOSE:
		Calculates spherical Bessel functions of the first kind, j_n(x).
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = SP_BESELJ( X, N)
 INPUTS:
	X
		Numeric, otherwise arbitrary.
	N
		Nonnegative scalar.  Should be integer (if not then rounded downwards
		to an integer on input.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the values of the spherical Bessel function j_n(x), which is
		related to the standard Bessel function J by
			j_n(x) = sqrt(pi/(2*x))*J_(n+1/2) (x)
		The result is of the same form and type as the input (but no lower then
		FLOAT.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than the restriction on N mentioned above.
 PROCEDURE:
		Uses a combination of modified series expansion (for small values of X
		and recursion for large X.  The transition between the two regions
		occurs in the vicinity of |X| ~ N.
		Warning:  for large values of N small inaccuracies may occur in the
		vicinity of the transition region.  These are usually to small to be
		noticed, though.
		Calls CAST and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 5-SEP-1995 by Mati Meron.
		Modified 20-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\sp_beselj.pro)


SP_BESELY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SP_BESELY
 VERSION:
		4.0
 PURPOSE:
		Calculates spherical Bessel functions of the first kind, y_n(x).
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = SP_BESELY( X, N)
 INPUTS:
	X
		Numeric, otherwise arbitrary.
	N
		Nonnegative scalar.  Should be integer (if not then rounded downwards
		to an integer on input.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the values of the spherical Bessel function y_n(x), which is
		related to the standard Bessel function Y by
			y_n(x) = sqrt(pi/(2*x))*Y_(n+1/2) (x)
		The result is of the same form and type as the input (but no lower then
		FLOAT.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than the restriction on N mentioned above.
 PROCEDURE:
		Recursion, using calculated values of y_0 and y_1.
		Calls CAST and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 5-SEP-1995 by Mati Meron.
		Modified 20-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\sp_besely.pro)


SQUARE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SQUARE
 VERSION:
		4.0
 PURPOSE:
 		Draws a SQUARE, based on a length of a side and a given location of a
		corner.  The square is drawn so as to appear visually as a square, even
		if the lengths of the sides in DATA coordinates differ.  The drawing is
		done in the currently defined plot area.  Alternatively, a *SHAPE*
		representation (see SHAPE_VER for definition) of the square may be
		returned through the SHAPEOUT keyword. DATA coordinates are used unless
		one of the keywords /DEVICE or /NORMAL is set.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		Square, {BASE = BAS, HEIGHT = HEI, SIDE = SID}, $
		{LL_CORNER = LLC, LR_CORNER = LRC, UR_CORNER = URC, UL_CORNER = ULC}, $
		[optional keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None
 KEYWORD PARAMETERS:
	BASE												|
		Length of side, measured in the X-direction.	| One
	SIDE												| and only one
		Same as BASE.									| must be
	HEIGHT												| provided
		Length of side, measured in the Y-direction.	|

	LL_CORNER												|
		2dim vector, coordinates of the lower left corner.	|
	LR_CORNER												| One
		2dim vector, coordinates of the lower right corner.	| and only one
	UR_CORNER												| must be
		2dim vector, coordinates of the upper right corner.	| provided
	UL_CORNER												|
		2dim vector, coordinates of the upper left corner.	|

	WIGGLE
		Optional.  Allows to change the sides of the square from straight to
		sinusoidal lines.  Can be given as scalar, 2D or 3D vector.  The first
		parameter (mandatory) is number of periods, the second and third
		(optional) are amplitude and phase, respectively (see the routine
		WIGGLINE for explanation).  Number of periods is always rounded to
		nearest integer or half integer and the phase is rounded to 0 or half
		period.  Default for amplitude is 1, for phase is 0.
	/FILL
		Switch.  Causes the square to be filled with a solid pattern.
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable, on return the variable
		contains the *SHAPE* representation of the square.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		SQUARE passes the extra keywords through _EXTRA, without checking.
		Therefore, some care must be exercised.
 PROCEDURE:
		Uses calls to COO_CONV, ONE_OF and SHAPE_COCON from MIDL.  Converts all
		parameters to device coordinates and calls RECTAN (also from MIDL) to
		do the actual plotting.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Modified 15-DEC-1993 by Mati Meron.  Now SQUARE takes advantage of the
		keyword inheritance property and accepts all IDL plotting keywords.
		Modified 25-JUL-1999 by Mati Meron.  Added keywords NO_SHOW and
		SHAPEOUT.
		Modified 20-SEP-1999 by Mati Meron.  Added possibility of wiggly
		borders, through the keyword WIGGLE.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\square.pro)


SQUNEXP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SQUNEXP
 VERSION:
		4.0
 PURPOSE:
		Calculates a "flattened" exponent.  See definition below.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = SQUNEXP( X, N)
 INPUTS:
	X
		Numeric, otherwise arbitrary.  However, negative inputs may create
		overflows and/or divergences.
	N
		Nonnegative scalar.  Should be integer (if not then rounded downwards
		to an integer on input.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the values of a "flattened negative exponent, defined by

			SQUNEXP(X,N) = exp(-X)*sum_(0 to N)(X^K)/K!

		The result is of the same form and type as the input (but no lower then
		FLOAT.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than the restriction on N mentioned above.
 PROCEDURE:
		Clenshaw recursion with renormalization.
		Calls CAST and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 25-OCT-1995 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\squnexp.pro)


SQUNORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SQUNORM
 VERSION:
		4.0
 PURPOSE:
		Calculates a "flattened" Gaussian.  See definition below.
 CATEGORY:
		Mathematical function.
 CALLING SEQUENCE:
		Result = SQUNORM( X, N)
 INPUTS:
	X
		Numeric, otherwise arbitrary.  However, negative inputs may create
		overflows and/or divergences.
	N
		Nonnegative scalar.  Should be integer (if not then rounded downwards
		to an integer on input.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the values of a "flattened" Gaussian, defined by

		SQUNORM(X,N) = C*exp(-X^2/(2*D^2))*sum_(0 to N)((X^2/(2*D^2))^K)/K!

		Where the constants C, D, given by:

			C = sqrt((2*N+3)/(6*PI))*2^(2*N)*(N!)^2/(2*N+1)!

			D = sqrt(3/(2*N+3))

		are chosen so as to make the integral and the variance of the function
		equal 1 (especially for N=0 the standard Normal distribution is
		obtained).

		The result is of the same form and type as the input (but no lower then
		FLOAT.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None other than the restriction on N mentioned above.
 PROCEDURE:
		Calculates the mormalization constants and calls SQUNEXP.  Also calls
		CAST, DEFAULT and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 25-OCT-1995 by Mati Meron.
		Modified 15-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\squnorm.pro)


SRVADD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SRVADD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Add velocity 3-vectors according to special relativity

 MAJOR TOPICS:
   Physics, Geometry

 CALLING SEQUENCE:
   U0 = SRVADD(U1, V)

 DESCRIPTION:

  The function SRVADD performs addition of velocity 3-vectors
  according to special relativity.

  Consider two inertial coordinate frames.  Frame "0" is a "lab" or
  rest frame.  Frame "1" is a "rocket" or moving frame, moving at
  velocity V with respect to the lab frame.  The velocity V is
  allowed to be an arbitrary 3-vector.

    * An observer in the rocket frame sees a body moving at velocity U1.

    * An observer in the lab frame sees the same body moving at
      velocity U0.

    * This function solves for U0 in terms of V and U1.

  U1 and V are allowed to be 3xN arrays, which means more than one
  vector can be computed in a single call.  If the dimensions of
  either U1 or V are 3x1, then it will be expanded to match the
  dimensions of the other vector.  This simulates addition by a
  "scalar" vector.  Because V can be a 3xN array, this means that
  multiple "rocket" frames can be computed at one time.

  NOTE: Velocities passed to SRVADD are measured as a *fraction of
        the speed of light*.  Therefore, if the velocities are
        measured in some physical units, and CLIGHT is the speed of
        light in those same units, then the following statement:

           U0 = SRVADD(U1/CLIGHT, V/CLIGHT)*CLIGHT

        will compute the velocity U0, also in the same units.


  The formula for computing the velocity in the lab frame is:

         ( (1-1/GAMMA)*(U1 . VUNIT)*VUNIT + U1/GAMMA + V )
    U0 = -------------------------------------------------
                           (1 - U1 . V)

  where 
    GAMMA is the Lorentz factor = 1/SQRT(1 - |V|^2)
    VUNIT is the unit vector in the direction of V, = V/|V|
    "." is the vector dot product

  [ IDL notation is not strictly adhered to in this formula, for
  clarity of presentation. ]


 INPUTS:

   U1 - 3-vector or 3xN array, the velocity of a body as seen in the
        rocket frame (frame 1).  The velocity is normalized such that
        the speed of light is 1.


   V - 3-vector or 3xN array, the velocity of the rocket frame as
       seen by an observer in the lab.  The velocity is normalized
       such that the speed of light is 1.

 RETURNS:

   A 3xN array, containing the velocity of the body as seen in the
   lab frame.  The velocity is normalized such that the speed of
   light is 1.

 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   IDL> print, srvadd([0.1d,0,0],   [0.5d,0,0])
         0.56504883       0.0000000       0.0000000

   Adds velocities of 0.1 and 0.5 times the speed of light.  The
   result is slightly less than the arithmetic sum.


   IDL> print, srvadd([0.,0.1,0],[0.5d,0,0])
         0.50000000     0.086602542       0.0000000

   Adds velocities in two orthogonal directions.  Demonstrates the
   relativistic aberration of velocities (i.e., velocities in the
   perpendicular direction are affected).


 MODIFICATION HISTORY:
   Written, 28 Jan 2002, CM
   More documentation, 29 Jan 2002, CM

  $Id: srvadd.pro,v 1.2 2002/02/03 17:30:32 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\srvadd.pro)


SRVDOPP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SRVDOPP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute relativistic doppler shift (arbitrary velocity & photon dir.)

 MAJOR TOPICS:
   Physics, Geometry

 CALLING SEQUENCE:
   NU1_NU0 = SRVDOPP(U0, V)

 DESCRIPTION:

  The function SRVDOPP computes the relativistic doppler shift
  between two inertial reference frames.

  Consider two inertial coordinate frames.  Frame "0" is a "lab" or
  rest frame.  Frame "1" is a "rocket" or moving frame, moving at
  velocity V with respect to the lab frame.  The velocity V is
  allowed to be an arbitrary 3-vector.

    * An observer in the lab frame sees a photon of frequency NU0
      propagating in the direction U0. (U0 is a unit 3-vector)

    * An observer in the rocket frame observes the same photon with
      frequency NU1.

    * This function computes the ratio NU1 / NU0.

  U0 and V are allowed to be 3xN arrays, which means more than one
  set of values can be computed in a single call.  If the dimensions
  of either U0 or V are 3x1, then it will be expanded to match the
  dimensions of the other vector.

  NOTE: Velocities passed to SRVDOPP are measured as a *fraction of
        the speed of light*.

  The formula for computing the relativistic doppler shift is:
              
    NU1_NU0 =  (1 - U0 . V) * GAMMA
              
  where 
    GAMMA is the Lorentz factor = 1/SQRT(1 - |V|^2)
    "." is the vector dot product

  [ IDL notation is not strictly adhered to in this formula, for
  clarity of presentation. ]


 INPUTS:

   U0 - 3-vector or 3xN array, the unit vector of the photon
        propagation direction, as seen in the lab frame.

   V - 3-vector or 3xN array, the velocity of the rocket frame as
       seen by an observer in the lab.  The velocity is normalized
       such that the speed of light is 1.

 RETURNS:

   A N-vector giving the ratio, NU1/NU0, which is the ratio of the
   frequency observed in the rocket frame to the frequency seen in
   the lab frame.

 KEYWORD PARAMETERS:

   NONE

 EXAMPLE:

   IDL> RATIO = SRVDOPP([-1d,0,0], [0.1d,0,0])

   A photon of frequency NU0 is moving along the -x axis in the lab
   frame; a rocket observer is moving with speed 0.1 c along the +x
   axis.  NU0 * RATIO is the frequency seen by the rocket observer.


   IDL> RATIO = SRVDOPP([0,-1d,0], [0.1,0,0])

   The observer is the same, but the photon is moving along the -y
   axis.  NU0 * RATIO is the frequency seen by the rocket observer.
   This is the relativistic transverse doppler shift.


 MODIFICATION HISTORY:
   Written, 05 May 2002, CM
   Documentation, 12 May 2002, CM

  $Id: srvdopp.pro,v 1.2 2002/05/13 06:44:17 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\srvdopp.pro)


STATE_NAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STATE_NAME
 PURPOSE:
       Return name of state given 2 letter abbreviation.
 CATEGORY:
 CALLING SEQUENCE:
       name = state_name(ss)
 INPUTS:
       ss = 2 letter abbreviation of state.  in
 KEYWORD PARAMETERS:
       Keywords:
         /UNDER  means replace spaces in name with underscore (_).
         /DASH   means replace spaces in name with dash (-).
         /LOWER  means all lower case.
         /UPPER  means all upper case.
         /SQUEEZE  means squeeze out all spaces.
 OUTPUTS:
       name = full name of state.            out
         If called with no arguments all 2 letter abbreviations
         are returned.
 COMMON BLOCKS:
       state_name_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Jan 27

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\state_name.pro)


STATISTICX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   statisticx

 PURPOSE:
   This function calculates a small statistical survey of a given array

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = STATISTICX(array)

 INPUTS:
   array: data field

 OPTIONAL INPUTS:

 Keyword PARAMETERS:
   MISSING:    missing value to be ignored
   NOARRAY:    returns a string rather than a string array
   FORMAT:     format for numbers

 OUTPUTS:
   String array containing the statistics

 EXAMPLE:
   printtab, statistics(FINDGEN(100))

 REVISION HISTORY:
       Written         Theo Brauers, June 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\statisticx.pro)


STATUSLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   STATUSLINE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Maintain a one-line status line on a VT100-compatible terminal. (Unix)

 MAJOR TOPICS:
   Text Output, Terminal.

 CALLING SEQUENCE:
   STATUSLINE, string, column, LENGTH=length, [/CLOSE,]
      [/CLEAR,] [/LEFT,] [/RIGHT,] [/QUIET,] [/ENABLE,] [/DISABLE]

 DESCRIPTION: 

   STATUSLINE maintains the current line of a VT100- or
   ANSI-compatible terminal, usually as a status line.

   Programs that run for extended periods of time can inform the user
   of the status of the computation by printing vital information.
   Instead of cluttering the console by using the PRINT procedure,
   which uses a new line with each call, STATUSLINE will re-use the
   same line.  This can make a cleaner interface.

   STATUSLINE interacts directly with the Unix terminal device,
   sending VT100-compatible cursor commands.  As a side effect it
   opens the terminal device /dev/tty and allocates a logical unit
   number.  Picky programmers should call STATUSLINE, /CLOSE to close
   the file unit.

   Procedures that finish their computation, or wish to make normal
   output to the console should first clear the terminal line with
   STATUSLINE, /CLEAR.  This will ensure that the console is
   uncluttered before printing.

   By default, STATUSLINE enables output for terminal types vt100,
   vtnnn, xterm, dec, or ansi.  *No* output appears on other
   terminals.  You can enable it explicitly by calling STATUSLINE,
   /ENABLE, and disable it by calling STATUSLINE, /DISABLE.

 INPUTS:

   STRING - A string to be placed on the current line.

 OPTIONAL INPUTS:

   COLUMN - The starting column number, beginning with zero.
            Default: zero.

 INPUT KEYWORD PARAMETERS:

   LENGTH - the record length, an integer.  Strings longer than this
            length will be truncated.  
            Default: strlen(STRING)

   CLEAR - if set, clear the current line to the end.  Control
           returns immediately (i.e., no output is made).

   LEFT  - if set, then left justify the string within the record.
           If the string is longer than the record length, then the
           leftmost portion of the string is printed.
           The Default (if /RIGHT is not given).

   RIGHT - if set, then right jusfity the string within the record.
           If the string is longer than the record length, then the
           rightmost portion of the string is printed.

   QUIET - if set, then no output is made (for this call only).

   NOCR - if set, no carriage return operation is performed after
          output.  This also has the side effect that in subsequent
          calls, column "0" will not cause the cursor to move.
          Default: cursor returns to column 0 after each output.

   ENABLE - if set, then permanently enable output by STATUSLINE.
            Normally STATUSLINE automatically enables output only for
            vt100-compatible terminals.  By setting /ENABLE, you
            override this automatic test.  However, /QUIET will
            still override ENABLE in an individual call.

   DISABLE - if set, then permanently disable output by STATUSLINE.
             When disabled, no output is ever produced.  Output can
             only be re-enabled again by using the /ENABLE flag.

   CLOSE - if set, instruct STATUSLINE to close the terminal device
           logical unit number.  Users should perform this operation
           when the computation has finished so that the terminal
           device is not left dangling open.  If, at a later time,
           STATUSLINE is called again, the terminal device will be
           re-opened.

 OUTPUTS:
   NONE

 SEE ALSO:
   PRINT, PRINTF
   PRINTLOG - to maintain transcript of IDL output

 MODIFICATION HISTORY:
   Written, CM, 1997-1998
   Documented, CM, Sep 1999
   Added NOCR keyword, CM, 28 Oct 1999
   Doesn't crash if can't write to TTY.  Returns silently.  CM, 16
     Nov 1999.
   Added PRINTLOG to "SEE ALSO", CM, 22 Jun 2000
   Keyword QUIET now causes earlier exit; catch errors in the CLEAR
     case, CM, 12 Oct 2001

  $Id: statusline.pro,v 1.4 2001/10/13 17:52:46 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\statusline.pro)


STEPIND

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  stepind

 PURPOSE:  step through a sequence of nested indicies

 USEAGE:   result=stepind,ic,n1,i1,n2,i2,n3,i3,n4,i4,n5,i5,n6,i6

 INPUT:    

   ic      one dimensional index.  decremented or incrimated by
           LMB or MMB, respectively.  if the starting value of ic
           ic is -1,  no delay occurs before the plot

   n1      number of elements in first dimension
   i1      index for first dimension
   n2      number of elements in second dimension
   i2      index for second dimension

   etc
           note: If any of  n2,n3,n4,.. are set then the plot window is
                 divided into N regions where N is the number of dimensions.  
                 The position of the button click in the plot window
                 determins which index is incremented. 
                 

                 

 KEYWORD INPUT

   nowait  STEPIND returns immediately if button is in down state

   step    if set STEPIND does not pause between invocations.  The 
           step index is incrementated between each call.  The sign
           of the incriminate can by toggled by clicking in the window. 
   
 OUTPUT:
   result  logical flag, 0 if RMB is pressed, 1 otherwise

  
 EXAMPLE:  

  ic=-1 &                       & x=5*(findgen(360)-180)*!dtor 
  e=exp(-(x/(360*!dtor))^2)     & phs=10.*!dtor

 while stepind(ic,36) do plot,x,e*sin(x+ic*phs),title=string(ic*phs)

 while stepind(ic,36,/nowait) do plot,x,e*sin(x+ic*phs),title=string(ic*phs)

 s=1
 while stepind(ic,36,s=s) do plot,x,e*sin(x+ic*phs),title=string(ic*phs)
 
;;;

 ic=-1
 !p.multi=0
 x=findrng(-5,5,100) & fmt='("f(",i1,", ",i2,")")'
 while stepind(ic,10,i1,5,i2) do plot,x,exp(-(x/(1.+i1))^2)*cos(i2*x),titl=string(f=fmt,i1,i2)

 AUTHOR:   Paul Ricchiazzi                        22 Sep 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\stepind.pro)


STEP_CT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:       step_ct

 USEAGE:        step_ct, range, inc, cs, nbotclr=nbotclr
                step_ct, /off

 PURPOSE:       Discreetizes color scale at given numerical intervals.
                NOTE:  the rgb color value of the top color scale index is
                       not changed.  

 INPUT:   

     range      array or vector which specifies range of physical values, 
                e.g., [amin,amax]

     inc        number scale increment

     cs         a floating point number between -1.0 to +1.0 that
                translates the color table a fraction of a color step
                higher (cs > 1) or lower (cs < -1).  It has its most
                noticeable effect when the number of steps is small,
                because in this case a single step is usually a
                significant change in color value.  (default = 0)

    nbotclr     starting color index

     off        restore original unquantized color table, 
                no other input is required when this keyword is set

 EXAMPLE
                loadct,0
                tvlct,r,g,b,/get
                plot,r,xmargin=[10,20],/yst=1
                color_key,range=[0,255],inc=20
                range=[0,255]
                inc=20
                step_ct,range,inc
                tvlct,r,g,b,/get
                oplot,r,li=3


 AUTHOR:        Paul Ricchiazzi    oct92 
                Earth Space Research Group
                UCSB
 REVISIONS:
 21sep93: fixed case of range spanning zero (see shiftup)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\step_ct.pro)


STEXT_XYP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STEXT_XYP
 PURPOSE:
       Return stroke text plot arrays.
 CATEGORY:
 CALLING SEQUENCE:
       XYP = STEXT_XYP(TXT)
 INPUTS:
       TXT = text string to plot.         in
 KEYWORD PARAMETERS:
       Keywords:
         X = Text X location in data coorinates (def=0).
         Y = Text Y location in data coorinates (def=0).
         SIZE = Text size (def = 1).
           Size 1 gives text 7 units high.
         ANG = Text angle (deg CCW, def=0).
         JUST = justification code (1-9, def=7).
           The justification code specifies the text
           reference point as follows:
           1     2     3
           4     5     6
           7     8     9
           So if JUST = 1 then X,Y is upper left corner of text,
           if JUST = 7 then X,Y is the lower left corner of text.
           This applies only to line 1 of a multiline text string.
         XFACT = size factor in X (def=1). Use to change shape.
 OUTPUTS:
       XYP = plot array:                  out
           X=XYP(*,0), Y=XYP(*,1), P=XYP(*,2)
           Then PLOTP, X, Y, P
 COMMON BLOCKS:
       STEXT_COMMON
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Oct, 1988.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\stext_xyp.pro)


STR2BYTE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STR2BYTE (function)

 PURPOSE:
        This function converts a string or string array into a byte
        array with fixed length for output in binary data files. With
        the fillchar keyword it may also be useful to generate
        "formatted" strings for output (i.e. String(Str2Byte(...)) ).

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        bstr = STR2BYTE(string [,length])

 INPUTS:
        STRING -> The string(s) to be converted

        LENGTH -> Length of the byte vector. Default is to use the 
            maximum length of the strings. Strings shorter than
            length will be filled with blanks (32B), longer strings
            will be truncated. 

 KEYWORD PARAMETERS:
        FILLCHAR -> Character to be used for filling byte arrays to
            the specified length. Default is blank (32B). 

 OUTPUTS:
        A byte array of the specified length * number of elements
        passed in the STRING argument.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        ; write a 80 character string into a binary file
        openw,lun,'test.dat',/F77_UNFORMATTED,/get_lun
        writeu,lun,str2byte('Test string',80)
        free_lun,lun

 MODIFICATION HISTORY:
        mgs, 24 Aug 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source
                          - pretty much a rewrite
                          - str argument may now be array
                          - added fillchar keyword
                          - stricter error handling

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\str2byte.pro)


STR2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	str2js

 PURPOSE:
       This function translates a string of time information (hh:mm:ss dd.mm.yyyy ms) into julian seconds.

 CATEGORY:
	TIME

 CALLING SEQUENCE:
       result=str2js(time_string)

 INPUTS:
       time_string: a string of the format: hh:mm:ss dd.mm.yyyy ms

 OUTPUTS:
       The result is time in julian seconds

 EXAMPLE:
       print,str2js('13:13:13 01.01.1997')
       -94560407.

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer 8. May 1997
                       R.Bauer 9.Oct. 1997 zeit_js=dtime2js(datstr=datstr,/char) replaced by zeit_js=dtime2js(datstr)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\str2js.pro)


STRAIGHT_SORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   straight_sort

 PURPOSE:
   sort an array leaving the original order of equal entries unchanged

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result= STRAIGHT_SORT(Array, [/REMOVE_MULTIPLES], [/REVERSE])

 INPUTS:
   Array:  array to be sorted 1-d

 KEYWORD PARAMETERS:
   REVERSE:            if set return reverse sorted array
   REMOVE_MULTIPLES:   if set the uniq function is applyed

 OUTPUTS:
   an index field to the input array

 EXAMPLE:

 REVISION HISTORY:
   Written     originally by Franz Rohrer, Nov 1998
   Modified    Theo Brauers, Nov 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\straight_sort.pro)


STRARR2BYT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRARR2BYT
 PURPOSE:
       Pack a string array into a byte array
 CATEGORY:
 CALLING SEQUENCE:
       strarr2byt, tarr, barr
 INPUTS:
       tarr = text string array.      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       barr = byte array with text.   out
 COMMON BLOCKS:
 NOTES:
       Notes: The format of barr is:
         byte 0: NUM = Number of strings (255 max).
         byte 1: MAX = Length of longest string (255 max).
         byte 2: LEN1 = Length of 1st string.
         byte 3: C1_0 = 1st char of 1st string.
         byte 4: C1_1 = 2nd char of 1st string.
         byte 5: C1_2 = 3rd char of 1st string.
         . . .
         byte x1 (2+LEN1): C1_last = last char of 1st string.
         byte x1+1: LEN2 = Length of 2nd string.
         . . .
         To last char of last string in tarr.
         NUM, MAX, LEN1, C1, C2, ..., Clast, LEN2, C1, C2, ...
       
         Advantage: saves space, allows storing text arrays of
         various lengths.  See also byt2strarr, the inverse.
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 29

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strarr2byt.pro)


STRCHEM (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRCHEM (function)

 PURPOSE:
        This function inserts Hershey formatting characters for
        superscripts and subscripts for numbers and special 
        characters ('x', 'y') in strings that supposedly contain
        names of chemical species. 

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = STRCHEM( STR [,keywords] )

 INPUTS:
       STR      -> The input string containing the name of the
                   chemical species (e.g. 'NOx', 'H2O', CxO2, etc, ) 

 KEYWORD PARAMETERS:
       /SUB     -> Will cause numbers and special characters to 
                   be subscripted.  This is the default.

       /SUPER   -> Will cause numbers and special characters to
                   be superscripted.

       SPECIALCHARS -> a string with characters that shall be sub- or 
                   superscripted. Defaults are '0123456789xyXY' for
                   /SUB and '+-0123456789' for /SUPER

       PROTECT  -> internal keyword used to protect certain characters
                   from being super or subscripted. May be necessary
                   to use explicitely if you want to use this
                   function twice to apply super and subscripts
                   (e.g. ions). See example 3 below. 
                   This keyword may only be used for scalar strings.

       /TRIM     -> perform a strtrim( ,2) on the result

 OUTPUTS:
       Returns a string with formatting characters included

 SUBROUTINES:
       None

 REQUIREMENTS:
       Example 3 uses STRWHERE function.

 NOTES:

 EXAMPLE:
       ; (1)
       print,strchem('C2H5O2 [pptv]')

       ; prints "C!l2!nH!l5!nO!l2!n [pptv]"

       ; (2)
       print,strchem(strchem('NH4+',/sub),/super,special='+-')

       ; prints NH!l4!n!u+!n.

       ; (3)
       s0 = '(H2O2)2'   ; supposed to be H2O2 squared
       protect = strlen(s0)-1   ; protect last character
       s1 = strchem(s0,protect=protect)
       s2 = strchem(s1,/super,protect=protect)
       print,s1,'->',s2

       ; prints (H!l2!nO!l2!n)2->(H!l2!nO!l2!n)!u2!n
       ; without protect the "square" would have been subscripted

 MODIFICATION HISTORY:
        bmy, 01 Jun 1998: VERSION 1.00
        mgs, 02 Jun 1998: VERSION 1.10 - rewritten
        mgs, 11 Jun 1998: 
            - removed IS_ION keyword
            - changed default specialchars for SUPER
        mgs, 22 Sep 1998:
            - added TRIM keyword
        mgs, 26 Aug 2000: 
            - changed copyright to open source
            - now allows for string arrays as argument 
            - bug fix: used wrong default for specialchars when
              neither sub nor super were explicitly set.             

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strchem.pro)


STRCNT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRCNT
 PURPOSE:
       Count number of occurrences of a substring in a string.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       num = strcnt(strn, substring, [pos])
 INPUTS:
       string    -- The string in which to count occurences.     in
       substring -- The substring to count occurrences of.       in
       pos       -- the position at which to begin the search.   [in]
                    If not supplied, start at beginning of
                    string.
 KEYWORD PARAMETERS:
       /HELP     -- Print useful message and return.
 OUTPUTS:
       num       -- Number of occurances of substring in string. out
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       Overlapping occurances are not counted separately.  For
       example, counting occurances of 'bb' in 'blah bbb' returns one
       occurance. 
 EXAMPLE:
 MODIFICATION HISTORY:
       $Id: strcnt.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
       $Log: strcnt.pro,v $
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Added fast processing using BYTE arrays if we are counting occurences of
       a single character.  Added error handling.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\strcnt.pro)


STRDATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRDATE

 PURPOSE:
        This functions returns a date string in a standard
        format. The default format is US: 'mm/dd/yyyy hh:MM',
        optionally you can select the german format 'dd.mm.yyyy
        hh:MM', or a short form without the time, or a "sortable"
        form that begins with the year.

 CATEGORY:
        date and time

 CALLING SEQUENCE:
        result=STRDATE([DATE][,keywords])

 INPUTS:
        DATE --> (optional) Either a up to 6 element array
            containing year, month, day, hour, minute, and secs
            (i.e. the format returned from BIN_DATE) or
            a structure containing at least year, month, and day,
            optionally also hour, and minute. Finally, date can be a
            date string in "standard" format as returned by
            SYSTIME(0). If DATE is omitted, STRDATE will
            automatically return the current system time. 

 KEYWORD PARAMETERS:
        SHORT --> omit the time value, return only date

        SORTABLE --> will return 'YYYY/MM/DD HH:MM' 

        GERMAN --> will return 'DD.MM.YYYY HH:MM'

        IS_STRING --> indicates that DATE is a date string rather
            than an integer array. This keyword is now obsolete but kept
            for compatibility.

 OUTPUTS:
        A date string formatted as 'MM/DD/YYYY HH:MM'.
        If SHORT flag is set, the format will be 'MM/DD/YYYY'

 SUBROUTINES:

 REQUIREMENTS:
        Uses chkstru function to test for structure and tags.

 NOTES:
        /GERMAN and /SORTABLE will have effect of SORTABLE but
        with dots as date seperators.
        No error checking is performed on input date (e.g. 31.02.2000)

 EXAMPLE:

 MODIFICATION HISTORY:
        mgs, 11 Nov 1997: VERSION 1.00
        mgs, 26 Mar 1998: VERSION 1.10 
            - examines type of DATE parameter and accepts structure
              input.
        mgs, 26 Aug 2000: - changed copyright to open source
            - now uses chkstru to test for structure type and tags

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strdate.pro)


STREP[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STREP
 PURPOSE:
       Edit a string by position. Precede, Follow, Replace, Delete.
 CATEGORY:
 CALLING SEQUENCE:
       newstring = strep(string,cmd,p,ss,[iflg])
 INPUTS:
       string = string to edit.                               in
       cmd = edit command:                                    in
         'P' = precede position p with substring ss.
         'F' = follow position p with substring ss.
         'R' = replace text starting at position p
               with text from substring ss.
         'D' = delete N characters starting at
               position p.  The calling sequence for
               this command is slightly different:
               IFLG = STREP(string,'D',p,n,[iflg])
               Where n = number of characters to delete.
       p = character position to use.                         in
           0 = first char.  Any number larger
           than the string length = last char.
       ss = substring to use.  For 'D' command                in
            n is used instead of ss.
 KEYWORD PARAMETERS:
 OUTPUTS:
       iflg = 0 for a successful edit,                        out
       iflg = -1 for an error and no change to string.
       newstring = edited string.                             out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 27 Dec, 1984.
       Converted to SUN 13 Aug, 1989 --- R. Sterner.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strep.pro)


STREP[2]

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  strep

 PURPOSE:  replace all instances of TARGET in STR with REPLACE

 USEAGE:   result=strep(str,target,replace)

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        15 Oct 98
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\strep.pro)


STREQ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		STREQ
 VERSION:
		4.0
 PURPOSE:
		Compares for equality the first LEN characters of STR1, STR2.
		If LEN is 0, or absent, the whole strings are compared.
 CATEGORY:
		String Processing.
 CALLING SEQUENCE:
		Result = STREQ( STR1, STR2 [,LEN] [, keywords])
 INPUTS:
	STR1, STR2
		character strings, mandatory.
 OPTIONAL INPUT PARAMETERS:
	LEN
		Number of characters to compare.  Default is 0, translating to a full
		comparison.
 KEYWORD PARAMETERS:
	/CASEON
		Switch. If set the comparison is case sensitive. Default is ignore case.
	/REVERSE
		Switch.  If set, and LEN provided and non-zero, the comparison is done
		for the last LEN characters of STR1, STR2.
	/WARN
		Switch.  If set, a warning is issued whenever STR1 or STR2 is not a
		character variable.  Default is no warning.
 OUTPUTS:
		1b for equal, 0b for nonequal.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Using DEFAULT and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 10-SEP-2001 by Mati Meron.  Added the keyword REVERSE and
		fixed a bug (providing LEN as a vector of length 1 instead of scalar
		caused errors).

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\streq.pro)


STRESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRESS
 PURPOSE:
       String edit by sub-string. Precede, Follow, Delete, Replace.
 CATEGORY:
 CALLING SEQUENCE:
       new = stress(old,cmd,n,oldss,newss,ned)
 INPUTS:
       old = string to edit.                               in
       cmd = edit command:                                 in
         'P' = precede.
         'F' = follow.
         'D' = delete.
         'R' = replace.
       n = occurrence number to process (0 = all).         in
       oldss = reference substring.                        in
       oldss may have any of the following forms:
         1. s	  a single substring.
         2. s...    start at substring s, end at end of string.
         3. ...e    from start of string to substring e.
         4. s...e   from subs s to subs e.
         5. ...     entire string.
       newss = substring to add. Not needed for 'D'        in
 KEYWORD PARAMETERS:
 OUTPUTS:
       ned = number of occurrences actually changed.       out
       new = resulting string after editing.               out
 COMMON BLOCKS:
 NOTES:
       Notes: oldss and newss may be arrays.
 MODIFICATION HISTORY:
       Written by R. Sterner, 6 Jan, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES --- 23 May, 1988 fixed a bug in SSTYP = 2.
       Converted to SUN 13 Aug, 1989 --- R. Sterner. (FOR loop change).
       --- 8 Dec, 1992 added recursion so that OLDSS and NEWSS may be arrays
       T.J.Harris, University of Adelaide.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\stress.pro)


STRING2JS

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   string2js

 PURPOSE:
   This function converts a string or string array of time into JulianSeconds.
   Many formats are supported. However, all array elements must have the same format.
   This function is inverse to JS2STRING

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=  STRING2JS(date_time)

 INPUTS:
   date_time:   string (see FORMAT keyword for format)

 KEYWORD PARAMETERS:
   NOW:    returns actual time instead

 OUTPUTS:
   julian sec: double

 RESTRICTIONS:
   1.1.70 ... 31.12.69 = 1.1.1970 ... 31.12.2069
   only seperators matter, spaces and zeros ignored
   the string array must contain all entries: 'd.m.y h:m:s'

 EXAMPLE:
   dt=['1.1.95 10:11:03', '1.1.96 1:11:36', '1.1.05 1:11:3']
   jsec=dmyhms2js(dt)

   dt=['1.1.95 10:11', '1.1.96 1:11', '1.1.05 1:11']
   jsec=dmyhms2js(dt, /no_sec)

 REVISION HISTORY:
   Written     Theo Brauers, Nov 1997
   Modified    T.B. bug with array and no_sec removed
               T.B. bug with year  < 1969 removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\string2js.pro)


STRING_IS_NUMBER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	string_is_number

 PURPOSE:
	Test if string represents a meaningful number.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = string_is_number(str)

 INPUTS:
	str: The string to be tested.

 OUTPUTS:
	This function returns 1 if str represents a meaningful number else it returns 0.

 PROCEDURE:
	The string is filtered with respect to the occurence of the allowed characters
	'+-0123456789.ED'. It is considered how often and in which order they occur in the
	string.

 EXAMPLE:
	PRINT, string_is_number('-12.3D+03')		--> 1
	PRINT, string_is_number('-12.3A+03')		--> 0

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 22.03.1999
	26.03.1999: Removed bug if str was string of length 1, e.g. '7'

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\string_is_number.pro)


STRIPSHIFT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRIPSHIFT
 PURPOSE:
       Shift strips of an image in x or y.
 CATEGORY:
 CALLING SEQUENCE:
       out = stripshift(in, ss, sa, flag)
 INPUTS:
       in = input image.                                 in
       ss = size of strip to shift in pixels.            in
       sa = shift array, 1 value for each strip.         in
       flag = optional direction flag. 0=x (def), 1=y.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = resulting shifted image.                    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  19 Apr, 1988.
       R. Sterner, 26 Feb, 1991 --- Renamed from strip_shift.pro
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\stripshift.pro)


STRIP_FN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRIP_FN 

 PURPOSE:
       Return a filename stripped of all directory information.

 CALLING SEQUENCE:
       result = strip_fn(filename)

 INPUTS:
       filename      filename to be stripped.  Can be scalar or vector.

 OPTIONAL INPUTS:

 OUTPUTS:
       stripped filename.  Same type (vector/scalar) as input filename.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     8/12/93

 MODIFICATION HISTORY:
     JAH  8/13/93   Added filename vector capability.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\strip_fn.pro)


STRLENTAB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRLENTAB
 PURPOSE:
       Gives length of a string with tab characters expanded.
 CATEGORY:
 CALLING SEQUENCE:
       len = strlentab(txt)
 INPUTS:
       txt = text string.                 in
 KEYWORD PARAMETERS:
       Keywords:
         TABSIZE=s  # spaces tabs expand to (def=8).
 OUTPUTS:
       len = length of expanded string.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Feb, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strlentab.pro)


STRMATCH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    strmatch

 PURPOSE:    check for string match to a wild card specification

 USEAGE:     result=strmatch(str,spec)

 INPUT:
   str       string
   spec      wild card specification

 OUTPUT:     1 if STR matches SPEC
             0 if STR does not match SPEC

 LIMITATIONS:
             Currently the only wild card character is asterisk, "*"
             which matches 1 or more arbitrary characters.

  
 EXAMPLE:    
             print,strmatch('string','st*ng')      ;  => 1
             print,strmatch('string','*st*ng')     ;  => 0
             print,strmatch('string','*t*ng')      ;  => 1
             print,strmatch('string','st*ng*')     ;  => 0
             print,strmatch('string','st*n*')      ;  => 1

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\strmatch.pro)


STRMATCH2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   strmatch2

 PURPOSE:
   The strmatch2 function compares its search string, which can contain wildcard characters,
   against the input string expression. The result of this function is an index vector of indices that match
   to the input string

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=strmatch2(text,searchstring,[count=count],[_extra=e])

 INPUTS:
   text:     The String to be matched.
   searchstring:  The search string, which can contain wildcard characters as discussed above.

 KEYWORD PARAMETERS:
   _extra: to submit keywords to STRMATCH()

 OUTPUTS:
  The result of this function is an index vector of indices that match to the input string

 EXAMPLE:
   text=['Anton:','Anton2:','Anton3:']
   result=strmatch2(text,'Anton')
   print,result
   -1

   result=strmatch2(text,'Anton:')
   print,result
   0

   result=strmatch2(text,'Anton?:')
   print,result
   1           2

   result=strmatch2(text,'A*')
   print,result
   0           1           2

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),2000-Mar-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\strmatch2.pro)


STRMATCH_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		STRMATCH_MM
 VERSION:
		4.1
 PURPOSE:
		Compares the string STR with the strings in the array LIST.  Comparison
		is done for the first LEN characters, or all of them if LEN is 0.  If a
		match is found, STR is replaced by the full string from the list (or
		if the keyword /ALL is set, by an array containing all the matching
		strings).
 CATEGORY:
		String Processing.
 CALLING SEQUENCE:
		Result = STRMATCH_MM( STR, LIST [, LEN] [, keywords])
 INPUTS:
	STR
		Character string.
	LIST
		Character array.
 OPTIONAL INPUT PARAMETERS:
	LEN
		The number of characters to compare.  Default is full comparison.
 KEYWORD PARAMETERS:
	/CASEON
		Switch. If set the comparison is case sensitive. Default is ignore case.
	/REVERSE
		Switch.  If set and LEN provided and non-zero, the comparison is done
		for the last LEN characters.
	/ALL
		Switch.  If set, returns the indices of all the matching elements.
	/EXCLUDE
		Switch.  If set returns the indices of all the non-matching elements.
	NUMBER
		Optional output, see below.
 OUTPUTS:
		Returns the index of the first match, or -1l if no match is found.
		Optionally (see keyword ALL above) returns all the matching indices,
		or non-matching indices when the keyword EXCLUDE is set.
 OPTIONAL OUTPUT PARAMETERS:
	NUMBER
		The name of a variable to receive the number of matches found.  Note
		that unless the keyword ALL is set, NUMBER can only yield 0 or 1.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None other then the substitution in STR.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the function STREQ from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron, as STRMATCH.
		Modified 20-NOV-1993 by Mati Meron.  Added keyword ALL.
		Modified 11-OCT-1997 by Roger J. Dejus.  Added keyword EXCLUDE.
		Renamed 25-SEP-1999 to STRMATCH_MM in order to avoid naming conflicts
		with RSI routines.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.
		Modified 25-AUG-2001, added keyword NUMBER.
		Modified 10-SEP-2001, added keyword REVERSE.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\strmatch_mm.pro)


STRMID2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   strmid2

 PURPOSE:
   This function adds array functionality to RSI's strmid

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = STRMID2(Expr, First, [Length])

 INPUTS:
   Expr:  Input string or string array
   First:  pos to start output string

 OPTIONAL INPUTS:
   Length:  length of output

 OUTPUTS:
   This function returns a supstring of expr

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-Nov-16

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\strmid2.pro)


STRPARSE_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		STRPARSE_MM
 VERSION:
		4.0
 PURPOSE:
		Parses the string LINE using the characters in DELIM as delimiters.
		Puts individual pieces into consecutive locations in LIST.
 CATEGORY:
		String Processing.
 CALLING SEQUENCE:
		Result = STRPARSE_MM( LINE, DELIM [, LIST])
 INPUTS:
	LINE
		Character string.
	DELIM
		Character string.  Each Character of DELIM is used as a delimiter.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the number of pieces found minus one i.e. the index of the last
		element of LIST if LIST is provided.  If LINE is a null string or not a
		string, the function returns -1l.
 OPTIONAL OUTPUT PARAMETERS:
	LIST
		Character array.  If name is provided, the pieces of LINE resulting
		from the parsing process are returned in consecutive locations in LIST.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Using the function TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron as STRPARSE.
		Renamed 25-SEP-1999 to STRPARSE_MM in order to avoid naming conflicts
		with RSI routines.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\strparse_mm.pro)


STRPOS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   strpos2

 PURPOSE:
   This function adds array functionality to RSI's strpos

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = STRPOS2(Expr, Search, [Pos])

 INPUTS:
   String:  Input string or string array
   Search:  Search string or string array

 OPTIONAL INPUTS:
   Pos:    Start position (skalar or array)

 OUTPUTS:
   This function returns the position of search found in expr

 EXAMPLE:
   IDL> print, strpos2(['abcdef','abcdef'], 'a', [1,0])
          -1           0
   IDL> print, strpos2(['abcdef','abcdef'], 'b', [1,0])
           1           1
   IDL> print, strpos2(['abcdef','abcdef'], 'b', [1,2])
           1          -1
   IDL> print, strpos2(['abcdef','abcdef'], ['b','e'], [1,2])
           1           4
   IDL> print, strpos2(['abcdef','abcdef'], ['b','e'], [5,2])
          -1           4

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1999-Nov-16

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\strpos2.pro)


STRREPL (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRREPL (function)

 PURPOSE:
        Replace all occurences of one character in a string
        with another character. The character to be replaced
        can either be given as string of length 1 or as an
        index array containing the character positions
        (see strwhere). This function also works for string arrays.

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = STRREPL(str, fromchar, tochar [,/IGNORECASE])

 INPUTS:
        STR      -> the string to be changed

        FROMCHAR -> either: a string of length 1 (the character to 
                        be replaced)
                    or: an index array with the character positions

        TOCHAR   -> replacement character

 KEYWORD PARAMETERS:
        IGNORECASE -> if set, fromchar will be treated case-insensitive
              (only if fromchar is a character)
        FOLD_CASE -> same thing but following IDL naming (e.g. StrMatch)

 OUTPUTS:
        A string of same length as the input string

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        Uses SIZE(/TYPE) available since IDL 5.2

 EXAMPLES:
        ; Convert a Unix filename to Windows
        ufile = '/usr/local/idl/lib/test.pro'
        wfile = 'c:' + strrepl(ufile,'/','\')
        print,wfile
        ; prints "c:\usr\local\idl\lib\test.pro"

        ; Use with index (uses strwhere function)
        a = 'abcdabcdabcd'
        index = [ strwhere(a,'a'), strwhere(a,'b') ] > 0
        print,strrepl(a,index,'#')
        ; prints  "##cd##cd##cd"

 MODIFICATION HISTORY:
        mgs, 02 Jun 1998: VERSION 1.00
        mgs, 24 Feb 2000: - rewritten
                          - now accepts character argument
                          - added IGNORECASE keyword
        mgs, 26 Aug 2000: - changed copyright to open source
                          - added FOLD_CASE keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strrepl.pro)


STRRIGHT (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRRIGHT (function)

 PURPOSE:
        This function returns the rightmost N characters from a
        string or string array. You can also look for a searchstring
        and return the portion of the string(s) behind the
        searchstring. 

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        res = STRRIGHT(string [,nlast])

 INPUTS:
        STRING --> the string(s) to be searched

        NLAST --> the number of characters to be returned. Default
           is 1. If NLAST is ge strlen(STRING), the complete string
           is returned. NLAST must either be a scalar or have the
           same number of elements as the string argument.

 KEYWORD PARAMETERS:
        SEARCHSTRING -> Use this keyword to return the portion of the
        string(s) behind a specific pattern. To extract a filename
        from a list of paths, write:
           res=StrRight(paths,searchstring='/')  (Unix)
        The LastN argument overrides searchstring.

 OUTPUTS:
        The portion of NLAST characters of STRING counted from the back.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        if (strright(path) ne '/') then path = path + '/'

 MODIFICATION HISTORY:
        mgs, 19 Nov 1997: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source
                          - changed return value for undefined
                            argument to ''
                          - now works with string arrays
                          - added searchstring keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strright.pro)


STRSCI (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRSCI (function)

 PURPOSE:                                                 
        Given a number, returns a string of that          B
        number in scientific notation format ( e.g. A x 10  )

 CATEGORY:
        String Utilities

 CALLING SEQUENCE:
        Result = STRSCI( DATA [,keywords] )

 INPUTS:
        DATA      -> A floating point or integer number to be
                     converted into a power of 10.

 KEYWORD PARAMETERS:
        FORMAT    -> The format specification used in the string
                     conversion for the mantissa (i.e. the
                     "A" of "A x 10^B").  Default is '(f12.2)'.  

        /POT_ONLY -> Will return only the "power of 10" part of the
                     string (i.e. the "10^B").  Default is to return
                     the entire string (e.g. "A x 10^B" )

        /MANTISSA_ONLY -> return only mantissa of the string

        /SHORT -> return 10^0 as '1' and 10^1 as '10'

        /TRIM -> don't insert blanks (i.e. return Ax10^B)

 OUTPUTS:
        None

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        This function does not "evaluate" the format statement thoroughly
        which can result in somewhat quirky strings. Example:
        print,strsci(-9.999) results in -10.0x10^0 instead of -1.0x10^1.

        Need a better symbol than the 'x' for the multiplier...

 EXAMPLE:
        Result = STRSCI( 2000000, format='(i1)' )
        print, result                
        ;                                                     6
        ;     prints 2 x 10!u6!n, which gets plotted as 2 x 10 
        
        Result = STRSCI( -0.0001 )
        print, result
        ;                                                            4
        ;     prints -1.00 x 10!u-4!n, which gets plotted as -1.00 x 10

        Result = STRSCI( 0d0, format='(f13.8)' )
        print, result
        ;
        ;     prints, 0.00000000
 

 MODIFICATION HISTORY:
        bmy, 28 May 1998: VERSION 1.00            B
           - now returns string of the form A x 10
        mgs, 29 May 1998:
           - bug fix: now allows negative numbers
           - keyword MANTISSA_ONLY added
           - default format changed to f12.2
        bmy, 02 Jun 1998:
           - renamed to STRSCI ("STRing SCIentific notation"),
        mgs, 03 Jun 1998:
           - added TRIM keyword
        mgs, 22 Sep 1998:
           - added SHORT keyword
           - modified handling of TRIM keyword
        mgs, 24 Sep 1998:
           - bug fix with SHORT flag
        bmy & mgs, 02 Jun 1999:
           - now can handle DATA=0.0 correctly
           - updated comments
        mgs, 03 Jun 1999: 
           - can now also handle values lt 1 ;-)
           - and doesn't choke on arrays

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strsci.pro)


STRSEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRSEC
 PURPOSE:
       Convert seconds after midnight to a time string.
 CATEGORY:
 CALLING SEQUENCE:
       tstr = strsec(sec, [d])
 INPUTS:
       sec = seconds after midnight.             in
         Scalar or array.
       d = optional denominator for a fraction.  in
 KEYWORD PARAMETERS:
       Keywords:
          /HOURS forces largest time unit to be hours instead of days.
 OUTPUTS:
       tstr = resulting text string.             out
 COMMON BLOCKS:
 NOTES:
       Notes: Output is of the form: [DDD/]hh:mm:ss[:nnn/ddd]
         where DDD=days, hh=hours, mm=minutes, ss=seconds,
         nnn/ddd=fraction of a sec given denominator ddd in call.
         If sec is double precision then 1/10 second can be
         resolved in more than 10,000 days.  Use double precision when
         possible. Time is truncated, so to round to nearest second,
         when not using fractions, add .5 to sec.
 MODIFICATION HISTORY:
       Written by R. Sterner, 8 Jan, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES --- Added day: 21 Feb, 1985.
       RES 19 Sep, 1989 --- converted to SUN
       RES 18 Mar, 1990 --- allowed arrays.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner, 12 Feb, 1993 --- returned 1 element array as a scalar.
       also cleaned up.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strsec.pro)


STRSUB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRSUB
 PURPOSE:
       Extract a substring by start and end positions.
 CATEGORY:
 CALLING SEQUENCE:
       ss = strsub(s, p1, p2)
 INPUTS:
       s = string to extract from.                    in
       p1 = position of first character to extract.   in
       p2 = position of last character to extract.    in
 KEYWORD PARAMETERS:
       Keywords:
         /LAST  means positions are backwards from last char.
           Ex: strsub(s,1,0,/last) returns last 2 chars in s.
 OUTPUTS:
       ss = extracted substring.                      out
 COMMON BLOCKS:
 NOTES:
       Notes: position of first character in s is 0.  If p1 and
         p2 are out of range they set to be in range.
 MODIFICATION HISTORY:
       Written by R. Sterner, 6 Jan, 1985.
       R. Sterner, 1996 Mar 20 --- Added /LAST.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strsub.pro)


STRTRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRTRANS
 PURPOSE:
       Translate all occurences of one substring to another.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       new = strtrans(oldstr,from,to,ned)
 INPUTS:
       oldstr -- string on which to operate.              in
                 May be an array.
       from   -- substrings to be translated. May be      in
                 an array.
       to     -- what strings in from should be           in
                 translated to. May be an array.
 KEYWORD PARAMETERS:
       /HELP  -- Set this to print useful message and 
                 exit.
 OUTPUTS:
       new    -- Translated string. Array if oldstr is    out          
                 an array.
       ned    -- number of substitutions performed in     out
                 oldstr.  Array if oldstr is an array.
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       - Any of old, from, and to can be arrays.  
       - from and to must have the same number of elements.
 EXAMPLE:
       inp='Many*bad!chars+in_here'
       from=['*','!','+','_']
       to  =[' ',' ',' ',' ']
       out = strtrans(inp,from,to,ned)
       Will produce out='Many bad chars in here', and set ned to 4.
 MODIFICATION HISTORY:
       $Id: strtrans.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
       $Log: strtrans.pro,v $
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Sped up significantly by using str_sep to handle the translation.  No longer
       relies on routines fromother user libraries.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\strtrans.pro)


STRTRM2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STRTRM2
 PURPOSE:
       Trim given character (and spaces) from ends of given string.
 CATEGORY:
 CALLING SEQUENCE:
       s2 = strtrm2(s1,[flag],[chr])
 INPUTS:
       s1 = String to trim.                          in
       flag = 0: remove trailing                     in
              1: remove leading
              2: remove both. No flag same as 0.
       chr = character to trim (def = spaces).       in
 KEYWORD PARAMETERS:
 OUTPUTS:
       s2 = trimmed string.  Works just like strtrim.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 11 Jan, 1985.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\strtrm2.pro)


STRUCT2HTMLTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   struct2htmltable

 PURPOSE:
   This functions creates a table in html from the tags odf a structure

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = STRUCT2HTMLTABLE(Str, BORDER=BORDER, IGNORE=IGNORE, NUMBERS=NUMBERS , HRULE = HRULE, TAGS_VERTICAL=TAGS_VERTICAL, CAPTION=CAPTION, SUBTABLES=SUBTABLES, MAX_ARRAY=MAX_ARRAY, ALIGNMENT=ALIGNMENT, _EXTRA=e)

 INPUTS:
   Str:    structure or array of structure

 KEYWORD PARAMETERS:
   BORDER: if this keyword is set a border will be produced for each
           table entry
   CAPTION: if this keyword is set to a string this will be printed
           as a table caption
   IGNORE: if this keyword is set to a string all tagnames beginning
           with this string will be ignored in html table (array possible)
   NUMBERS: if this keyword is set index of structure arrays is
            printed in first column
   MAX_ARRAY: if this keyword is set to a integer number only max_array
           elements of arrays in structures are displayed
            printed in first column
   ALIGNMENT: Specifies the alignment of the caption text. An alignment
           of 0.0 (the default) aligns left, 1.0 right and 0.5 centered
   SUBTABLES: if this keyword is set all structures contained in the
           structure Str are resolved into tables and appended to the output
           string array
   HRULE:  if set a horizontal rule is included after each table
   BLOCKQUOTE:  if set subtables are set in a block qoute environement

   passed to tab_i
   SMALL:      use small fonts for table entries
   FIXED:      use fixed fonts for table entries
   NOBREAK:    no line breaks in table entries

 OUTPUTS:
   This function returns a string array containing html-code for table
   which correponds to the content of an IDL strcuture

 EXAMPLE:
   see html_example.pro and html_example2.pro

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-19
   Modified:   T.B. Oct 1998 handles pointers inside structures as well
   Modified:   T.B. Dec 1998 MIN of max_arr and max_array bug removed
   Modified:   T.B. Mar 1999 random_names for subtable target names
   Modified:   T.B. Apr 1999 ignore array allowed
   Modified:   T.B. Jan 2000 works correctly with pointers now (null, arrays, etc)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\struct2htmltable.pro)


STRUCT2HTMLVTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   struct2htmlvtable

 PURPOSE:
   This functions creates a table in html from the tags odf a structure

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result = STRUCT2HTMLVTABLE(Str)

 INPUTS:
   Str:    structure or array of structure

 KEYWORD PARAMETERS:
   BORDER: if this keyword is set a border will be produced for each
           table entry
   CAPTION: if this keyword is set to a string this will be printed
           as a table caption
   IGNORE: if this keyword is set to a string all tagnames beginning
           with this string will be ignored in html table
   NUMBERS: if this keyword is set index of structure arrays is
            printed in first column
   MAX_ARRAY: if this keyword is set to a integer number only max_array
           elements of arrays in structures are displayed
            printed in first column
   ALIGNMENT: Specifies the alignment of the caption text. An alignment
           of 0.0 (the default) aligns left, 1.0 right and 0.5 centered
   HRULE:  if set a horizontal rule is included after each table

   passed to tab_i
   SMALL:      use small fonts for table entries
   FIXED:      use fixed fonts for table entries
   NOBREAK:    no line breaks in table entries

 OUTPUTS:
   This function returns a string array containing html-code for table
   which correponds to the content of an IDL strcuture

 EXAMPLE:
   see html_example.pro and html_example2.pro

 MODIFICATION HISTORY:
   Written by:     Theo Brauers, 1998-JAN-19
   Modified:       T.B. 1999-Jun-30    bug with array counter removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\struct2htmlvtable.pro)


STRUCT2HTML_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   struct2html_file

 PURPOSE:
   This procedure writes a structure to a html tree

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   struct2html_file,filename,structure,[_extra=e]

 INPUTS:
   filename: the name of the file to write to
            at the moment the data is saved to this file and in addition a start file named start_+filename is written too
   structure: the structure to write to the html data file

 KEYWORD PARAMETERS:
  _extra: to add keywords to array2htmltable

 PROCEDURE:
  Diese Routine ist noch nicht ganz fertig: Der  Frame links oben muß noch mit Steuerelementen angefüllt werden.


 EXAMPLE:
  ct_ncdf,c
  struct2html_file,'color.html',c


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-MAR-05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct2html_file.pro)


STRUCT2ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   struct2icg_struct

 PURPOSE:
   The result of this function is the icg_struct from a given struct

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=struct2icg_struct(struct,icg_struct,[/set_flag])

 INPUTS:
   struct:   the corresponding struct given to the parameter tag_names of a icg_struct
   icg_struct: the defined ICG data structure

 KEYWORD PARAMETERS:
   set_flag:  if set the param_flag attribute is set to the defined flags

 EXAMPLE:
    pi={name:'P.Mustermann',organisation:'FZ Jülich'}
    platform={name:'cessna',type:'AIRCRAFT'}
    dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT',$
              experiment:'GHOST',title:'validation',$
              type_of_data:'MEASUREMENTS'}
    global=CREATE_STRUCT('pi',pi,'platform',platform,'dataset',dataset)

    n2o={units:'ppm',$
         long_name:'N2O',short_name:'N2O',$
         flag:'NONE'}
    time={units:'seconds since 2000-01-01 00:00:00 UTC',$
          long_name:'time',short_name:'time',flag:'NONE'}
    s=CREATE_STRUCT('!global',global,'time',time,'n2o',n2o)

    n=100
    data=create_struct('time',dindgen(n),'N2O',sin(findgen(n)),$
                       'N2O@STDEV',findgen(n)/10.)

    icg=struct2icg_struct(data,s,/set_flag)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Sep-27
   This function is adapted from v_struct2icg_struct later on v_struct2icg_struct is only used for arrayed strutures
   1999-Nov-20 bug with !filename removed
   2000-Feb-17 Because of idl5.3 it is not longer possible to use @ in a tag definition.
               This behaviour was in earlier versions a bug.
               Therefore I have changed the @ into $.
   2000-Feb-18 Bug with QUALITY removed
   2000-Feb-25: CATEGORY changed
   2000-Apr-11: bug removed if $QUALITY is not defined

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct2icg_struct.pro)


STRUCT2NAMES_AND_PTRS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    struct2names_and_ptrs

 PURPOSE:
   This functions creates an array of tagnames and and an array of pointers of the submitted structure
   The return value of this function is n_elements(names) and the keywords names and ptr_values
   This keywords are defined as output only.

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   result=struct2names_and_ptrs(struct,[tagname],[tname=tname],names=names,ptr_values=ptr_values,[recurse=recurse])

 INPUTS:
   struct: the structure to transform to names and ptr_values

 OPTIONAL INPUTS:
   tagname: to separate the tagnames which should be expanded to names and ptr_values
   wildcard (*) is forbidden

 In dieser Routine würde das ganz gut funktionieren, jedoch vor der Umstellung auf idl5.3
 sind die Änderungen in der Syntax für die darauf aufbauenden Funktionen doppelt
 auszuführen, daher unterdrücke ich derzeit diese Funktionalität.



 KEYWORD PARAMETERS:
   tname: is used recursivly for the substructures
   names: is used recursivly for the substructures to save the names
          ONLY OUTPUT
   ptr_values: is used recursivly for the substructures to save the pointers
          ONLY OUTPUT

   recurse: is used recursivly for the substructures

 PROCEDURE:
   This routine was written after a discussion of Frank Hollands Meta-Structure
   First idea Frank Holland, advanced idea Franz Rohrer and Reimar Bauer



 EXAMPLE:
   d={A:1,B:{B1:0,B2:1},c:{B1:0,B2:1}}

   n=struct2names_and_ptrs(d,names=names,ptr_values=ptr_values)
   PRINT,n
      5
   PRINT,names
     A B.B1 B.B2 C.B1 C.B2

   PRINT,ptr_values
    


   n=struct2names_and_ptrs(d,'B',names=names,ptr_values=ptr_values)
   PRINT,n
      4
   PRINT,names
     A B.B1 B.B2 C

   PRINT,ptr_values
     



 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-Jan-22

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct2names_and_ptrs.pro)


STRUCT_ARRAY2ARRAY_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	struct_array2array_struct

 PURPOSE:
   This function returns an arrayed structure given from a structure with arrayed tagnames

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=struct_array2array_struct(structure)

 INPUTS:
  structure: The input structure with tags defined as 2 dimensional arrays

 OUTPUTS:
   This function returns am arrayed structure

 PROCEDURE:
  opposite is a=struct.(0)

 EXAMPLE:
   structure={b:findgen(2,4),c:1,d:findgen(2,4)}
   result=struct_array2array_struct(structure)
   IDL> help,result
   RESULT          STRUCT    = ->  Array[4]
   IDL> help,result,/str
   ** Structure <300395ec>, 3 tags, length=20, refs=1:
      B               FLOAT     Array[2]
      C               INT              1
      D               FLOAT     Array[2]

 MODIFICATION HISTORY:
   Written by:	R.Bauer (ICG-1),  1998-Sep-28
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct_array2array_struct.pro)


STRUCT_TAGS2ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	struct_tags2array

 PURPOSE:
   This function generates a new structure from a given structure with an array of
   tagnames as attribute and an array of values by values

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=struct_tags2array(structure,[/tranpose])

  INPUTS:
   structure:   The structure which should be scaned

 KEYWORD PARAMETERS:
   transpose: if is set result tags are transposed

 OUTPUTS:
   The return value is a structure with the tags:
   attribute: all tagnames
   value: all values

 EXAMPLE:
   Result=struct_tags2array(experiment)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-08-03
   1999-04-26 transpose added
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct_tags2array.pro)


STRUCT_TREE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   struct_tree

 PURPOSE:
   This procedure displays a tree of a structure

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   struct_tree,struct,[/psflag],[psfile=psfile],[filter=filter],[exclude=exclude],[first_value=first_value],$
                      [charsize=charsize],[column=column],[/no_block]

 INPUTS:
   struct:   A structure

 KEYWORD PARAMETERS:
   psflag: output is a psfile
   psfile: name of output psfile
   filter: a filter e.g. 'c_*' or a vector ['c_*','m_*']
   exclude: negative filter
   first_value: if is set to one the first value is printed right to the tagname
   charsize: this keyword is only useful for use with the psflag
   columns:  this keyword is only useful for use with the psflag

 PROCEDURE:


 USES:
 CT_NCDF.
 ARR2STRING.
 CALL_HELP.
 GET_COLOR_STRUCT.
 GET_TAGNAME.
 IS_ARRAY.
 IS_STRUCTURE.
 NUMBER_FORMAT.
 N_TAGS_STRUCT.
 TAG_POSITION.
 TEXTWIDTH.
 A_NOT_B.
 FIND_FORM.
 GET_TEMPLATE_ONE_VALUE.
 STR_SEP.                 IDL
 TEXT_FILTER.
 IS_DOUBLE.
 IS_FLOAT.
 IS_STRING.
 REVERSE_STRING.
 UNIQ.                    IDL
 REVERSE.                 IDL

 EXAMPLE:
   pi={name:'P.Mustermann',organisation:'FZ Jülich'}
   platform={name:'Cessna',type:'AIRCRAFT'}
   dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT',$
           experiment:'GHOST',title:'validation',$
           type_of_data:'MEASUREMENTS'}

   GHOST={FC1_type:'BROOKS',FC1_last_calibrated:'1999-02-02', $
         FC1_intern_no:4}
   EXP={ghost:ghost}
   history='info_file:add001.txt'
   global=CREATE_STRUCT('pi',pi,'platform',platform,$
          'dataset',dataset,'EXP',exp,'history',history)
   time={param:DINDGEN(100), $
        units:'seconds since 2000-01-01 00:00:00 UTC',$
        long_name:'time',short_name:'time',flag:'NONE'}
   time=CREATE_STRUCT(time,valid_param(time))
   n2o={param:FINDGEN(100),units:'ppm',$
       long_name:'N2O',short_name:'N2O',$
       flag:'STDEV',stdev:SIN(DINDGEN(100))}
   n2o=CREATE_STRUCT(n2o,valid_param(n2o))
   struct=CREATE_STRUCT('!global',global,'time',time,'n2o',n2o)

   struct_tree,struct,/first
   

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Nov-10 2000-Jan-09 : multi page mode added 2000-Jan-18 : if the struct identifier is used once the right one is displayed else STRUCT.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\struct_tree.pro)


STRVALID_MM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		STRVALID_MM
 VERSION:
		4.2
 PURPOSE:
		Locating a substring within a string, subject to "boundary conditions".
 CATEGORY:
		String processing.
 CALLING SEQUENCE:
		Result = STRVALID_MM( EXPR, STR [keywords])
 INPUTS:
	EXPR
		The expression in which to search for the substring (see STRPOS).
	STR
		The substring to be searched for within EXPR (see STRPOS).
 OPTIONAL INPUT PARAMETERS:
	POS
		The character position at which the search is begun (see STRPOS).
		Default value is 0.
 KEYWORD PARAMETERS:
	PREFIX
		Character string, including all the characters which can legitimately
		preceed STR within EXPR.  Default is "any character".
	POSTFIX
		Character string, including all the characters which can legitimately
		follow STR within EXPR.  Default is "any character".
	/TEXT
		Switch.  If set then both PREFIX and POSTFIX default to "puctuation
		and operation characters" i.e. all characters which are neither a
		letter nor a number.
 OUTPUTS:
		Returns the position of STR within EXPR, same as STRPOS.  However, if
		PREFIX and/or POSTFIX are set (directly or through TEXT), and STR
		appears within EXPR while being preceded by a character *not* in
		PREFIX, or followed by a character not in POSTFIX, this occurence
		won't count.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses IDL STRPOS, followed by checking of the preceding and following
		character, if such exist.  Calls DEFAULT from MIDL.
 MODIFICATION HISTORY:
		Created 15-SEP-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\strvalid_mm.pro)


STRWHERE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  strwhere

 PURPOSE:  a "where" operator for strings matching a set of string 
           wild cards

 USEAGE:   result=strwhere(starr,wildcard)

 INPUT:    
   starr   an array of strings                   

 wildcard  wild card specifier composed of regular and special
           characters.  The special characters are  asterisk '*'
           and vertical bar '|'.  The asterisk matches any number of
           characters the vertical bar indicates an "or" operation
           between different wild card specifications.

 KEYWORD INPUT:

   orchar  character used to indicate "or" wildcard operation.
           (default = '|')

 OUTPUT:
   result  an index array such that starr(result) = those elements of
           STARR that match the wild card specification in WILDCARD
   

 EXAMPLE:  

  f=findfile(/home/paul/arm/arese/bsrn/sgpbsrnC1.a1.*.cdf)
  clrdays='*1018*|*1022*|*1030*'
  print,f(strwhere(f,clrdays))

 AUTHOR:   Paul Ricchiazzi                        14 Jan 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\strwhere.pro)


STRWHERE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        STRWHERE  (function)

 PURPOSE:
        This function returns a position *array* for occurence of a
        character in a string. Note: in IDL 5.3 or higher, the same
        effect (even for esearch expressions which are not single
        characters) can be achieved with the system routine STRSPLIT:
           StrWhere(s,c) = StrSplit(s,c)-StrLen(c)

 CATEGORY:
        string utilities

 CALLING SEQUENCE:
        pos = STRWHERE(str, schar [,Count] )

 INPUTS:
        STR -> the string

        SCHAR -> the character to look for

 KEYWORD PARAMETERS:
        none.

 OUTPUTS:
        COUNT -> (optional) The number of matches that were found 

        The function returns an index array similar to the 
        result of the where function

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        ind = strwhere('abcabcabc','a')

        ; returns [ 0, 3, 6 ]

 MODIFICATION HISTORY:
        mgs, 02 Jun 1998: VERSION 1.00
        bmy, 30 Jun 1998: - now returns COUNT, the number 
                            of matches that are found (this is
                            analogous to the WHERE command)
        mgs, 28 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\strwhere.pro)


STR_FIND_EX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	str_find_ex

 PURPOSE:
	This function will give true if a whole word search string is in a given string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=str_find_ex(text,word,new_word,[/no_strings])

 INPUTS:
   text:     a text string
   word:     the word for searching for

 KEYWORD PARAMETERS:
  no_strings: strings are excluded from the operation

 RESTRICTIONS:
   momentanly uppercase are the same as lowercase

 OUTPUTS:
   This function returns 1 if a string word is in a given string and 0 if not

 EXAMPLE:
   Result=str_find_ex('this is a test','is')
   Result=1
   Result=str_find_ex('this is a test','his')
   Result=0

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), April 11 1998
    1998-May-02
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\str_find_ex.pro)


STR_FIND_EX_POS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	str_find_ex_pos

 PURPOSE:
	This function returns the charposition where word is placed in text

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=str_find_ex(text,word,new_word)

 INPUTS:
   text:     a text string
   word:     the word for searching for


 RESTRICTIONS:
   momentanly uppercase are the same as lowercase

 OUTPUTS:
   This function returns a vector with two elements [0] the start pos [1] the length of word

 EXAMPLE:
   Result=str_find_ex_pos('this is a test','is')
IDL> print,result
           5           2


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-October-11
    1998-May-02
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\str_find_ex_pos.pro)


STR_MATRIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   str_matrix

 PURPOSE:
  The result of this function is a string vector of added string arrays

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=str_matrix(string1,string2,[/uniq])

 INPUTS:
   string1:  first string vector
   string2:  second string vector

 KEYWORD PARAMETERS:
   uniq:  result is uniq

 OUTPUTS:
  This function returns a vector where each element of string2 is added to each element of string1

 EXAMPLE:
   string1=['A:','B:','C:']
   string2=['1','2']
   result=str_matrix(string1,string2)
   print,result
   A:1 B:1 C:1 A:2 B:2 C:2


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),2000-Mar-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\str_matrix.pro)


STR_REP_EX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	str_rep_ex

 PURPOSE:
	This function will replace exactly a string in a given string

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=str_rep_ex(text,word,new_word,[/no_strings])

 INPUTS:
   text:     a text string
   word:     the word for searching for
   new_word: the word for replacing

 KEYWORD PARAMETERS:
  no_string: excludes strings from the operation

 RESTRICTIONS:
   momentanly uppercase are the same as lowercase

 OUTPUTS:
   This function returns the submitted text after replacing "word" with "new word"

 EXAMPLE:
   Result=str_rep_ex('this is a test','is','was')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), April 11 1998
    1998-May-02
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\str_rep_ex.pro)


STR_SEP2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   str_sep2

 PURPOSE:
   This function seperates a string (or array) into 2 parts

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = STR_SEP2(String)

 INPUTS:
   String:  Input string or string array

 OPTIONAL INPUTS:
   Seperator:  seperator string (equivalent to DELIMITER keyword)

 KEYWORD PARAMETERS:
   DELIMITER:  string seperating the two parts, if not given '='
   ONLY:       integer, if set to 0 only part before delimiter is returned
               if set to 0 only part before delimiter is returned
               if not given, both parts are returned

 OUTPUTS:
   This function returns the string array of the text
   cut by the delimiters

 EXAMPLE:
   str=['{t}est[123]=5', 'test{[123456]}={1}', 'a=b']
   print, str_sep2(str)
   IDL prints:
       {t}est[123] test{[123456]} a
       5 {1} b

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-6
   Modified:   Theo Brauers, 1998-MAY-2
                   new optional parameter sep equivalent to delimiter
   Modified:   Theo Brauers, 1998-JULY-10
                   returns correct if del was not found

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\str_sep2.pro)


STR_SEP_ALL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	str_sep_all

 PURPOSE:
	This function divides each string in a string array into pieces
	as designated by a separator string.

 CATEGORY:
	PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	Result = str_sep_all(string_array, sep)

 INPUTS:
	string_array: String array to be separated.
	sep: The separator string.

 OUTPUTS:
	This function returns a 2-D string array where each element
	is a separated piece of the original string.

 EXAMPLE:
	a = ['', 'A', 'B', 'B.B1', 'B.B2', 'B.B2.B21', 'C']
	d = str_sep_all(a, '.')

	HELP, d
		D               STRING    = Array[7, 3]

	PRINT, '<' + d + '>'
		<>          
		<> <>  <>      <>
		<> <>  <>  <>   <>    <>

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05.01.2000
	19.01.2000:	Bug removed if string_array was Array[1]

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\str_sep_all.pro)


STR_SIZE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  STR_SIZE

 PURPOSE:

  The purpose of this function is to return the proper
  character size to make a specified string a specifed
  width in a window. The width is specified in normalized
  coordinates. The function is extremely useful for sizing
  strings and labels in resizeable graphics windows.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   2642 Bradbury Court
   Fort Collins, CO 80521 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

  Graphics Programs, Widgets.

 CALLING SEQUENCE:

  thisCharSize = STR_SIZE(thisSting, targetWidth)

 INPUTS:

  thisString:  This is the string that you want to make a specifed
     target size or width.

 OPTIONAL INPUTS:

  targetWidth:  This is the target width of the string in normalized
     coordinates in the current graphics window. The character
     size of the string (returned as thisCharSize) will be
     calculated to get the string width as close as possible to
     the target width. The default is 0.25.

 KEYWORD PARAMETERS:

  INITSIZE:  This is the initial size of the string. Default is 1.0.

  STEP:   This is the amount the string size will change in each step
     of the interative process of calculating the string size.
     The default value is 0.05.

 OUTPUTS:

  thisCharSize:  This is the size the specified string should be set
     to if you want to produce output of the specified target
     width. The value is in standard character size units where
     1.0 is the standard character size.

 EXAMPLE:

  To make the string "Happy Holidays" take up 30% of the width of
  the current graphics window, type this:

               XYOUTS, 0.5, 0.5, ALIGN=0.5, "Happy Holidays", $
        CHARSIZE=STR_SIZE("Happy Holidays", 0.3)

 MODIFICATION HISTORY:

  Written by: David Fanning, 17 DEC 96.
  Added a scaling factor to take into account the aspect ratio
     of the window in determing the character size. 28 Oct 97. DWF
  Added check to be sure hardware fonts are not selected. 29 April 2000. DWF.
  Added a pixmap to get proper scaling in skinny windows. 16 May 2000. DWF.
  Forgot I can't do pixmaps in all devices. :-( Fixed. 7 Aug 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\str_size.pro)


STR_SIZE[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  STR_SIZE

 PURPOSE:

  The purpose of this function is to return the proper
  character size to make a specified string a specifed
  width in a window. The width is specified in normalized
  coordinates. The function is extremely useful for sizing
  strings and labels in resizeable graphics windows.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   2642 Bradbury Court
   Fort Collins, CO 80521 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

  General Graphics

 CALLING SEQUENCE:

  thisCharSize = STR_SIZE(thisSting, targetWidth)

 INPUTS:

  thisString:  This is the string that you want to make a specifed
     target size or width.

 OPTIONAL INPUTS:

  targetWidth:  This is the target width of the string in normalized
     coordinates in the current graphics window. The character
     size of the string (returned as thisCharSize) will be
     calculated to get the string width as close as possible to
     the target width. The default is 0.25.

 KEYWORD PARAMETERS:

  INITSIZE:  This is the initial size of the string. Default is 1.0.

  STEP:   This is the amount the string size will change in each step
     of the interative process of calculating the string size.
     The default value is 0.05.

 OUTPUTS:

  thisCharSize:  This is the size the specified string should be set
     to if you want to produce output of the specified target
     width. The value is in standard character size units where
     1.0 is the standard character size.

 EXAMPLE:

  To make the string "Happy Holidays" take up 30% of the width of
  the current graphics window, type this:

               XYOUTS, 0.5, 0.5, ALIGN=0.5, "Happy Holidays", $
        CHARSIZE=STR_SIZE("Happy Holidays", 0.3)

 MODIFICATION HISTORY:

  Written by: David Fanning, 17 DEC 96.
  Added a scaling factor to take into account the aspect ratio
     of the window in determing the character size. 28 Oct 97. DWF
  Added check to be sure hardware fonts are not selected. 29 April 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\str_size.pro)


STR_TOKEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       STR_TOKEN
 PURPOSE:
       Retrieve portion of string up to token.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       new = str_token( old, token )
 INPUTS:
       old   -- String to be split.  Contains text after    in, out
                token on output.
       token -- Token to use in splitting old.              in
 KEYWORD PARAMETERS:
       /TRIM -- set to remove leading blanks from old 
                before returning.
       /HELP -- print useful message and exit.
 OUTPUTS:
       new   -- portion of string up to token.              out
       old   -- portion of old after token.                 out, in
 COMMON BLOCKS:
 SIDE EFFECTS:
       Input parameter old is modified.
 NOTES:
       Token may be one or more characters.
       If token is not found, returns old and sets old to ''.
 EXAMPLE:
       If old is 'foo44 bar', then str_token( old, '44' ) would return
       'foo', and upon return, old will be left with ' bar'.  If /TRIM
       were set, old would be 'bar' on return.

       If old='xyz', then new=str_token(old,'a') would return with
       new='xyz' and old=''.
 THANKS:
       To D. Linder who wrote GETTOK, part of the goddard library,
       upon which this is based.
 MODIFICATION HISTORY:
       $Id: str_token.pro,v 1.1 2000/06/14 19:09:22 mcraig Exp $
       $Log: str_token.pro,v $
       Revision 1.1  2000/06/14 19:09:22  mcraig
       Changed name of strtok str_token to avoid conflict in IDL 5.3.

       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.2  1996/05/09 00:22:17  mcraig
       Added built in help.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\str_token.pro)


SUBCELL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SUBCELL

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Finds the position of a subwindow within a reference window.

 CALLING SEQUENCE:
   sub = subcell(panel, refposition)

 DESCRIPTION: 

   SUBCELL finds the position of a subwindow within another window.
   This could be useful in cases where the position of one window is
   specified relative to another one.

   When plotting, one often wants to describe the position of the
   plot box with respect to another box on the screen.  In that
   respect, the reference window can be thought of as a virtual
   display, and the SUBPOS as virtual a position on that display.
   The SUBCELL function transforms the relative coordinates of the
   virtual position back to normal screen coordinates.

 INPUTS:

   SUBPOS - A four-element array giving the position of the
            subwindow, *relative* to a reference window given by
            POSITION.  Given as [XS1, YS1, XS2, YS2], which describes
            the lower left and upper right corners of the subwindow.
            Each value is a number between zero and one, zero being
            the lower/left and one being the upper/right corners of
            the reference window.

   POSITION - A four-element array giving the position of the
              reference window on the screen.  Equivalent to the
              graphics keyword of the same name.
 
 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   MARGIN - If set, then a default value for SUBPOS is found using
            the DEFSUBCELL function.

 RETURNS:
   The position of the subwindow, in normal coordinates.

 PROCEDURE:

 EXAMPLE:


 SEE ALSO:

   DEFSUBCELL, SUBCELLARRAY

 EXTERNAL SUBROUTINES:

   DEFSUBCELL

 MODIFICATION HISTORY:
   Written, CM, 1997
   Added copyright notice, 25 Mar 2001, CM

  $Id: subcell.pro,v 1.2 2001/03/25 18:54:31 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\subcell.pro)


SUBCELLARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   SUBCELLARRAY

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Returns a set of subcells, suitable for creating a matrix of plots.

 CALLING SEQUENCE:
   subcellarray, xdivs, ydivs, newpanels, newsubpanels

 DESCRIPTION: 

   SUBCELLARRAY generates a group of subcells.  The subcells are
   useful for plotting a matrix of windows.

   This procedure takes a list of subdivisions in X and Y,
   designating the subdivision of the plot into num(X) X panels and
   num(Y) Y panels, and creates a new batch of panels and subpanels,
   which can be used in the individual plot commands of the array.

 INPUTS:

   XDIVS - list of subdivisions in the X-direction.  Example: [1,1,2]
           will create three panels in the X-direction such that
           their sizes are in the ratio of 1:1:2.  These are the
           subdivisions of the SUBPANEL, the inner plot box boundary,
           not divisions of the PANEL, which is the boundary that
           includes axis labels.

   YDIVS - same, for Y direction

 OPTIONAL INPUTS:
   NONE

 INPUT KEYWORD PARAMETERS:

   PANEL - Original panel (outer margin) of plot. Default is to fill
           screen.

   SUBPANEL - Original subpanel (inner margin) of plot.  Default is
              to use defsubcell().

 OUTPUTS:

   NEWPANELS - output array of panels.  The output is 4 x M x N where
               M is the number of X divisions and N is the number of
               Y divisions.

   NEWSUBPANELS - output array of subpanels, with correct adjustment
                  for margins, same format as NEWPANELS.

 PROCEDURE:

 EXAMPLE:

   See PLOTCUBE for an example usage.

 SEE ALSO:

   DEFSUBCELL, SUBCELLARRAY, PLOTCUBE

 EXTERNAL SUBROUTINES:

   DEFSUBCELL, SUBCELL

 MODIFICATION HISTORY:
   Written, CM, 1997
   Added copyright notice, 25 Mar 2001, CM

  $Id: subcellarray.pro,v 1.2 2001/03/25 18:54:31 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\subcellarray.pro)


SUBIMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUBIMG
 PURPOSE:
       From current image select and redisplay a subimage.
 CATEGORY:
 CALLING SEQUENCE:
       subimg
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         X=x, Y=y returned device coordinates of LL corner.
         EXIT_CODE=ex  Exit code: 0=ok, 1=abort.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Destroys current window.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Mar 22
       R. Sterner, 1994 Dec 1 --- Added corner position return.
       R. Sterner, 1995 Apr 7 --- Switched to box1.
       R. Sterner, 2000 Jun 29 --- Modified for 24 bit images.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\subimg.pro)


SUBNORMAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUBNORMAL
 PURPOSE:
       Convert from subnormal coordinates to normalized coord.
 CATEGORY:
 CALLING SEQUENCE:
       subnormal, xsn, ysn, xn, yn
 INPUTS:
       xsn, ysn = a point in sub-normal coordinates.                 in
       psn = position parameter in sub-normal coordinates.           in
 KEYWORD PARAMETERS:
       Keywords:
         /CM means that (xsn,ysn) or psn is specified in cm instead
             of sub-normal coordinates.
         WINDOW=n  Sets the subwindow to use.  Over-rides !p.multi.
             If n > # subwindows then subnormal automatically wraps n.
         /LASTWINDOW uses last plot window.
 OUTPUTS:
       xn, yn = point converted to normalized coordinates.           out
       or
       subnormal, psn, pn
         pn = position parameter converted to normalized coordinates.  out
           where the position parameter has the format: [x1,y1,x2,y2]
           with (x1,y1) being the lower left corner of the plot,
           and  (x2,y2) being the upper right corner of the plot.
           If x2 or y2 is 0 (but not both) the plot is forced to be square.
 COMMON BLOCKS:
 NOTES:
       Notes: Sub-normal coordinates range from 0 to 1 in the plot sub-area.
         These coordinates arise for multiple plots per pages obtained by
         using !p.multi.  The position keyword always works in normalized
         coordinates which always range from 0 to 1 for the entire plot area.
         Ex: subnormal,[.2,.2,.8,.8],p & plot,x,y,position=p
         For multiple page plots subnormal must be called before each plot.
         For single points: subnormal,.3,.7,xn,yn & xyouts,xn,yn,'test',/norm.
           (Must use keyword /norm in xyouts to force normalized coordinates,
            plot position keyword uses normalized coordinates by default).
 MODIFICATION HISTORY:
       R. Sterner,  12 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\subnormal.pro)


SUB_SUP_IDL[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUB_SUP_IDL
 PURPOSE:
       Return the proper IDL font positioning command for TeX
       sub/superscripts. 
 CATEGORY:
 CALLING SEQUENCE:
       fnt = sub_sup_idl( strn )
 INPUTS:
       strn -- Either '^' or '_', the TeX super/subscript       in
               characters
 KEYWORD PARAMETERS:
       /FORCE_UD -- Set this to use !U/!D instead of !E/!I for
                    sub/superscripts .
 OUTPUTS:
       fnt -- Either '!U' or !E' for superscripts,              out
              or '!D' or '!I' for subscripts.
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
 EXAMPLE:
 LIBRARY FUNCTIONS CALLED:
        
 MODIFICATION HISTORY:
       $Id: sub_sup_idl.pro,v 1.1 1996/01/31 18:47:37 mcraig Exp $
       $Log: sub_sup_idl.pro,v $
       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\sub_sup_idl.pro)


SUB_SUP_IDL[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUB_SUP_IDL
 PURPOSE:
       Return the proper IDL font positioning command for TeX
       sub/superscripts. 
 CATEGORY:
       TeXtoIDL
 CALLING SEQUENCE:
       fnt = sub_sup_idl( strn )
 INPUTS:
       strn      -- Either '^' or '_', the TeX super/subscript       in
                    characters
 KEYWORD PARAMETERS:
       /FORCE_UD -- Set this to use !U/!D instead of !E/!I for
                    sub/superscripts .
       /HELP     -- Set to print useful message and exit.
 OUTPUTS:
       fnt       -- Either '!U' or !E' for superscripts,             out
                    or '!D' or '!I' for subscripts.
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       Used only by translate_sub_super.  Should be kept in same
       file. 
 EXAMPLE:
 MODIFICATION HISTORY:
       $Id: translate_sub_super.pro,v 1.5 2000/06/14 19:09:22 mcraig Exp $
       $Log: translate_sub_super.pro,v $
       Revision 1.5  2000/06/14 19:09:22  mcraig
       Changed name of strtok str_token to avoid conflict in IDL 5.3.

       Revision 1.4  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.3  1996/05/09 00:22:17  mcraig
       Changed some function calls to reflect changes in those functions, moved
       some code out of the main loop that didn't need to be there, added
       documentation.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $
 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\translate_sub_super.pro)


SUCHE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	suche

 PURPOSE:
       This routine finds the unique elements in two timeseries datasets

 CATEGORY:
	MATH

 CALLING SEQUENCE:
       suche,t2,t1,a2,a1,deltat     

 INPUTS:
       t1:  timeseries data 1
       t2:  timeseries data 2

 OUTPUTS:
       a2:
       a1:
       deltat: maximum time distance

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer August 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\suche.pro)


SUMV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        SUMV

 PURPOSE:
        Takes data on one vertical grid, translates it to 
        another vertical grid, and sums it.  The total
        column sum will be preserved.

 CATEGORY:
        Regridding / Summing

 CALLING SEQUENCE:
        Result = SUMV( DATA, POLD [, PNEW [, KEYWORDS ] ] )

 INPUTS:
        DATA -> the 1-D vertical column of data to be regridded

        POLD -> The pressure centers (in mb) corresponding
             to each element of DATA.

        PNEW (optional) -> The pressure centers (in mb) that 
             defines the grid onto which DATA will be placed.
             PNEW is superseded by the ZEDGE keyword, which 
             contains pressure-altitude edges that will be
             used to define the output grid.;        

 KEYWORD PARAMETERS:
        BOXHEIGHT -> The height of each of the vertical boxes of
             the old grid.  This is needed to make sure that
             quantities such as kg/m3 are regridded properly.  If
             BOXHEIGHT is not specified, then each box will be
             assumed to be of height 1.0.  

        PSURF -> Vector containing [ PSURFACE(old), PSURFACE(new) ]
             for the old and new grids.  If PSURF is passed as a
             scalar, then the same surface pressure will be used
             for both old and new grids.  Default is [ 1000.0, 1000.0 ].

        ZEDGE -> Contains pressure-altitude edges (see Note #1 below) 
             which define the output grid.  Regridded data will be 
             returned at the center point between successive
             pressure-altitude edges.

        MIN_VALID -> the minimum valid data value that shall be accepted.
             Values lower than MIN_VALID will be assigned a value of 
             MIN_VALID. Default is 0. (since this routine will be mostly
             used to regrid concentration data which shouldn't become
             negative).

        MAX_VALID -> the maximum valid data value that shall be accepted.
             (see MIN_VALID). Default for MAX_VALID is 9.99E30.

        /VERBOSE -> Prints detailed information.

 OUTPUTS:
        RESULT contains the regridded, summed data.

 SUBROUTINES:

 REQUIREMENTS:
        PEDGE
        ZMID
        ZSTAR

 NOTES:
        (1) Pressure is converted to pressure-altitude units, which
            are defined as:

                 Z* = 16 * log10[ 1000 / P(mb) ]

            which, by the laws of logarithms, is equivalent to:

                 Z* = 48 - ( 16 * log10[ P(mb) ] ).

        (2) SUMV only processes one column at a time.  One must loop 
            over the surface grid boxes to process the entire globe.

 EXAMPLE:
        POLD    = [ 900, 700, 500, 300 ]
        PNEW    = [ 800, 400 ]
        DATA    = FINDGEN( N_ELEMENTS( POLD ) ) + 1
        NEWDATA = SUMV( DATA, POLD, PNEW )
        print, NEWDATA
            2.0000000       2.0000000
 
            ; Sums the data array from a grid with centers at 900,
            ; 700, 500, and 300 mb to a grid with centers at
            ; 800 and 400 mb.  Note that the total column sum in
            ; both cases (which equals 4.0) is preserved.

 MODIFICATION HISTORY:
        bmy, 01 Jul 1999: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\sumv.pro)


SUN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUN
 PURPOSE:
       Computes geocentric physical ephemeris of the sun.
 CATEGORY:
 CALLING SEQUENCE:
       sun, y, m, d, et
 INPUTS:
       y = year.                      in
       m = month number.              in
       d = monthday number.           in
       et = ephemeris time in hours.  in
         Delta T = ET - UT which is not completely
         predictable but is about 1 minute now.
         This difference is noticable slightly.
 KEYWORD PARAMETERS:
       Keywords:
         /LIST displays values on screen.
         DIST = distance in AU.
         SD = semidiameter of disk in arc seconds.
         TRUE_LONG = true longitude (deg).
         TRUE_LAT = 0 always.
         APP_LONG = apparent longitude (deg).
         APP_LAT = 0 always.
         TRUE_RA = true RA (hours).
         TRUE_DEC = true Dec (deg).
         APP_RA = apparent RA (hours).
         APP_DEC = apparent Dec (deg).
         LAT0 = latitude at center of disk (deg).
         LONG0 = longitude at center of disk (deg).
         PA = position angle of rotation axis (deg).
	  CARRINGTON = Carrington rotation number.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: based on the book Astronomical Formulae
         for Calculators, by Jean Meeus.
         If no arguments given will prompt and list values.
 MODIFICATION HISTORY:
       R. Sterner, 19 Feb, 1991
	24 July, 1991 --- added Carrington Rotation number
	  based on an equation from Howard Cohl, Sac Peak.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sun.pro)


SUNALTAZI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUNALTAZI
 PURPOSE:
       Compute sun position from date/time and long/lat.
 CATEGORY:
 CALLING SEQUENCE:
       sunaltazi, time, lng, lat, azi, alt
 INPUTS:
       time=t  Date and time string or double               in
          precision Julian Seconds.
       lng, lat = Longitude and latitude.  May be arrays.   in
 KEYWORD PARAMETERS:
       Keywords:
         ZONE=hrs  Hours ahead of GMT (def=0).  Ex: zone=-4 for EDT.
         SUBLNG=lng  Subsolar point longitude (deg).
         SUBLAT=lat  Subsolar point latitude (deg).
         /NOREFRACT  Means return true altitude, not refracted.
         ERROR=err   Time error flag (0=ok).
 OUTPUTS:
       azi, alt = corresponding solar azimuth and altitude  out
          at given points.  Altitude is refracted, not actual.
 COMMON BLOCKS:
 NOTES:
       Note: true alt returned unrefracted if it is < -1 deg.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 13
       R. Sterner, 1998 Jan 19 --- Renamed from sunpos to avoid conflict
       with a routine of the same name in the IDLASTRO library from GSFC.
       R. Sterner, 2001 Jan 24 --- Added /NOREFRACT.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sunaltazi.pro)


SUNCLOCK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUNCLOCK
 PURPOSE:
       Show world map with day, twilight, and night.
 CATEGORY:
 CALLING SEQUENCE:
       sunclock, plat, plong
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:  map_set keywords may be given to control the map
         display.
         TIME=dt_tm  Specify a date and time.
           Format is flexible but requires month name (3 char min).
           Default is current system time. Ex: "1994 jun 22 13:45"
         ZONE=n  Specify a time zone as hours ahead of GMT.
           Default is local time zone.  Ex: zone=-4 for EDT.
           Only needed if in another time zone.
         /USA plots U.S. states.
         LNG=tlng, LAT=tlat Lat and Long array to plot.
         COLOR=clr  Plot color [r,g,b].
         /QUIET means suppress status messages.
         /SAME_WINDOW means use last window instead of a new one.
 OUTPUTS:
 COMMON BLOCKS:
       sunclock_com
 NOTES:
       Notes: The meaning of the colors is as follows:
         Subsolar point: Red.
         Daylight: Yellow-Orange.
         Sun rise/set line: Red.
         Twilights: Pink, Blue, and Darker Blue bands.
           Civil:        Sun is   0 to  -6 degrees below horizon.
           Nautical:     Sun is  -6 to -12 degrees below horizon.
           Astronomical: Sun is -12 to -18 degrees below horizon.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 5

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sunclock.pro)


SUNDISK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUNDISK
 PURPOSE:
       Compute solar disk coordinates as seen from anywhere.
 CATEGORY:
 CALLING SEQUENCE:
       sundisk,time, elng, elat, hlng, hlat
 INPUTS:
       time = UT time (JS or date/time string).           in
       elng, elat = Ecliptic long,lat of observer (deg).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       hlng, hlat = Heliographic long, lat of             out
         solar disk center (deg).
 COMMON BLOCKS:
 NOTES:
       Notes: example time in js:
         js0=dt_tm_tojs('2005 aug 18 3:13')
       To test find central disk heliographic coordinates
       as viewed from earth using sunjs, which also gives
       also central heliographic as seen from earth:
         sunjs,js0,app_long=elngs,lat0=hlat0,long0=hlng0
       Earth's longitude is 180 deg from sun's longitude:
         elnge = elngs - 180.
       Using sundisk:
         sundisk,js0,elnge,0.,hlng,hlat
       Compare: help,hlat0,hlat,hlng0,hlng
 MODIFICATION HISTORY:
       R. Sterner, 2001 Jan 18

 Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sundisk.pro)


SUNGLINT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:	sunglint

 PURPOSE:	compute lat-lon of point on earths surface which will
               reflect sunlight to satellite observation point by 
               purely specular reflection.

 USEAGE:	sunglint,doy,time,lat,lon,alt,glat,glon

 INPUT:

   doy		day of year              (scalor)
   time	time UTC (hours)         (scalor)
   lat         satellite latitude       (scalor)
   lon         satellite longitude      (scalor)
   alt         satellite altitude       (scalor)

 OUTPUT

   glat        sunglint latitude
   glon        sunglint longitude
   gnadir      sunglint nadir angle
   gaz         sunglint azimuth
               
               if satellite is on the night side 
               glat and glon are returned as 1000,1000
 
   if parameters GLAT, GLON, GNADIR and GAZ are left off the argument
   list then SUNGLINT prints these parameters to the terminal


 KEYWORD INPUT:

  
 EXAMPLE:	

 sunglint,129,21.5,25,-120,800,glat,glon,gnadir,gaz
 print,f='(4f10.2)',glat,glon,gnadir,gaz

 sunglint,80,12,90.0,0,1000              ; sunlat =0 sunlon=0
 sunglint,80,12,90.0,0,10000             ;   note how glat approaches
 sunglint,80,12,90.0,0,100000            ;   45 at alt is increased
 sunglint,80,12,90.0,0,1000000           ; 


 REVISIONS:

  author:  Paul Ricchiazzi                           dec 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\sunglint.pro)


SUNJS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUNJS
 PURPOSE:
       Computes geocentric physical ephemeris of the sun.
 CATEGORY:
 CALLING SEQUENCE:
       sunjs, js
 INPUTS:
       js = ephemeris time as Julian Seconds.  in
         Delta T = ET - UT which is not completely
         predictable but is about 1 minute now.
         This difference is noticable slightly.
 KEYWORD PARAMETERS:
       Keywords:
         /LIST displays values on screen.
         DIST = distance in AU.
         SD = semidiameter of disk in arc seconds.
         TRUE_LONG = true longitude (deg).
         TRUE_LAT = 0 always.
         APP_LONG = apparent longitude (deg).
         APP_LAT = 0 always.
         TRUE_RA = true RA (hours).
         TRUE_DEC = true Dec (deg).
         APP_RA = apparent RA (hours).
         APP_DEC = apparent Dec (deg).
         LAT0 = latitude at center of disk (deg).
         LONG0 = longitude at center of disk (deg).
         PA = position angle of rotation axis (deg).
         CARRINGTON = Carrington rotation number.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: based on the book Astronomical Formulae
         for Calculators, by Jean Meeus.
         If no arguments given will prompt and list values.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 13
       R. Sterner, 1998 Apr 15 --- Modified to work for arrays of times.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sunjs.pro)


SUNPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUNPOS
 PURPOSE:
       Compute sun position from date/time and long/lat.
 CATEGORY:
 CALLING SEQUENCE:
       sunpos, time, lng, lat, azi, alt
 INPUTS:
       time=t  Date and time string or double               in
          precision Julian Seconds.
       lng, lat = Longitude and latitude.  May be arrays.   in
 KEYWORD PARAMETERS:
       Keywords:
         ZONE=hrs  Hours ahead of GMT (def=0).  Ex: zone=-4 for EDT.
         SUBLNG=lng  Subsolar point longitude (deg).
         SUBLAT=lat  Subsolar point latitude (deg).
 OUTPUTS:
       azi, alt = corresponding solar azimuth and altitude  out
          at given points.  Altitude is refracted, not actual.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 13

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sunpos.pro)


SUN_COLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUN_COLORS
 PURPOSE:
       Load sun color table
 CATEGORY:
 CALLING SEQUENCE:
       sun_colors
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DEEPER means use deeper colors.
         /QUANTIZED means show day colors in 10 degree bands.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: loads color table from sun_colors.txt
         or sun_colors0.txt (more saturated)
         in routine source directory.
         Colors above index 185 are untouched.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 17
       R. Sterner, 1997 Dec 30 --- converted color table to a text file.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1999 Oct 14 --- Added original more saturated colors.
       R. Sterner, 2000 Sep 19 --- Added 10 degree banded color tables.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sun_colors.pro)


SUN_SHADE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUN_SHADE
 PURPOSE:
       Make a colored shaded relief view of a surface array.
 CATEGORY:
 CALLING SEQUENCE:
       relief = sun_shade(surf, [alt, azi, smin, smax])
 INPUTS:
       surf = Surface array.                          in
       alt = Optional sun altitude (def = 60).        in
       azi = Optional sun azimuth (def = 135).        in
       smin = Optional min value to use for scaling.  in
       smax = Optional max value to use for scaling.  in
         If not specified the array min and max are used.
         These are useful to insure that different data
         arrays are scaled the same.
 KEYWORD PARAMETERS:
 OUTPUTS:
       relief = Shaded relief image.                  out
 COMMON BLOCKS:
 NOTES:
       Note: Use shade_clt to get proper color table.
 MODIFICATION HISTORY:
       J. Culbertson, 15 Feb, 1989.
       Re-entered by RES.
       Johns Hopkins University Applied Physics Laboratory.
       RES 31 Aug, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sun_shade.pro)


SUN_ZD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SUN_ZD
 PURPOSE:
       Return solar zenith distances for given position.
 CATEGORY:
 CALLING SEQUENCE:
       zd = sun_zd(lng, lat, t1, t2)
 INPUTS:
       lng = Longitude of position (west<0).               in
       lat = Latitude of position.                         in
       t1 = start time.                                    in
       t2 = end time (def=t1+1 day).                       in
         Times may be Julian Seconds or Date/Time string.
 KEYWORD PARAMETERS:
       Keywords:
         ZONE=hrs  Hours ahead of GMT (def=0). Ex: zone=-4 for EDT.
         NUMBER=n  Specified number of output values (def=25).
         TIME=t    Returned time (JS) for each ZD.
         AZIMUTH=azi  Returned azimuths for each time.
 OUTPUTS:
       zd = returned solar zenith distances in degrees.    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 15
       R. Sterner, 1998 Jan 19 --- Renamed sunpos to sunaltazi.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\sun_zd.pro)


SUPERPIX

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:           superpix

 USEAGE:            superpix, a, binsz, abin, sbin
                    superpix, a, binsz, abin, sbib, /align, /compare

 PURPOSE:           compute super pixel average and standard deviation
                    of a scene

 INPUT:
         a          image array

         binsz      A scalar specifying the number of horizontal and 
                    vertical sub-pixels in one super pixel. 
                    BINSZ must be an odd integer.

         align      If set, output arrays are REBINed back up to the 
                    original size and output array cell centers are aligned
                    with input array cell centers.

         compare    if set, compare A and ABIN with the FLICK procedure

 OUTPUT:
         abin       mean value of superpixel at superpixel cell centers

         sbin       standard deviation of superpixel at superpixel
                    cell centers.

 AUTHOR:            Paul Ricchiazzi    oct92 
                    Earth Space Research Group, UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\superpix.pro)


SUPER_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	super_plot

 PURPOSE:
   this procedure creates ps files by plotxy in for the icg-1 datalibrary

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   super_plot,campaign

 INPUTS:
 campaign: the name of the campaign you like to have plots, e.g. 'STREAM1997'


 OUTPUTS:
   a  ps file


 RESTRICTIONS:
 will at the moment only work whith icg1's data-base

 EXAMPLE:
   super_plot,'stream1997'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),August 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\super_plot.pro)


SWAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SWAP
 PURPOSE:
       Swap two values.
 CATEGORY:
 CALLING SEQUENCE:
       swap, a, b
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1997 Nov 12

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\swap.pro)


SWATH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  swath

 PURPOSE:  plot raw data (not on a regular lat-lon grid) from a satellite
           pass on a predifined ploting grid (usually setup by map_set)

 USEAGE:   swath,image,lon,lat,thick=thick,nlevels=nlevels, $
           colors=colors,outline=outline

 INPUT:    

  image
    two dimensional satellite data field.  the first index 
    corresponds to cross-track sample number and the second 
    to the along-track line number.

  lon
    longitude array, same size as image

  lat
    latitude array, same size as image

 KEYWORD INPUT:
  thick
    thickness of lines used to fill lines in swath
    (The default is 3 for "X" and 10 for "ps")

  colors
   discreet set of colors used for each level in LEVELS.  

  nlevels
    number of contour level values (if not set continuous colors are used)

  range
    physical range of image (2 element vector)

  outline
    color index used to draw swath outline. If not set, a swath
    outline is not drawn. 

 KEYWORD OUTPUT:
  colors 
    a vector of color indicies which can be used as input to
    color_key. This is required to coordinate the color key with the
    discreet colors drawn by SWATH. It is not required when nlevels
    is not set.  COLORS is returned if the input value of COLORS is a
    named variable with 0 or 1 elements.

 DISCUSSION:
    Each individual satellite line is drawn as a separate call
    to PLOTS.  Hence, there may be gaps between lines.  This
    can be controlled by adjusting the thickness of the drawn
    lines.  If the the printer has greater resolution than the
    screen or if the number of lines is not large, you may have to
    increase THICK to avoid getting gaps between lines on your
    hardcopy.

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 y=findrng(-8500,8500,400)     ; satelite data coordinates (400 lines)
 x=findrng(-1012,1012,100)     ;                           (100 samples)
 gengrid,x,y
 incl=98                       ; orbital inclination
 az=atan(x,y)/!dtor            ; azimuth (clockwise around track direction)
 az=(az+90-incl+360) mod 360
 rng=sqrt(x^2+y^2)             ; range   (from equator crossing)
 compass,0,0,rng,az,alat,alon,/to_latlon 
 range=[0,1]
 colors=0

 map_set,0,0,/orth,pos=boxpos(/asp)
 for i=0,5 do swath,abs(sin(!pi*x/2000)*sin(!pi*y/2000)), $
     alon+25*i-50,alat,nlev=11,colors=colors,/outline
 map_continents
 map_grid
 color_key,range=range,colors=colors
  
 map_set,0,0,/cyl,pos=boxpos(/asp)
 for i=0,5 do swath,abs(sin(!pi*x/2000)*sin(!pi*y/2000)), $
     alon+30*i-60,alat,nlev=11,colors=colors,outline=255
 map_continents
 map_grid
 color_key,range=range,colors=colors
 

 AUTHOR:   Paul Ricchiazzi                        20 Dec 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\swath.pro)


SWDELETE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SWDELETE
 PURPOSE:
       Delete a scrolling window.
 CATEGORY:
 CALLING SEQUENCE:
       swdelete, [index]
 INPUTS:
       index = optional window index (def=current window).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       swindow_com
 NOTES:
       Notes: index may point to either a scrolling window made
         by swindow or to an ordinary window.
 MODIFICATION HISTORY:
       R. Sterner, 14 Jun, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\swdelete.pro)


SWIDTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		SWIDTH
 VERSION:
		4.2
 PURPOSE:
		Calculating peak width.
 CATEGORY:
		Spectral analysis.
 CALLING SEQUENCE:
		Result = SWIDTH ( X, Y [, keywords])
 INPUTS:
	X
		Numeric, Either a vector (scalar is considered to be a vector of
		length 1) or an [2,*] array.
 OPTIONAL INPUT PARAMETERS:
	Y
		Numeric, acceptable only when X is a vector, in which case Y has to be
		a vector of same length.

		Note:	If only one input is provided then, if it is a [2,*] array, it
				is split into X and Y vectors.  If it is a vector then it is
				taken to be Y.  In such case X is generated internally as a
				vector with spacing of 1, unless DELTA is explicitly provided.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	DELTA
		Sets the spacing of the X coordinates of the data.  If the X coord.
		are explicitly provided (see X input above) DELTA is ignored.
	BASELINE
		Optional baseline, to be subtracted from the Y values.  Can be given
		either as a scalar or a vectro of same length as Y.
 OUTPUTS:
		Returns the "square width" calculated as

			(Integral(Y))^2/integral(Y^2)

		For a gaussian this yields sigma*sqrt(4*pi).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Strightforward.  Calls INTEG, SPLIT_XY and FPU_FIX from MIDL.
 MODIFICATION HISTORY:
		Created 10-JUN-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\swidth.pro)


SWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SWINDOW
 PURPOSE:
       Create a scrolling window.  Works much like window.
 CATEGORY:
 CALLING SEQUENCE:
       swindow
 INPUTS:
 KEYWORD PARAMETERS:
       keywords:
         INDEX=ind Returned window index, base number, and
           sw index:
           ind = [indx, base, sw_ind].  Use ind in wset, base
           is not be needed directly, sw_ind is used in swdelete.
         COLORS=c  Set number of colors to use in windows.
           Must be given for the first window created.
         XSIZE=xs  Set total window X size in pixels.
         YSIZE=ys  Set total window Y size in pixels.
           Defaults = 500 x 400.
         X_SCROLL_SIZE=xsc  Set visible window X size in pixels.
         Y_SCROLL_SIZE=ysc  Set visible window Y size in pixels.
           Defaults = total window size up to 2/3 screen size.
         TITLE=txt  Set optional window title.
         /QUIET  means do not list window number when created.
         RETAIN=r  Set backing store type (def=2, see manual).
         /PIXMAP means use pixmap instead of screen window.  If
          given then an ordinary window is used.
 OUTPUTS:
 COMMON BLOCKS:
       swindow_com
 NOTES:
       Notes: A draw widget is used to make a scrolling window.
         Differences between windows and draw widgets prevent
         exact emulation of the window command.
         See also swdelete, and swlist.
 MODIFICATION HISTORY:
       R. Sterner, 14 Jun, 1993
       R. Sterner, 29 Sep, 1993
       R. Sterner, 30 Dec, 1993 --- added /QUIET.
       R. Sterner, 1995 Dec 20 --- removed window size extension.
       R. Sterner, 1997 Sep 24 --- Handled Win95 Y scroll bug.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\swindow.pro)


SWITCH_GREEK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	switch_greek

 PURPOSE:
	This procedure translates text written with Hershey Font 7 for
	use with the PostScript SYMBOL 

       Note: Not all characters can be translated: y and z of Font 7

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       switch_greek,string

 INPUTS:
       the string to be printed 

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:

 OUTPUTS:
	The string string contains the characters to be printed with the
       PostScript Symbol Font instead of the hershey greek font.

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:
      

 PROCEDURE:


 EXAMPLE:
       testgreek

 MODIFICATION HISTORY:
 	Written by:	M. Busch, 18.02.1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mb_lib\switch_greek.pro)


SWLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SWLIST
 PURPOSE:
       Display info for all scrolling windows, set new active one.
 CATEGORY:
 CALLING SEQUENCE:
       swlist
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       swlist_com
       swlist_com
       swindow_com
 NOTES:
       Notes: Scrolling windows are useful for images larger than
         the screen can display.
         To create a scrolling window: use swindow.
         To delete a scrolling window: use swdelete.
         To display info on all scrolling windows: use swlist.
 MODIFICATION HISTORY:
       R. Sterner, 29 Sep, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\swlist.pro)


SYMASYM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SYMASYM
 PURPOSE:
       Resolve an array into symmetric & anti-symmetric components.
 CATEGORY:
 CALLING SEQUENCE:
       symasym, in, sym, asym
 INPUTS:
       in = input array (1-d or 2-d).          in
 KEYWORD PARAMETERS:
       Keywords:
         /X  means do symmetry/antisymmetry in X dimension.
         /Y  means do symmetry/antisymmetry in Y dimension.
            These keywords only apply to 2-d data.
 OUTPUTS:
       sym = symmetric component of in.        out
       asym = anti-symmetric component of in.  out
 COMMON BLOCKS:
 NOTES:
       Notes: A set of radially sym/asym components for a
         2-d array may be obtained as follows:
         symasym,z,sx,sy,/x
         symasym,z,sy,sy,/y
         sym  = (sx+sy)-(ax+ay)
         asym = (sx-sy)-(ax-ay)
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jun 21

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\symasym.pro)


SYMBOLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:	    SYMBOLS
 PURPOSE:
	    Create custom plotting symbols
 CATEGORY:
 CALLING SEQUENCE:
	    symbols,symbol_number,scale	
 INPUTS:
	    symbol_number=
                1 = open circle
                2 = filled circle
                3 = arrow pointing right
                4 = arrow pointing left
                5 = arrow pointing up
                6 = arrow pointing down
                7 = arrow pointing up and left (45 degrees)
		 8 = arrow pointing down and left
		 9 = arrow pointing down and right.
		 10 = arrow pointing up and right.
		 11 through 18 are bold versions of 3 through 10
		 19 = horizontal line
		 20 = box
		 21 = diamond
		 22 = triangle
		 30 = filled box
		 31 = filled diamond
		 32 = filled triangle
		 
	    Scale = size of symbols.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
		Color = color of symbols
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
           The desired symbol is stored in the user buffer and 
	    will be plotted if !P.PSYM = 8.

 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
		Jeff Bennett, U of Colorado, 198?

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\symbols.pro)


SYM[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        SYM

 PURPOSE:
 
        This function provides a convenient way to utilize the
        USERSYM procedure to create an extended choice of plotting
        symbols, and is intended to be used directly with the PSYM
        keyword to PLOT, OPLOT, etc.

 CALLING SEQUENCE:
 
        Result=SYM(NUMBER)

 INPUTS:
 
        NUMBER - symbol number
 
               0 : dot
               1 : filled circle
               2 : filled upward triangle
               3 : filled downward triangle
               4 : filled diamond
               5 : filled square
               6 : open circle
               7 : open upward triangle
               8 : open downward triangle
               9 : open diamond
              10 : open square
              11 : plus
              12 : X
              13 : star
              14 : filled rightfacing triangle
              15 : filled leftfacing triangle
              16 : open rightfacing triangle
              17 : open leftfacing triangle

 OUTPUTS:
 
        The function returns the symbol number to be used with the
        PSYM keyword in the PLOT, OPLOT, etc. commands

 SIDE EFFECTS:
 
        The USERSYM procedure is used to create a symbol definition.

 EXAMPLE:

        To produce a plot using open circles as plotting symbols:
 
        PLOT,X,Y,PSYM=SYM(6)

 MODIFICATION HISTORY:
 
        Martin Schultz, Harvard University, 22 Aug 1997: VERSION 1.00
        
        (with some minor changes to the information in this header by
        D. Windt, windt@bell-labs.com)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\sym.pro)


SYM[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        SYM

 PURPOSE:
        This function defines a standard sequence of plotting symbols
        that can be used in place of PSYM e.g. in a call to
        PLOT. Example: plot,x,y,psym=sym(1) draws filled circles.
        A chart of these new symbols can be created with Showsym.

 CATEGORY:
        General Graphics

 CALLING SEQUENCE:
        PLOT,X,Y,PSYM=SYM(NUMBER)

 INPUTS:
        NUMBER    ->   symbol number
 
               0 : dot
               1 : filled circle
               2 : filled upward triangle
               3 : filled downward triangle
               4 : filled diamond
               5 : filled square
               6 : open circle
               7 : open upward triangle
               8 : open downward triangle
               9 : open diamond
              10 : open square
              11 : plus
              12 : X
              13 : star
              14 : filled rightfacing triangle
              15 : filled leftfacing triangle
              16 : open rightfacing triangle
              17 : open leftfacing triangle

 KEYWORD PARAMETERS:

 OUTPUTS:
        function returns the symbol number to be used with PSYM= in the 
        PLOT command

 SUBROUTINES:
        SHOWSYM : Can be used to produce a symbol chart for reference
        (Type .r sym, then showsym, optionally with the /PS option).
        Extra keywords are passed to PLOTS, so you can e.g. choose
        a fancy color for your chart.

 REQUIREMENTS:

 NOTES:
        This function produces a side effect in that the USERSYM procedure
        is used to create a symbol definition. It's meant for usage within
        the PLOT, OPLOT, etc. command

 EXAMPLE:
        PLOT,X,Y,PSYM=SYM(0),SYMSIZE=3
                produces a plot with dots (standard symbol 3)
        FOR I=0,17 DO OPLOT,X+1,Y,PSYM=SYM(I),COLOR=I
                overplots 17 curves each with its own symbol

 MODIFICATION HISTORY:
        mgs, 22 Aug 1997: VERSION 1.00
        mgs, 10 Sep 1999: - added SHOWSYM procedure
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\sym.pro)


SYST2INF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	syst2inf

 PURPOSE:
   This function translates the systime time or an other to the time format YYY-MM-DD hh:mm:ss.

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=syst2inf([time][,/short][,/equal_length][,/strtrim][,/js])

 OPTIONAL INPUTS:
   time: the time in the format of idl e.g. 'Sat Jun 13 13:31:13 1997'
         if omitted current system time is taken

 KEYWORD PARAMETERS:
   short        : result will be without :  -  and ' '
   {equal_length: day and month will be formated with a leading 0 if day or month lt 10}
   strtrim      : trailing and leading blanks are removed
   js           : output in julian seconds

 OUTPUTS:
   The result is a string of system time formatted like '1997-6-13 13:31:13'

 EXAMPLE:
   help,syst2inf()
       STRING    = '1998-06-10 20:09:37 '
   help,syst2inf(/short)
       STRING    = '19980610201300'


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Sep. 25 1996
               R.Bauer  , Mar 1997 input parameter time added
               R.Bauer 1998-Jun-13 keywords short and equal_length added
               1999-03-01 keyword equal_length is obsolete because it's default
               1999-03-06 keyword strtrim added
               2000-02-11 keyword js added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\syst2inf.pro)


TABLE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    table

 PURPOSE:    print a table of vectors in nicely formatted columns

 USEAGE:     table,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,f=f

 INPUT:      
  p1,p2,...  a set of vector quantities to print. all vectors must
             be of the same length

 KEYWORD INPUT:
   f         format specification string, E.G.  'f10.3,e11.2'

             NOTE:     don't provide a specification for the integer
             subscript which appears in the first column. TABLE puts
             it in automatically. Also, the format string need not
             have opening and closing parenthesis, but its ok to put
             them in.

   index     if set, the array indicies of the first parameter, p1,
             are printed.  This only has effect when p1 has dimension
             greater than two.  Indicies for array dimensions greater
             than 5 are not printed.


 EXAMPLE:

    x=sqrt(findgen(20)+23)
    y=sin(.1*x)

    table,x,y                                            ; 
    table,x,y,x+y,x-y,x*y,(x+y)*(x-y),x/y,f='7f10.3'
    table,rebin(x,4,5),y,/index
    table,rebin(x,5,4),y,/index
    table,rebin(x,5,2,2),y,/index

  author:  Paul Ricchiazzi                            may94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\table.pro)


TABULATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		TABULATE
 VERSION:
		4.0
 PURPOSE:
		Accepts data in form of a set (up to 8) one dimensional arrays and
		prints it out as a table.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		TABULATE, A [,B ....H] [,keywords]
 INPUTS:
	A [B ... H]
		One or more (up to 8) one dimensional arrays.  Type arbitrary
		(including string arrays).  If the array lengths are not all equal, the
		shortest length will be used.
 OPTIONAL INPUT PARAMETERS:
		All but the first array are arbitrary.
 KEYWORD PARAMETERS:
	/INDEX
		If set, the elements indices (0, 1 ... etc.) are printed in the first
		column of the table.  Set by default if only one column is provided.
	FROM
		Specifies the index of the first element to be displayed.  Default is 0.
	TO
		Specifies the index of the last element to be displayed.  Default is
		end of array.
	TITLE
		Character string, used as the title of the table.  Default is no title.
	HEADER
		Character array containing the titles of the columns.  Default titles
		are the letters A thru H.  The title of the index column, if it appears
		is N and cannot be changed.  If some of the entries in HEADER are null
		strings, the default headers will be used for the corresponding columns.
	/NOHEADER
		Switch.  If set, no header is printed.  If HEADER is provided and
		NOHEADER is set, HEADER will be ignored.
	FORMAT
		Character array, containing format specifications for the columns.  The
		default formats are as follows:
			BYTE		- I4
			INTEGER		- I8
			LONG		- I12
			FLOATING		- G13.6
			DOUBLE		- G16.8
			COMPLEX		- G13.6  (twice)
			STRING		- A16
			DOUBLECOMPLEX 	- G16.8  (twice)
		If some of the entries in FORMAT are null strings, defaults will be
		used for the corresponding columns.  If only partial formats are given
		(for example 'E', or '16.6') missing fields are filled from the
		default.  Valid formats are A, D, E, F, G, I, O, Z.  Nonvalid formats
		are ignored.
		Important:  TABULATE may change the formats (either defaults or
		provided explicitly through FORMAT) in order to make enough room in the
		display.
	REALFORM
		Character string (only first letter matters).  If given and is one of
		D, E, F or G, provides the default format for all the real, double and
		complex data.  If not given, the default is G format.
	/IDF_OFF
		Switch.  In normal operation formats I, D and F (if present) are
		adjusted to the sizes of numbers displayed.  /IDF_OFF, when set, turns
		off this adjustment.
	FILE
		String representing a valid file name (if extension is not provided the
		default is .TAB).  If provided, the output is sent to this file,
		otherwise it is sent to the terminal.
	/MORE
		Sends output to the screen one page at a time (like UNIX MORE).
 OUTPUTS:
		None, other then the printed table.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		TABULATE may reduce the widths of the print fields in order to
		accomodate all the data.  If after reduction to minimum widths the data
		still cannot be fitted, no table will be generated.
		While in theory TABULATE can display up to 8 columns, the actual number
		depends on the data types and magnitudes.  Approximate maximal numbers
		of columns are:
			BYTE, INTEGER
			or STRING		- 8 columns (strings may be truncated)
			LONG		- 6-8 columns (depends on size)
			FLOAT		- 8 columns in E/G format.  Size dependent in F.
			DOUBLE		- 8 columns in E/G format.  Size dependent in F.
			COMPLEX		- 4 columns in E/G format.  Size dependent in F.
			DOUBLECOMPLEX	- 4 columns in E/G format.  Size dependent in F.

		Beginning with the SEP-1997 version, undefined columns are ignored
		instead of being flagged as an error.  If there are defined columns
		following an undefined one, they'll be ignored as well.
 PROCEDURE:
		Straightforward.  Uses ABS_MM, DEFAULT, STREQ, STRPARSE_MM and TYPE
		from MIDL.
 MODIFICATION HISTORY:
		Created 3-MAY-1992 by Mati Meron.
		Modified 20-JUN-1995 by Mati Meron to accept the new DOUBLECOMPLEX type.
		Modified 30-MAY-1996 by Mati Meron.  Added keyword NOHEADER.
		Modified 20-JUL-1997 by Mati Meron.  Adjusted format handling.
		Modified 20-SEP-1997 by Mati Meron.  Ability to ignore undefined
		columns added.
		Modified 15-NOV-1997 by Mati Meron.  Formats adjusted to IDL standards
		and correction for the errant behavior of G format added.
		Modified 20-SEP-1998 by Mati Meron.  TABULATE now accepts multiline
		titles.  Also, repeated formats, such as '3i' or '5e12.4' are now
		recognized.  Enclosing formats in parentheses is legal but not needed.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\tabulate.pro)


TAGSIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   TAGSIZE

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Compute SIZE descriptors for each tag in a structure

 CALLING SEQUENCE:
   SIZES = TAGSIZE(STRUCT, N_TAGS=ntags, TAG_NAMES=tagnames,
                   STRUCTURE_NAME=structname, STATUS=status, LENGTH=length)

 DESCRIPTION: 

   The TAGSIZE function determines the types and sizes of each tag in
   a structure.  This is not as easy as it may seem, because IDL
   makes it very, *very* difficult to find out the true dimensions of
   a structure element.

   Here is a brief explanation.  It is known that IDL drops trailing
   dimensions of size 1 in many situations.  Also, for structures
   only, arrays of any dimensionality which have only one element are
   RETURNED AS SCALARS.  Thus, if you are doing any heavy duty work
   with structures, copying and querying individual elements between
   structures, etc., you will find that you will lose some crucial
   dimensions which you can't normally regain.

   TAGSIZE attempts to work around all of these limitations to
   present the true dimensions of all elements in a structure.

   It returns an 11xNTAGS array, which contains a SIZE-style vector
   for each element in the structure.  Eleven elements is the largest
   array size needed to describe any IDL data type using SIZE.  Thus,
   to extract information about the second tag in structure X
   (element number 1 starting from zero), you would use the following
   code:

     SIZES = TAGSIZE(X)  ;; Extract type information from structure X
     SIZE_1 = SIZES(*,1) ;; Extract type information about the 2nd element

     SIZE_1 = SIZE_1(0:SIZE_1(0)+2) ;; Trim the array if desired

   The last command is optional, but trims the resulting array to be
   a true SIZE-style result.
     
   TAGSIZE also has several convenience keywords to extract other
   relevant information about a structure.


 INPUTS:

   STRUCTURE - any structure to examine.  If the value is not a
               structure then an error is reported.

 KEYWORDS:

   N_TAGS - upon return, the number of tags in the structure is
            stored in this keyword.

   TAG_NAMES - upon return, the names of each tag are stored in this
               keyword, as an array of strings.

   STRUCTURE_NAME - upon return, the name of the structure is stored
                    in this keyword.  If the structure is anonymous
                    then the empty string ('') is returned.

   LENGTH - upon return, the size in bytes of each tag element in the
            structure is stored in this keyword, as an array of
            integers.

   STATUS - upon return, the status is stored in this keyword.  A
            value of 1 indicates success, 0 indicates failure.


 RETURNS:

   A two dimensional array, with dimensions LONARR(11,NTAGS),
   containing the size information of all tag elements in the
   structure.  SIZES(*,i) is the SIZE-style vector for tag element i.

 EXAMPLE:

   Compute the sizes of the elements in X, defined here.
     IDL> x = {a: [1], b: intarr(2,2), c: reform(strarr(2,1),2,1)}
     IDL> help, /struct, x
     ** Structure <818c8b4>, 3 tags, length=28, refs=1:
        A               INT       Array[1]
        B               INT       Array[2, 2]
        C               STRING    Array[2, 1]
     IDL> print, byte(tagsize(x))
        1  [1]  2   1   0   0   0   0   0   0   0
        2  [2   2]  2   4   0   0   0   0   0   0
        2  [2   1]  7   2   0   0   0   0   0   0
     [ Array dimensions are emphasized with brackets ]

   Compare this to the type information returned by HELP, which is
   incorrect for tags A and C.
     IDL> help, x.a, x.b, x.c
         INT       =        1
         INT       = Array[2, 2]
         STRING    = Array[2]

 SEE ALSO:

   TAG_NAMES, N_TAGS, SIZE, HELP, INPUTFORM, HELPFORM

 MODIFICATION HISTORY:
   Written, CM, 13 May 2000
   Documented, 05 Jul 2000
   Small documentation changes, CM, 31 Aug 2000
   Signficant cleanup of HELP parsing, CM, 04 Dec 2000
   Added case for array of structures with new parsing, CM 12 Jan
     2001

  $Id: tagsize.pro,v 1.4 2001/02/09 04:57:42 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\tagsize.pro)


TAG_DEFINED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	tag_defined

 PURPOSE:
	This function returns 1 if a tag name is defined in a given structure.

 CATEGORY:
	OBSOLETE

 CALLING SEQUENCE:
	result = tag_defined(struc, tagname)

 INPUTS:
	struc:  		the structure
	tagname:    the tag name as string which will be searched for in struc

 OUTPUTS:
   Result will be 1 if tagname is defined in struc else 0

 RESTRICTIONS:
	tag_defined does not search for tag names recursively, so if struc
	is a structure containing nested structures, only the tag names
	in the outermost structure are tested.

 EXAMPLE:
   print, tag_defined({a_tag:4L, b_tag:'Hello'},'b_tag')
   --> 1

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 18.01.98
	15.11.98:	Header added
	16.11.98:	Error handling improved
	28.04.99:	Changed CATEGORY to OBSOLETE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\tag_defined.pro)


TAG_POSITION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TAG_POSITION

 PURPOSE:
     This function finds the position of a tag in a structure

 CATEGORY:
     PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
     pos=tag_position(structure,tag,[count],[valid=valid])

 INPUTS:
     structure: name of the structure to be searched for
     tag      : name of the tag whose position should be find

 OPTIONAL OUTPUTS:
     count:   is n_elements of tag

 KEYWORD PARAMETERS:
   valid: if arg_present the valid indices are returned in valid

 OUTPUTS:
     pos: the tag position (integer)

 EXAMPLE:
     test=create_struct('A',1,'B',2)
     pos= tag_position(test,'A')
     pos= tag_position(test,['A','B','C'])

 MODIFIVATION HISTORY:
       Written         Marsy Lisken, august 1998
       1999-June-30    Routine is now able to look at multiple tags in structure
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\tag_position.pro)


TAG_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TAG_TEST
 PURPOSE:
       Test if given tag is in given structure.
 CATEGORY:
 CALLING SEQUENCE:
       flag = tag_test(ss, tag)
 INPUTS:
       ss = given structure.       in
       tag = given tag.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       flag = test result:         out
          0=tag not found, 1=tag found.
 COMMON BLOCKS:
 NOTES:
       Note: useful for testing if tag occurs. Example:
         if tag_test(ss,'cmd') then call_procedure,ss.cmd
 MODIFICATION HISTORY:
       R. Sterner, 1998 Jun 30

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tag_test.pro)


TAIL[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	tail

 PURPOSE:
	This function returns the last element of an array or the last character of a string

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	result = tail(var [, ntail])

 INPUTS:
	var: variable of which last element (if array) or last character (if string)
		will be returned.

 OPTIONAL INPUTS:
	ntail: see under KEYWORD PARAMETERS

 KEYWORD PARAMETERS:
	N_TAIL = ntail: If set the ntail last elements (chars) of var are returned

 OUTPUTS:
	This function returns the last element of an array or the last character of a string.
	If var is neither an array nor a string this function simply returns var.

 EXAMPLE:
	a = INDGEN(10)
	PRINT, tail(a)     --->     9

	a = 'tail.pro'
	PRINT, tail(a, NTAIL = 3)     --->     'pro'

	a = 1.2345D-12
	PRINT, tail(a)     --->     1.2345000e-012

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 30.07.1999
	17.05.2000:	ntail may now also be entered as an optional positional argument.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\tail.pro)


TAIL[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		TAIL
 VERSION:
		4.0
 PURPOSE:
		Displays the ending ("tail") or, optionally, a selected part of an
		1-2D array.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		TAIL, A [,B ...H] [,keywords]
 INPUTS:
	A [,B ...H]
		One or more arrays, of arbitrary type.  If more than one array is
		provided, all the arrays have to be 1D.  A single array can have 1 or
		2 dimensions, but no more than 2.
 OPTIONAL INPUT PARAMETERS:
		All but the first input are optional.
 KEYWORD PARAMETERS:
	NR
		The number of rows to be displayed.  Default value is 10 (except for
		the case of a single 1D array in wrapping mode (see keyword NO_WRAP,
		below), when it is 12).  If explicit values for the starting and ending
		row numbers are provided through the keyword ROW (see below), NR is
		ignored.
	NC
		Same as NR, for columns.  Default value is 6, maximal value is 8.
		In the case of a single 1D array in wrapping mode, NC is
		interchangeable with NR and, if both are provided, NC is ignored.
	ROW
		Specifies the first (and possibly last) row of the displayed array
		part.  For an array with N rows, the possibilities are as follows:

			1)	No value provided: display area is from row #(N - NR) (or 0 if
				N - NR is negative) through row #(N - 1).
			2)	Scalar value r0:  display area is from row #r0 through row
				#(r0 + NR - 1) or last row, whichever comes first.
			3)  Single vector value r0 (for example, ROW = [4]):  this is
				interpreted as a vector input, ROW = [r0,r0] (see case 4 below)
				and a single row (#r0) is output.
			4)	Two element vector of the form ROW = [r0,r1]:  In this case
				display area is from row #r0 through row #r1.

		In the case of a single 1D array in the default wrapping mode (see
		keyword NO_WRAP, below), ROW is interchangeble with COLUMN and
		specifies the first (and, possibly, last) element to be displayed).
	COLUMN
		Same as ROW, for columns of the display area.  For a 2D array the
		default number of displayed columns is the smaller of 6 and the actual
		number of columns in the data.  For 1D arrays COLUMN is ignored,
		except for the case of a single 1D array in wrapping mode.  In this
		case COLUMN is interchangeable with ROW (see above) and ignored if ROW
		is provided.
		Maximal possible number of displayed columns is 8.
	/TRANSPOSE
		Switch.  If set and the input array is 2D, the transpose of the array
		is used.  Thus TAIL, A, /TRANSPOSE is equivalent to TAIL, TRANSPOSE(A).
		Ignored for multiple 1D inputs.
	/SHOW_INDEX
		Switch.  If set, the indices of the rows and columns shown are
		displayed, on the right (for rows) and top (for columns).
	/NO_WRAP
		Switch.  Turns off wrapping mode which is on, by default for single 1D
		arrays.  In the wrapping mode the array is displayed over as many lines
		as needed, same as when being displayed using the PRINT statement.  In
		a non-wrapping mode only a portion of a 1D array that fits on a single
		line may be displayed.  If the input consists of a 2D array or multiple
		1D arrays, the wrapping mode is off.
	FORMAT
		Character array, containing format specifications for the columns.
		If not provided, default TABULATE formats are used.  If only a single
		entry provided, it'll be used for all columns.  For more details see
		TABULATE.
		If multiple entries are provided in the wrapping mode, only the first
		one is used.
	_EXTRA
		A formal keyword used to pass keywords to TABULATE.  Not to be used
		directly.  All TABULATE keywords are available.
 OUTPUTS:
		None, other then the printed output.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		As mentioned above:
			1)	Arrays with more then 2 dimensions not accepted.
			2)	For 2D, only a single array is allowed.
			3)	For 1D, up to 8 arrays allowed.  They can be of different
				types but must have same length.
			4)  Wrapping is only possible with a single 1D array.
 PROCEDURE:
		TAIL serves as a front end to TABULATE.  It selects a part of the
		input, based on the row and column settings, and passes it to TABULATE
		which displays it.  In addition to TABULATE, TAIL calls DEFAULT,
		HOW_MANY, STRPARSE_MM and TYPE from MIDL.
		In the wrap mode, TAIL bypasses TABULATE and uses PRINT, directly.
 MODIFICATION HISTORY:
		Created 1-NOV-1997 by Mati Meron.
		Modified 5-OCT-1998 by Mati Meron.  Added wrap mode for 1D arrays.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\tail.pro)


TAI_UTC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   TAI_UTC

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Compute (TAI - UTC) time difference (i.e., leap seconds)

 MAJOR TOPICS:
   Time

 CALLING SEQUENCE:
   LEAP = TAI_UTC(JD_UTC)                  ;; or,
   LEAP = TAI_UTC(JD_TAI, /INVERT)

 DESCRIPTION:

   The function TAI_UTC computes the difference between International
   Atomic Time (TAI) and Universal Coordinated Time (UTC), in
   seconds.  

   After 01 Jan 1972, the two time systems are synchronized, except
   for a number of leap seconds added to account for the varying rate
   of rotation of the earth.  While TAI is a continuous atomic time
   system, UTC is a civil time system which may have discontinuities
   where leap seconds are introduced.  This function computes the
   differences between the two time systems.

   The conversion from UTC to TAI is computed as:

     JD_TAI = JD_UTC + TAI_UTC(JD_UTC)/86400

   The inversion conversion, from TAI to UTC, is computed as:

     JD_UTC = JD_TAI + TAI_UTC(JD_TAI, /INVERT)/86400

   Here JD_UTC and JD_TAI are the UTC and TAI times measured in
   Julian days respectively.

   The introduction of leap seconds is not predictable, owing to the
   non-linear processes that govern the rotation of the earth.  The
   International Earth Rotation Service determines when leap seconds
   will be introduced.  Thus, the user must download the history of
   leap seconds.  This file can be downloaded at the following URL:

     ftp://maia.usno.navy.mil/ser7/tai-utc.dat

   NOTE - the leap second file must be kept up to date as new leap
   seconds are introduced.  The file is kept internally in
   memory, but is reloaded from disk at least once per day.

   If the disk file is not available, then a copy of the file as
   available from the USNO on 02 Jan 2002 is used, but a warning
   message is printed.


 PARAMETERS: 

   JD - time measured in Julian days.  The time being converted
        *from*.

 RETURNS:

   The number of seconds to be added to the input time, to arrive at
   the desired time.


 KEYWORD PARAMETERS:

   INVERT - if set, then convert from TAI to UTC.  If not set
            (default), then convert from UTC to TAI.

 EXAMPLE:

   print, tai_utc(2451544.5d)
         32.000000


 REFERENCES:

   Definition of leap seconds.
      http://tycho.usno.navy.mil/leapsec.html

   File containing leap seconds.
     ftp://maia.usno.navy.mil/ser7/tai-utc.dat


 SEE ALSO
   TDB2TDT, SYSTIME, CALDAT, JULDAY
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Dec 2001
   Fixed array indexing errors when the requested time range falls in
     the leap second period, and the input is an array; avoided use
     of variable JDAY, which is a function clash for me, 02 Mar 2002,
     CM
   Added helpful usage message, CM, 15 Mar 2002

  $Id: tai_utc.pro,v 1.4 2002/03/15 12:00:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\tai_utc.pro)


TAND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TAND

 PURPOSE:
       Return the tangent of an angle specified in degrees rather than radians.

 CALLING SEQUENCE:
       x = tand(deg)

 INPUTS:
       angle   angle in degrees

 OPTIONAL INPUTS:

 OUTPUTS:
       Tangent of angle returned.

 PROCEDURE

 COMMON BLOCKS:
       None.

 NOTES

 REFERENCES
 
 AUTHOR and DATE:
     Jeff Hicke     Earth Space Research Group, UCSB  12/07/93

 MODIFICATION HISTORY:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tand.pro_)


TARCLR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TARCLR
 PURPOSE:
       Find closest match to target color in current color table.
 CATEGORY:
 CALLING SEQUENCE:
       in = tarclr(tclr)
 INPUTS:
       tclr = target color.  Flexible format see notes.    in
 KEYWORD PARAMETERS:
       Keywords:
         SET=i  Set color index i (if given) to specified color.
           Ignored if in high color mode (> 256) except to
           set the color table if it is given.  Reserves color.
         /NOLOAD means use SET=i for color table only, not screen.
         /HSV   Target colors is given in HSV instead of RGB.
           Hue 0-360, Saturation 0-1 float, Value 0-1 float.
           Same input options as for RGB.
         RED=red, GREEN=green, BLUE=blue change values in these
           given color tables also if SET=i is used.
           If given use to find target color if SET not given.
         To allow color sharing tarclr allows colors to be reserved.
         INIT=[lo,hi] Set a range of working colors. /INIT for all.
         /ADD means add target color to available space and reserve.
         DROP=i or DROP=[lo,hi] Return reserved colors.
         /LIST gives info on available colors.
         /B24 means force 24 bit color mode (good for testing).
 OUTPUTS:
       in = index in current color table of closest match. out
 COMMON BLOCKS:
       tarclr_com
 NOTES:
       Notes: input target color may be given in one of many ways.
       It may be given in a single argument or in 3 arguments.  The
       required order in either case is Red, Green, and Blue and
       the target values of each are assumed to be in the range
       0-255 (unless /HSV).  Some example single arg entries:
       '100 120 255', '80,20,0', ['200','200','0'], [0,50,100]'
       The 3 values may also be given in 3 args.
       A special case single arg entry may be in hex such as:
       '#ffaa77' to match WWW format.'
       If using high color (more than 8 bits) then the actual
       color values is returned for use with the COLOR keyword.
       SET=i can be used to construct a color table.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Oct 30
       R. Sterner, 1997 Dec  3 --- Upgraded for high color use.
       R. Sterner, 1999 Jul 28 --- Added /HSV keyword.
       R. Sterner, 1999 Jul 29 --- Added RED,GREEN,BLUE,/NOLOAD.
       R. Sterner, 1999 Oct 12 --- Handled cases for 1 or 2 values.
       R. Sterner, 1999 Nov 11 --- Added reserved color items.
       R. Sterner, 1999 Nov 24 --- Added forced 24 bit mode.
       R. Sterner, 2000 Sep 20 --- Treats decomp=0 as 8-bit color.

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tarclr.pro)


TDB2TDT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   TDB2TDT

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Relativistic clock corrections due to Earth motion in solar system 

 MAJOR TOPICS:
   Planetary Orbits

 CALLING SEQUENCE:
   corr = TDB2TDT(JD, TBASE=, DERIV=deriv)

 DESCRIPTION:

   The function TDB2TDT computes relativistic corrections that must
   be applied when performing high precision absolute timing in the
   solar system.

   According to general relativity, moving clocks, and clocks at
   different gravitational potentials, will run at different rates
   with respect to each other.  A clock placed on the earth will run
   at a time-variable rate because of the non-constant influence of
   the sun and other planets.  Thus, for the most demanding
   astrophysical timing applications -- high precision pulsar timing
   -- times in the accelerating earth observer's frame must be
   corrected to an inertial frame, such as the solar system
   barycenter (SSB).  This correction is also convenient because the
   coordinate time at the SSB is the ephemeris time of the JPL
   Planetary Ephemeris.

   In general, the difference in the rate of Ti, the time kept by an
   arbitrary clock, and the rate of T, the ephemeris time, is given
   by the expression (Standish 1998):

      dTi/dT = 1 - (Ui + vi^2/2) / c^2

   where Ui is the potential of clock i, and vi is the velocity of
   clock i.  However, when integrated, this expression depends on the
   position of an individual clock.  A more convenient approximate
   expression is:

     T = Ti + (robs(Ti) . vearth(T))/c^2 + dtgeo(Ti) + TDB2TDT(Ti)

   where robs is the vector from the geocenter to the observer;
   vearth is the vector velocity of the earth; and dtgeo is a
   correction to convert from the observer's clock to geocentric TT
   time.  TDB2TDT is the value computed by this function, the
   correction to convert from the geocenter to the solar system
   barycenter.

   As the above equation shows, while this function provides an
   important component of the correction, the user must also be
   responsible for (a) correcting their times to the geocenter (ie,
   by maintaining atomic clock corrections); (b) estimating the
   observatory position vector; and and (c) estimating earth's
   velocity vector (using JPLEPHINTERP).

   Users may note a circularity to the above equation, since
   vearth(T) is expressed in terms of the SSB coordinate time.  This
   appears to be a chicken and egg problem since in order to get the
   earth's velocity, the ephemeris time is needed to begin with.
   However, to the precision of the above equation, < 25 ns, it is
   acceptable to replace vearth(T) with vearth(TT).

   The method of computation of TDB2TDT in this function is based on
   the analytical formulation by Fairhead, Bretagnon & Lestrade, 1988
   (so-called FBL model) and Fairhead & Bretagnon 1990, in terms of
   sinusoids of various amplitudes.  TDB2TDT has a dominant periodic
   component of period 1 year and amplitude 1.7 ms.  The set of 791
   coefficients used here were drawn from the Princeton pulsar timing
   program TEMPO version 11.005 (Taylor & Weisberg 1989).

   Because the TDB2TDT quantity is rather expensive to compute but
   slowly varying, users may wish to also retrieve the time
   derivative using the DERIV keyword, if they have many times to
   convert over a short baseline.

 Verification

   This implementation has been compared against a set of FBL test
   data found in the 1996 IERS Conventions, Chapter 11, provided by
   T. Fukushima.  It has been verified that this routine reproduces
   the Fukushima numbers to the accuracy of the table, within
   10^{-14} seconds.

   Fukushima (1995) has found that the 791-term Fairhead & Bretagnon
   analytical approximation use here has a maximum error of 23
   nanoseconds in the time range 1980-2000, compared to a numerical
   integration.  In comparison the truncated 127-term approximation
   has an error of ~130 nanoseconds.


 PARAMETERS: 

   JD - Geocentric time TT, scalar or vector, expressed in Julian
        days.  The actual time used is (JD + TBASE).  For maximum
        precision, TBASE should be used to express a fixed epoch in
        whole day numbers, and JD should express fractional offset
        days from that epoch.


 KEYWORD PARAMETERS:

   TBASE - scalar Julian day of a fixed epoch, which provides the
           origin for times passed in JD.
          Default: 0

   DERIV - upon return, contains the derivative of TDB2TDT in units
           of seconds per day.  As many derivatives are returned as
           values passed in JD.


 RETURNS:
   The correction offset(s) in units of seconds, to be applied as
   noted above.


 EXAMPLE:

   Find the correction at ephemeris time 2451544.5 (JD):
     IDL> print, tdb2tdt(2451544.5d)
       -0.00011376314
   or 0.11 ms.


 REFERENCES:

   Princeton TEMPO Program
      http://pulsar.princeton.edu/tempo/

   FBL Test Data Set
      ftp://maia.usno.navy.mil/conventions/chapter11/fbl.results

   Fairhead, L. & Bretagnon, P. 1990, A&A, 229, 240
     (basis of this routine)

   Fairhead, L. Bretagnon, P. & Lestrade, J.-F. 1988, in *The Earth's
     Rotation and Reference Frames for Geodesy and Geodynamics*,
     ed. A. K. Babcock and G. A. Wilkins, (Dordrecht: Kluwer), p. 419
     (original "FBL" paper)

   Fukushima, T. 1995, A&A, 294, 895  (error analysis)

   Irwin, A. W. & Fukushima, T. 1999, A&A, 348, 642  (error analysis)

   Standish, E. M. 1998, A&A, 336, 381 (description of time scales)

   Taylor, J. H. & Weisberg, J. M. 1989, ApJ, 345, 434 (pulsar timing)


 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
   
 MODIFICATION HISTORY:
   Original logic from Fairhead & Bretagnon, 1990
   Drawn from TEMPO v. 11.005, copied 20 Jun 2001
   Documented and vectorized, 30 Jun 2001
   Added helpful usage message, CM, 15 Mar 2002
   

  $Id: tdb2tdt.pro,v 1.5 2002/03/15 12:00:27 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\tdb2tdt.pro)


TDESHLER2NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tdeshler2ncdf

 PURPOSE:
	This procedure will translate files from T.Deshler (pto files) to netCDF

 CATEGORY:
   DATAFILES/FILTER

 CALLING SEQUENCE:
   tdeshler2ncdf,[inhalt=inhalt]

 OPTIONAL OUTPUTS:
   inhalt: the structure INHALT may be useful for debuging

 PROCEDURE:
 This procedure reads ascii files like:

 "TimFrmLnch","Pres","Alt","Theta","Temp","OzPP","OzMR","Tim/day"
 "s","hPa","km","K","K","mPa","ppmv","s","KI970211.UWY"
 0,948.68,0.3,261.7,257.8,3.14,0.0331,33910
 0,947.99,0.303,261.4,257.5,3.17,0.0334,33910
 10.2,947.99,0.305,261.5,257.5,3.22,0.034,33920.2
 21,947.65,0.307,261.4,257.5,3.19,0.0337,33931
 31.2,947.99,0.307,261.4,257.5,3.22,0.0339,33941.2
 42,946.96,0.31,261.4,257.4,3.32,0.035,33952


 EXAMPLE:
   tdeshler2ncdf

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 1996

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tdeshler2ncdf.pro)


TDEWP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:	tdewp

 PURPOSE:	compute dew point temperature from ambient temperature and
		relative humidity.  The dew point is the temperature to
		which air must be cooled at constant pressure and
		constant mixing ratio to reach 100% saturation with
		respect to a plane water surface

 USEAGE:	result=tdewp(t,p,rh)

 INPUT:      
   t		ambient temperature	       (celsius)
   p           ambient pressure               (mb)
   rh		rh relative humidity	       (0-100%)
               

 OUTPUT:
   result	dew point temperature (celsius)

 METHOD:

   From thermodynamics we know that the saturated water vapor pressure
   is just a function of the temperature.  Lets call that function 
   VPS(T).  Then the water vapor mixing ratio, which is the ratio of
   the mass of vapor to the mass of dry air, is

   1.	    r = (Mw/Ma) .01*rh VPS(T)/(P - VPS(T))

   where rh is the relative humidity (this equation can be taken as
   the definition of rh) and k is Boltzman's constant and Mw and Ma
   are the molecular masses of water and air.  By the definition of
   dew point temperature, the water vapor density in this
   non-saturated situation can also be expressed by,

   2.	    r = (Mw/Ma) VPS(Td)/(P - VPS(Td))

   Now, to solve for Td in terms of T and rh we set the RHS of eqn 1
   equal to the RHS of eqn 2.	

   So the dew point is found by solving

   3.	      VPS(Td)/(1.-VPS(Td)/P)=.01*rh*VPS(T)/(1.-VPS(T)/P)

   To simplify matters we use an analytic approximation, 

   4.        VPS(t) = c0*exp(c1*t/(t+c2)) (Tetans, 1930).  


 References:

 equation relating saturated vapor pressure to temperature from:
 Tetans, O. 1930. Uber emige meteorologische Begriffe. Z. Geophys. 6:297-309

 EXAMPLE:

  print,'the dewpoint temperature is',tdewp(29,44)
  15.4947

; plot contours dew point temperture for a range of temperature
; and relative humidity

  t=findgen(100)
  rh=1+findgen(100)
  gengrid,t,rh
  td=tdewp(t,1013,rh)
  contour,td,t,rh,xtitle='temperature (C)',ytitle='relative humidity',$
     levels=contlev(td),/follow

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tdewp.pro)


TD_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	td_filter

 PURPOSE:
	This function returns the indices of elements in a time vector (time given in Js)
	which are located in a certain time window

 CATEGORY:
	TIME

 CALLING SEQUENCE:
	index = td_filter(time_vector, date [, time] [, /EXCLUDE] [, TIME_WINDOW = tw] [, /TW_STRING])

 INPUTS:
	time_vector:	vector of type double with time elements given in Js
	date:				EITHER: scalar (one day) or 2-element vector (range of days)
							specifying the date(s) of the time window as a string:
							'dd.mm.yy' or [dd1.mm1.yy1, dd2.mm2.yy2]
						OR: 2-element vector specifying the time window in Js

 OPTIONAL INPUTS:
	time: (applies only if date is of type string)
			2-element vector of type string with time window: ['hh1:mm1:ss1', hh2:mm2:ss2']
			the default is ['00:00:00', '23:59:59']
			If date is a scalar then the resulting time window is ['date time_1', 'date time_2']
			If date is a 2-element vector then the time window is ['date_1 time_1', 'date_2 time_2']

 KEYWORD PARAMETERS:
	/EXCLUDE: exclude time window from index
	TIME_WINDOW: if set to a named variable the applied time window is returned in Js
	/TW_STRING: return time window as a string (dd.mm.yyyy hh:mm:ss - dd.mm.yyyy hh:mm:ss)

 OUTPUTS:
	Index vector. If no elements are found within time window -1 is returned.

 EXAMPLE:
	a = DINDGEN(36000)
	ind = td_filter(a, '1.1.2000', ['04:00:00', '06:00:00'])
	HELP, ind   -->   IND             LONG      = Array[7201]

	ind = td_filter(a, [17000D, 22000D], TIME_WINDOW = tw, /TW_STRING)
	PRINT, tw   -->   01.01.2000 04:43:20 - 01.01.2000 06:06:40

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05. Aug. 98.
	16.12.98:	Keyword parameter TIME = time exchanged against positional parameter time
					to avoid conflict with keyword parameter TIME_WINDOW = tw
	28.01.2000:	New keyword /TW_STRING
	16.02.2000:	Implemented the possibility to pass a time window (date) as a two-element
					double vector (Js) into the routine.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\td_filter.pro)


TENZ2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tenz2js

 PURPOSE:
       converts seconds since with ref date to js

 CATEGORY:
       TIME

 CALLING SEQUENCE:
       js=tenz2js(sec, ref)

 INPUTS:
       sec:    seconds
       ref:    string with ref date dd.mm.yy hh:mm:yy

 OPTIONAL INPUTS:
       none

 OUTPUTS:
   time in julian sec

 SIDE EFFECTS:

 RESTRICTIONS:
       None.

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised         T.B. Oct 1997
       Corrected       F.R. Aug 1998
       Revised         T.B. Sep 1998
       Modified        F.R. Feb 1999  DAYSSINCE included
                       F.R. Jun 2000  /year2 added in call of string2js

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tenz2js.pro)


TERM_SIZE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  term_size

 PURPOSE:  find the number columns and number of lines in the idl terminal

 USEAGE:   term_size,xs,ys

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:
  xs       number of columns
  ys       number of lines

 DISCUSSION:
  uses the unix command "resize" to find the terminal size

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  
           term_size,xs,ys & print,xs,ys

 AUTHOR:   Paul Ricchiazzi                        04 Nov 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\term_size.pro)


TESTCOLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TESTCOLOR
 PURPOSE:
       Display colors selected by number.
 CATEGORY:
 CALLING SEQUENCE:
       testcolor
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /ALL displays all colors with names and numbers.
	  START=n starts displaying at color # n (def=0).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 18 Jan, 1990
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\testcolor.pro)


TESTPATH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        TESTPATH

 PURPOSE:
        This routine sets the !PATH system variable to a limited set
        of directories for test purposes and saves the original
        value even over multiple calls. The path argument will be
        expanded, so you can easily add a hierarchy of
        subdirectories, and the IDL system library will be added. 
        Call this routine with the restore keyword to restore the
        original !PATH information. 

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        TESTPATH [,pathstring] [,/restore] [,/force_new]

 INPUTS:
        PATHSTRING (string) -> a string with the test directory name(s)
             The !PATH variable will contain this string plus the
             standard IDL library search path [which is hardwired
             and may have to be changed after future updates].
             Note: This parameter is ignored if the /RESTORE keyword 
             is set.

 KEYWORD PARAMETERS:
        RESTORE (flag) -> restore initial value of !PATH. This is always
             the value before the very first call to testpath! Use
             of this keyword overrides the PATHSTRING parameter.

        FORCE_NEW (flag) -> Override the saved path value in any
        case. Normally this is done only on the very first call to
        testpath or after a restore operation.

 OUTPUTS:

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        This routine defines a common block (storepath) and a pointer
        which may not be freed if you don't restor the path at some point.

 EXAMPLE:
        testpath,'~mgs/IDL/test3d'
        ; sets !PATH to the given name + standard IDL libraries

        testpath,/restore
        ; resets !PATH variable to original value

 MODIFICATION HISTORY:
        mgs, 16 Jun 1998: VERSION 1.00
        mgs, 02 Nov 1998: - changed IDL path from idl5 to idl
        mgs, 26 Aug 2000: - changed copyright to open source
                          - added guess_systemlib routine
                          - oldpath now contains pointer
                          - added force_new keyword
                          - now always expands the path

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\testpath.pro)


TESTSIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	 testsin

 PURPOSE:
	This procedure is an example for the use of @gen_inh2 and ncdf_w

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   testsin

 EXAMPLE:
   testsin

 MODIFICATION HISTORY:
 	Written by:	F.Rohrer / R.Bauer (ICG-3/1), 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\testsin.pro)


TEST_C4IDL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Test_C4idl

 PURPOSE:
 	Example for using the idl procedure CALL_EXTERNAL with the WIN32 DLL C4IDL.dll

 CATEGORY:
  EXAMPLES

 CALLING SEQUENCE:
  Test_C4idl

 MODIFICATION HISTORY:
  Written by: Frank Holland, 03. Jun 98
	Modified: 02.11.98, FH:	Aufruf von GetCursorPosition eingefuegt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\test_c4idl.pro)


TEST_FLAG_STRUCT

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

 NAME:
   test_flag_struct

 PURPOSE:
  This routine tests writing of flags

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_flag_struct

 EXAMPLE:
  test_flag_struct


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_flag_struct.pro)


TEST_INTERACTIVE_CURSOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	test_interactive_cursor

 PURPOSE:
	This routine shows how to use the interactive cursor routine

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   test_interactive_cursor

 MODIFICATION HISTORY:
   Written by: Frank Holland, 03. Jun 98

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\examples\test_interactive_cursor.pro)


TEST_NORMAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   test_normal

 PURPOSE:
   test_normal coordinates (0 < n.coord.< 1)

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
   Result = TEST_NORMAL(pos)

 INPUTS:
   pos:    position in normal coordinates

 OUTPUTS:
   pos:    updated position

 EXAMPLE:
       ....................

 REVISION HISTORY:
   Written         Theo Brauers, 1997-DEC-8
   Corrected
   Revised         IDL 5.0

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\test_normal.pro)


TEST_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       test_range

 PURPOSE:
       sets the plotting range of a data set to min/max + some
   additional space

 CATEGORY:
       PLOT/MPLOT

 CALLING SEQUENCE:
       TEST_RANGE, Range, Data, Type

 INPUTS:
       range:  array of 2 numbers containing the actual range
       if range(0) EQ range(1) a new range is calculated
       data:   data set, array of numbers
       type:   0=linear axis, 1=log axis

 KEYWORD PARAMETERS:
   MISSING_VALUE:  if set to a single number these values will be excluded from calculation
   ADDSPACE:       additional range, default 0.1

 OUTPUTS:
       an array with a new range for plotting the data set

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised     T.B. Sep. 97
       Revised     T.B. Aug 1998 converted to IDL5

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\test_range.pro)


TEST_READ_EROS_MAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   test_read_eros_map

 PURPOSE:

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1998-JUNE

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\examples\test_read_eros_map.pro)


TEST_STRUCT

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

 NAME:
   test_struct

 PURPOSE:
  This routine shows a simple definition of the icg data struct

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct

 EXAMPLE:
  test_struct


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct.pro)


TEST_STRUCT10

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

 NAME:
   test_struct10

 PURPOSE:
  This routine tests the overwrite key and the history mechanism

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct10

 EXAMPLE:
  test_struct10


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct10.pro)


TEST_STRUCT11

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

 NAME:
   test_struct11

 PURPOSE:
  This routine tests writing of data without time using own status dimension settings

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct11

 EXAMPLE:
  test_struct11


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct11.pro)


TEST_STRUCT12

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

 NAME:
   test_struct12

 PURPOSE:
  This routine tests the overwriting

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct12

 EXAMPLE:
  test_struct12


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct12.pro)


TEST_STRUCT13

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

 NAME:
   test_struct13

 PURPOSE:
  This routine tests the predefining of a datamatrix and writing in steps

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct13

 EXAMPLE:
  test_struct13


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct13.pro)


TEST_STRUCT14

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

 NAME:
   test_struct14

 PURPOSE:
  This routine tests writing of time flags

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct14

 EXAMPLE:
  test_struct14


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct14.pro)


TEST_STRUCT15

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

 NAME:
   test_struct15

 PURPOSE:
  This routine tests the usage of the keyword ignore_test by writing a netCDF File bei ncdf_write

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct15

 EXAMPLE:
  test_struct15


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct15.pro)


TEST_STRUCT16

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

 NAME:
   test_struct16

 PURPOSE:
  This routine tests the usage of the keyword ignore_test by writing a netCDF File bei ncdf_write

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct16

 EXAMPLE:
  test_struct16


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct16.pro)


TEST_STRUCT17

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

 NAME:
   test_struct17

 PURPOSE:
  This routine tests the usage of a named structure by read_ncdf()

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct17

 EXAMPLE:
  test_struct17


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct17.pro)


TEST_STRUCT18

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

 NAME:
   test_struct18

 PURPOSE:
  This routine tests the usage of valid_min and valid_max

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct18

 EXAMPLE:
  test_struct18


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct18.pro)


TEST_STRUCT18_B

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

 NAME:
   test_struct18_b

 PURPOSE:
  This routine tests the usage of valid_min and valid_max

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct18_b

 EXAMPLE:
  test_struct18_b


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct18_b.pro)


TEST_STRUCT2

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

 NAME:
   test_struct2

 PURPOSE:
  This routine tests the writing of different string parameter

 CATEGORY:
  EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct2

 EXAMPLE:
  test_struct2


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct2.pro)


TEST_STRUCT2ICG_STRUCT

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

 NAME:
   test_struct2icg_struct

 PURPOSE:
  This routine tests adapting an icg_struct to a normal structure

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct2icg_struct

 EXAMPLE:
  test_struct2icg_struct


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Sep-27

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct2icg_struct.pro)


TEST_STRUCT3

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

 NAME:
   test_struct3

 PURPOSE:
  This routine tests the definition of dimensions greater as the size of data

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct3

 EXAMPLE:
  test_struct4


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct3.pro)


TEST_STRUCT4

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

 NAME:
   test_struct4

 PURPOSE:
  This routine tests the definition of dimensions greater as the size of data

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct4

 EXAMPLE:
  test_struct4


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct4.pro)


TEST_STRUCT5

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

 NAME:
   test_struct5

 PURPOSE:
  This routine tests the append Modus of three additional parameters, history has to be appended too

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct5

 EXAMPLE:
  test_struct5


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct5.pro)


TEST_STRUCT5_B

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

 NAME:
   test_struct5_b

 PURPOSE:
  This routine tests the append Modus of three additional parameters, history has to be appended too

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct5_b

 EXAMPLE:
  test_struct5_b


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct5_b.pro)


TEST_STRUCT6

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

 NAME:
   test_struct6

 PURPOSE:
  This routine tests writing of parameters by offset, count and stride only 10 values are written

 CATEGORY:
  EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct6

 EXAMPLE:
  test_struct6


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct6.pro)


TEST_STRUCT7

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

 NAME:
   test_struct7

 PURPOSE:
  This routine tests writing of a readed icg_struct without /status and /status
  /status is necessary by vectors or arrays where not only the dimension 'time' is used

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct7

 EXAMPLE:
  test_struct7


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct7.pro)


TEST_STRUCT8

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

 NAME:
   test_struct8

 PURPOSE:
  This routine tests the definition of an experimental data structure

 CATEGORY:
   EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct8

 EXAMPLE:
  test_struct8


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct8.pro)


TEST_STRUCT_B

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

 NAME:
   test_struct_b

 PURPOSE:
  This routine shows a simple definition of the icg data struct

 CATEGORY:
  EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
   test_struct_b

 EXAMPLE:
  test_struct_b


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jan-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\test_struct_b.pro)


TEST_XYOUTS_BOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    test_xyouts_box

 PURPOSE:
   This routine shows the capabilities of xyouts_box

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   test_xyouts_box

 MODIFICATION HISTORY:
   Written by: Theo Brauers 1997-Dec

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\examples\test_xyouts_box.pro)


TETRIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TETRIS
 PURPOSE:
       Play tetris game.
 CATEGORY:
 CALLING SEQUENCE:
       tetris
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         WAIT=tm  Seconds between pieces (def=.05).
           tm = 0 is very fast, 0.1 is slow.
         LEVEL=L  Level of random starting pieces (def=0).
           If L is negative then starting pieces are gray.
         /BELL means ring bell for each line scored.
         TOP=tp returns highest level for each piece played.
           Games are delimited by -1s.
 OUTPUTS:
 COMMON BLOCKS:
       t_com
       t_com
       t_com
       t_com
       t_com
       t_com
       t_com
       t_com
       t_com
 NOTES:
 MODIFICATION HISTORY:
       Ray Sterner, 23 and 25 June, 1991
       R. Sterner, 23 Jun, 1991

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tetris.pro)


TEXT2TAGNAME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	text2tagname

 PURPOSE:
	This function converts a text string into an allowed tag name for a structure

 CATEGORY:
	PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
	Result = text2tagname(text)

 INPUTS:
	text: String to be converted to tag name (scalar or array)

 KEYWORD PARAMETERS:
	TAG_LIST = tag_list: List (vector) of 'reserved' tag names which will not be returned
		by this procedure.
	/COMPRESS: If set, any occurences of repeated '_' chars will be compressed into a single '_'.
	/TRIM: If set, trailing chars which are not allowed tag-name chars are removed before the
		conversion takes place

 OUTPUTS:
	This function resturns a string (scalar or array depending on input)
	which consists only of the chars '0'-'9', 'A'-'Z', and '_'.

 PROCEDURE:
	All not allowed chars in text (e.g. '(', '-', '$', etc.) are replaced by '_'.
	If the first char of text is a number the char '_' is placed in front.
	If an array is passed into this routine all returned tag names will differ from each other.

 EXAMPLE:
	PRINT, text2tagname(['J(O1D) [s-1]', 'O3 [ppb]'], /COMPRESS)
	-->	J_O1D_S_1 O3_PPB

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 24.09.1999
	28.09.1999:	Keyword parameters /COMPRESS, /TRIM, TAG_LIST = tag_list were added.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\text2tagname.pro)


TEXTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTABLE
 PURPOSE:
       Returns a translation table from TeX to IDL.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       table = textable()
 INPUTS:
       None
 KEYWORD PARAMETERS:
       /POSTSCRIPT -- If set, return postscript translation
                      table rather than vector fonts table.
                      Default is translations for vector
                      fonts.
       /HELP       -- Print help and exit.
 OUTPUTS:
       table -- a 2D text array.  table(0,*) contains          out
                the words to be translated away, table(1,*)
                contains the words to translate them to.   
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       To find out what TeX sequences are available, look at
       table(0,*).
 EXAMPLE:
 MODIFICATION HISTORY:
       $Id: textable.pro,v 1.7 1996/07/22 23:56:08 mcraig Exp $
       $Log: textable.pro,v $
       Revision 1.7  1996/07/22 23:56:08  mcraig
       Added \vartheta.

       Revision 1.6  1996/07/12 21:31:42  mcraig
       Fixed \varphi in vector font, added \circ.

       Revision 1.5  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.4  1996/05/09 00:22:17  mcraig
       Added command to return to previous font after switching to Greek or
       symbol font.

       Revision 1.3  1996/02/08 19:49:35  mcraig
       Removed control sequence \perp because the postscript code for it is '^'.

       Revision 1.2  1996/02/08 18:53:38  mcraig
       Added translations for PostScript fonts, and added several new TeX
       control sequences.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\textable.pro)


TEXTCLOSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TEXTCLOSE                   

 PURPOSE:
	procedure to close file for text output as specifed
	by the (non-standard) system variable !TEXTOUT. 

 CALLING SEQUENCE:
	textclose, [ TEXTOUT = ]

 KEYWORDS:
	textout - Indicates output device that was used by
		TEXTOPEN

 SIDE EFFECTS:
	if !textout is not equal to 5 and the textunit is
	opened.   Then unit !textunit is closed and released

 HISTORY:
	D. Lindler  Dec. 1986  (Replaces PRTOPEN)
	Test if TEXTOUT is a scalar string   W. Landsman   August 1993

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\textclose.pro)


TEXTHOEHE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	texthoehe

 PURPOSE:
	"This function (or procedure) ..."
       procedure to test:
	text in same height for  X and PS device

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       texthoehe

 INPUTS:

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:

 OUTPUTS:
	This procedure prints a string for all hershey fonts surounded
       by a box and limited by a line
       for each font a PS name pltest3.ps, pltest4,ps,... is created

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:
       this will be a function in future !!

 PROCEDURE:
 Vorgehen:
 - X Display und PS Device werden in gleichem Breite/Hoehe 
   Verhaeltnis angelegt (Din Format, Landscape)
 - Textbreite im X Device mit Keyword width an einer Stelle 100.,100.
   ausserhalb der Zeichnung mit Keyword /norm
 - Textbreite im PS Device auf gleiche Weise ermitteln 
   -> Textbreite fuer PS ist skal=width_x/width_ps 
   Texthoehe CHARSIZE bei X Device angeben, Bei PS Texthoehe CHARSIZE
   mit  Skalierungsfaktor skal multiplizieren
 - Bemerkung:
   Font = -1 oder !3 !5 usw. waehlt Hersheyfont fuer X-Device
   Im PS Device wird automatisch auf den entsprechenden PS Font
   gemappt.

 EXAMPLE:
       texthoehe

 MODIFICATION HISTORY:
 	Written by:	M. Busch, 23.12.1997
	Dec, 1997	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mb_lib\texthoehe.pro)


TEXTI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTI
 PURPOSE:
       Interactive Text.
 CATEGORY:
 CALLING SEQUENCE:
       texti, text
 INPUTS:
       text = Text to write (def=Text).   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       texti_com
 NOTES:
       Notes: XOR plot mode is used to display text
         before it is burned into image.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Sep 27

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\texti.pro)


TEXTOIDL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTOIDL
 PURPOSE:
       Convert a valid TeX string to a valid IDL string for plot labels.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       new = textoidl(old)
 INPUTS:
       old            -- TeX string to be converted.  Will not be     in
                         modified.  old may be a string array.
 KEYWORD PARAMETERS:
       FONT           -- Set to 0 to use hardware font, -1 to use 
                         vector.  Note that the only hardware font 
                         supported is PostScript.
       /TEX_SEQUENCES -- return the available TeX sequences
       /HELP          -- print out info on use of the function
                         and exit.
 OUTPUTS:
       new            -- IDL string corresponding to old.             out
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       - Use the procedure SHOWTEX to get a list of the available TeX
         control sequences.  
       - The only hardware font for which translation is available is
         PostScript. 
       - The only device for which hardware font'
         translation is available is PostScript.'
       - The FONT keyword overrides the font selected'
         by !p.font'
 EXAMPLE:
       out = TeXtoIDL('\Gamma^2 + 5N_{ed}')
       The string out may be used in XYOUTS or other IDL text
       display routines.  It will be an uppercase Gamma, with an
       exponent of 2, then a plus sign, then an N with the subscript
       ed.
 MODIFICATION HISTORY:
       $Id: textoidl.pro,v 1.4 1996/06/14 20:00:27 mcraig Exp $
       $Log: textoidl.pro,v $
       Revision 1.4  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.3  1996/05/09 00:22:17  mcraig
       Added error handling, cleaned up documentation.

       Revision 1.2  1996/02/08 18:52:50  mcraig
       Added ability to use hardware fonts for PostScript device.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\textoidl.pro)


TEXTOPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TEXTOPEN
 PURPOSE
	Procedure to open file for text output.   The type of output 
	device (disk file or terminal screen) is specified by the 
	TEXTOUT keyword or the (nonstandard) system variable !TEXTOUT.

 CALLING SEQUENCE:
	textopen, program, [ TEXTOUT = ]

 INPUTS:
	program - scalar string giving name of program calling textopen

 OPTIONAL INPUT KEYWORDS:
	TEXTOUT - Integer scalar (0-6) specifying output file/device to be 
		opened (see below) or scalar string giving name of output file.
		If TEXTOUT is not supplied, then the (non-standard) system 
		variable !TEXTOUT is used.

 SIDE EFFECTS:
	The following dev/file is opened for output.

		textout=0 	Nowhere
		textout=1	TERMINAL using /more option
		textout=2	TERMINAL without /more option
		textout=3	.prt
		textout=4	laser.tmp
		textout=5      user must open file
		textout = filename (default extension of .prt)

	The unit it is opened to is obtained with the procedure GET_LUN
	unless !TEXTOUT=5.  The unit number is placed in system variable 
	!TEXTUNIT.  For !TEXTOUT=5 the user must set !TEXTUNIT to the 
	appropriate unit number.

 NOTES:
	Note that TEXTOUT = 1 or TEXTOUT = 2 will open a unit to the terminal,
	SYS$OUTPUT (VMS) or /dev/tty (Unix).     However, this terminal 
	output will *not* appear in an IDL JOURNAL session, unlike text
	printed with the PRINT command.	

 NON-STANDARD SYSTEM VARIABLES:
	DEFSYSV,'!TEXTOUT',1
	DEFSYSV,'!TEXTUNIT',0

 HISTORY:
	D. Lindler  Dec. 1986  
	Keyword textout added, J. Isensee, July, 1990
	Made transportable, D. Neill, April, 1991
	Trim input PROGRAM string W. Landsman  Feb 1993
	Don't modify TEXTOUT value   W. Landsman   Aug 1993

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\textopen.pro)


TEXTPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTPLOT
 PURPOSE:
       Plot text with 2-d alignment.  Also return bounding box.
 CATEGORY:
 CALLING SEQUENCE:
       textplot, x, y, txt
 INPUTS:
       x,y = Text x,y position.   in
       text = text to plot.       in
 KEYWORD PARAMETERS:
       Keywords:
         CHARSIZE=character size (def=1).
         COLOR=clr Text color (may be 1-d array).
         BOLD=bld Text bold value (may be 1-d array).
         SHIFT=shft Shift between colors (for drop shadows).
         ORIENTATION=ang Text angle CCW from horizontal (deg).
         ALIGNMENT=fx or [fx,fy] Text alignment as fraction of
           text size in x or x and y relative to x,y
           (def=lower left corner = [0,0]).
         /DEVICE, /NORMAL, /DATA coordinate system to use.  If not
           given will default to normal if x & y between 0 & 1, or
           device if x & y in range, or else data.
         MARGIN=mar  Expand bounding box by margin (pixels, def=0).
         FACTOR=fact Text height factor (def=1) for current font.
           This factor is applied to bounding box height.
         BOX=bclr Set bounding box color (-1 for none).
         FILL=fclr Set bounding box fill color (-1 for none).
         /TEST plot bounding box and reference point.
         /SET save any given keyword values for future calls.
         HREF=href Give a URL to be used in an image map when
           clicking inside the bounding box.  Def=none.
         CODE=code  Returned image map code if given a non-null
           URL.
         FRONT_CODE=front HTML code for the image and start of
           the image map.
         TAIL_CODE=tail  HTML code to terminate the image map.
         IMAGE=img  Name of image map image (def=IMAGE).
         XCROP=[x1,x2]  Min and Max image pixels to keep in X.
         YCROP=[y1,y2]  Min and Max image pixels to keep in Y.
 OUTPUTS:
 COMMON BLOCKS:
       textplot_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 2000 Nov 13

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\textplot.pro)


TEXTPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTPOS
 PURPOSE:
       Find size and angle of text string given points at each end.
 CATEGORY:
 CALLING SEQUENCE:
       textpos, txt, p1, p2, ix,iy,sz,ang
 INPUTS:
       txt = Desired text string.                       in
       p1 = [x1,y1] = text starting point.              in
       p2 = [x2,y2] = text end point.                   in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA input points in data coordinates (default).
         /DEVICE input points in device coordinates.
         /NORMAL input points in normalized coordinates.
         ALIGNMENT=jst  Desired text alignment (def=0.).
 OUTPUTS:
       ix,iy = Returned device coordinates of text.     out
       sz = Returned charsize for text.                 out
       ang = Returned angle of text.                    out
 COMMON BLOCKS:
 NOTES:
       Notes: If p1 is desired text string starting point then
         xyouts may use the same coordinate system as p1.
         But if ALIGNMENT is not 0 then use the returned device
         coordinates, ix,iy.  Text is not plotted, only the
         position, size, and angle is determined.  Use xyouts
         to actually plot the text and remember to use the same
         value for the alignment parameter.
 MODIFICATION HISTORY:
       R. Sterner, 1996 Mar 3

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\textpos.pro)


TEXTURE_SURFACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TEXTURE_SURFACE

 PURPOSE:

       The purpose of this program is to demonstrate how to
       create a simple surface plot with an image applied as
       a texture in object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       TEXTURE_SURFACE, data, x, y, Image=image

 REQUIRED INPUTS:

       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       BORDERCOLOR : A three element array [R, G, B] describing the color
       used to draw the non-textured part of the surface if POSITION is
       specified.

       COLORTABLE: The number of an IDL color table to use for the image
       texture. Used only if the supplied image is 2D. Ignored otherwise.

       EXACT:  Set this keyword to get exact axis scaling.

       _EXTRA: This keyword collects otherwise undefined keywords that are
        passed to the surface initialization routine.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       IMAGE: An 8-bit or 24-bit image you wish to use for the image texture.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       POSITION: A four element array of the form [x1, y1, x2, y2] that will
       position the image with its lower-left corner at (x1,y1) and its upper-
       right corner at (x2,y2) in the device coordinate system of the surface.
       In other words, if my surface is a 41 by 41 array, and I want the image
       positioned with lower-left at (5,10) and upper-right at (25,18), then
       I call the program like this: Texture_Surface, Position=[5, 10, 25, 18].

       VECTOR: Set this keyword if you want vector printing (as opposed to
       the default bitmap printing).

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

       ZTITLE: A string used as the Z title of the plot.

 COMMON BLOCKS:

       None.

 EXAMPLE:

       To use this program with your surface data and 2D image, type:

        IDL> data = Loaddata(2)
        IDL> image = Loaddata(7)
        IDL> Texture_Surface, data, Image=image, Colortable=33

 MODIFICATION HISTORY

       Written by David Fanning, 1 Nov 2001, from previous Simple_Surface code.
       Modifications suggested by Karl Shultz added to allow surface color
          specification and improved resolution about image edges when
          positioning images. BORDERCOLOR keyword added. DWF. 4 Nov 2001.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\texture_surface.pro)


TEXTWIDTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  textwidth

 PURPOSE:
  This function determines the width of the sequence 0123456789

 CATEGORY:
       PROG_TOOLS

 CALLING SEQUENCE:
       textwidth

 INPUTS:

 OPTIONAL INPUTS:
       testflag
 KEYWORD PARAMETERS:

 OUTPUTS:
       width : width of sequence in normalized units (for PS-device, width=1.)

 SIDE EFFECTS:

 RESTRICTIONS:

 EXAMPLE:
       w=texthoehe

 MODIFICATION HISTORY:
  Written by: M. Busch, 23.12.1997
   Modified by F.Rohrer, 11.01.1998
   Modified by F.Rohrer, 07.03.1998 , changed normwidth 0.112048 to 0.0792256

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\textwidth.pro)


TEXT_BOX

[Previous Routine] [Next Routine] [List of Routines]
 Name        : text_box

 Purpose     : Writes a text message within a box in a graphics window.

 Description:  This procedure writes a short text message within a box-shaped
               area in a graphics window.  The message may be split at word
               boundaries into several lines, and the character size and
               orientation may be adjusted for the text to fit within the box.

 Useage:       text_box,text,pos=pos,color=color,$
                    justify=justify,vert_space=vert_space

 Inputs      
 TEXT          ASCII text string containing the message.

 keywords
  pos          4 element vector specifying the box position and size
               pos(0),pos(1) specify the lower left corner coordinate
               pos(2),pos(3) specify the upper right corner coordinate
               data window normalized coordinates are use

   fg_color    color of box and legend titles (default=!P.COLOR)

   bg_color    background color. Setting BG_COLOR erases the area 
               covered by the text box (filling it with color BG_COLOR)
               prior to writing the text.  If both BG_COLOR and !p.color
               are zero then the background color is reset to 255 to
               gaurantee a readability.
               
  right        if set, right justify text
  center       if set, center the text

  vert_space   vertical spacing of lines in units of character height 
               (default = 1.5)


  author:  Paul Ricchiazzi                            7Jul93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\text_box.pro)


TEXT_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	text_filter

 PURPOSE:
   This function is used to filter an array of string names by a search string.
   This function is searching case sensitive.


 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=text_filter(names,search_string)

  INPUTS:
   names:   An array of names to examine by the search string
   search_string:      The string which should be used as text_filter e.g. A*, *A, *A*, ANTON


 EXAMPLE:
  PRINT,text_filter(['ANTON', 'BETA'],'A*')
  'ANTON'

  PRINT,text_filter(['ANTON', 'BETA'],'*A*')
  'ANTON BETA'

  PRINT,text_filter(['ANTON', 'BETA'],'A*')
  'ANTON'

  PRINT,text_filter(['ANTON', 'BETA'],'BETA')
  'BETA'

  PRINT,text_filter(['ANTON', 'BETA'],['b*','A*'])
  'ANTON'


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-11-13
   extraced from get_tagname

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\text_filter.pro)


TEX_BEGIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tex_begin

 PURPOSE:
   This functions returns the beginning commands for a tex document

 CATEGORY:
   PROG_TOOLS/TEX

 CALLING SEQUENCE:
   Result = tex_begin([oddsidemargin=oddsidemargin],[headheight=headheight],[textheight=textheight],[textwidth=textwidth],[usepackage=usepackage],[pagestyle=pagestyle])

 OUTPUTS:
   This function returns a string array containing tex-code to start a tex text

 OPTIONAL INPUTS:
   oddsidemargin: the odd side magrgin, value type of string e.g '-2.5cm'
   headheight:    the height of the head, value type of string e.g. '-2cm'
   textheight:    the height of the text, value type of string  e.g. 25cm
   textwidth:     the width of the text, value type of string e.g. '21cm'
   usepackage:    the package to add, value type of string, if not selected '\usepackage{a4,german}' is set

 EXAMPLE:
  test=tex_begin()
  print,test
  \documentclass{article} \usepackage{a4,german}
  \begin{document}

  test2=tex_begin(textwidth='25cm',oddsidemargin='-2cm',headheight='-2cm')
  print,test2
  \documentclass{article}
  \usepackage{a4,german}
  \setlength{\oddsidemargin} {-2cm}
  \setlength{\headheight} {-2cm}
  \setlength{\textwidth} {25cm}
  \begin{document}

 MODIFICATION HISTORY:
   Written by: Reimar Bauer, 1998-Jun-29
   1999-08-27 keywords added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tex_begin.pro)


TEX_END

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tex_end

 PURPOSE:
   This functions returns the ending commands for a tex document

 CATEGORY:
   PROG_TOOLS/TEX

 CALLING SEQUENCE:
   Result = tex_end()

 OUTPUTS:
   This function returns a string array containing tex-code to end a tex text

 EXAMPLE:
  test=tex_end()
  print,test
  \end{document}


 MODIFICATION HISTORY:
   Written by: Reimar Bauer, 1998-Jun-29

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tex_end.pro)


TEX_FILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	tex_filter

 PURPOSE:
	This function translates special tex symbols to their tex syntax

 CATEGORY:
   PROG_TOOLS/TEX

 CALLING SEQUENCE:
   result=tex_filter(value[/no_html])

 KEYWORD PARAMETERS:
 no_html: to remove all html included commands e.g. 

 INPUTS:
 value: a string or vector of ascii text


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-05
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tex_filter.pro)


TEX_TABULAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tex_tabular

 PURPOSE:
   This functions creates a tabular environment for a string array

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = tex_text_format(string)

 INPUTS:
   string:  a string array which should be formatted

 KEYWORD PARAMETERS:
   TEXTSIZE:  this keyword if this keyword is set large will be used

 OUTPUTS:
   This function returns a string array tex-code formated text

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers
   1999-08-26 some typemismatches removed and keyword border programmed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tex_tabular.pro)


TEX_TEXT_FORMAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tex_text_format

 PURPOSE:
   This functions adds tex format to a string

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = tex_text_format(string)

 INPUTS:
   string:  a string which should be formatted

 KEYWORD PARAMETERS:
   TEXTSIZE:  this keyword if this keyword is set large will be used

 OUTPUTS:
   This function returns a string tex-code formated text

 EXAMPLE:
 IDL> print, tex_text_format( ['acfgbhjkl','b'], tex_style='\bf', tex_size=5, form='(a3)')
   {\Huge\bf acf}
   {\Huge\bf   b}

 MODIFICATION HISTORY:
   Written by: Theo Brauers

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tex_text_format.pro)


THICK

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    thick

 PURPOSE:    thicken lines and characters on postscript output.

 USEAGE:     thick,thck,cthck

 INPUT:      thck        the thickening factor.
                         if not set all graphics system variables
                         related to line thickness are set to 1

             cthck       character thickening factor, if CTHCK is not
                         not set or equal to zero then it defaults to 
                         1+.5*(thck-1) if not set.


 OUTPUT:     none

 SIDE EFFECTS:  changes the values of system varaibles as follows

            !p.charthick=cthck

            !p.thick=thck
            !x.thick=thck
            !y.thick=thck


 PROCEDURE:  a thickening factor of 3 is a good value to use for
             plots on the Phaser color printer.  and 5 is good for
             very bold lines.  2 is good enough for the low resolution
             printers
  
  author:  Paul Ricchiazzi                            feb94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\thick.pro)


THICKEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       THICKEN
 PURPOSE:
       Thicken graphics in an existing image.  Good for viewgraphs.
 CATEGORY:
 CALLING SEQUENCE:
       thicken, img, color
 INPUTS:
       color = color index to thicken.  in
 KEYWORD PARAMETERS:
       Keywords:
         BOLD=b  Desired thickness (def=2).
           BOLD may also be set to an N x M array which defines
           a brush stroke by non-zero elements.  For example:
           BOLD=shift(dist(3),-2,-2) lt 1.2
         SUBSTITUTE=nclr  New color to replace color by after
           thickening.  Needed for multiple calls.  For example,
           to thicken multiple black lines, need a temporary color
           to thicken and then substitute black:
           thicken,img,clr,sub=0  will thicken clr, then make it
           be 0.
         /NOCENTER thicken on positive side of points (default is
            to center thickening.
         MASK=m   Optionally returned mask with 1 for pixels
           in thickened areas, else 0.  May be useful for more
           complex processing.
 OUTPUTS:
       img = input image (byte).        in, out
 COMMON BLOCKS:
 NOTES:
       Notes: Useful to make existing graphics such as axes,
         text, data curves, and so on thicker in an existing
         image.  Makes viewgraphs more readable.  May want to
         make original graphics in different colors so thickness
         can be customized: For axes use 0, for text use 1, ...
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 2.
       R. Sterner, 1994 Apr 4 --- Allowed 2-d brush stroke.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\thicken.pro)


THPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       THPLOT
 PURPOSE:
       Plot a curve with varying thickness along it.
 CATEGORY:
 CALLING SEQUENCE:
       thplot, x, y  or thplot, y
 INPUTS:
       x, y = array of x,y values along curve.   in
 KEYWORD PARAMETERS:
       Keywords:
         CTHICK=cthk Thickness along curve (def=0).
         FILL=fclr   Fill color of thick curve (def=!p.color).
         /CCLIP  means clip a thick curve to plot window.
         CBACK=cbak  0 thickness curve background color (def=none).
         CCOLOR=cclr 0 thickness curve foreground color.
         CSTYLE=csty 0 thickness curve line style (def=1).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: CTHICK must be given an array with same number of
         elements as x and y (or it may be a scalar).  Curve is
         plotted with filled region between y-cthk/2 and y+cthk/2.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Dec 7

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\thplot.pro)


TICKLEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TICKLEN
 PURPOSE:
       Compute ticklength for specified size in pixels.
 CATEGORY:
 CALLING SEQUENCE:
       ticklen, x1,y1,x2,y2
 INPUTS:
       x1, y1 = desired ticklengths in pixels.   in
 KEYWORD PARAMETERS:
       Keywords:
         POSITION=pos  Plot position (normalized).
         /DEVICE       Plot position is in device coordinates.
 OUTPUTS:
       x2, y2 = values to use in the plot call.  out
         xticklen=x2, yticklen=y2.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Apr 11
       R. Sterner, 1995 Jun 22 --- fixed a minor bug.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ticklen.pro)


TIFF2JPEG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIFF2JPEG
 PURPOSE:
       Convert a TIFF image to a JPEG image.
 CATEGORY:
 CALLING SEQUENCE:
       tiff2jpeg, file
 INPUTS:
       file = TIFF image file name.       in
         Prompted for if not given.
 KEYWORD PARAMETERS:
       Keywords:
         QF=qf  JPEG quality factor (def=100).
           Since color improvement is the goal here qf is
           set to the max value of 100 by default.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Intended to convert 24 bit TIFF images to JPEG
         format since they display better.
         Output file name is same as input but with .jpg as type.
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 19

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tiff2jpeg.pro)


TIFFSCREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIFFSCREEN
 PURPOSE:
       Save current screen image and color table to a TIFF file.
 CATEGORY:
 CALLING SEQUENCE:
       tiffscreen, [file]
 INPUTS:
       file = name of TIFF file.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Prompts for file if called with no args.
 MODIFICATION HISTORY:
       R. Sterner, 1 Jun, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tiffscreen.pro)


TIME2JDOFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIME2JDOFF
 PURPOSE:
       Find Julian day and offset from seconds. JS, Timeaxis
 CATEGORY:
 CALLING SEQUENCE:
       time2jdoff, t
 INPUTS:
       t = start time or array of times in seconds.  in
         Time is in seconds after a reference time.
         Reference time may be specified with the
         REFERENCE keyword.  Default is Julian Seconds,
         which are seconds after 0:00 Jan 1, 2000.
 KEYWORD PARAMETERS:
       Keywords:
         JD=jd    returned Julian Day for 0:00 of the day of
           or just before start time in t.
         OFF=off  returned offset in seconds which is to be
           subtracted from t to put in in the range 0 to midnight.
         REFERENCE=ref = date/time string (like "12:00 1 jan 1970")
           which is the zero point for time t.  If not given this
           refernce time is assumed to be 0:00 1 Jan, 2000.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes:  This routine is needed because IDL stores !x.crange
         only in single precision, not good enough for time
         intervals in seconds far from the zero time.  This gives
         the values needed by the timeaxis routine:
         time2jdoff, t, jd=jd, off=off, ref="1 jan, 1970"
         plot,t-off, y, xstyle=5
         timeaxis, jd=jd
 MODIFICATION HISTORY:
       R. Sterner, 18 Aug, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\time2jdoff.pro)


TIMEAXIS1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:                
       TIMEAXIS1                
 PURPOSE:                
       Plot a time axis like timeaxis, but upper axis too              
 CATEGORY:                
  PLOT
 CALLING SEQUENCE:                
       timeaxis1, [t]                
 INPUTS:                
       t = optional array of seconds after midnight.  in                
 KEYWORD PARAMETERS:                
       Keywords:                
         JD=jd   Set Julian Day number of reference date.                
         FORM=f  Set axis label format string, over-rides default.                
           do help,dt_tm_mak(/help) to get formats.                
           For multi-line labels use @ as line delimiter.                
         NTICKS=n  Set approximate number of desired ticks (def=6).                
         TITLE=txt Time axis title (def=none).                
         TRANGE=[tmin,tmax] Set specified time range.                
         YVALUE=Y  Y coordinate of time axis (def=bottom).                
         TICKLEN=t Set tick length as % of yrange (def=5).                
         /NOLABELS means suppress tick labels.                
         /NOYEAR drops year from automatically formatted labels.                
           Doesn't apply to user specified formats.                
         LABELOFFSET=off Set label Y offset as % yrange (def=0).                
           Allows label vertical position adjustment.                
         DY=d  Set line spacing factor for multiline labels (def=1).                
         COLOR=c   Axis color.                
         CHARSIZE=s    Axis text size.                
         CHARTHICK=cth thickness of label text (def=1).                
         THICK=thk thickness of axes and ticks (def=1).                
         MAJOR=g   Linestyle for an optional major tick grid.                
         MINOR=g2  Linestyle for an optional minor tick grid.                
 OUTPUTS:                
 COMMON BLOCKS:                
 NOTES:                
       Notes: To use do the following:                
         plot, t, y, xstyle=4                
         timeaxis                
         If no arguments are given to TIMEAXIS then an                
         axis will be drawn based on the last plot, if any.                
         Try DY=1.5 for PS fonts.                
 MODIFICATION HISTORY:                
       R. Sterner, 25 Feb, 1991                
       R. Sterner, 26 Jun, 1991 --- made nticks=0 give default ticks.                
       R. Sterner, 18 Nov, 1991 --- allowed Log Y axes.                
       R. Sterner, 11 Dec, 1992 --- added /NOLABELS.                
       R. Sterner, 20 May, 1993 --- Made date labeling (jd2mdays).                
       Allowed CHARSIZE for SIZE.                
                
 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory                
 This software may be used, copied, or redistributed as long as it is not                
 sold and this copyright notice is reproduced on each copy made.  This                
 routine is provided as is without any express or implied warranties                
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.                

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mb_lib\timeaxis1.pro)


TIMEAXIS[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIMEAXIS
 PURPOSE:
       Plot a time axis.
 CATEGORY:
 CALLING SEQUENCE:
       timeaxis, [t]
 INPUTS:
       t = optional array of seconds after midnight.  in
 KEYWORD PARAMETERS:
       Keywords:
         JD=jd   Set Julian Day number of reference date.
         FORM=f  Set axis label format string, over-rides default.
           do help,dt_tm_mak(/help) to get formats.
           For multi-line labels use @ as line delimiter.
         NTICKS=n  Set approximate number of desired ticks (def=6).
         TITLE=txt Time axis title (def=none).
         TRANGE=[tmin,tmax] Set specified time range.
         YVALUE=Y  Y coordinate of time axis (def=bottom).
         TICKLEN=t Set tick length as % of yrange (def=5).
         /NOLABELS means suppress tick labels.
         /NOYEAR drops year from automatically formatted labels.
           Doesn't apply to user specified formats.
         LABELOFFSET=off Set label Y offset as % yrange (def=0).
           Allows label vertical position adjustment.
         DY=d  Set line spacing factor for multiline labels (def=1).
         COLOR=c   Axis color.
         CHARSIZE=s    Axis text size.
         CHARTHICK=cth thickness of label text (def=1).
         THICK=thk thickness of axes and ticks (def=1).
         MAJOR=g   Linestyle for an optional major tick grid.
         MINOR=g2  Linestyle for an optional minor tick grid.
         TMAJOR=tmaj Returned seconds after JD of major ticks.
         TMINOR=tmin Returned seconds after JD of minor ticks.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: To use do the following:
         plot, t, y, xstyle=4
         timeaxis
         If no arguments are given to TIMEAXIS then an
         axis will be drawn based on the last plot, if any.
         Try DY=1.5 for PS fonts.
 MODIFICATION HISTORY:
       R. Sterner, 25 Feb, 1991
       R. Sterner, 26 Jun, 1991 --- made nticks=0 give default ticks.
       R. Sterner, 18 Nov, 1991 --- allowed Log Y axes.
       R. Sterner, 11 Dec, 1992 --- added /NOLABELS.
       R. Sterner, 20 May, 1993 --- Made date labeling (jd2mdays).
       Allowed CHARSIZE for SIZE.
       R. Sterner, 1999 Sep 23 --- Returned major and minor tick positions.
       R. Sterner, 2000 Jun 23 --- Added label shift: LSHIFT=sec.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\timeaxis.pro)


TIMEAXIS[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIMEAXIS
 PURPOSE:
       Plot a time axis.
 CATEGORY:
       PLOT 
 CALLING SEQUENCE:
       timeaxis, [t]
 INPUTS:
       t = optional array of seconds after midnight.  in
 KEYWORD PARAMETERS:
       Keywords:
         JD=jd   Set Julian Day number of reference date.
         FORM=f  Set axis label format string, over-rides default.
           do help,dt_tm_mak(/help) to get formats.
           For multi-line labels use @ as line delimiter.
         NTICKS=n  Set approximate number of desired ticks (def=6).
         TITLE=txt Time axis title (def=none).
         TRANGE=[tmin,tmax] Set specified time range.
         YVALUE=Y  Y coordinate of time axis (def=bottom).
         TICKLEN=t Set tick length as % of yrange (def=5).
         /NOLABELS means suppress tick labels.
         /NOYEAR drops year from automatically formatted labels.
           Doesn't apply to user specified formats.
         LABELOFFSET=off Set label Y offset as % yrange (def=0).
           Allows label vertical position adjustment.
         DY=d  Set line spacing factor for multiline labels (def=1).
         COLOR=c   Axis color.
         CHARSIZE=s    Axis text size.
         CHARTHICK=cth thickness of label text (def=1).
         THICK=thk thickness of axes and ticks (def=1).
         MAJOR=g   Linestyle for an optional major tick grid.
         MINOR=g2  Linestyle for an optional minor tick grid.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: To use do the following:
         plot, t, y, xstyle=4
         timeaxis
         If no arguments are given to TIMEAXIS then an
         axis will be drawn based on the last plot, if any.
         Try DY=1.5 for PS fonts.
 MODIFICATION HISTORY:
       R. Sterner, 25 Feb, 1991
       R. Sterner, 26 Jun, 1991 --- made nticks=0 give default ticks.
       R. Sterner, 18 Nov, 1991 --- allowed Log Y axes.
       R. Sterner, 11 Dec, 1992 --- added /NOLABELS.
       R. Sterner, 20 May, 1993 --- Made date labeling (jd2mdays).
       Allowed CHARSIZE for SIZE.

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\timeaxis.pro)


TIMER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIMER
 PURPOSE:
       Measure elapsed time between calls.
 CATEGORY:
 CALLING SEQUENCE:
       timer, [dt]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /START  starts timer.
         /STOP   stops timer (actually updates elapsed time).
         /PRINT  prints timer report.
         NUMBER = n. Select timer number to use (default = 0).
            Timer numbers 0 through 9 may be used.
         COMMENT = cmt_text. Causes /PRINT to print:
           cmt_text elapsed time: hh:mm:ss (nnn sec)
 OUTPUTS:
       dt = optionally returned elapsed time in seconds.    out
 COMMON BLOCKS:
       timer_com
 NOTES:
       Notes:
        Examples:
        timer, /start  use this call to start timer.
        timer, /stop, /print, dt   use this call to stop timer
          and print start, stop, elapsed time.  This example also
          returns elapsed time in seconds.
        Timer must be started before any elapsed time is available.
        Timer may be stopped any number of times after starting once, and
        the elapsed time is the time since the last timer start.
        timer, /start, number=5   starts timer number 5.
        timer, /stop, /print, number=5   stops timer number 5
        and prints result.
 MODIFICATION HISTORY:
       R. Sterner, 17 Nov, 1989
       R. Sterner, 28 Sep, 1993 --- Used dt_tm_tojs to handle long intervals.
       R. Sterner,  2 Dec, 1993 --- Now uses systime(1) for high precision.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\timer.pro)


TIMESTAMP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE      timestamp
 PURPOSE      print the current day and time in the lower right corner of
              the device window
 
 USEAGE       timestamp
              timestamp,label,charsize=charsize
 INPUT:
    label     optional label string. If LABEL not supplied the current
              working directory is used

 KEYWORD INPUT:
    charsize  character size multiplier (default=0.5)
    right     put timestamp at lower right corner of the page
              (default is lower left corner)

 OUTPUT:      none

 AUTHOR:              Paul Ricchiazzi    oct92 
                      Earth Space Research Group, UCSB

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\timestamp.pro)


TIMES_OF_FILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	times_of_files

 PURPOSE:
	This function reads the time vector from a netCDF File or concatinates time vectors from many netCDF Files

 CATEGORY:
   DATAFILES/NETCDF

 CALLING SEQUENCE:
   Result=times_of_files(files)

 INPUTS:
	files: The name of one or more netCDF File

 OUTPUTS:
	This function returns the parameter time in julian Seconds
   of all submitted files. The time is sorted and unique is used to remove
   repeated elements.

 EXAMPLE:
   result=times_of_files(['otto.nc','otto2.nc])

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), July, 8 1997
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\times_of_files.pro)


TIME_DIFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   time_diff

 PURPOSE:
   This function returns difference in seconds between
   the creation, modification, or access time of two files

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   Result=TIME_DIFF(Filename1,Filename2)

 INPUTS:
   Filename1:  a filename to be processed

 OPTIONAL INPUTS:
   Filename2:  a filename to be processed, if ommited the
           difference to the actual time is calculated

 KEYWORD PARAMETERS:
   keyword parameters of js_file_time are passed thru _EXTRA

   DLL_NAME:  name of the dll containing the code to get the information
   CREATION:  return creation time instead of modification time
   ACCESS:    return access time instead of modification or creation time
   ERR:       set this to a named variable and it will be set to 1 if an
              error occured

 OUTPUTS:
   This function returns the difference between the time stamps of two files
   if Filename1 is OLDER, a NEGATIVE value will be returned
   if an error occures -9.9999D99 is returned

 RESTRICTIONS:
   This routine works under Win32 only.

 PROCEDURE:
   This routine uses the c4idl.dll which was provided by Frank Holland

 EXAMPLE:
   filename=!dir
   string=time(filename, filename)
   print, 'The time difference is ', string, ' seconds'

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-APR-8
   modified by FR, Aug 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\time_diff.pro)


TIME_LABEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TIME_LABEL
 PURPOSE:
       Make a time label array
 CATEGORY:
 CALLING SEQUENCE:
       lbl = time_label(v, form)
 INPUTS:
       v = Array of values in seconds.   in
       form = Time date format string.   in
 KEYWORD PARAMETERS:
       Keywords:
         JD=jd  Set Julian Day of reference date.
           If not given the 1-Jan-2000 is used.
 OUTPUTS:
       lbl = String array of labels.     out
 COMMON BLOCKS:
 NOTES:
       Notes: The input time array is really an array
         of seconds from 0:00 on the reference date given
         by JD=jd.  If format string does not specify a
         date output then JD=jd need not be given, it
         defaults to 1-Jan-2000.  When d$ is given in the
         format string this just counts from day 1 up (to 31).
         For a description of the time format string
         see the routine dt_tm_mak.
 MODIFICATION HISTORY:
       R. Sterner. 18 Nov, 1988.
       R. Sterner, 22 Feb, 1991 --- Converted to IDL V2.
       R. Sterner, 26 Feb, 1991 --- Renamed from make_time_labels.pro
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\time_label.pro)


TIME_SERIES_SYNC

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   time_series_sync

 PURPOSE:
   This function returns a time synchronized array of data. (See the PROCEDURE
   section of this file for a description of the possible algorithms.)

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = TIME_SERIES_SYNC(Master_time, Client_time, Client_value [, /ALL] )

 INPUTS:
   Client_time:    array[M] of times where input is present
   Client_value:   array[M] of values of input which will be sync to master_time
   Master_time:    array[N] of times where output should be calculated

 OUTPUTS:
   Result:         Structure containing the info

 KEYWORD PARAMETERS:

   FILL_VALUE:         value to be used if no output can be calculated

   selecting the values to be used: priority (VALID, QUALITY, MISSING_VALUE)
   MISSING_VALUE:          value for missing data in the input value array
   QUALITY:                array of size of client values NE 0 are disregarded
   VALID:                  index field into client, only these values are regarded for average/interpol

   MESSAGE:            if this keyword is set messages will be printed
   ERROR:              if set to an variable an error status is returned (0: OK)
   TIMING_TEST:        if this keyword is set messages with computer time used are printed

   the following keywords are used to invoke different procedures for the interpolation

   SPLINE_INTERPOLATION    if set the build-in spline interpolation (SPLINE) is used
   LINEAR_INTERPOLATION    if set the build-in linear interpolation (INTERPOL) is used
   LINEAR_WITH_LIMIT       if set a linear interpolation with limits in in the
                           interpolation interval is used. Also returning the length
                           of the interval and the slope if requested (was verf2b)
   WINDOW_AVERAGE          if set the client data will be averaged over the provided time intervals (was verf1b)

   MASTER_WINDOW           time interval for WINDOW_AVERAGE mode in units of master (and client) time (scalar or array)

   STDEV                   if set the returned struct contains the standard deviation of the averaged data points
   MINIMUM                 if set the returned struct contains the minimum of the averaged data points
   MAXIMUM                 if set the returned struct contains the maximum of the averaged data points
   NO_OF_POINTS            if set the returned struct contains the number of the averaged data points

   INTERPOL_DISTANCE       if set the returned struct contains the time distance from the nearest neighbours
                           used for the interpolation
   INTERPOL_LIMIT          use this keyword to provide the maximum time distance between 2 data points used for
                           interpolation
   SPLINE_TENSION          use this keyword to provide the "tension" used by the build in spline procedure

   ALL                     if this keyword is set the returned structure contains all available
                           tags of statistical information
   ADDITIONAL_INFORMATION  in, a string [array] containing text to be added to the returned structure


 PROCEDURE:
   This function is the main function for syncronyzing time series data.
   Part of it (window_average, linear_with_limit) was originally realized in the
   ZUSAMMEN (fortran) program by London, Neuwohner, and Poppe and was converted
   to IDL by Franz Rohrer and Reimar Bauer (verf1b, verf2b). Other parts
   (prop_interpol) was developed by Theo Brauers for the TABKAL program and
   converted to IDL.

   This version provides and common interface to all of this routines.

 EXAMPLE:
   see example_time_series_*

 MODIFICATION HISTORY:
   Written by:     Theo Brauers (ICG-3), 1998-Oct
   Modified:       Theo Brauers 1999-Feb-8
   Modified:       Theo Brauers 1999-Jul-22 works with NaN as input
                                   for FILL_VALUE and  MISSING_VALUE:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\time_series_sync.pro)


TNAXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TNAXES
 PURPOSE:
       Find nice time axis tics.
 CATEGORY:
 CALLING SEQUENCE:
       tnaxes, xmn, xmx, nx, mjx1, mjx2, xinc, [mnx2, mnx2, xinc2]
 INPUTS:
       xmn, xmx = Axis min and max in sec.          in
       nx = Desired number of axis tics.            in
 KEYWORD PARAMETERS:
       Keywords:
         FORM=form  returns a suggested format, suitable
           for use in formatting time axis labels.
           Ex: h$:m$:s$, h$:m$, d$
 OUTPUTS:
       mjx1 = first major tic position in sec.      out
       mjx2 = last major tic position in sec.       out
       xinc = Suggested major tic spacing in sec.   out
       mnx1 = first minor tic position in sec.      out
       mnx2 = last minor tic position in sec.       out
       xinc2 = suggested minor tic spacing in sec.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Nov, 1988.
       R. Sterner, 22 Feb, 1991 --- converted to IDL V2.
       R. Sterner, 25 Feb, 1991 --- added minor ticks.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tnaxes.pro)


TNMIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   TNMIN

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Performs function minimization (Truncated-Newton Method)

 MAJOR TOPICS:
   Optimization and Minimization

 CALLING SEQUENCE:
   parms = TNMIN(MYFUNCT, X, FUNCTARGS=fcnargs, NFEV=nfev,
                 MAXITER=maxiter, ERRMSG=errmsg, NPRINT=nprint,
                 QUIET=quiet, XTOL=xtol, STATUS=status, 
                 FGUESS=fguess, PARINFO=parinfo, BESTMIN=bestmin,
                 ITERPROC=iterproc, ITERARGS=iterargs, niter=niter)

 DESCRIPTION:

  TNMIN uses the Truncated-Newton method to minimize an arbitrary IDL
  function with respect to a given set of free parameters.  The
  user-supplied function must compute the gradient with respect to
  each parameter.  TNMIN is based on TN.F (TNBC) by Stephen Nash.

  If you want to solve a least-squares problem, to perform *curve*
  *fitting*, then you will probably want to use the routines MPFIT,
  MPFITFUN and MPFITEXPR.  Those routines are specifically optimized
  for the least-squares problem.  TNMIN is suitable for constrained
  and unconstrained optimization problems with a medium number of
  variables.  Function *maximization* can be performed using the
  MAXIMIZE keyword.

  TNMIN is similar to MPFIT in that it allows parameters to be fixed,
  simple bounding limits to be placed on parameter values, and
  parameters to be tied to other parameters.  See PARINFO below for
  discussion and examples.

 USER FUNCTION

  The user must define an IDL function which returns the desired
  value as a single scalar.  The IDL function must accept a list of
  numerical parameters, P.  Additionally, keyword parameters may be
  used to pass more data or information to the user function, via the
  FUNCTARGS keyword.

  The user function should be declared in the following way:

     FUNCTION MYFUNCT, p, dp [, keywords permitted ]
       ; Parameter values are passed in "p"
       f  = ....   ; Compute function value
       dp = ....   ; Compute partial derivatives (optional)
       return, f
     END

  The function *must* accept at least one argument, the parameter
  list P.  The vector P is implicitly assumed to be a one-dimensional
  array.  Users may pass additional information to the function by
  composing and _EXTRA structure and passing it in the FUNCTARGS
  keyword.

  User functions may also indicate a fatal error condition using the
  ERROR_CODE common block variable, as described below under the
  TNMIN_ERROR common block definition (by setting ERROR_CODE to a
  number between -15 and -1).

  ANALYTIC vs. NUMERICAL DERIVATIVES

  By default, the user must compute gradient components analytically
  using AUTODERIVATIVE=0.  As explained below, numerical derivatives
  can also be calculated using AUTODERIVATIVE=1.  

  For analytic derivatives, the user should call TNMIN using the
  default keyword value AUTODERIVATIVE=0.  [ This is different
  behavior from MPFIT, where AUTODERIVATIVE=1 is the default. ] The
  IDL user routine should compute the gradient of the function as a
  one-dimensional array of values, one for each of the parameters.
  They are passed back to TNMIN via "dp" as shown above.
             
  The derivatives with respect to fixed parameters are ignored; zero
  is an appropriate value to insert for those derivatives.  Upon
  input to the user function, DP is set to a vector with the same
  length as P, with a value of 1 for a parameter which is free, and a
  value of zero for a parameter which is fixed (and hence no
  derivative needs to be calculated).  This input vector may be
  overwritten as needed.

  For numerical derivatives, a finite differencing approximation is
  used to estimate the gradient values.  Users can activate this
  feature by passing the keyword AUTODERIVATIVE=1.  Fine control over
  this behavior can be achieved using the STEP, RELSTEP and TNSIDE
  fields of the PARINFO structure.

  When finite differencing is used for computing derivatives (ie,
  when AUTODERIVATIVE=1), the parameter DP is not passed.  Therefore
  functions can use N_PARAMS() to indicate whether they must compute
  the derivatives or not.  However there is no penalty (other than
  computation time) for computing the gradient values and users may
  switch between AUTODERIVATIVE=0 or =1 in order to test both
  scenarios.

 CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD

  The behavior of TNMIN can be modified with respect to each
  parameter to be optimized.  A parameter value can be fixed; simple
  boundary constraints can be imposed; limitations on the parameter
  changes can be imposed; properties of the automatic derivative can
  be modified; and parameters can be tied to one another.

  These properties are governed by the PARINFO structure, which is
  passed as a keyword parameter to TNMIN.

  PARINFO should be an array of structures, one for each parameter.
  Each parameter is associated with one element of the array, in
  numerical order.  The structure can have the following entries
  (none are required):
  
     .VALUE - the starting parameter value (but see the START_PARAMS
              parameter for more information).
  
     .FIXED - a boolean value, whether the parameter is to be held
              fixed or not.  Fixed parameters are not varied by
              TNMIN, but are passed on to MYFUNCT for evaluation.
  
     .LIMITED - a two-element boolean array.  If the first/second
                element is set, then the parameter is bounded on the
                lower/upper side.  A parameter can be bounded on both
                sides.  Both LIMITED and LIMITS must be given
                together.
  
     .LIMITS - a two-element float or double array.  Gives the
               parameter limits on the lower and upper sides,
               respectively.  Zero, one or two of these values can be
               set, depending on the values of LIMITED.  Both LIMITED
               and LIMITS must be given together.
  
     .PARNAME - a string, giving the name of the parameter.  The
                fitting code of TNMIN does not use this tag in any
                way.
  
     .STEP - the step size to be used in calculating the numerical
             derivatives.  If set to zero, then the step size is
             computed automatically.  Ignored when AUTODERIVATIVE=0.

     .MPSIDE - the sidedness of the finite difference when computing
               numerical derivatives.  This field can take four
               values:

                  0 - one-sided derivative computed automatically
                  1 - one-sided derivative (f(x+h) - f(x)  )/h
                 -1 - one-sided derivative (f(x)   - f(x-h))/h
                  2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)

              Where H is the STEP parameter described above.  The
              "automatic" one-sided derivative method will chose a
              direction for the finite difference which does not
              violate any constraints.  The other methods do not
              perform this check.  The two-sided method is in
              principle more precise, but requires twice as many
              function evaluations.  Default: 0.

     .TIED - a string expression which "ties" the parameter to other
             free or fixed parameters.  Any expression involving
             constants and the parameter array P are permitted.
             Example: if parameter 2 is always to be twice parameter
             1 then use the following: parinfo(2).tied = '2 * P(1)'.
             Since they are totally constrained, tied parameters are
             considered to be fixed; no errors are computed for them.
             [ NOTE: the PARNAME can't be used in expressions. ]
  
  Future modifications to the PARINFO structure, if any, will involve
  adding structure tags beginning with the two letters "MP" or "TN".
  Therefore programmers are urged to avoid using tags starting with
  these two combinations of letters; otherwise they are free to
  include their own fields within the PARINFO structure, and they
  will be ignored.
  
  PARINFO Example:
  parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
                       limits:[0.D,0]}, 5)
  parinfo(0).fixed = 1
  parinfo(4).limited(0) = 1
  parinfo(4).limits(0)  = 50.D
  parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
  
  A total of 5 parameters, with starting values of 5.7,
  2.2, 500, 1.5, and 2000 are given.  The first parameter
  is fixed at a value of 5.7, and the last parameter is
  constrained to be above 50.


 INPUTS:

   MYFUNCT - a string variable containing the name of the function to
             be minimized (see USER FUNCTION above).  The IDL routine
             should return the value of the function and optionally
             its gradients.

   X - An array of starting values for each of the parameters of the
       model.

       This parameter is optional if the PARINFO keyword is used.
       See above.  The PARINFO keyword provides a mechanism to fix or
       constrain individual parameters.  If both X and PARINFO are
       passed, then the starting *value* is taken from X, but the
       *constraints* are taken from PARINFO.
 

 RETURNS:

   Returns the array of best-fit parameters.


 KEYWORD PARAMETERS:

   AUTODERIVATIVE - If this is set, derivatives of the function will
                    be computed automatically via a finite
                    differencing procedure.  If not set, then MYFUNCT
                    must provide the (analytical) derivatives.
                    Default: 0 (analytical derivatives required)

   BESTMIN - upon return, the best minimum function value that TNMIN
             could find.

   EPSABS - a nonnegative real variable.  Termination occurs when the
            absolute error between consecutive iterates is at most
            EPSABS.  Note that using EPSREL is normally preferable
            over EPSABS, except in cases where ABS(F) is much larger
            than 1 at the optimal point.  A value of zero indicates
            the absolute error test is not applied.  If EPSABS is
            specified, then both EPSREL and EPSABS tests are applied;
            if either succeeds then termination occurs.
            Default: 0 (i.e., only EPSREL is applied).

   EPSREL - a nonnegative input variable. Termination occurs when the
            relative error between two consecutive iterates is at
            most EPSREL.  Therefore, EPSREL measures the relative
            error desired in the function.  An additional, more
            lenient, stopping condition can be applied by specifying
            the EPSABS keyword.
            Default: 100 * Machine Precision

   ERRMSG - a string error or warning message is returned.

   FGUESS - provides the routine a guess to the minimum value.
            Default: 0

   FUNCTARGS - A structure which contains the parameters to be passed
               to the user-supplied function specified by MYFUNCT via
               the _EXTRA mechanism.  This is the way you can pass
               additional data to your user-supplied function without
               using common blocks.

               Consider the following example:
                if FUNCTARGS = { XVAL:[1.D,2,3], YVAL:[1.D,4,9]}
                then the user supplied function should be declared
                like this:
                FUNCTION MYFUNCT, P, XVAL=x, YVAL=y

               By default, no extra parameters are passed to the
               user-supplied function.

   ITERARGS - The keyword arguments to be passed to ITERPROC via the
              _EXTRA mechanism.  This should be a structure, and is
              similar in operation to FUNCTARGS.
              Default: no arguments are passed.

   ITERDERIV - Intended to print function gradient information.  If
               set, then the ITERDERIV keyword is set in each call to
               ITERPROC.  In the default ITERPROC, parameter values
               and gradient information are both printed when this
               keyword is set.

   ITERPROC - The name of a procedure to be called upon each NPRINT
              iteration of the TNMIN routine.  It should be declared
              in the following way:

              PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
                PARINFO=parinfo, QUIET=quiet, _EXTRA=extra
                ; perform custom iteration update
              END
         
              ITERPROC must accept the _EXTRA keyword, in case of
              future changes to the calling procedure.
          
              MYFUNCT is the user-supplied function to be minimized,
              P is the current set of model parameters, ITER is the
              iteration number, and FUNCTARGS are the arguments to be
              passed to MYFUNCT.  FNORM is should be the function
              value.  QUIET is set when no textual output should be
              printed.  See below for documentation of PARINFO.

              In implementation, ITERPROC can perform updates to the
              terminal or graphical user interface, to provide
              feedback while the fit proceeds.  If the fit is to be
              stopped for any reason, then ITERPROC should set the
              common block variable ERROR_CODE to negative value
              between -15 and -1 (see TNMIN_ERROR common block
              below).  In principle, ITERPROC should probably not
              modify the parameter values, because it may interfere
              with the algorithm's stability.  In practice it is
              allowed.

              Default: an internal routine is used to print the
                       parameter values.

   MAXITER - The maximum number of iterations to perform.  If the
             number is exceeded, then the STATUS value is set to 5
             and TNMIN returns.
             Default: 200 iterations

   MAXIMIZE - If set, the function is maximized instead of
              minimized.

   MAXNFEV - The maximum number of function evaluations to perform.
             If the number is exceeded, then the STATUS value is set
             to -17 and TNMIN returns.  A value of zero indicates no
             maximum.
             Default: 0 (no maximum)

   NFEV - upon return, the number of MYFUNCT function evaluations
          performed.

   NITER - upon return, number of iterations completed.

   NPRINT - The frequency with which ITERPROC is called.  A value of
            1 indicates that ITERPROC is called with every iteration,
            while 2 indicates every other iteration, etc.  
            Default value: 1

   PARINFO - Provides a mechanism for more sophisticated constraints
             to be placed on parameter values.  When PARINFO is not
             passed, then it is assumed that all parameters are free
             and unconstrained.  Values in PARINFO are never modified
             during a call to TNMIN.

             See description above for the structure of PARINFO.

             Default value:  all parameters are free and unconstrained.

   QUIET - set this keyword when no textual output should be printed
           by TNMIN

   STATUS - an integer status code is returned.  All values greater
            than zero can represent success (however STATUS EQ 5 may
            indicate failure to converge).  Gaps in the numbering
            system below are to maintain compatibility with MPFIT.
            Upon return, STATUS can have one of the following values:

        -18  a fatal internal error occurred during optimization.

        -17  the maximum number of function evaluations has been
             reached without convergence.

        -16  a parameter or function value has become infinite or an
             undefined number.  This is usually a consequence of
             numerical overflow in the user's function, which must be
             avoided.

        -15 to -1 
             these are error codes that either MYFUNCT or ITERPROC
             may return to terminate the fitting process (see
             description of MPFIT_ERROR common below).  If either
             MYFUNCT or ITERPROC set ERROR_CODE to a negative number,
             then that number is returned in STATUS.  Values from -15
             to -1 are reserved for the user functions and will not
             clash with MPFIT.

	   0  improper input parameters.
         
	   1  convergence was reached.

          2-4 (RESERVED)
         
	   5  the maximum number of iterations has been reached

          6-8 (RESERVED)
         

 EXAMPLE:

   FUNCTION F, X, DF, _EXTRA=extra  ;; *** MUST ACCEPT KEYWORDS
     F  = (X(0)-1)^2 + (X(1)+7)^2
     DF = [ 2D * (X(0)-1), 2D * (X(1)+7) ] ; Gradient
     RETURN, F
   END

   P = TNMIN('F', [0D, 0D], BESTMIN=F0)
   Minimizes the function F(x0,x1) = (x0-1)^2 + (x1+7)^2.


 COMMON BLOCKS:

   COMMON TNMIN_ERROR, ERROR_CODE

     User routines may stop the fitting process at any time by
     setting an error condition.  This condition may be set in either
     the user's model computation routine (MYFUNCT), or in the
     iteration procedure (ITERPROC).

     To stop the fitting, the above common block must be declared,
     and ERROR_CODE must be set to a negative number.  After the user
     procedure or function returns, TNMIN checks the value of this
     common block variable and exits immediately if the error
     condition has been set.  By default the value of ERROR_CODE is
     zero, indicating a successful function/procedure call.


 REFERENCES:

   TRUNCATED-NEWTON METHOD, TN.F
      Stephen G. Nash, Operations Research and Applied Statistics
      Department
      http://www.netlib.org/opt/tn

   Nash, S. G. 1984, "Newton-Type Minimization via the Lanczos
      Method," SIAM J. Numerical Analysis, 21, p. 770-778
      

 MODIFICATION HISTORY:
   Derived from TN.F by Stephen Nash with many changes and additions,
      to conform to MPFIT paradigm, 19 Jan 1999, CM
   Changed web address to COW, 25 Sep 1999, CM
   Alphabetized documented keyword parameters, 02 Oct 1999, CM
   Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
   Continued and fairly major improvements (CM, 08 Jan 2001):
      - calling of user procedure is now concentrated in TNMIN_CALL,
        and arguments are reduced by storing a large number of them
        in common blocks;
      - finite differencing is done within TNMIN_CALL; added
        AUTODERIVATIVE=1 so that finite differencing can be enabled,
        both one and two sided;
      - a new procedure to parse PARINFO fields, borrowed from MPFIT;
        brought PARINFO keywords up to date with MPFIT;
      - go through and check for float vs. double discrepancies;
      - add explicit MAXIMIZE keyword, and support in TNMIN_CALL and
        TNMIN_DEFITER to print the correct values in that case;
        TNMIN_DEFITER now prints function gradient values if
        requested;
      - convert to common-based system of MPFIT for storing machine
        constants; revert TNMIN_ENORM to simple sum of squares, at
        least for now;
      - remove limit on number of function evaluations, at least for
        now, and until I can understand what happens when we do
        numerical derivatives.
   Further changes: more float vs double; disable TNMINSTEP for now;
     experimented with convergence test in case of function
     maximization, 11 Jan 2001, CM
   TNMINSTEP is parsed but not enabled, 13 Mar 2001
   Major code cleanups; internal docs; reduced commons, CM, 08 Apr
     2001
   Continued code cleanups; documentation; the STATUS keyword
     actually means something, CM, 10 Apr 2001
   Added reference to Nash paper, CM, 08 Feb 2002

 TODO
  - scale derivatives semi-automatically;
  - ability to scale and offset parameters;
  
  $Id: tnmin.pro,v 1.9 2002/02/11 23:31:09 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\tnmin.pro)


TODEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TODEV
 PURPOSE:
       Convert from data or normalized to device coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       todev,x1,y1,x2,y2
 INPUTS:
       x1,y1 = input coordinates.                in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA if x1,y1 are data coordinates (default).
         /NORM if x1,y1 are normalized coordinates.
 OUTPUTS:
       x2,y2 = device coordinates.               out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 21 June 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\todev.pro)


TOGGLE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      toggle

 USEAGE For opening a postscript file:

       toggle,color=color,landscape=landscape,portrait=portrait, $
              queue=queue,print=print,filename=filename, $
              eps=eps,xoffset=xoffset,yoffset=yoffset,xsize=xsize, $
              ysize=ysize,_extra=_extra

 USEAGE For closing a postscript file:

       toggle,print=print, queue=queue

 PURPOSE:      toggles IDL graphics output between X-window and a postscript
               output file.  This program creates postscript and encapsulated
               files.  You can generate other graphics output formats by using
               the UNIX command "convert"

 OPTIONAL INPUTS (keyword parameters):

;;; these keywords recognized when opening a postscript file:

   COLOR
     Enable color plotting (output to Tek Phaser color printer)

   LANDSCAPE
     Horizontal plotting format (i.e., long side of paper is horizontal)

   PORTRAIT
     Vertical plotting format (default)

   EPS
     If set, an encapsulated postscript file is produced.  Many word
     processing and typesetting programs provide facilities to
     include encapsulated PostScript output within documents (for
     example groff's PSPIC command).  If the XSIZE and YSIZE
     parameters are not set the value of EPS is interpreted as an
     aspect ratio of the graphic.

     NOTE: Using the SET_CHARSIZE procedure to set the character size
           makes it easier to use an x-window preview to predict the
           appearance of PS output.

   XSIZE, YSIZE
     Controls the size of the plotting area (inches).  These
     parameters can be used to set the size of an EPS graphic.  If
     XSIZE and YSIZE are not set the value of of EPS is used to
     compute the aspect ratio.  In that case, the internal values of
     XSIZE and YSIZE are set to 8 and 8/EPS inches, respectively.
     Setting XSIZE and YSIZE explicitly is useful for controlling the
     appearance of different linestyles.  For example, when linestyle
     2 is used to produce dashed lines, a 4"x4" plot size will
     produce half as many dashes as a 8"x8" plot size.

   XOFFSET,YOFFSET
     In PORTRAIT mode XOFFSET,YOFFSET is the coordinate position of
     the lower left corner of the plotting area (inches) with respect
     to the lower left corner of the paper.  In LANDSCAPE mode the
     whole coordinate system is turned to 90 degrees counter-
     clockwise, so that XOFFSET is the bottom margin and YOFFSET is
     the distance from the lower-left corner of the plotting area to
     the RIGHT (yup, that's RIGHT) edge of the page.

   FILENAME
     name of postscript file (default = plot.ps or plotc.ps).

;;; these keywords recognized when closing a postscript file:

   PRINT
     PRINT=1 => submit to default printer ( setenv PRINTER ????)
     otherwise if PRINT is a string variable the job will be spooled
     to the named print queue (e.g., PRINT='tree').

   QUEUE
     if set, print queue is selected from a pop-up menu.

 PROCEDURE:
     The first call to TOGGLE (and all odd number calls) changes the
     output device from X-window to a Postscript output file.  If the
     output file name is not specified on the command line the
     default file name will be plot.ps for the laser printers, or
     plotc.ps for the TEK Phaser color printer.

     The next call (and all even number calls) switches back to the
     X-window and closes the plot file.  If the keyword PRINT is set
     the plotfile will be submitted to one of the ICESS print queues.

     NOTE: Only one postscript file can be open at any given time

 SIDE EFFECTS:
     In order to maintain a font size which keeps the same
     relation to the screen size, the global variable
     !p.charsize is changed when switching to and from
     postscript mode, as follows,

     When toggleing to PS !p.charsize --> !p.charsize/fac
     When toggleing to X  !p.charsize --> !p.charsize*fac

                 [!d.x_ch_size]    [!d.x_vsize  ]
     where fac=  [------------]    [----------- ]
                 [!d.x_vsize  ]    [!d.x_ch_size]
                               PS                X

     Thus, to ensure that plotted character strings scale
     properly in postscript mode, specify all character
     sizes as as multiples of !p.charsize.

 EXAMPLE:  View the IDL dist function and then make a hardcopy:

      d=dist(200)
      loadct,5
      tvscl,d                    ; view the plot on X-windows
      toggle,/color,/landscape   ; redirect output to plotc.ps
      tvscl,d                    ; write plot onto plotc.ps
      toggle,/print              ; resume output to X-windows
                                 ; submit plot job to default printer
      toggle,/color,/land
      tvscl,d
      toggle,print='term'        ; submit plot "term" print queue


 BUGS:  EPS option does not work in LANDSCAPE format.  Looks like a
        a problem in IDL's DEVICE proceedure.



  author:  Paul Ricchiazzi                            1jun92
           Institute for Computational Earth System Science
           University of California, Santa Barbara


 NOTE: you can check for the currently defined print queues in /etc/printcap

 REVISIONS:
  feb93: added PRINT keyword
  feb93: set yoffset=10.5 in landscape mode
  feb93: added FILENAME keyword
  mar93: added bits=8 in black and white mode
  mar96: modify !p.charsize to compensate for larger ps font size
  mar96: send output to print queue tree on eos
  sep96: added EPS,XSIZE and YSIZE keywords
  dec96: make PORTRAIT format standard for color plots

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\toggle.pro)


TOLER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		TOLER
 VERSION:
		4.0
 PURPOSE:
		Establishes numerical tolerance value for numerical procedures.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = TOLER(X [, keywords])
 INPUTS:
	X
		Numeric, otherwise arbitrary.  Ignored if one of the keywords TYPE or
		DOUBLE (see below) is used.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	TYPE
		Numeric type code.  If given overrides the type provided by X.
	/DOUBLE
		Switch.  Specifies double precision.  If given, overrides both TYPE and
		the type provided by X.
 OUTPUTS:
		Returns a value equal to twice the .EPS field of the structure created
		by the IDL function MACHAR.  If the type code, as set by the type of X,
		or directly by one of the keywords TYPE or DOUBLE is 5 (DOUBLE) or 9
		(DOUBLECOMPLEX), MACHAR is called with the keyword /DOUBLE.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		X (when provided) must be numeric else an error occurs.  Similarly,
		calling TOLER with TYPE = 8 or 9 will cause an error.
 PROCEDURE:
		Straightforward.  Uses MACHAR.  Calls DEFAULT and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUN-1995 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Added keyword /DOUBLE.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\toler.pro)


TOPC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TOPC
 PURPOSE:
       Return top color number for current device.
 CATEGORY:
 CALLING SEQUENCE:
       tc = topc()
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Aug 9
	R. Sterner, 1998 Jan 15 --- Fixed to return color table size,
	  not number of colors (24 bit color should now work).

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\topc.pro)


TOPCOLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TOPCOLORS
 PURPOSE:
       Reserve and define some colors at top of color table.
 CATEGORY:
 CALLING SEQUENCE:
       topcolors
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TOP=top  Returned top available image color.
         PUT_HUE=s  Specified starting index for reserved colors.
           By default reserved colors start at top+1.
         /REMAP   Means remap current color table to new range.
         HUE=hue  Returned index table of hues. The pure colors are:
           color=hue(0) gives white.
           color=hue(1) gives red.
           color=hue(2) gives yellow.
           color=hue(3) gives green.
           color=hue(4) gives cyan.
           color=hue(5) gives blue.
           color=hue(6) gives magenta.
           Hue-1: darker, Hue-2: darkest, Hue+1: pale, Hue+2: palest
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Example use:
         Load desired color table: loadct, 4
         Remap and reserve colors: topcolors,top=top,hue=hue,/remap
         Display image using bytscl: tv,bytscl(img,top=top).
         Make a dark blue background: erase, hue(5)-2
         Make a pale red plot: plot,x,y,color=hue(1)+1,/noerase
 MODIFICATION HISTORY:
       R. Sterner, 9 Dec, 1993
       R. Sterner, 1994 Jan 12 --- Added PUT_HUE keyword.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\topcolors.pro)


TOPO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TOPO
 PURPOSE:
       Make a monochrome shaded relief view of a surface.
 CATEGORY:
 CALLING SEQUENCE:
       t = topo(z, az, ax)
 INPUTS:
       z = array of elevations to shade.                       in
       az = light source angle from zenith in deg (def = 45).  in
       ax = light source angle from x axis in deg (def = 45).  in
 KEYWORD PARAMETERS:
       Keywords:
         DELTA=d  Set a range of slopes in degrees to map to 0 to 1.
           Delta is relative to sun angle. Try small value, 5 or 10.
         ZERO=v  Value (0 to 1) to map zero slope (flat surface) to.
           May be used with DELTA (DELTA=10 if not given with ZERO).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: there are no true shadows.  DELTA and ZERO give better
         control over brightness and avoid low sun angles returning
         low brightness results.  The operation of DELTA and ZERO
         are roughly: ZERO is brightness, DELTA is contrast.
         Best values depend on the data but ZERO=.5 and DELTA
         around 5 to 15 might be reasonable.
 MODIFICATION HISTORY:
       R. Sterner. 19 Nov, 1987.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner, 1994 Jun 6 --- Made a minor memory savings.
       R. Sterner, 1994 Jun 28 --- Added DELTA and ZERO keywords.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\topo.pro)


TRACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		TRACE

 PURPOSE:	Define a path through a plot or image using the image display 
               system and the cursor/mouse.  TRACE can be used either to 
               obtain the vector of x and y vertices of a path in data 
               coordinates or, when used with TVIM, the array of image 
               indecies of all points along the path or inside the defined
               polygon.

 CATEGORY:	Image processing.

 CALLING SEQUENCE:
	trace,xv,yv,ii,retore=retore,silent=silent,region=region,dt=dt,
                  color=color

 INPUTS:         none

 KEYWORD INPUT PARAMETERS:

	RESTORE   if set, originaly displayed image is restored to its
		  original state on completion. 

       SILENT    If set no intructional printout is issued at the 
                 beginning of execution

       DT        repitition time interval for adding or removing nodes
                 when the mouse button is held down

       REGION    keyword REGION is set II contains indecies of all points
                 within the polygon defined by XV and YV

       COLOR     color to shade polygonal region, 
                 works only when REGION is set and RESTORE is not set

 OUTPUTS:

       XV    Vector of x vertices of traced path in data coordinates

       YV    Vector of y vertices of traced path in data coordinates

       ii    subscript vector of all pixels along defined path.  This works
             on an image displayed by TVIM as long as you don't define
             an XRANGE and YRANGE in the TVIM call.

             if keyword REGION is set II contains indecies of all points
             within the polygon defined by XV and YV


 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Display is changed if RESTORE is not set.

 RESTRICTIONS:
       1. Only works for interactive, pixel oriented devices with a
          cursor and an exclusive or writing mode.

       2. A path may have at most 1000 vertices.  If this is not enough
          edit the line setting MAXPNTS.

       3. Only works with images displayed by TVIM

 PROCEDURE:
       This procedure is intended to be used with TVIM.  The original
       TVIM image should be displayed without the XRANGE and YRANGE
       parameters set, because in this case the x and y axis of the
       TVIM plot represents the actual image or array coordinates of
       the imaged quantity.  TRACE uses these values to compute the
       array indices either along a transect or within a specified
       polygonal region.

       The exclusive-or drawing mode is used to allow drawing and
       erasing objects over the original object.

       The operator marks the vertices of the path, either by
       dragging the mouse with the left button depressed or by
       marking individual points along the path by clicking the
       left mouse button, or with a combination of both.

       The center button removes the most recently drawn points.

       Press the right mouse button when finished.  On exit gaps in the 
       traced path are filled by interpolation

 EXAMPLE
       !p.multi=[0,1,2]
       d=dist(300,100)
       tvim,d
       trace,xv,yv,ii           ; draw a circle inside the image with the 
                                ; the left mouse button pressed down
       polyfill,xv,yv,color=100 ; shade the selected region
       oplot,xv,yv,psym=-1      ; highlight the border of the region
       plot,d(ii),psym=-1       ; plot a transect of the path


; blowup a given region and show it under the original image

       loadct,5
       !p.multi=[0,1,2]
       a=randata(200,200,s=4)
       rng=[min(a,max=amx),amx]              ; save range for use in blowup
       tvim,a,/scale,range=rng
       trace,xv,yv,ii,/region
       xv=[xv,xv(0)] & yv=[yv,yv(0)]         
       oplot,xv,yv                           ; show border of blowup region
       xrng=[min(xv,max=xmx),xmx]            ; save xrng and yrng for blowup
       yrng=[min(yv,max=ymx),ymx]
       b=fltarr(200,200)
       b(ii)=a(ii)                           ; show only the selected region
       b=b(xrng(0):xrng(1),yrng(0):yrng(1))
       tvim,b,xrange=xrng,yrange=yrng,range=rng,/scale
       oplot,xv,yv                           ; show border of blowup region


 Adapted from DEFROI by : Paul Ricchiazzi    oct92 
                          Earth Space Research Group, UCSB

 REVISIONS
 29oct92: if no points are selected return -1
 11nov92: allow input parameter AA to be 2 element vector 
 26apr93: massive simplifications to make TRACE easier to use

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\trace.pro)


TRAJ_ROUTE

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       traj_route
 
 PURPOSE: 
       This procedure computes the fly- route of one or more trajectories
       at a map. You can choose the time- steps which will be shown, if 
       you declare the last time- point.
       The single trajectories you can choose over their start- time.
       
 CATEGORY: 
       PLOT/TRAJECTORIES 
 
 CALLING SEQUENCE: 
       traj_route,traj1_st,trajn_st,anzahl,time=time,map=map
 
 INPUTS: 
       traj1_st: the start- time of the first trajectorie, which will be plotted
                 a string of the form: 'hh:minmin:ss dd.mm.yyyy ms'

 OPTIONAL INPUTS:
       trajn_st: the start- time of the last trajectorie, which will be plotted
                 (optional) a string of the form: 'hh:minmin:ss dd.mm.yyyy ms'
       anzahl:   every 'anzahl'-th trajectorie between the first and the last 
                 trajectorie is plotted (Type: integer)

 KEYWORD PARAMETERS:
       time:     the time where the calculate is to end
                 a string of the form: 'hh:minmin:ss dd.mm.yyyy ms'
       map:      the projection which should be used
                 default: mercator
                 options: 'psg' for polarstereographic

 OUTPUTS: 
       A plot where you can see the fly- route of the specified trajectories.
 
 EXAMPLE: 
        route,traj1_st,trajn_st,anzahl,time=time,map=map
 
 MODIFICATION HISTORY: 
       Written by:  Juergen Ankenbrand , 1.6.98 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\ja_lib\traj_route.pro)


TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	trans

 PURPOSE:
	This procedure is an example for the use of asc2ncdf

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   trans


 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
       Copyright (C) 1997, Forschungszentrum Juelich GmbH,
                     Institut für Stratosphaerische Chemie (ICG-1)
       This software may be used, copied, or redistributed as long as it is not
       sold and this copyright notice is reproduced on each copy made.  This
       routine is provided as is without any express or implied warranties
       whatsoever.


 EXAMPLE:
   trans

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\trans.pro)


TRANSFORM_VOLUME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TRANSFORM_VOLUME

 PURPOSE:

       The purpose of this program is to transform (e.g., rotate,
       scale, and translate) a 3D array or volume.

 AUTHOR:

       Martin Downing,
       Clinical Research Physicist,
       Grampian Orthopaedic RSA Research Centre,
       Woodend Hospital, Aberdeen, AB15 6LS.
       Pnone: 01224 556055 / 07903901612
       Fa: 01224 556662
       E-mail: m.downing@abdn.ac.uk

 CATEGORY:

      Mathematics, graphics.

 CALLING SEQUENCE:

      result = TRANSFORM_VOLUME( volume )

 INPUTS:

       volume:    The 3D array or volume to be transformed.

 OPTIONAL KEYWORDS:

      BUFFER_SIZE: To reduce memory overhead the routine processes the job in chunks, the number
         of elements of which can be set using the BUFFER_SIZE keyword, set this keyword to
         0 to force the whole array to be processed at one time. The default value is 128.

      MISSING: The value to return for transformed values outside the bounds of
         the volume. (Passed to the INTERPOLATE function.) Default is 0.

      T3DMAT: The homogeneous transforamtion matrix. If this keyword is not present,
         the following keywords can be used to create a homogeneous transformation matrix:

         ROTATION - The rotation vector [rx,ry,rz]. The order of rotation is ZYX.
         TRANSLATE - The translation vector [tx,ty,tz].
         SCALE - The scale vector [sx,sy,sz].
         CENTRE_ROTATION - The centre of rotation [cx,cy,cz].

 OUTPUTS:

       result:    The transformed array or volume.

 COMMON BLOCKS:

       None.

 DEPENDENCIES:

       The program uses the library INTERPLOLATE routine, which currently (IDL 5.4)
       uses linear interpolation. Note that the operation is performed in chunks,
       each of which is independant of the result of the others, so the operation
       could easiliy be parallelised.

 MODIFICATION HISTORY:

       Written by: Martin Downing, 16 September 2001.
       Added MISSING keyword. Removed INPLACE keyword. 25 Nov 2001. MD

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\transform_volume.pro)


TRANSLATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TRANSLATE
 PURPOSE:
       Translate an image to regisiter with a reference image.
 CATEGORY:
 CALLING SEQUENCE:
       translate, img1, img2, [dx2, dy2, key]
 INPUTS:
       img1 = reference image.                  in
       img2 = image to translate.               in
 KEYWORD PARAMETERS:
       Keywords:
         EXITKEY=k define exit key.  Default is A.
         EXITTEXT=txt  to use for menu giving action of EXITKEY.
           Should say something like Exit and do ...
         /FIRST keeps difference image scaling same as unshifted difference.
 OUTPUTS:
       dx2, dy2 = pixels shifted in x and y.    in, out
       key = non keypad key returned.           out
 COMMON BLOCKS:
 NOTES:
       Notes: the displayed image is: img1 - shift(img2,dx2,dy2)
         Images with discontinueties may have small differences
         when unshifted but very large differences in a few
         places when shifted.  These large differences may
         dominate the autoscaling.  Try using /FIRST to avoid this.
 MODIFICATION HISTORY:
       R. Sterner, 9 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\translate.pro)


TRANSLATE_SUB_SUPER[1]

[Previous Routine] [Next Routine] [List of Routines]
 SPECIAL NOTE: 
       The file translate_sub_super.pro contains two functions,
       translate_sub_super, and sub_sup_idl.  The former is the
       generic routine for processing TeX sub/superscripts, the
       latter is used only by translate_sub_super and has no general
       utility.  Hence it lives here.  You will see documentation for
       translate_sub_super second if you use DOC_LIBRARY.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\translate_sub_super.pro)


TRANSLATE_SUB_SUPER[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TRANSLATE_SUB_SUPER
 PURPOSE:
       Translate TeX sub/superscripts to IDL sub/superscripts.
 CATEGORY:
       text/strings
 CALLING SEQUENCE:
       new = translate_sub_super( old )
 INPUTS:
       old       -- string to be translated from TeX to IDL.   in
 KEYWORD PARAMETERS:
       /RECURSED -- set if this function is being called 
                    recursively.                  
       /HELP     -- Set to print useful message and exit.
 OUTPUTS:
       new       -- string old converted from TeX to IDL       out
 COMMON BLOCKS:
 SIDE EFFECTS:
 NOTES:
       - For best results, when both a sub and superscript are used,
         place the shorter of the two first (e.g. 'N^{a}_{bbbb}' is
         better than 'N_{bbbb}^{a}').
       - Single character sub/super scripts do not need to be
         protected by braces.
       - Sub/superscripts may be nested (e.g. 'N^{N_1^N}').
 EXAMPLE:
       out = translate_sub_super( 'N^2_{big}' )
       Then out='N!U2!N!Dbig!N' which looks like it should on the
       display. 
 LIBRARY FUNCTIONS CALLED:
       str_token      -- Text/string (mcraig)
       sub_sup_idl -- contained in this file
 MODIFICATION HISTORY:
       $Id: translate_sub_super.pro,v 1.5 2000/06/14 19:09:22 mcraig Exp $
       $Log: translate_sub_super.pro,v $
       Revision 1.5  2000/06/14 19:09:22  mcraig
       Changed name of strtok str_token to avoid conflict in IDL 5.3.

       Revision 1.4  1996/06/14 20:00:27  mcraig
       Updated Copyright info.

       Revision 1.3  1996/05/09 00:22:17  mcraig
       Changed some function calls to reflect changes in those functions, moved
       some code out of the main loop that didn't need to be there, added
       documentation.

       Revision 1.2  1996/02/08 18:54:20  mcraig
       Changed default sub/superscript size to be !D/!U rather than !I/!E to
       improve readability of plat annotations.

       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision

 RELEASE:
       $Name: Rel_2_0 $

 COPYRIGHT:
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\textoidl\translate_sub_super.pro)


TRANSREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   TRANSREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov

 PURPOSE:
   Parse a tabular ASCII data file or string array.

 CALLING SEQUENCE:
   TRANSREAD, UNIT, VARi [, FORMAT=FORMAT]  (first usage)
      or
   TRANSREAD, UNIT, VARi [, FORMAT=FORMAT], FILENAME=FILENAME  (second usage)
      or
   TRANSREAD, STRINGARRAY, VARi [, FORMAT=FORMAT]  (second usage)

 DESCRIPTION:
   TRANSREAD parses an ASCII table into IDL variables, one variable
   for each column in the table.  The tabular data is not limited to
   numerical values, and can be processed with an IDL FORMAT
   expression.

   TRANSREAD behaves similarly to READF/READS in that it transfers
   ASCII input data into IDL variables.  The difference is that
   TRANSREAD reads more than one row in one pass, and returns data by
   column.  In a sense, it forms the *transpose* of the typical
   output from READF or READS (which returns data by row), hence the
   name TRANSREAD.  [ TRANSREAD can parse up to 20 columns in its
   current implementation, but that number can be easily increased. ]

   TRANSREAD can optionally be provided with a FORMAT expression to
   control the transfer of data.  The usage is the same as for
   READ/READF/READS.  However, you may find that you need to slightly
   modify your format statements to read properly.  In this
   implementation, variables are intermediately parsed with READS,
   which appears from my experimentation to require at least a
   default length for transfers.

   Hence, you should use:   ..., FORMAT='(D0.0,D0.0,I0)'       ; GOOD
   instead of:              ..., FORMAT='(D,D,I)'          ; BAD

   As with the standard IDL READ-style commands, you need to supply
   initial values to your variables before calling TRANSREAD, which
   are used to determine the type.  Then dimensions of the variable
   are not important; TRANSREAD will grow the arrays to an
   appropriate size to accomodate the input.  Lines from the input
   which do not contain the correct number of columns or do not obey
   the format statement are ignored.

   TRANSREAD will also flexibly manage typical data files, which may
   contain blank lines, lines with comments (see COMMENT keyword), or
   incomplete lines.  These lines are ignored.  It can be programmed
   to wait for a user-specified "trigger" phrase in the input before
   beginning or ending processing, which can be useful if for example
   the input table contains some header lines (see STARTCUE and
   STOPCUE keywords).  [ The user can also pre-read these lines
   before calling TRANSREAD. ]  Finally, the total number of lines
   read can be controlled (see MAXLINES keyword).  TRANSREAD parses
   until (a) the file ends, (b) the STOPCUE condition is met or (c)
   the number of lines read reaches MAXLINES.

   TRANSREAD has three possible usages.  In the first, the file must
   already be open, and TRANSREAD begins reading at the current file
   position.  In the second usage, a filename is given.  TRANSREAD
   automatically opens the file, and reads tabular data from the
   beginning of the file.  Normally the file is then closed, but this
   can be prevented by using the NOCLOSE keyword.

   In the third usage, a string array is passed instead of a file
   unit.  Elements from the array are used one-by-one as if they were
   read from the file.

   Since TRANSREAD is not vectorized, and does a significant amount
   of processing on a per-line basis, it is probably not optimal to
   use on very large data files.

 INPUTS:

   UNIT - in the first usage, UNIT is an open file unit which
          contains ASCII tabular data to read.  UNIT must not be a
          variable which could be mistaken for a string array.

          In the second usage, when FILENAME is specified, then upon
          return UNIT contains the file unit that TRANSREAD used for
          reading.  Normally, the UNIT is closed before return, but
          it can be kept open using the NOCLOSE keyword.  In that
          case the unit should be closed with FREE_LUN.

   STRINGARRAY - this is the third usage of TRANSREAD.  When a string
                 array is passed, elements from the array are used as
                 if they were lines from an input file.  The array
                 must not be of a numeric type, so it cannot be
                 mistaken for a file unit.  [ Of course, the string
                 itself can contain ASCII numeric data. ]

 OUTPUTS:
   VARi - List of named variables to receive columns from the table,
          one variable for each column.  Upon output each variable
          will be an array containing the same number of elements,
          one for each row in the table.  If no rows were
          successfully parsed, then the variable values are not
          changed.  Use the COUNT output keyword to determine whether
          any rows were parsed.

          NOTE: Up to twenty columns may be parsed.  If more columns
          are desired, then a simple modification must be made to the
          IDL source code.  To do so, find the beginning of the
          procdure definition, identified by the words, "pro
          transread, ..."  and follow the instructions there.

 INPUT KEYWORD PARAMETERS:
   FORMAT - an IDL format expression to be used to transfer *each*
            row in the table.  If no format as given then the default
            IDL transfer format is used, based on the types of the
            input variables.  As mentioned in the description above,
            a length should be assigned to each format code; a length
            of zero can be used for numeric types.  Lines from the
            input which do not contain the correct number of columns
            or do not obey the format statement are ignored.

   COMMENT - A one-character string which designates a "comment" in
             the input.  Input lines beginning with this character
             (preceded by optional spaces) are ignored.  FAILCOUNT
             does not increase.
             DEFAULT: no comments are recognized.

             NOTE: lines which do not match the format statement are
             ignored.  Comments are likely to be ignored based on
             this behavior, even without specifying the COMMENT
             keyword; however the FAILCOUNT will increase.

   MAXLINES - the maximum number of lines to be read from input.  The
              count begins *after* any STARTCUE is satisfied (if any)
              DEFAULT: no maximum is imposed.

   SKIPLINES - the number of lines of input to skip before beginning
               to parse the table.
               DEFAULT: no lines are skipped.
               NOTE: if STARTCUE is also given, then the line count
               does not start until after the STARTCUE phrase has
               been encountered.

   STARTCUE - a unique string phrase that triggers the start of
              parsing.  Lines up to and including the line containing
              the cue are ignored.  Because each line is checked for
              this starting cue, it should be unambiguous.
              DEFAULT: parsing begins immediately.

   STOPCUE - a unique string phrase that triggers the finishing of
             parsing.  The line including the cue is ignored, and no
             more reads occur afterward.
             DEFAULT: no STOPCUE is imposed.

   FILENAME - the presence of this keyword signals the second usage,
              where TRANSREAD explicitly opens the input file named
              by the string FILENAME.  Reading begins at the start of
              the file.

              Normally TRANSREAD will close the input file when it
              finishes.  This can be prevented by setting the NOCLOSE
              keyword.

              DEFAULT: input is either an already-opened file passed
              via the UNIT keyword, or a string array.

   NOCLOSE - if set and if FILENAME is given, then the file is not
             closed upon return.  The file unit is returned in UNIT,
             and must be closed by the user via FREE_LUN, UNIT.
             DEFAULT: any files that TRANSREAD opens are closed.

   DEBUG - set this keyword to enable debugging messages.  Detailed
           error messages will be printed for each failed line.

 OUTPUT KEYWORDS:
   LINES - the number of lines read, including comments and failed
           parses.

   COUNT - the number of rows successfully parsed.  Can be zero if
           accessing the input utterly fails, or if no rows are
           present.

   FAILCOUNT - the number of rows that could not be parsed
               successfully.  Comments and blank lines are not
               included.

 EXAMPLES:
   OPENR, UNIT, 'widgets.dat', /GET_LUN
   A = '' & B = 0L & C = 0D
   TRANSREAD, UNIT, A, B, C, COUNT=COUNT, FORMAT='(A10,I0,D0.0)'
   FREE_LUN, UNIT

   (First usage) Opens widgets.dat and reads three columns.  The
   first column is a ten-character string, the second an integer, and
   the third a double precision value.

   A = '' & B = 0L & C = 0D
   TRANSREAD, UNIT, A, B, C, COUNT=COUNT, FORMAT='(A10,I0,D0.0)', $
      FILENAME='widgets.dat'

   (Second usage) Achieves the same effect as the first example, but
   TRANSREAD opens and closes the file automatically.

   SPAWN, 'cat widgets.dat', BUF
   A = '' & B = 0L & C = 0D
   TRANSREAD, BUF, A, B, C, COUNT=COUNT, FORMAT='(A10,I0,D0.0)'

   (Third usage) Achieves the same effect as the first two examples,
   but input is read from the string variable BUF.

 MODIFICATION HISTORY:
   Feb 1999, Written, CM
   Mar 1999, Added SKIPLINES and moved on_ioerror out of loop, CM
   Jun 2000, Added NOCATCH and DEBUG keyword options, CM

  $Id: transread.pro,v 1.2 2001/03/25 18:10:43 craigm Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\transread.pro)


TRANS_UNIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	trans_unit

 PURPOSE:
	This function returns the scale factor and offset between units

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result=trans_unit(inunit,outunit,[/get_group])

 INPUTS:
   inunit:  The input unit e.g. 'feet'
   outunit: The output unit e.g.'km'

 KEYWORDS:
   get_group: gaves an output structure holding:
               group: the group name of the inunit
               units: all units of a group

 OUTPUTS:
   This function returns a string which is the function to get the new unit

 EXAMPLE:
   Result=trans_unit('feet','km')
   print,result
   '*0.304800/1000.'

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), August, 4 1997
                                1997-Dec-27 added get_group
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\trans_unit.pro)


TREE2HTMLFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tree2htmlfile

 PURPOSE:
   This function creates the html-file of a directory tree

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result=TREE2HTMLFILE(dir, [/MESSAGE], [TREE2HTML_FILE=file], _EXTRA=extra )

 INPUTS:
   dir : directory name to be searched for with full path

 KEYWORD PARAMETERS:
   MESSAGE     : if set messages will be printed
   TREE2HTML_FILE: name of the html-file, which contains the table of the tree

   _EXTRA  :       BORDER=border (default) ,CAPTION=dirpath (default), see array2htmltable for details
                   TITLE=directory name (default),  see html_header for details
                   LEVEL:          the number of directory levels to be searched for
                   DIR2HTML_FILE:  name of the html-file, which contains the table of informations
                       about the directories (default=dir2html.html)
                   CREATE_DIR2HTML: create the dir2html_files if not exist
                   EXCLUDE :       string array of file search patterns to be excluded
                   INCLUDE :       string array of file search patterns to be included (only these files will be taken)

 OUTPUTS:
   This function returns name of the file which contain the html code  for a directory tree

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998
   Modified and debugged Theo Brauers Oct 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tree2htmlfile.pro)


TREE2HTMLTABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tree2htmltable

 PURPOSE:
   makes the html-code of a directory tree

 CATEGORY:
   PROG_TOOLS/HTML

 CALLING SEQUENCE:
   Result=TREE2HTMLTABLE(dir, [/MESSAGE], [LEVEL=level], [DIR2HTML_FILE=file], [/CREATE_DIR2HTML], _EXTRA=extra )

 INPUTS:
   dir : directory name to be searched for with full path

 KEYWORD PARAMETERS:
   LEVEL       : the number of directory levels to be searched for
                 (default=-1 all levels)
   MESSAGE     : if set messages will be printed
   DIR2HTMLFILE: name of the html-file, which contains the table of informations
                 about the directories (default=dir2html.html)
   CREAE_DIR2HTML: if set a dir2html file will be created

   _EXTRA : BORDER=border (default),CAPTION=dirpath (default) see array2htmltable for details

 OUTPUTS:
   This function returns an array which contain the html-code
   for a directory tree

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by:      Marsy Lisken  august 1998
   Modified and debugged Theo Brauers Oct 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tree2htmltable.pro)


TRI_SURF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TRI_SURF

 PURPOSE:
	This function Interpolates a regularly or irregularly gridded
	set of points with a C1 smooth quintic surface.

 CATEGORY:
	Mathematical functions, Interpolation, Surface Fitting

 CALLING SEQUENCE:
	Result = TRI_SURF(Z [, X, Y])

 INPUTS: 
	X, Y, Z:  arrays containing the X, Y, and Z coordinates of the 
		  data points on the surface. Points need not be 
		  regularly gridded. For regularly gridded input data, 
		  X and Y are not used: the grid spacing is specified 
		  via the XGRID and YGRID (or XVALUES and YVALUES) 
		  keywords, and Z must be a two dimensional array. 
		  For irregular grids, all three parameters must be
		  present and have the same number of elements. 

 KEYWORD PARAMETERS:
  Input grid description:
	REGULAR:  if set, the Z parameter is a two dimensional array 
		  of dimensions (N,M), containing measurements over a 
		  regular grid. If any of XGRID, YGRID, XVALUES, YVALUES 
		  are specified, REGULAR is implied. REGULAR is also 
		  implied if there is only one parameter, Z. If REGULAR is 
		  set, and no grid (_VALUE or _GRID) specifications are 
		  present, the respective grid is set to (0, 1, 2, ...). 
	XGRID:    contains a two element array, [xstart, xspacing], 
		  defining the input grid in the X direction. Do not
		  specify both XGRID and XVALUES. 
	XVALUES:  if present, XVALUES(i) contains the X location 
		  of Z(i,j). XVALUES must be dimensioned with N elements. 
	YGRID:    contains a two element array, [ystart, yspacing], 
		  defining the input grid in the Y direction. Do not
		  specify both YGRID and YVALUES. 
	YVALUES:  if present, YVALUES(i) contains the Y location 
		  of Z(i,j). YVALUES must be dimensioned with N elements. 

  Output grid description:
	GS:	  If present, GS must be a two-element vector [XS, YS],
		  where XS is the horizontal spacing between grid points
		  and YS is the vertical spacing. The default is based on
		  the extents of X and Y. If the grid starts at X value
		  Xmin and ends at Xmax, then the default horizontal
		  spacing is (Xmax - Xmin)/(NX-1). YS is computed in the
		  same way. The default grid size, if neither NX or NY
		  are specified, is 26 by 26. 
	BOUNDS:   If present, BOUNDS must be a four element array containing
		  the grid limits in X and Y of the output grid:
		  [Xmin, Ymin, Xmax, Ymax]. If not specified, the grid
		  limits are set to the extent of X and Y. 
	NX:       The output grid size in the X direction. NX need not
	  	  be specified if the size can be inferred from GS and
		  BOUNDS. The default value is 26.
	NY:       The output grid size in the Y direction. See NX. 

  Others:
       EXTRAPOLATE: If set, extrapolate the surface to points outside
		the convex hull of input points.  Has no effect if
		input points are regularly gridded.
	MISSING: If set, points outside the convex hull of input points
		are set to this value.  Default is 0.  Has no effect
		if input points are regularly gridded.

 OUTPUTS:
	This function returns a two-dimensional floating point array
 	containing the interpolated surface, sampled at the grid points.

 RESTRICTIONS:
	The output grid must enclose convex hull of the input points.
 PROCEDURE:
	This routine is similar to MIN_CURVE_SURF but the surface
	fitted is a smooth surface, not a minimum curvature surface.  This
	routine has the advantage of being much more efficient
	for larger numbers of points.

	The built-in IDL routines TRIANGULATE and TRIGRID(/QUINTIC) are
	used.

 EXAMPLES:
 Example 1: Irregularly gridded cases
	Make a random set of points that lie on a gaussian:
	  n = 15				;# random points
	  x = RANDOMU(seed, n)
	  y = RANDOMU(seed, n)
	  z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) 	 ;The gaussian

 	get a 26 by 26 grid over the rectangle bounding x and y:
	  r = TRI_SURF(z, x, y)	;Get the surface.

 	Or: get a surface over the unit square, with spacing of 0.05:
	  r = TRI_SURF(z, x, y, GS=[0.05, 0.05], BOUNDS=[0,0,1,1])

 	Or: get a 10 by 10 surface over the rectangle bounding x and y:
	  r = TRI_SURF(z, x, y, NX=10, NY=10)

 Example 2: Regularly gridded cases
	Make some random data
	  z = randomu(seed, 5, 6)

	interpolate to a 26 x 26 grid:
	  CONTOUR, TRI_SURF(z, /REGULAR)

 MODIFICATION HISTORY:
	DMS, RSI, October, 1993.  Written.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tri_surf.pro)


TROE_FORMULA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   troe_formula

 PURPOSE:
   this function calculates effective second-order rate constant
   for a three-body reaction (Troe formula)

 CATEGORY:
   PHYSCHEM

 CALLING SEQUENCE:
   Result=TROE_FORMULA(K0300, Q, KU300, R, M, T)

 INPUTS:
   KO300:  low pressure limit (cm6s-1)
   Q:      exponent for correction of low pressure limit to 300 K
   KU300:  high pressurte limit (cm3s-1)
   R:      exponent for correction of low pressure limit to 300 K
   M:      number density of gas (cm-3)
   T:      temperature in K

 OUTPUTS:
   the value of the 2nd order reaction rate (cm3s-1)

 PROCEDURE:
   See: DeMore et al., Chemical kinetics and Photochemical Data
   for Use in Stratospheric modeling (#11), 1994, page 8

 MODIFICATION HISTORY:
   Written by:     Theo Brauers, 1997-Dec-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\troe_formula.pro)


TSS_MASTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	tss_master

 PURPOSE:
	This procedure is a wrapper around time_series_sync. A master and client data file name
	are passed into this routine. On return a file with the syncronized client data
	at master time was generated. This routine handels ENZ as well as NCDF files.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	tss_master, master, client, output

 INPUTS:
	master:	File name of the data set which provides the time grid for syncronisation.
	client:	File name of the data set which is syncronized to master.
	output:	Name of the output file with the syncronized data set.

 KEYWORD PARAMETERS:
	MASTER_FILE_TYPE = mft:	Type of the master file ('NC' or 'ENZ'). If not provided the
		program extracts this information from the file name extension (.nc, .enz).
	CLIENT_FILE_TYPE = cft: Type of the client file ('NC' or 'ENZ'). If not provided the
		program extracts this information from the file name extension (.nc, .enz).
	OUTPUT_FILE_TYPE = oft: Type of the output file ('NC' or 'ENZ'). If not provided the
		program extracts this information from the file name extension (.nc, .enz).
	CLIENT_PARAM_NAME = cpn: Name of the parameter in the client file which will be syncronized.
		If not provided the program will handle files with only one parameter correctly.
	REFERENCE_DATE = ref_date: If data are written to an ENZ file this date will serve
		as reference date for the time data (default: 01.01.1996 00:00:00).
	NCDF_GLOBAL = ncdf_global: Global parameters (!global of icg-structure) for output ncdf file.
		If not provided the global parameters of the client file (if ncdf format) are used.
	NCDF_PARAM = ncdf_param: NCDF parameters of the client parameter for output ncdf file.
		If not provided the NCDF parameters of the client parameter (if ncdf format) are used.
	ERROR = err: Returns 0 if no error occured.

	Any keywords accepted by time_series_sync. Important ones are:
	/WINDOW_AVERAGE: If set the client data will be averaged over a time intervall dt at
		(master time) +- (dt/2).
	MASTER_WINDOW = dt: Time intervall for averaging client data.
	/LINEAR_WITH_LIMIT: If set the client data will be interpolated at master time
	INTERPOL_LIMIT = ip_limit: If defined the client data are interpolated only if the
		time interval beween the two closest client data points is not larger than ip_limit.
	MISSING_VALUE = missing_value: Missing value in client data file.
	FILL_VALUE = fill_value: Value for missing data in output file.

 OUTPUTS:
	This procedure returns a file (either ENZ or ncdf format) with the
	time syncronized client data. Time syncronization takes place at master time.

 RESTRICTIONS:
	This procedure works only with ENZ or ncdf format files.

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 18.3.1999
	22.03.1999: Check if user has access to 'S:\links\idl_test\new_netcdf\read_ncdf.pro'
	24.06.1999: Check removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\tss_master.pro)


TST_DISTRIB_BINOMIAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_distrib_binomial

 PURPOSE:
       This procedure generates 'max_numbers' random deviates from a
       binomial distribution. Then the interval ['lBound', 'uBound']
       is divided in 'bins' equdistant subintervals. The frequency of
       each subinterval will be counted.

 CATEGORY:
       EXAMPLES/RANDOM

 CALLING SEQUENCE:
       tst_distrib_binomial

 OUTPUTS:
       Plot of frequency

 RESTRICTIONS:
       This procedure is only an example.

 MODIFICATION HISTORY:
       Written by:     E. Gruenter
       July, 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_distrib_binomial.pro)


TST_DISTRIB_GAMMA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_distrib_gamma

 PURPOSE:
       This procedure generates 'max_numbers' random deviates from a
       gamma distribution of integer order 'ia'. An integer order
       equal to 1 is the same as an exponential distribution.
       Then the interval ['lBound', 'uBound'] is divided in 'bins'
       equidistant subintervals. The frequency of each subinterval
       will be counted.

 CATEGORY:
       EXAMPLES/RANDOM

 CALLING SEQUENCE:
       tst_distrib_gamma

 OUTPUTS:
       Plot of frequency

 RESTRICTIONS:
       This procedure is only an example.

 MODIFICATION HISTORY:
       Written by:     E. Gruenter
       July, 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_distrib_gamma.pro)


TST_DISTRIB_NORMAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_distrib_normal

 PURPOSE:
       This procedure generates 'max_numbers' random deviates from a
       normal distribution . Then the interval ['lBound', 'uBound']
       is divided in 'bins' equidistant subintervals. The frequency
       of each subinterval will be counted.

 CATEGORY:
       EXAMPLES/RANDOM

 CALLING SEQUENCE:
       tst_distrib_normal

 OUTPUTS:
       Plot of frequency

 RESTRICTIONS:
       This procedure is only an example.

 MODIFICATION HISTORY:
       Written by:     E. Gruenter
       July, 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_distrib_normal.pro)


TST_DISTRIB_POISSON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_distrib_poisson

 PURPOSE:
       This procedure generates 'max_numbers' random deviates from a
       poisson distribution . Then the interval ['lBound', 'uBound']
       is divided in 'bins' equidistant subintervals. The frequency
       of each subinterval will be counted.

 CATEGORY:
       EXAMPLES/RANDOM

 CALLING SEQUENCE:
       tst_distrib_poisson

 OUTPUTS:
       Plot of frequency

 RESTRICTIONS:
       This procedure is only an example.

 MODIFICATION HISTORY:
       Written by:     E. Gruenter
       July, 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_distrib_poisson.pro)


TST_DISTRIB_UNIFORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_distrib_uniform

 PURPOSE:
       This procedure generates 'max_numbers' random deviates from a
       uniform distribution . Then the interval ['lBound', 'uBound']
       is divided in 'bins' equidistant subintervals. The frequency
       of each subinterval will be counted.

 CATEGORY:
       EXAMPLES/RANDOM

 CALLING SEQUENCE:
       tst_distrib_uniform

 OUTPUTS:
       Plot of frequency

 RESTRICTIONS:
       This procedure is only an example.

 MODIFICATION HISTORY:
       Written by:     E. Gruenter
       July, 1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_distrib_uniform.pro)


TST_DT_TM_FROMJS

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	tst_dt_tm_fromjs 
 
 PURPOSE: 
  This example shows the formatting of Julian Seconds (JS) 
 
 CATEGORY: 
   EXAMPLES/TIME 
 
 CALLING SEQUENCE: 
   tst_dt_tm_fromjs 
 
 PROCEDURE: 
 dt_tm_fromjs gehoert zur Ray Sterner Bibliothek 
 
 MODIFICATION HISTORY: 
 	Written by:	R.Bauer (ICG-1), 1998-Mar-0/ 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\time\tst_dt_tm_fromjs.pro)


TST_FUNCTION_REDEF

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	tst_function_redef 
 
 PURPOSE: 
  Problem: This function returns two values 
 
 CATEGORY: 
   EXAMPLES 
 
 CALLING SEQUENCE: 
   b=6 
   out=tst_function_redef(b) 
 
 OUTPUT: 
 out: 10 
 b: AETSCH (b will be redefined) 
 
 MODIFICATION HISTORY: 
 	Written by:	R.Bauer (ICG-1), 1998-Mar-0/ 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_function_redef.pro)


TST_FZJ_LOGO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tst_fzj_logo

 PURPOSE:
   Test routine for fzj_logo


 CATEGORY:
   EXAMPLES/PLOT

 CALLING SEQUENCE:
   tst_fzj_logo

 MODIFICATION HISTORY:
 R.Bauer 1999-Mar-10

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\fzj_logo\tst_fzj_logo.pro)


TST_NCDF_GR_CACHE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   tst_ncdf_gr_cache

 PURPOSE:
   This procedure tests the speed using cache / sav files included into the ncdf_gr procedure

 CATEGORY:
   EXAMPLES

 CALLING SEQUENCE:
   tst_ncdf_gr_cache,n

 INPUTS:
  n: number of tests

 MODIFICATION HISTORY:
 R.Bauer 1998-Jul-24

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\tst_ncdf_gr_cache.pro)


TST_NCDF_W

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_ncdf_w

 PURPOSE:
       This routine tests ncdf_w and the overwrite modus of ncdf_w

 CATEGORY:
       EXAMPLES/DATAFILES/NETCDF

 CALLING SEQUENCE:
        testsin1


 MODIFICATION HISTORY:
       Written by:     R.Bauer May 1998
       parts of the source are from testsin1 by F. Rohrer

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\datafiles\netcdf\tst_ncdf_w.pro)


TST_SET_FRAME_1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    tst_set_frame_1

 PURPOSE:
 
set_frame test plotxy and ovelayed polyfill box
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: tst_set_frame_1 EXAMPLE: tst_set_frame_1 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\tst_set_frame_1.pro)


TST_SET_FRAME_2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    tst_set_frame_2

 PURPOSE:
 
set_frame test plotxy setting polyfill bars and overlays a frame of plot2d
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: tst_set_frame_2 EXAMPLE: tst_set_frame_2 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\tst_set_frame_2.pro)


TST_SET_FRAME_3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    tst_set_frame_3

 PURPOSE:
 
set_frame test plotxy overlayed frame of plot2d
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: tst_set_frame_3 EXAMPLE: tst_set_frame_3 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\tst_set_frame_3.pro)


TST_SET_FRAME_4

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    tst_set_frame_4

 PURPOSE:
 
set_frame test normal frame position
CATEGORY: EXAMPLES/PLOT/PLOTXY CALLING SEQUENCE: tst_set_frame_4 EXAMPLE: tst_set_frame_4 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\tst_set_frame_4.pro)


TST_SYMBOL_10

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_symbol_10

 PURPOSE:
 
Tests if symbol 10 will work
CATEGORY: EXAMPLES/PLOT CALLING SEQUENCE: tst_symbol_10 MODIFICATION HISTORY: R.Bauer 1998-Jul-24

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\tst_symbol_10.pro)


TST_XP_LEGEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tst_xp_legend

 PURPOSE:
 This example shows the use of xp_legend with the no_replace mode


 CATEGORY:
   EXAMPLES/PLOT

 CALLING SEQUENCE:
   tst_xp_legend

 MODIFICATION HISTORY:
 R.Bauer 1998-Jul-24

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\tst_xp_legend.pro)


TST_XP_WIDGET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	tst_xp_widget

 PURPOSE:
  This example shows the xp_widgets

 CATEGORY:
   EXAMPLES/PLOT/PLOTXY

 CALLING SEQUENCE:
   tst_xp_widget

 EXAMPLE:
   tst_xp_widget


 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 2000-Apr-25

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\examples\plot\plotxy\tst_xp_widget.pro)


TS_SYNCHRONIZE_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   ts_synchronize_array

 PURPOSE:
   This function returns a time synchronized array of data (see PROCEDURE section
   for a description of the algorithms

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = TS_SYNCHRONIZE_ARRAY(Master_time, Client_time, Client_value)

 INPUTS:
   Master_time:    array[N] of times where output should be calculated
   Client_time:    array[M] of times where input is present
   Client_value:   array[M] of values of input which will be sync to master_time

 OUTPUTS:
   Result:         array[N] of the syncronized values

   output is also provided thru some of the keyword parameters which are parsed to
   the calculation routines

 KEYWORD PARAMETERS:

   these keywords control the execution of the main program and set values for the exlusion
   and inclusion of data

       NO_ERROR_CHECK:         set this keyword to switch off checking for monotonic arrays
       FILL_VALUE:             value to be used if no output can be calculated

   selecting the values to be used: priority (VALID, QUALITY, MISSING_VALUE)
       MISSING_VALUE:          value for missing data in the input value array
       QUALITY:                array of size of client values NE 0 are disregarded
       VALID:                  index field into client, only these values are regarded for average/interpol

       MESSAGE                 if this keyword is set messages will be printed
       ERROR                   if set to an variable an error status is returned (0: OK)
       TIMING_TEST             if this keyword set

   the following keywords are used to invoke different procedures for the interpolation

       SPLINE_INTERPOLATION    if set the build-in spline interpolation (SPLINE) is used
       LINEAR_INTERPOLATION    if set the build-in linear interpolation (INTERPOL) is used
       LINEAR_WITH_LIMIT       if set a linear interpolation with limits in in the
                               interpolation interval is used. Also returning the lenght
                               of the interval and the slope if required (was verf2b)
       RUNNING_AVERAGE         .... not yet implemented
       PROP_INTERPOLATION      proportional interpolation guided by values of the master time
                               .... not yet implemented
       WINDOW_AVERAGE          averaging over the provided intervals (was verf1b)
                               if window average is called together with the keyword /LINEAR_WITH_LIMIT
                               then those master_time entries without a valid average are calculated
                               using the algorithm of linear with limits


   these keywords are used for the underlying routines a keywords for execution

       MASTER_WINDOW           necesarray input for window averages (scalar or array)

       CLIENT_WINDOW           .... not yet implemented
       CLIENT_STDEV            .... not yet implemented
       _REF_EXTRA              used to transfer the keywords of the underlying routines
                               by reference calls so that data can be returned
                               STDEV                   out, window_average
                               MINIMUM                 out, window_average
                               MAXIMUM                 out, window_average
                               NO_OF_POINTS            out, window_average
                               INTERPOL_DISTANCE       out, linear_with_limit
                               INTERPOL_LIMIT          in,  linear_with_limit
                               SPLINE_TENSION          in,  spline_interpolation


 PROCEDURE:
   This function is the array level function for syncronyzing time series data.
   Part of it (window_average, linear_with_limit) was originally realized in the
   ZUSAMMEN (fortran) program by London, Neuwohner, and Poppe and was converted
   to IDL by Franz Rohrer and Reimar Bauer (verf1b, verf2b). Other parts
   (prop_interpol) was developed by Theo Brauers for the TABKAL program and
   converted to IDL. This function should be called through
   TIME_SERIES_SYNC which provides a better user interface to all of this routine.

 EXAMPLE:
   see example_time_series_*

 MODIFICATION HISTORY:
   Written by:     Theo Brauers (ICG-3), 1998-Oct
   Modified:       Theo Brauers 1999-Feb-8
                   now including the sources of the intepolation routines
   Modified:       Theo Brauers 1999-Juni 17
                   bug with m_idx removed
   Modified:       13.1.2000 Franz Rohrer: keyword no_error_check to suppress error check for increasing time axis

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\ts_synchronize_array.pro)


TVB

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:   tvb

 USEAGE:    tvb,im

 PURPOSE:   Display a large image in one window at reduced resolution.
            Use the CURBOX routine to select a region of interest.
            The sub-array is displayed in another window at full resolution
            For each new sub-array the selected subscript range is printed
            to the terminal.  

 INPUT:
   im       a large two dimensional image array

 OUTPUT:    none

 PROCEDURE:
            when first invoked TVB renders the full image (possibly
            at reduced resolution) in a large window.  A region of
            interest is selected via the CURBOX procedure, by moving
            the mouse pointer or pressing the LMB or MMB to
            decrease/increase the box size.  The region is selected
            with the right mouse button.  Next, TVB draws the
            selected region at full resolution in another window and
            puts up a popup menu with 5 options.  The operator can
            choose to

         1. select a new region, killing the last special region window
         2. select a new region, keeping the last special region window
         3. blow up the current special region window by 50%
         4. quit the procedure, keeping all windows
         5. quit the procedure, killing all windows

 Side Effects:
            When items 1,2,4 or 5 are selected the the sub-array indecies of 
            the save window are printed to the terminal in format,
 
               window wid: (ix1:ix2, iy1:iy2)

            where,
 
            wid      is the window id of the special region window
            ix1:ix2  range of first subscript
            iy1:iy2  range of second subscript

            the sub array can be retrieved as,
 
            sub_array = im(ix1:ix2, iy1:iy2)

 EXAMPLE

    loadct,5
    im=randata(50,100,s=3)
    im=congrid(im,500,1000,/interp)

    tvb,im

  author:  Paul Ricchiazzi                            oct93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tvb.pro)


TVBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVBOX
 PURPOSE:
       Draw or erase a box on the image display.
 CATEGORY:
 CALLING SEQUENCE:
       tvbox, x, y, dx, dy, clr
 INPUTS:
       x = Device X coordinate of lower left corner of box.  in
       y = Device Y coordinate of lower left corner of box.  in
       dx = Box X size in device units.                      in
       dy = Box Y size in device units.                      in
       clr = box color.                                      in
          -1 to just erase last box (only last box).
          -2 for dotted outline.  Useful if box must cover an
             unknown range of colors.
 KEYWORD PARAMETERS:
       Keywords:
         /NOERASE  causes last drawn box not to be erased first.
         /COPY  use first time to set screen copy mode.  Good for
           windows on slow machines.  Uses an internal copy of the
           screen image instead of tvrd (tvrd is up to 16 times
           slower than tv on some machines).  Avoid for large
           windows.  Unneeded on fast machines.
        /NOCOPY  unsets the COPY mode.
 OUTPUTS:
 COMMON BLOCKS:
       box_com
 NOTES:
       Notes: /COPY and /NOCOPY should be used with no
         other parameters.
 MODIFICATION HISTORY:
       R. Sterner, 25 July, 1989
       R. Sterner, 1994 Jan 11 --- Added copy mode.
       R. Sterner, 1994 Aug 31 --- Added dotted outline.
       R. Sterner, 1994 Nov 27 --- Changed dotted colors from 0,255
       to darkest, brightest.
       R. Sterner, 1998 Mar 18 --- Attempt to deal with true color.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvbox.pro)


TVBOX2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tvbox2
 PURPOSE:
       Draw or erase a box on the image display.
 CATEGORY:
  PLOT

 CALLING SEQUENCE:
       tvbox2, x, y, dx, dy, clr
 INPUTS:
       x = Device X coordinate of lower left corner of box.  in
       y = Device Y coordinate of lower left corner of box.  in
       dx = Box X size in device units.                      in
       dy = Box Y size in device units.                      in
       clr = box color.                                      in
          -1 to just erase last box (only last box).
          -2 for dotted outline.  Useful if box must cover an
             unknown range of colors.
 KEYWORD PARAMETERS:
       Keywords:
         /NOERASE  causes last drawn box not to be erased first.
         /COPY  use first time to set screen copy mode.  Good for
           windows on slow machines.  Uses an internal copy of the
           screen image instead of tvrd (tvrd is up to 16 times
           slower than tv on some machines).  Avoid for large
           windows.  Unneeded on fast machines.
        /NOCOPY  unsets the COPY mode.
 OUTPUTS:
 COMMON BLOCKS:
       box_com
 NOTES:
       Notes: /COPY and /NOCOPY should be used with no
         other parameters.
 MODIFICATION HISTORY:
       R. Sterner, 25 July, 1989
       R. Sterner, 1994 Jan 11 --- Added copy mode.
       R. Sterner, 1994 Aug 31 --- Added dotted outline.
       R. Sterner, 1994 Nov 27 --- Changed dotted colors from 0,255
       to darkest, brightest.
       R. Bauer,   1998 May 22 --- Changed tvrd to tvrd2

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tvbox2.pro)


TVCIRC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVCIRC
 PURPOSE:
       Draw a circle on the display.
 CATEGORY:
 CALLING SEQUENCE:
       tvcirc, x, y, r
 INPUTS:
       x,y = center of circle in device units.    in
       r = Radius of circle in device units.      in
           May be an array of radii.
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c  plot color (def=!p.color).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, Aug 1989
       R. Sterner, 26 May, 1993 --- documented COLOR keyword and
       allowed r to be an array.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvcirc.pro)


TVCRS2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVCRS2
 PURPOSE:
       Like tvcr but allows data, device, & normal coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       tvcrs2, [on_off] or tvcrs2, x, y
 INPUTS:
       on_off = 0: turn cursor off, 1: turn cursor on.      in
       x, y = Position cursor at x,y and turn on.           in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA    x and y are in data coordinates.
         /DEVICE  x and y are in device coordinates (default).
         /NORMAL  x and y are in normal coordinates.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 26

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvcrs2.pro)


TVIM

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  tvim

 USEAGE:   tvim,a

           tvim,a,scale=scale,range=range,xrange=xrange,yrange=yrange,     $
                aspect=aspect,title=title,xtitle=xtitle,ytitle=ytitle,     $
                noaxis=noaxis,interp=interp,colors=colors,c_map=c_map,     $
                stitle=stitle,rmarg=rmarg,clip=clip,labels=labels,         $
                pcharsize=pcharsize,lcharsize=lcharsize,nbotclr=nbotclr,   $
                clevels=clevels,nodata=nodata,rgb_nodata=rgb_nodata,       $
                barwidth=barwidth,position=position,noframe=noframe,rct=rct

 PURPOSE:  Display an image with provisions for
               
            1. numbered color scale 
            2. plot title
            3. annotated x and y axis 
            4. simplified OPLOT capability
            5. manual or automatic scaling with smooth or discreet colors
            6  special treatment of "invalid data" pixels

 INPUT    
   a           image quantity

 Optional keyword input:

  title
    plot title

  xtitle
    x axis title
 
  ytitle
    y axis title

  stitle
    color key title (drawn to the right of color scale)

  rmarg 
    right margin expansion factor to provide more room for extra wide
    color scale annotation (default=1)

  xrange
    array spanning entire x axis range. (default = [0,x_dimension-1])

  yrange
    array spanning entire y axis range. (default = [0,y_dimension-1])

    NOTE:TVIM only uses min(XRANGE), max(XRANGE), min(YRANGE) and max(YRANGE).

  scale
    if set draw color scale.  SCALE=2 causes steped color scale

  range
    two or three element vector indicating physical range over which
    to map the color scale.  The third element of RANGE, if specified, 
    sets the step interval of the displayed color scale.  It has no
    effect when SCALE is not set. E.g., RANGE=[0., 1., 0.1] will
    cause the entire color scale to be mapped between the physical
    values of zero and one; the step size of the displayed color
    scale will be set to 0.1.

  clip
    specifies a set percentage of pixels which will be left outside
    the color scale.  Larger values of CLIP yield images with greater
    contrast. For example if clip=2 then the color scale range will
    be set to include 98% of the pixels and to exclude the brightest
    1% and the dimmest 1% of the pixel brightness distribution.
    Keyword RANGE overides the effect of CLIP.

    If CLIP is a two element vector, the upper and lower percentile
    range can be specified.  For example CLIP=[0,95] will exclude the
    top 5%.  

    An alternative is to set CLIP to a single negative integer.  This
    causes the grey scale range to be obtained from the max and min
    value of the image array after it is filtered by a 2-D median
    filter. The radius of the median filter is set to -clip.  Median
    filtering is effective in removing "salt and pepper" noise,
    (isolated high or low values). For example, setting clip=-1
    causes the code to check the 9 element superpixel centered at
    each pixel for median values.  A single extremely large or small
    value does not affect the final value of the median at each pixel
    point.

  aspect
    the x over y aspect ratio of the output image. If not set, aspect
    is set to (size_x/size_y) of the input image.

  position
    specifies the lower left and upper right TVIM frame position in
    normal coordinates.  When set POSITION overides the setting of
    ASPECT.

  noaxis
    if set do not draw x and y numbered axis around image. Instead
    just draw a box

  noframe
    if set no not draw anything around image, not even a box

  interp
    TVIM normally uses nearest neighbor sampling to resize the image
    to fill the data window area. If INTERP is set the resizing
    operation uses bilinear interpolation

    If INTERP = 2 the interpolation range is adjusted so that there
    is a half pixel border around the plot.  This ensures that the
    smoothed image properly represents the cell center values of the
    pixels, but introduces an extrapolation on the outer edges.  This
    option has noticeable effects for small (<20) image arrays.
    
    NOTE: When writing to a Postscript file the resizing operation is
    accomplished by changing the pixel size.  Thus the INTERP
    parameter has no effect on Postscript output.

  pcharsize
    character size of numbers along x and y axis and the title
    (default is !p.charsize if non-zero, 1 otherwise)
 
    NOTE: The character size of the x and y-axis number scale
    annotation may be independently controlled by the !x.charsize or
    !y.charsize system variables.  For example, the x and y axis
    number scale characters may be made invisible by setting these
    variables to a very small non-zero number before calling TVIM.
    Remember to restore normal character sizes by setting !x.charsize
    and !y.charsize to 1 or zero after the call to TVIM.

  lcharsize
    character size of color key number or labels (default is
    !p.charsize if non-zero, 1 otherwise)

  barwidth
     width of color key which appears to right of image when SCALE is
     set.  (default=1)

  labels
     a vector of strings used to label the color key levels.  If not
     set the default color key number labels are used.  If the number
     of elements in LABELS is the same as the number of elements in
     COLORS then the labels will appear in the middle of a given
     color band instead of at the boundary between colors.  If COLORS
     is not set the number of elements in LABELS should be at least
     as large as the number of color key segments plus one.

  colors
     an array of color indicies.  When the COLORS array is set TVIM
     will map values of A into the color values specified in COLORS.
     How physical values are assigned to color values depends on how
     the RANGE parameter is set, as shown in this table:
     
             RANGE           color_value
             -----           -----------
       1.  not set          COLORS(A)
       2.  [amin,amax]      COLORS((A-amin)/dinc)
       3.  [amin,amax,inc]  COLORS((A-amin)/inc)
     
     where amin, amax and inc are user specified elements of RANGE
     and dinc=(amax-amin)/n_elements(COLORS).  In case 1, A is used
     directly as a subscript into COLORS.  When RANGE is not set
     legend labels should be used to annotate the color values. In
     case 2, A is scaled so that each color defined in COLORS
     represents a proportionate fraction of the total dynamic range.
     In case 3, amin and inc (and not amax) are used to control which
     colors are associated with given physical values.  See examples.

  c_map
     TVIM normally rescales the input image to span the entire color
     table range. Setting C_MAP disables this automatic re-scaling.
     This is useful when the image byte values correspond to a
     particular color mapping that could be destroyed by the
     rescaling process (E.G.  a gif image).
     
     NOTE: When the number of IDL color table entries is less than
     256 some colors may be lost. Use a private color map to avoid
     this. See examples.
               
  nbotclr
     number of reserved colors at the bottom of the color
     table.  Color values between 0 and nbotclr-1 will not
     be used in the displayed image.  This allows the
     bottom of the table to be set to special colors which
     will not be used in the displayed the image.  This
     keyword is disabled when either the COLORS or NODATA 
     options are used.  (default=1)

     NOTE: by default the color table indicies used within a TVIM
     image is limited to the range 1 to !d.n_colors-2. In most
     predefined color tables, color index 0 and !d.n_color-1
     correspond to pure black and white, respectively. TVIM uses
     these color indicies as background and foreground colors for
     region blanking and axis annotation. Color tables which do not
     define black and white in these index locatations are not good
     choices for TVIM plots, unless the first and last color table
     entries are redefined as black and white using TVLCT, e.g.,
     tvlct,0,0,0,0 & tvlct,255,255,255,!d.n_colors-1
     
     NOTE: the procedure DCOLORS can be used to load a set
     of discreet colors in the bottom 11 color values
     (0-10). The original color table is resampled to fit
     between color value 11 and the !d.n_colors-1.
             

  nodata
     pixel values which are interpreted as invalid data.  Pixels
     containing this data value are colored with color RGB_NODATA.

  rgb_nodata
     an RGB value (a 3 component vector) used to color pixels filled
     with invalid data. (default = [0,0,0])

     NOTE: NODATA and RGB_NODATA override the effect of NBOTCLR

  rct
     if set, reverse direction of color table.  This keyword can be
     used on black & white printers to allow large field values to be
     represented by dark colors.  Note, this feature is implemented
     by reversing the association between physical values and color.
     Though it reverses the colors on the color key, it does not
     affect the actual color table.
     
               
 KEYWORD OUTPUT:
   clevels 
     physical values at the color key tic marks.  Use this to set
     contour levels in a subsequent call to CONTOUR.

 SIDE EFFECTS: 
     Setting SCALE=2 changes the color scale using the STEP_CT
     procedure.  The color scale may be returned to its original
     state by the command, STEP_CT,/OFF

 PROCEDURE:
     TVIM first determines the size of the plot data window with a
     dummy call to PLOT.  When the output device is "X", CONGRID is
     used to scale the image to the size of the available data
     window.  Otherwise, if the output device is Postscript,
     scaleable pixels are used in the call to TV.
     
     If the input image quantity is not of type byte, TVIM converts
     them to byte by scaleing the input between 0 and !d.n_colors-1.
     If the input is already a byte array and if either the number of
     color table entries is 256 or if C_MAP is set, then no scaling
     is done.  This is to ensure consistency with specially defined
     private color tables.
     
     After the the image is drawn TVIM calls PLOT again to draw the x
     and y axis and titles.  Finally if scale is set, TVIM calls the
     COLOR_KEY procedure to draw the color scale just to the right of
     the data window.

 RESTRICTIONS: 
     A stepped color scale (SCALE = 2 option) is not available when
     writing to a black & white postscript file (i.e., when the
     DEVICE color option is not enabled).

 DEPENDENCIES: COLOR_KEY, STEP_CT, PRANK

 EXAMPLES:

;    Plot a GIF image with its own preset RGB
;    table (perhaps from a digitized video image)

 window,colors=256            ; set up a private color map
 read_gif,'/home/paul/gif/el-nino.gif',im,r,g,b
 tvlct,r,g,b
 tvim,im,/c_map
;
;
;    Plot an image with descreet greyscale values to a printer
;    which has its own hard-wired color table.

 im=randata(128,128,s=4)
 immx=max(im) & immn=min(im)
 !p.multi=[0,2,2]
 tvim,im,/scale,colors=!p.color*indgen(4)/3.,range=[immn,immx]
 tvim,im,/scale,colors=!p.color*indgen(5)/4.,range=[immn,immx]
 tvim,im,/scale,colors=!p.color*indgen(8)/7.,range=[immn,immx]
 tvim,im,/scale,colors=!p.color*indgen(10)/9.,range=[immn,immx]
;
;
;    Display a map of surface types (green=veg, blue=water, red=sand)
;    Notice how RANGE is used to associate physical values with colors.
;    (use im from the previous example)

 im=randata(128,128,s=4)
 immx=max(im) & immn=min(im) & delim=immx-immn
 
 tvlct,[0,0,0,255],[0,255,0,0],[0,0,255,0]
 !p.multi=[0,2,2]
 colors=[1,2,3] & labels=[' veg',' water',' sand']
 range=[immn,immx,delim/3]
 
 tvim,im,/scale
 
 tvim,im,colors=colors,range=range,/scale
 
 tvim,im,colors=colors,range=range,/scale,labels=labels,lch=2
 
 !p.multi=0
 range=[immn-.25*delim,immx+.25*delim,delim/2]
 lbl=[' veg!c region 1',' water!c region 2',' sand!c region 3']
 tvim,im,colors=colors,range=range,/scale,labels=lbl,lch=2,rmarg=2,pchar=1.2
;
;
;   Display the image from previous example and overlay a contour plot
;
 loadct,5
 im=randata(128,128,s=4)
 immx=max(im) & immn=min(im) & delim=immx-immn
 xrange=[-120,-100]
 yrange=[20,50]
 range=[immn,immx]
 xx=findrng(xrange,128)
 yy=findrng(yrange,128)

 tvim,im,/scale,xrange=xrange,yrange=yrange,clevels=clevels,range=range
 contour,im,xx,yy,levels=clevels,/overplot


;    NOTE: You might prefer the results obtained from procedure CONFILL.
         
 confill,im,xx,yy,/asp,levels=clevels
;
; 
;    Display a grey scale image and annotate certain points in color
;
 loadct,0
 dcolors
 tvim,im,/scale,nbotclr=11                    ; reserve some colors at bottom
 xx=interpolate([40,80],randomu(iseed,10))
 yy=interpolate([40,80],randomu(iseed,10))
 plots,xx,yy,psym=2,color=1+indgen(10)
  
;
; 
;    Display a grey scale image and show nodata values in red
;
 loadct,0
 im=randata(100,100,s=4.5)
 im(randomu(iseed,50)*9999)=-999.
 tvim,im,/scale,nodata=-999.,rgb_nodata=[255,0,0]
  
;
;
;    Postscript output with a reversed color scale.  Because the
;    background color is always RGB=(255,255,255) you must set the
;    default color, !p.color, to a dark color if you want good contrast
;    between the axis labels and the white paper.   According to 
;    Didier's reversed color table a color index of 255 should produce
;    black, but for some reason !p.color=255 doesn't work right.
;    I think IDL is iterpreting !p.color=255 in some special way.
;    So instead use !p.color=254; this seems to work fine.
;
 toggle,/color
 loadct,28
 !p.color=254              ; don't use 255, don't ask me why
 tvim,dist(20),/scale
 toggle
               
;
; display data defined on a regular LAT-LON grid onto a given map 
; projection.  USE MAP_SET and MAP_IMAGE to create the map projection
; and to warp the image.  Then use BOXPOS to position the TVIM frame
; to correctly register the map and image

 IMAGE = sin(!pi*findrng(0,24,200))#sin(!pi*findrng(0,12,200))
 !p.multi=[0,1,2]
 map_set,45,0,/ortho,/advance,pos=boxpos(/aspect)
 newimage=map_image(image,/bilin,latmin=-90,latmax=90,lonmin=-180,lonmax=180)
 tvim,newimage,title='Warped data',pos=boxpos(/get),/scale
 map_set,45,0,/ortho,pos=boxpos(/get),/grid,/cont,/noerase ; draw map
 tvim,image,xrange=[-180,180],yrange=[-90,90],/scale, $
     title='Unwarped data',xtitle='Longitude',ytitle='Latitude'
 map_set,0,0,/cyl,pos=boxpos(/get),/grid,/cont,/noerase ; draw map

; use MAP_SET2 to mask out land areas. Note that the example below is
; unusual.   MAP_SET2 doesn't always produce such nicely filled land areas.
; Typically one must run MAP_SET2 with /SAVE
; to create a ascii file containing the continental boundary lat-lon
; coordinates. Then use an editor  to group the continental coordinates 
; line segments to form closed contours which POLYFILL can understand 
; (the call to POLYFILL is enabled by setting con_color).
;  

 image=randata(256,256,s=2.5)
 tvim,image
 map_set2,-64,-64,/cont,limit=[-65.1,-64.5,-64,-62],/ortho,con_col=100,$
           pos=boxpos(/get),/noerase,/grid
;               
 AUTHOR:       Paul Ricchiazzi    oct92 
               Earth Space Research Group, UCSB

 REVISIONS:
 28jan93: switched from PUT_COLOR_SCALE to COLOR_KEY
 11feb93: added INTERP keyword
 11feb93: added C_MAP keyword
 11feb93: added STITLE keyword
 20apr93: added RMARG keyword, centered image in plot window
 23apr93: call COLOR_KEY before TV. Now stepped color scales copy to PS file
 10sep93: deal with perfectly flat images. No more math error when a=0
 14sep93: added CLIP keyword
 11feb94: added PCHARSIZE,LCHARSIZE,LABELS, and COLORS keywords
 18feb94: added NBOTCLR keyword
 16mar94: added INTERP=2 option and adjusted centering of pixels
 08Jul94: added NODATA and RGB_NODATA keywords
 04Aug94: added BARWIDTH keyword 
 04Aug94: defaulted PCHARSIZE and LCHARSIZE to !P.CHARSIZE if non-zero
 02Mar95: added POSITION keyword
 31Mar95: added NOAXIS keyword
 24may95: initial sizing includes allowance for PCHARSIZE > 1
 06sep95: color indecies used in plot now run from 1 to !d.ncolors-2
 24jul96: do a REFORM(a) to allow tvim,a(1,*,*) to work with no complaints
 01sep96: added the RCT keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tvim.pro)


TVIMAGE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     TVIMAGE

 PURPOSE:
     This purpose of TVIMAGE is to enable the TV command in IDL
     to be a completely device-independent and color-decomposition-
     state independent command. On 24-bit displays color decomposition
     is always turned off for 8-bit images and on for 24-bit images.
     The color decomposition state is restored for those versions of
     IDL that support it (> 5.2). Moreover, TVIMAGE adds features
     that TV lacks. For example, images can be positioned in windows
     using the POSITION keyword like other IDL graphics commands.
     TVIMAGE also supports the !P.MULTI system variable, unlike the
     TV command. TVIMAGE was written to work especially well in
     resizeable graphics windows. Note that if you wish to preserve
     the aspect ratio of images in resizeable windows, you should set
     the KEEP_ASPECT_RATIO keyword, described below. TVIMAGE works
     equally well on the display, in the PostScript device, and in
     the Printer and Z-Graphics Buffer devices. The TRUE keyword is
     set automatically to the correct value for 24-bit images, so you
     don't need to specify it when using TVIMAGE.

 AUTHOR:
       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:
     Graphics display.

 CALLING SEQUENCE:

     TVIMAGE, image

 INPUTS:
     image:    A 2D or 3D image array. It should be byte data.

       x  :    The X position of the lower-left corner of the image.
               This parameter is only recognized if the TV keyword is set.

       y  :    The Y position of the lower-left corner of the image.
               This parameter is only recognized if the TV keyword is set.

 KEYWORD PARAMETERS:

     BACKGROUND:   This keyword specifies the background color. Note that
               the keyword ONLY has effect if the ERASE keyword is also
               set or !P.MULTI is set to multiple plots and TVIMAGE is
               used to place the *first* plot.

     ERASE:    If this keyword is set an ERASE command is issued
               before the image is displayed. Note that the ERASE
               command puts the image on a new page in PostScript
               output.

     _EXTRA:   This keyword picks up any TV keywords you wish to use.

     HALF_HALF: If set, will tell CONGRID to extrapolate a *half* row
               and column on either side, rather than the default of
               one full row/column at the ends of the array.  If you
               are interpolating images with few rows, then the
               output will be more consistent with this technique.
               This keyword is intended as a replacement for
               MINUS_ONE, and both keywords probably should not be
               used in the same call to CONGRID.

     KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
               specified position in the window. If you prefer, you can
               force the image to maintain its aspect ratio in the window
               (although not its natural size) by setting this keyword.
               The image width is fitted first. If, after setting the
               image width, the image height is too big for the window,
               then the image height is fitted into the window. The
               appropriate values of the POSITION keyword are honored
               during this fitting process. Once a fit is made, the
               POSITION coordiates are re-calculated to center the image
               in the window. You can recover these new position coordinates
               as the output from the POSITION keyword.

     MARGIN:   A single value, expressed as a normalized coordinate, that
               can easily be used to calculate a position in the window.
               The margin is used to calculate a POSITION that gives
               the image an equal margin around the edge of the window.
               The margin must be a number in the range 0.0 to 0.333. This
               keyword is ignored if the POSITION keyword is used.

     MINUS_ONE: The value of this keyword is passed along to the CONGRID
               command. It prevents CONGRID from adding an extra row and
               column to the resulting array, which can be a problem with
               small image arrays.

     NOINTERPOLATION: Setting this keyword disables the default bilinear
               interpolation done to the image when it is resized. Nearest
               neighbor interpolation is done instead. This is preferred
               when you do not wish to change the pixel values of the image.
               This keyword must be set, for example, when you are displaying
               GIF files that come with their own non-IDL color table vectors.

     NORMAL:   Setting this keyword means image position coordinates x and y
               are interpreted as being in normalized coordinates. This keyword
               is only valid if the TV keyword is set.

     OVERPLOT: Setting this keyword causes the POSITION keyword to be ignored
               and the image is positioned in the location established by the
               last graphics command. For example:

                    Plot, Findgen(11), Position=[0.1, 0.3, 0.8, 0.95]
                    TVImage, image, /Overplot

     POSITION: The location of the image in the output window. This is
               a four-element floating array of normalized coordinates of
               the type given by !P.POSITION or the POSITION keyword to
               other IDL graphics commands. The form is [x0, y0, x1, y1].
               The default is [0.0, 0.0, 1.0, 1.0]. Note that this can
               be an output parameter if the KEEP_ASPECT_RATIO keyword is
               used.

     TV:       Setting this keyword makes the TVIMAGE command work much
               like the TV command, although better. That is to say, it
               will still set the correct DECOMPOSED state depending upon
               the kind of image to be displayed (8-bit or 24-bit). It will
               also allow the image to be "positioned" in the window by
               specifying the coordinates of the lower-left corner of the
               image. The NORMAL keyword is activated when the TV keyword
               is set, which will indicate that the position coordinates
               are given in normalized coordinates rather than device
               coordinates.

               Setting this keyword will ensure that the keywords
               KEEP_ASPECT_RATIO, MARGIN, MINUS_ONE, MULTI, and POSITION
               are ignored.

 OUTPUTS:
     None.

 SIDE EFFECTS:
     Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
     may not have the same aspect ratio as the input data set.

 RESTRICTIONS:
     If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
     used together, there is an excellent chance the POSITION
     parameters will change. If the POSITION is passed in as a
     variable, the new positions will be returned in the same variable
     as an output parameter.

     If a 24-bit image is displayed on an 8-bit display, the
     24-bit image must be converted to an 8-bit image and the
     appropriate color table vectors. This is done with the COLOR_QUAN
     function. The TVIMAGE command will load the color table vectors
     and set the NOINTERPOLATION keyword if this is done. Note that the
     resulting color table vectors are normally incompatible with other
     IDL-supplied color tables. Hence, other graphics windows open at
     the time the image is display are likely to look strange.

 EXAMPLE:
     To display an image with a contour plot on top of it, type:

        filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
        image = BYTARR(360,360)
        OPENR, lun, filename, /GET_LUN
        READU, lun, image
        FREE_LUN, lun

        TVIMAGE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
        CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
            YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10

 MODIFICATION HISTORY:
      Written by:     David Fanning, 20 NOV 1996.
      Fixed a small bug with the resizing of the image. 17 Feb 1997. DWF.
      Removed BOTTOM and NCOLORS keywords. This reflects my growing belief
         that this program should act more like TV and less like a "color
         aware" application. I leave "color awareness" to the program
         using TVIMAGE. Added 24-bit image capability. 15 April 1997. DWF.
      Fixed a small bug that prevented this program from working in the
          Z-buffer. 17 April 1997. DWF.
      Fixed a subtle bug that caused me to think I was going crazy!
          Lession learned: Be sure you know the *current* graphics
          window! 17 April 1997. DWF.
      Added support for the PRINTER device. 25 June 1997. DWF.
      Extensive modifications. 27 Oct 1997. DWF
          1) Removed PRINTER support, which didn't work as expected.
          2) Modified Keep_Aspect_Ratio code to work with POSITION keyword.
          3) Added check for window-able devices (!D.Flags AND 256).
          4) Modified PostScript color handling.
      Craig Markwart points out that Congrid adds an extra row and column
          onto an array. When viewing small images (e.g., 20x20) this can be
          a problem. Added a Minus_One keyword whose value can be passed
          along to the Congrid keyword of the same name. 28 Oct 1997. DWF
      Changed default POSITION to fill entire window. 30 July 1998. DWF.
      Made sure color decomposition is OFF for 2D images. 6 Aug 1998. DWF.
      Added limited PRINTER portrait mode support. The correct aspect ratio
          of the image is always maintained when outputting to the
          PRINTER device and POSITION coordinates are ignored. 6 Aug 1998. DWF
      Removed 6 August 98 fixes (Device, Decomposed=0) after realizing that
          they interfere with operation in the Z-graphics buffer. 9 Oct 1998. DWF
      Added a MARGIN keyword. 18 Oct 1998. DWF.
      Re-established Device, Decomposed=0 keyword for devices that
         support it. 18 Oct 1998. DWF.
      Added support for the !P.Multi system variable. 3 March 99. DWF
      Added DEVICE, DECOMPOSED=1 command for all 24-bit images. 2 April 99. DWF.
      Added ability to preserve DECOMPOSED state for IDL 5.2 and higher. 4 April 99. DWF.
      Added TV keyword to allow TVIMAGE to work like the TV command. 11 May 99. DWF.
      Added the OVERPLOT keyword to allow plotting on POSITION coordinates
         estabished by the preceding graphics command. 11 Oct 99. DWF.
      Added automatic recognition of !P.Multi. Setting MULTI keyword is no
         longer required. 18 Nov 99. DWF.
      Added NOINTERPOLATION keyword so that nearest neighbor interpolation
         is performed rather than bilinear. 3 Dec 99. DWF
      Changed ON_ERROR condition from 1 to 2. 19 Dec 99. DWF.
      Added Craig Markwardt's CMCongrid program and removed RSI's. 24 Feb 2000. DWF.
      Added HALF_HALF keyword to support CMCONGRID. 24 Feb 2000. DWF.
      Fixed a small problem with image start position by adding ROUND function. 19 March 2000. DWF.
      Updated the PRINTER device code to take advantage of available keywords. 2 April 2000. DWF.
      Reorganized the code to handle 24-bit images on 8-bit displays better. 2 April 2000. DWF.
      Added BACKGROUND keyword. 20 April 2000. DWF.
      Fixed a small problem in where the ERASE was occuring. 6 May 2000. DWF.
      Rearranged the PLOT part of code to occur before decomposition state
         is changed to fix Background color bug in multiple plots. 23 Sept 2000. DWF.
      Removed MULTI keyword, which is no longer needed. 23 Sept 2000. DWF.
      Fixed a small problem with handling images that are slices from 3D image cubes. 5 Oct 2000. DWF.
      Added fix for brain-dead Macs from Ben Tupper that restores Macs ability to display images. 8 June 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\tvimage.pro)


TVIMAGE[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     TVIMAGE

 PURPOSE:
     This purpose of TVIMAGE is to allow you to display an image
     on the display or in a PostScript file in a particular position.
     The position is specified by means of the POSITION keyword. In
     this respect, TVIMAGE works like other IDL graphics commands.
     Moreover, the TVIMAGE command works identically on the display
     and in a PostScript file. You don't have to worry about how to
     "size" the image in PostScript. The output on your display and
     in the PostScript file will be identical. The major advantage of
     TVIMAGE is that it can be used in a natural way with other IDL
     graphics commands in resizeable IDL graphics windows. TVIMAGE
     is a replacement for TV and assumes the image has been scaled
     correctly when it is passed as an argument.

 AUTHOR:
       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
     Graphics display.

 CALLING SEQUENCE:

     TVIMAGE, image

 INPUTS:
     image:    A 2D or 3D image array. It should be byte data.

 KEYWORD PARAMETERS:
     _EXTRA:   This keyword picks up any TV keywords you wish to use.

     KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
               specified position in the window. If you prefer, you can
               force the image to maintain its aspect ratio in the window
               (although not its natural size) by setting this keyword.
               The image width is fitted first. If, after setting the
               image width, the image height is too big for the window,
               then the image height is fitted into the window. The
               appropriate values of the POSITION keyword are honored
               during this fitting process. Once a fit is made, the
               POSITION coordiates are re-calculated to center the image
               in the window. You can recover these new position coordinates
               as the output from the POSITION keyword.

     MINUS_ONE: The value of this keyword is passed along to the CMCONGRID
               command. It prevents CMCONGRID from adding an extra row and
               column to the resulting array.
     HALF_HALF: The value of this keyword is passed along to the
               CMCONGRID command, causing the "extra" row and column to
               be split evenly between both sides.

     POSITION: The location of the image in the output window. This is
               a four-element floating array of normalized coordinates of
               the type given by !P.POSITION or the POSITION keyword to
               other IDL graphics commands. The form is [x0, y0, x1, y1].
               The default is [0.15, 0.15, 0.85, 0.85]. Note that this can
               be an output parameter if the KEEP_ASPECT_RATIO keyword is
               used.

 OUTPUTS:
     None.

 SIDE EFFECTS:
     Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
     may not have the same aspect ratio as the input data set.

 RESTRICTIONS:
     If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
     used together, there is an excellent chance the POSITION
     parameters will change. If the POSITION is passed in as a
     variable, the new positions will be returned as an output parameter.

 EXAMPLE:
     To display an image with a contour plot on top of it, type:

        filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
        image = BYTARR(360,360)
        OPENR, lun, filename, /GET_LUN
        READU, image
        FREE_LUN, lun

        TVIMAGE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
        CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
            YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10

 MODIFICATION HISTORY:
      Written by:     David Fanning, 20 NOV 1996.
      Fixed a small bug with the resizing of the image. 17 Feb 1997. DWF.
      Removed BOTTOM and NCOLORS keywords. This reflects my growing belief
         that this program should act more like TV and less like a "color
         aware" application. I leave "color awareness" to the program
         using TVIMAGE. Added 24-bit image capability. 15 April 1997. DWF.
      Fixed a small bug that prevented this program from working in the
          Z-buffer. 17 April 1997. DWF.
      Fixed a subtle bug that caused me to think I was going crazy!
          Lession learned: Be sure you know the *current* graphics
          window! 17 April 1997. DWF.
      Added support for the PRINTER device. 25 June 1997. DWF.
      Extensive modifications. 27 Oct 1997. DWF
          1) Removed PRINTER support, which didn't work as expected.
          2) Modified Keep_Aspect_Ratio code to work with POSITION keyword.
          3) Added check for window-able devices (!D.Flags AND 256).
          4) Modified PostScript color handling.
      Craig Markwart points out that Congrid adds an extra row and column
          onto an array. When viewing small images (e.g., 20x20) this can be
          a problem. Added a Minus_One keyword whose value can be passed
          along to the Congrid keyword of the same name. 28 Oct 1997. DWF

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\tvimage.pro)


TVPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVPOS
 PURPOSE:
       Gives screen position used by tv, tvscl.
 CATEGORY:
 CALLING SEQUENCE:
       tvpos, img, n, x0, y0
 INPUTS:
       img = Image of desired size (for size only).    in.
         img may be an array, [nx,ny] giving
         dimensions of desired image instead of
         image itself (saves space).
       n = Position number.                            in.
 KEYWORD PARAMETERS:
       Keywords:
         RESOLUTION=[rx,ry] Specify bounding array size instead
           of using current screen size.  Allows tvpos to work
           with an array with no reference to the screen.
 OUTPUTS:
       x0, y0 = screen coordinates of lower left       out.
          corner of tv position.
 COMMON BLOCKS:
 NOTES:
       Note: On error x0 and y0 are -1.
 MODIFICATION HISTORY:
       R. Sterner.  15 July, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 11 Dec, 1989 --- converted to SUN.
       R. Sterner, 1995 Nov 21 --- Added RESOLUTION keyword.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvpos.pro)


TVRD2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVRD2
 PURPOSE:
       Version of tvrd that allows out of bounds.
 CATEGORY:
 CALLING SEQUENCE:
       img = tvrd2(x,y,dx,dy)
 INPUTS:
       x,y = lower left corner of screen image to read.  in
       dx,dy = x and y size to read.                     in
 KEYWORD PARAMETERS:
       Keywords:
         TRUE=true Same as TVRD.
 OUTPUTS:
       img = output image.                               out
 COMMON BLOCKS:
 NOTES:
       Notes: allows x,y to be outside of screen image.
         Allows dx, dy to extend outside screen image.
         Values are in pixels.
 MODIFICATION HISTORY:
       R. Sterner, 1 Oct, 1992
       R. Sterner, 1999 Oct 05 --- Upgraded for true color.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvrd2.pro)


TVRD256COLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  tvrd256colors

 PURPOSE:
  This function returns a tvrd() dataset of 256 indexed colors using of color_quan if more than 256 colors are defined

 CATEGORY:
  PLOT

 CALLING SEQUENCE:
   result=tvrd256colors()

 OUTPUTS:
  The result is a structure with this tagnames:
   result: a 2-Dim byte array with the byte index of the picture
   red:    the red color code
   green:  the green color code
   blue:   the blue color code

 EXAMPLE:
       result=tvrd256colors()


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1998-Oct-4

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\tvrd256colors.pro)


TVRDBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVRDBOX
 PURPOSE:
       Read part of screen image into a byte array.
 CATEGORY:
 CALLING SEQUENCE:
       tvrdbox, a
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=clr Set box color (-2 for dotted).
         /NOERASE prevents last box from being erased first.
           Good when a new image covers up last box.
         /EXITERASE means erase box on exit.
         CODE=c  returns exit code: 4=normal, 2=alternate.
         X=x, Y=y  Returned device coordinates of LL corner.
 OUTPUTS:
       a = image read from screen.   out
 COMMON BLOCKS:
       tvrdbox_com
 NOTES:
       Notes: See also tvwrbox
 MODIFICATION HISTORY:
       R. Sterner, 19 Nov, 1989
       R. Sterner, 1994 Dec 1 --- Added keywords X and Y.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvrdbox.pro)


TVREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVREAD

 PURPOSE:

       To get accurate screen dumps with the IDL command TVRD on 24-bit
       PC and Macintosh computers, you have to be sure to set color
       decomposition on. This program adds that capability automatically.
       In addition, the program will optionally write BMP, GIF, JPEG,
       PICT, PNG, and TIFF color image files of the screen dump.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       image = TVREAD(xstart, ystart, ncols, nrows)

       The returned image will be a 2D image on 8-bit systems and
       a 24-bit pixel interleaved true-color image on 24-bit systems.
       A -1 will be returned if a file output keyword is used (e.g., JPEG, TIFF, etc.).

 OPTIONAL INPUTS:

       XSTART -- The starting column index.  By default, 0.

       YSTART -- The starting row index. By default, 0.

       NCOLS -- The number of columns to read. By default, !D.X_Size - XSTART

       NROWS -- The number of rows to read. By default, !D.Y_Size - YSTART.

 KEYWORD PARAMETERS:

       BMP -- Set this keyword to write the screen dump as a color BMP file.

       CANCEL -- An output keyword set to 1 if the user cancels out of a
          filename dialog. Set to 0 otherwise.

       COLORS -- If a 24-bit image has to be quantized, this will set the number
          of colors in the output image. Set to 256 by default. Applies to BMP,
          GIF, PICT, and PNG formats written from 24-bit displays.(See the
          COLOR_QUAN documentation for details.)

       CUBE -- If this keyword is set to a value between 2 and 6 the color
          quantization will use a cubic method of quantization. Applies to BMP,
          GIF, PICT, and PNG formats written from 24-bit displays.(See the
          COLOR_QUAN documentation for details.)

       DITHER -- If this keyword is set the quantized image will be dithered.
          Applies to BMP, GIF, PICT, and PNG formats written from 24-bit displays.
          (See the COLOR_QUAN documentation for details.)

       FILENAME -- The base name of the output file. (No file extensions;
           they will be added automatically.) This name may be changed by the user.

              image = TVREAD(Filename='myfile', /JPEG)

           No file will be written unless a file output keyword is used
           (e.g., JPEG, TIFF, etc.) in the call. By default the FILENAME is
           set to "idl". The file extension will be set automatically to match
           the type of file created.

       GIF -- Set this keyword to write the screen dump as a color GIF file.

       JPEG -- Set this keyword to write the screen dump as a color JPEG file.

       NODIALOG -- Set this keyword if you wish to avoid the DIALOG_PICKFILE
           dialog that asks you to name the output file. This keyword should be
           set, for example, if you are processing screens in batch mode.

       PICT -- Set this keyword to write the screen dump as a color PICT file.

       PNG -- Set this keyword to write the screen dump as a color PNG file.

       TIFF -- Set this keyword to write the screen dump as a color TIFF file.

       QUALITY -- This keyword sets the amount of compression for JPEG images.
           It should be set to a value between 0 and 100. It is set to 75 by default.
           (See the WRITE_JPEG documentation for details.)

       WID -- The index number of the window to read from. The current graphics window
           (!D.Window) is selected by default. An error is issued if no windows are
           currently open on a device that supports windows.

       _EXTRA -- Any keywords that are appropriate for the WRITE_*** routines are
           also accepted via keyword inheritance.

 COMMON BLOCKS:

       None

 RESTRICTIONS:   Requires IDL 5.2 and higher.

 MODIFICATION HISTORY:

       Written by David Fanning, 9 AUG 2000.
       Added changes to make the program more device independent. 16 SEP 2000. DWF.
       Removed GIF file support for IDL 5.4 and above. 18 JAN 2001. DWF.
       Added NODIALOG keyword. 28 MAR 2001. DWF.
       Added an output CANCEL keyword. 29 AUG 2001. DWF.
       Added ERROR_MESSAGE code to file. 17 DEC 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\tvread.pro)


TVSCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     TVSCALE

 PURPOSE:
     This purpose of TVSCALE is to enable the TVSCL command in IDL
     to be a completely device-independent and color-decomposition-
     state independent command. On 24-bit displays color decomposition
     is always turned off for 8-bit images and on for 24-bit images.
     The color decomposition state is restored for those versions of
     IDL that support it (> 5.2). Moreover, TVSCALE adds features
     that TVSCL lacks. For example, images can be positioned in windows
     using the POSITION keyword like other IDL graphics commands.
     TVSCALE also supports the !P.MULTI system variable, unlike the
     TVSCL command. TVSCALE was written to work especially well in
     resizeable graphics windows. Note that if you wish to preserve
     the aspect ratio of images in resizeable windows, you should set
     the KEEP_ASPECT_RATIO keyword, described below. TVSCALE works
     equally well on the display, in the PostScript device, and in
     the Printer and Z-Graphics Buffer devices. The TRUE keyword is
     set automatically to the correct value for 24-bit images, so you
     don't need to specify it when using TVSCALE. In addition, you can
     use the TOP and BOTTOM keywords to define a particular set of
     number to scale the data to. The algorithm used is this:

         TV. BytScl(image, TOP=top-bottom) + bottom

     Note that if you scale the image between 100 and 200, that
     there are 101 possible pixel values. So the proper way to
     load colors would be like this:

       LoadCT, NColors=101, Bottom=100
       TVSCALE, image, Top=200, Bottom=100

     Alternatively, you could use the NCOLORS keyword:

       LoadCT, NColors=100, Bottom=100
       TVSCALE, image, NColors=100, Bottom=100

 AUTHOR:
       FANNING SOFTWARE CONSULTING:
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
     Graphics display.

 CALLING SEQUENCE:

     TVSCALE, image

 INPUTS:
     image:    A 2D or 3D image array. It does not have to be byte data.

       x  :    The X position of the lower-left corner of the image.
               This parameter is only recognized if the TVSCL keyword is set.

       y  :    The Y position of the lower-left corner of the image.
               This parameter is only recognized if the TVSCL keyword is set.

 KEYWORD PARAMETERS:
     BACKGROUND:   This keyword specifies the background color. Note that
               the keyword ONLY has effect if the ERASE keyword is also
               set or !P.MULTI is set to multiple plots and TVSCALE is
               used to place the *first* plot.

     BOTTOM:   The image is scaled so that all displayed pixels have values
               greater than or equal to BOTTOM and less than or equal to TOP.
               The value of BOTTOM is 0 by default.

     ERASE:    If this keyword is set an ERASE command is issued
               before the image is displayed. Note that the ERASE
               command puts the image on a new page in PostScript
               output.

     _EXTRA:   This keyword picks up any TV keywords you wish to use.

     HALF_HALF: If set, will tell CONGRID to extrapolate a *half* row
               and column on either side, rather than the default of
               one full row/column at the ends of the array.  If you
               are interpolating images with few rows, then the
               output will be more consistent with this technique.
               This keyword is intended as a replacement for
               MINUS_ONE, and both keywords probably should not be
               used in the same call to CONGRID.

     KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
               specified position in the window. If you prefer, you can
               force the image to maintain its aspect ratio in the window
               (although not its natural size) by setting this keyword.
               The image width is fitted first. If, after setting the
               image width, the image height is too big for the window,
               then the image height is fitted into the window. The
               appropriate values of the POSITION keyword are honored
               during this fitting process. Once a fit is made, the
               POSITION coordiates are re-calculated to center the image
               in the window. You can recover these new position coordinates
               as the output from the POSITION keyword.

     MARGIN:   A single value, expressed as a normalized coordinate, that
               can easily be used to calculate a position in the window.
               The margin is used to calculate a POSITION that gives
               the image an equal margin around the edge of the window.
               The margin must be a number in the range 0.0 to 0.333. This
               keyword is ignored if the POSITION keyword is used.

     MAXVALUE: The data is linearly scaled between the MIN and MAX values,
               if they are provided. MAX is set to MAX(image) by default.

     MINVALUE: The data is linearly scaled between the MIN and MAX values,
               if they are provided. MIN is set to MIN(image) by default.

     MINUS_ONE: The value of this keyword is passed along to the CONGRID
               command. It prevents CONGRID from adding an extra row and
               column to the resulting array, which can be a problem with
               small image arrays.

     NCOLORS:  If this keyword is supplied, the TOP keyword is ignored and
               the TOP keyword is set equal to BOTTOM + NCOLORS - 1. This
               keyword is provided to make TVSCALE easier to use with the
               color-loading programs such as LOADCT:

                  LoadCT, 5, NColors=100, Bottom=100
                  TVScale, image, NColors=100, Bottom=100

     NOINTERPOLATION: Setting this keyword disables the default bilinear
               interpolation done to the image when it is resized. Nearest
               neighbor interpolation is done instead. This is preferred
               when you do not wish to change the pixel values of the image.

     NORMAL:   Setting this keyword means image position coordinates x and y
               are interpreted as being in normalized coordinates. This keyword
               is only valid if the TVSCL keyword is set.

     OVERPLOT: Setting this keyword causes the POSITION keyword to be ignored
               and the image is positioned in the location established by the
               last graphics command. For example:

                    Plot, Findgen(11), Position=[0.1, 0.3, 0.8, 0.95]
                    TVScale, image, /Overplot

     POSITION: The location of the image in the output window. This is
               a four-element floating array of normalized coordinates of
               the type given by !P.POSITION or the POSITION keyword to
               other IDL graphics commands. The form is [x0, y0, x1, y1].
               The default is [0.0, 0.0, 1.0, 1.0]. Note that this can
               be an output parameter if the KEEP_ASPECT_RATIO keyword is
               used.

     TOP:      The image is scaled so that all displayed pixels have values
               greater than or equal to BOTTOM and less than or equal to TOP.
               The value of TOP is !D.Table_Size by default.

     TVSCL:    Setting this keyword makes the TVIMAGE command work much
               like the TVSCL command, although better. That is to say, it
               will still set the correct DECOMPOSED state depending upon
               the kind of image to be displayed (8-bit or 24-bit). It will
               also allow the image to be "positioned" in the window by
               specifying the coordinates of the lower-left corner of the
               image. The NORMAL keyword is activated when the TV keyword
               is set, which will indicate that the position coordinates
               are given in normalized coordinates rather than device
               coordinates.

               Setting this keyword will ensure that the keywords
               KEEP_ASPECT_RATIO, MARGIN, MINUS_ONE, MULTI, and POSITION
               are ignored.

 OUTPUTS:
     None.

 SIDE EFFECTS:
     Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
     may not have the same aspect ratio as the input data set.

 RESTRICTIONS:
     If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
     used together, there is an excellent chance the POSITION
     parameters will change. If the POSITION is passed in as a
     variable, the new positions will be returned as an output parameter.

     If the image is 2D then color decomposition is turned OFF
     for the current graphics device (i.e., DEVICE, DECOMPOSED=0).

     If outputting to the PRINTER device, the aspect ratio of the image
     is always maintained and the POSITION coordinates are ignored.
     The image always printed in portrait mode.

 EXAMPLE:
     To display an image with a contour plot on top of it, type:

        filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
        image = BYTARR(360,360)
        OPENR, lun, filename, /GET_LUN
        READU, lun, image
        FREE_LUN, lun

        thisPosition = [0.1, 0.1, 0.9, 0.9]
        TVSCALE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
        CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
            YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10

 MODIFICATION HISTORY:
      Written by:     David Fanning, 27 May 1999 from TVIMAGE code.
      Added MIN, MAX, and NCOLORS keywords 28 May 1999. DWF.
      Added the OVERPLOT keyword to allow plotting on POSITION coordinates
         estabished by the preceding graphics command. 11 Oct 99. DWF.
      Added NOINTERPOLATION keyword so that nearest neighbor interpolation
         is performed rather than bilinear. 3 Dec 99. DWF
      Brought the TVSCALE code up to date with TVIMAGE code. 3 April 2000. DWF.
      Brought the TVSCALE code up to date with TVIMAGE code. 6 May 2000. DWF.
      Change MIN and MAX keywords to MINVALUE and MAXVALUE to prevent
         ambiguous keyword errors. 27 July 2000. DWF.
      Brought up to date with changes in TVImage. 23 Sept 2000. DWF.
      Added fix for brain-dead Macs from Ben Tupper that restores Macs ability to display images. 8 June 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\tvscale.pro)


TVSHARP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVSHARP
 PURPOSE:
       Redisplay a sharpened version of the current screen image.
 CATEGORY:
 CALLING SEQUENCE:
       tvsharp
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         SMOOTH=sm  Smoothing window size (def=3).
         WEIGHT=wt  Weight for smoothed image (def=0.75).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: BW images only.  Use odd values for SMOOTH: 3,5,7,...
         WEIGHT should be >0 and < 1.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Feb 17
       R. Sterner, 1999 Sep 15 --- Added optional smoothing and weight.

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvsharp.pro)


TVWRBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVWRBOX
 PURPOSE:
       Display byte array on screen using box for position & size.
 CATEGORY:
 CALLING SEQUENCE:
       tvwrbox, a
 INPUTS:
       a = byte array to write to screen.   in
 KEYWORD PARAMETERS:
       Keywords:
         /BILINEAR uses bilinear interp. to change array size.
            Default is nearest neighbor interpolation.
         /NOERASE prevents last box from being erased.
            Good when a new image covers up last box.
 OUTPUTS:
 COMMON BLOCKS:
       tvrdbox_com
 NOTES:
       Notes: See also tvrdbox
 MODIFICATION HISTORY:
       R. Sterner, 19 Nov, 1989

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\tvwrbox.pro)


TV_POLAR

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    
   tv_polar
 
 USEAGE:     
   tv_polar,psi,phi,theta

   tv_polar,psi,phi,theta,style=style,grdres=grdres,title=title,rot=rot, $
            image=image,xvec=xvec,yvec=yvec,phitics=phitics,half=half, $
            thetics=thetics,charsize=charsize,thephi=thephi,rmarg=rmarg, $
            labels=labels,colors=colors,lcharsize=lcharsize,stitle=stitle, $
            showpnts=showpnts,range=range,lower=lower,upper=upper,gclr=gclr, $
            clevels=clevels,noscale=noscale,barwidth=barwidth, $
            c_thick=c_thick,c_color=c_color,xtitle=xtitle,nadir=nadir

 PURPOSE:    
   Display of images defined in polar coordinates (without resorting
   to IDL's mapping routines).

 INPUT:
   psi      
     image quantity (2-d array) one value at each (phi,theta) point
     note that the phi coordinate is the first index

   phi
     monitonically increasing vector specifying azimuthal coordinate
     PHI must span either 0 to 360 degrees or 0 to 180 degrees.  If
     phi spans 0-180 degrees and the keyword HALF is not set, then
     reflection symmetry is assumed, i.e., r(phi,theta)=r(360-phi,theta).
     If phi(0) is not zero and keyword HALF is not set, then the
     contour plot is rotated to that value of phi.  
     

   theta
     monitonically increasing vector specifying polar coordinate (degrees)
 
 KEYWORD INPUT:

   style
     0   do not plot anything, just return image,xvec and yvec
     1   use confill for plot
     2   use tvim for plot
     3   use contour for plot, no grey scale

   title
     plot title

   grdres
     number of grid points in cartesian grid used to rebin polar
     information.  Array size is (grdres x grdres) default=51

   phitics
     azimuth tic mark spacing in degrees 

   thetics
     polar angle tic mark spacing in degrees
 
   half
     if set, the part of the polar plot with azimuth angles between
     180 and 360 is not displayed.  if HALF lt 0 the half circle is
     inverted so that the horizontal axis is at the top of the plot 
     and the magnitude of HALF is the vertical offset (in character 
     heights) below the previous plot (which is presumed to be a 
     TV_POLAR plot of the upper hemisphere).  If abs(HALF) le 2 then
     xaxis labeling is disabled. This option requires column major
     ordering, i.e., either !P.MULTI(4)=1 or !P.MULTI(1)=1
     Don't set HALF if ROT ne 0. (see example)

   thephi
     vector of azimuth angles at which to annotate polar angles.  For
     example setting THEPHI=[45,315] causes all the polar angles
     listed in THETICS to be labeled at azimuth angles 45 and 315.
     If maximum element of THEPHI is negative then the 
     (default is 45 degrees)

   charsize
     character size multiplier used on all plot labels but not on
     color scale labels

   rot
     set location of azimuth zero point and direction of increase

     0    right , azimuth increases counterclockwise (default)
     1    top   , azimuth increases counterclockwise
     2    left  , azimuth increases counterclockwise
     3    bottom, azimuth increases counterclockwise
     4    top   , azimuth increases clockwise       (standard compass)
     5    left  , azimuth increases clockwise
     6    bottom, azimuth increases clockwise
     7    left  , azimuth increases clockwise
             

   range
     two or three element vector indicating physical range over which
     to map the color scale.  The third element of RANGE, if
     specified, sets the step interval of the displayed color scale.
     It has no effect when SCALE is not set. E.g., RANGE=[0., 1.,
     0.1] will cause the entire color scale to be mapped between the
     physical values of zero and one; the step size of the displayed
     color scale will be set to 0.1.  RANGE overides CLEVELS.

   rmarg
     right margin expansion factor to provide more room for extra
     wide color scale annotation (default=1)

   labels
     a vector of strings used to label the color key levels.  If not
     set the default color key number labels are used.  If the number
     of elements in LABELS is the same as the number of elements in
     COLORS then the labels will appear in the middle of a given
     color band instead of at the boundary between colors.  If COLORS
     is not set the number of elements in LABELS should be at least
     as large as the number of color key segments plus one.

   colors
     an array of color indicies.  When the COLORS array is set TVIM
     will map values of A into the color values specified in COLORS.
     How physical values are assigned to color values depends on how
     the RANGE parameter is set, as shown in this table:
     
               RANGE           color_value
               -----           -----------
         1.  not set          COLORS(A)
         2.  [amin,amax]      COLORS((A-amin)/dinc)
         3.  [amin,amax,inc]  COLORS((A-amin)/inc)
     
     where amin, amax and inc are user specified elements
     of RANGE and dinc=(amax-amin)/n_elements(COLORS).  In
     case 1, A is used directly as a subscript into COLORS.

   lcharsize
     character size of color key number or labels

   stitle
     color key title (drawn to the right of color scale) 

   contour
     if set draw contour lines 

   showpnts
     if set original grid of (phi,theta) points are ploted on the
     image

   gclr
     the color used for grid labels and axis, default=!p.color

   clevels
     a vector of contour levels

   barwidth
     width of color key which appears to right of contour plot (default=1).

   noscale
     if set don't draw color scale to the right of the plot

   c_thick
     thickness of contour lines, set to zero to eliminate contour lines

   c_color
     color of contour lines (special interpretation of c_color is
     possible when CONFILL is used, see CONFILL documentation)
     
   lower
     if set, theta values between 90 and 180 are ploted

   nadir
     if set, theta (which are usually zenith values) is displayed 
     as 180-theta

   xtitle
     title for horizontal axis when HALF is set, the titles would
     usually be either "nadir angle" or "zenith angle", 

 OUTPUT:
     none

 KEYWORD OUTPUT:
   image
     rebined image of size (grdres,grdres) 

   xvec
     vector of x coordinate values

   yvec
     vector of y coordinate values

     These optional output quantities can be used to overplot contour
     lines over the TV_POLAR output.

 EXAMPLE:

; show all styles

    loadct,5
    phi=findgen(25)*15
    theta=5+findgen(17)*5
    psi=(cos(4*phi*!dtor)#sin(5*theta*!dtor))^2
    w11x8 &  !p.multi=[0,3,2]
    tvim,psi,xrange=phi,yrange=theta,/interp
    for s=1,3 do TV_POLAR,psi,phi,theta,style=s,c_thick=0
    tv_polar,psi,phi,theta,style=1
    tv_polar,psi,phi,theta,style=2

; show all ROT possibilities

    w8x11 & !p.multi=[0,2,4]
    loadct,5
    phi=findgen(25)*15
    theta=5+findgen(14)*5
    psi=(phi*!dtor)#replicate(1.,n_elements(theta))
    title="ROT = " + string(f='(i2)',indgen(8))+repchr(50,' ')
    for rot=0,7 do TV_POLAR,psi,phi,theta,rot=rot,title=title(rot),sty=2,c_t=0

; plot radiance in lower and upper hemisphere


    t=[0,15,32,45,60,70,80,89,91,100,110,120,135,148,165,180.]
    p=[0,15,30,45,60,75,90,105,120,135,150,165,180.]
    r=fltarr(13,16) & read,r
           81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
           96, 95, 93, 91, 87, 85, 84, 83, 80, 76, 74, 74, 73, 
          130,128,123,119,113,103, 95, 92, 84, 81, 80, 77, 75, 
          184,181,171,153,136,126,110,104, 93, 90, 84, 82, 84, 
          293,279,243,212,182,152,134,117,106, 99, 90, 93, 80, 
          388,370,323,250,208,165,144,119,110, 98, 91, 91, 90, 
          513,448,344,274,194,160,127,106, 97, 82, 82, 72, 74, 
          184,165,101, 71, 48, 40, 28, 26, 21, 19, 18, 18, 16, 
           97, 94, 89, 81, 73, 66, 60, 55, 52, 49, 47, 46, 45, 
          168,163,151,135,120,107, 96, 87, 80, 75, 71, 69, 69, 
          244,232,208,181,157,136,120,108, 98, 91, 87, 84, 83, 
          322,299,257,216,183,156,136,120,109,101, 95, 92, 91, 
          356,332,284,238,199,169,146,129,117,108,102, 98, 97, 
          291,281,254,222,193,168,148,132,121,112,107,103,102, 
          200,198,191,181,170,158,148,139,131,125,121,119,118, 
          148,148,148,148,148,148,148,148,148,148,148,148,148. 
;
  nclr=12 & cl=findrng(0,550,nclr) & clr=!d.n_colors*(1+findgen(nclr))/nclr
 !p.multi=[0,2,4,1,1] & w8x11 & !y.omargin=[12,0] & set_charsize,2
  loadct,5 & xtz='Zenith Angle' & xtn='Nadir Angle' 

 tv_polar,r,p,t,xt=xtz,/half,clevels=cl,colors=clr,/noscale
 tv_polar,r,p,t,half=-4,/lower,clevels=cl,colors=clr,/noscale

 tv_polar,r,p,t,xt=xtn,/half,clevels=cl,colors=clr,/noscale,/nadir
 tv_polar,r,p,t,half=-4,/lower,clevels=cl,colors=clr,/noscale,/nadir

 tv_polar,r,p,t,/half,clevels=cl,colors=clr,/noscale
 tv_polar,r,p,t,half=-3,/lower,clevels=cl,colors=clr,/noscale

 tv_polar,r,p,t,/half,clevels=cl,colors=clr,/noscale
 tv_polar,r,p,t,half=-2,/lower,clevels=cl,colors=clr,/noscale

 color_bar,cl,clr,pos=[0.1,0.05,0.9,0.12],title='Radiance (W/m!a2!n/um/sr)'
 !y.omargin=0
 
 DEPENDENCIES
     TVIM, COLOR_KEY, CONTLEV, FINTERP, GENGRID, CONFILL, BOXPOS

 AUTHOR:     Paul Ricchiazzi    oct92 
             Earth Space Research Group, UCSB

 Revisions:
 aug98: use fill_image to smooth "horizon" points
 sep98: allow phi(0) to be non-zero, causes rotation of plot to given azimuth

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\tv_polar.pro)


TWO2ONE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TWO2ONE
 PURPOSE:
       Convert from 2-d indices to 1-d indices.
 CATEGORY:
 CALLING SEQUENCE:
       two2one, ix, iy, arr, in
 INPUTS:
       ix, iy = 2-d indices.                 in
       arr = array to use (for size only).   in
         Alternatively, arr can be [nx, ny]
         where nx and ny are the image sizes
         in x and y (saves space).
 KEYWORD PARAMETERS:
 OUTPUTS:
       in = equivalent 1-d indices.          out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 7 May, 1986.
       Johns Hopkins Applied Physics Lab.
       R. Sterner, 19 Nov, 1989 --- converted to SUN
       R. Sterner, 15 Feb, 1993 --- fixed a bug in the [nx,ny] case.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\two2one.pro)


TWO_SORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   two_sort

 PURPOSE:
   sort an array according to 2 columns (or with respect to an additional array)

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result= TWO_SORT(Array, Array2, [INDEX=index], [ERROR=error])

 INPUTS:
   Array:  array to be sorted either 1-d or 2-d. If 2-d then 2 columns are used
           as sort criterions, see example
           If you provide a 1-d array and Array2 is not present, a column of numbers
           is generated as a second field to maintain the original order if two
           items have the same value

 OPTIONAL INPUTS:
   Array2: array used as a second sort criterion

 KEYWORD PARAMETERS:
   INDEX:  a vector of two column number (def:  [0, 1])
   ERROR:  returns an error code: 0 = OK, 1=err

 OUTPUTS:
   an index field to the columns

 EXAMPLE:
   dt=[['cde', 'abc', 'abc', 'cde'], ['1', '2', '1', '2']]
   print, two_sort(dt)
           2           1           0           3
   print, two_sort(dt[*,[1,0]])
           2           0           1           3
   print, two_sort(dt[*,0], findgen(4))
           1           2           0           3



 REVISION HISTORY:
   Written     Theo Brauers, Nov 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\two_sort.pro)


TXTFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTFILE
 PURPOSE:
       Enter a (new) file name.
 CATEGORY:
 CALLING SEQUENCE:
       txtfile, file
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         DIRECTORY=dd directory name (def=current directory).
           May send a directory.  A change will be returned.
         TITLE=tt menu title (def=Enter a file name).
         ERROR_TEXT=etxt Text to display if file does not exist
           and /CHECK is turned on (def=nothing).
         /CHECK means check if file exists.  If not
           set returned file name to "none".
 OUTPUTS:
       file = file name.            in, out
         If file defined on entry it is used as default.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 26 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtfile.pro)


TXTGETFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTGETFILE
 PURPOSE:
       Select a file name.
 CATEGORY:
 CALLING SEQUENCE:
       txtgetfile, name
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TITLE_TEXT=txt text for title.
           Def = Select file option.
         QUIT_TEXT=txt text for quit option.
           If specified QUIT_TEXT replaces the Accept file
           option and supresses the abort file selection
           option if ABORT_TEXT not given.
         ABORT_TEXT=txt text to replace abort file selection.
         /NOCHECK means don't check if file exists.
         /MULTIPLE means allow multiple files to be selected.
           When /MULT is in effect /NOCHECK automatically is too.
         DIRECTORY=dd set default directory.  May change.
           New directory returned on exit.
         WILDCARD=ww set default filename wildcard for searches.
           May change, new value is returned on exit.
         DEF_EXTENSION=def_ex  Default file extension to add if
           none given in an entered file name.
         NUMDEF=n on input sets item number to highlight as default.
           On output returns item number selected.
         OPTION1=[title_text, routine]
           title_text = the text describing the action of
             the optional user supplied file processing procedure.
           routine = name of an optional user supplied
             procedure that takes as its one argument the file
             currently specified.  This routine will process
             the file in some way, like list it.  The specified
             procedure must handle errors such as missing files.
         OPTION2 through OPTION5 are also allowed and work same.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 13 Mar, 1992
       R. Sterner, 18 May, 1993 --- Added multiple options.
       R. Sterner, 19 May, 1993 --- Added DEF_EXTENSION keyword.
       R. Sterner,  1 Jun, 1993 --- Added ABORT_TEXT keyword.
       R. Sterner,  2 Sep, 1993 --- Added option 5.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtgetfile.pro)


TXTGETKEY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTGETKEY
 PURPOSE:
       Get a keyword value from a string array.
 CATEGORY:
 CALLING SEQUENCE:
       val = txtgetkey(key)
 INPUTS:
       key = keyword to find. Case ignored.    in
 KEYWORD PARAMETERS:
       Keywords:
         INIT=txtarr  string array to search.  Must be given as an
           initialization array before asking for values. If txtarr
           stays the same it need be given only on first call.
         DELIMITER=del  Set keyword/value delimiter (def is =).
         /LIST lists keywords and values.
         /START  start search at beginning of array, else
           continue from last position (can pick up multiple
           copies of a keyword by not using /START).
         INDEX=indx  Index where key was found.
 OUTPUTS:
       val = returned value of keyword.        out
         Null string if key not found.
 COMMON BLOCKS:
       txtgetkey_com
 NOTES:
       Notes: File must contain keywords and values separated by an
         equal sign (=) or DELIM.  When a matching keyword is found
         everything following the equal is returned as a text
         string.  Spaces are optional.  Some examples:
           title = This is a test.
           n=128
           xrange = 10, 20
         Example call: v = txtgetkey(init=txt, key).
 MODIFICATION HISTORY:
       R. Sterner, 17 Mar, 1993
       R. Sterner, 25 Oct, 1993 --- Added DELIMITER keyword.
       R. Sterner, 1994 May 6 --- Added /START and fixed minor bugs.
       R. Sterner, 1995 Jun 26 --- Added INDEX keyword.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtgetkey.pro)


TXTIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTIN
 PURPOSE:
       txtmenu value entry.
 CATEGORY:
 CALLING SEQUENCE:
       txtin, ptxt, val
 INPUTS:
       ptxt = prompt text, string scalar or array. in
 KEYWORD PARAMETERS:
       Keywords:
         X=x  Column number to use (def=5).
         Y=y  Starting line (def=22-# lines in ptxt).
         DEFAULT=def default value (def=null string).
 OUTPUTS:
       val = returned value (as a string).         out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 19 Feb, 1992
	R. Sterner, 26 May, 1992 --- fixed to allow default to be same
	  string as output result.
	R. Sterner, 18 Jun, 1992 --- fixed a bug caused by last fix.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtin.pro)


TXTMENU

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTMENU
 PURPOSE:
       Text screen menu routine.
 CATEGORY:
 CALLING SEQUENCE:
       txtmenu
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       txtmenu_com
       txtmenu_com
       txtmenu_com
 NOTES:
       Notes: This routine will display a screen menu and allow
         menu items to be selected and updated.  The routine is
         not hard to use but requires a more detailed description
         then this space allows, so a routine was written that
         gives more help for TXTMENU.
       
         For more help do TXTMENU,/MOREHELP
       
       There is a set of screen menu support routines:
       TXTMENU --- the screen menu routine itself.
       TXTIN --- prompts and reads user input allowing defaults.
       TXTMESS --- displays a message on the screen.
       TXTYESNO --- asks a yes/no questions and returns answer.
       TXTFILE --- prompts for a single file (and directory).
       TXTPICK --- prompts for multiple files.
       TXTGETFILE --- Like TXTPICK but does wildcard search.
       TXTMETER --- displays a 0 to 100% updatable meter on screen.
 MODIFICATION HISTORY:
       R. Sterner, 31 Jan, 1992
       R. Sterner, 11 Mar, 1992 --- made value of _ eq ''

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtmenu.pro)


TXTMENU_HELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTMENU_HELP
 PURPOSE:
       Gives detailed help for the TXTMENU routine.
 CATEGORY:
 CALLING SEQUENCE:
       txtmenu_help
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: not meant to be run directly, but by the
         command txtmenu,/morehelp
       
       There is a set of screen menu support routines:
       TXTMENU --- the screen menu routine itself.
       TXTIN --- prompts and reads user input allowing defaults.
       TXTMESS --- displays a message on the screen.
       TXTYESNO --- asks a yes/no questions and returns answer.
       TXTFILE --- prompts for a single file (and directory).
       TXTPICK --- prompts for multiple files.
       TXTMETER --- displays a 0 to 100% updatable meter on screen.
 MODIFICATION HISTORY:
       R. Sterner, 27 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtmenu_help.pro)


TXTMESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTMESS
 PURPOSE:
       Display a message on the screen and wait for any key.
 CATEGORY:
 CALLING SEQUENCE:
       txtmess, txt
 INPUTS:
       txt = string or string array.   in
 KEYWORD PARAMETERS:
       Keywords:
        /NOCLEAR inhibits the screen clear but will erase
          displayed text on exit.
        X=x message starting column (def=centered around col 40).
        Y=y message starting line (def=centered around line 10).
        PROMPT=txt set prompt text.
          def=< Press any key to continue >
        KEY=k returned value of key pressed.
        WAIT=s message wait time in seconds.  This overides
          the wait for a key press and times out.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 14 Feb, 1992
       R. Sterner, 14 Feb, 1992 --- added WAIT, /NOCLEAR
       R. Sterner, 16 Mar, 1992 --- added PROMPT=txt, KEY=k.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtmess.pro)


TXTMETER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTMETER
 PURPOSE:
       Display a 0 to 100% meter on a text screen.
 CATEGORY:
 CALLING SEQUENCE:
       txtmeter, fr
 INPUTS:
       fr = fraction, 0 to 1.00 to display as %.  in
 KEYWORD PARAMETERS:
       Keywords:
         /INITIALIZE must be called to start meter.
         /CLEAR will erase the specified meter.
         TITLE=txt set meter title (def=no title). Only on /INIT.
         Y=y set meter screen line (def = line 15). Only in /INIT.
         NUMBER=n selects meter number, 0 to 9 (def=0).
         /ALTERNATE  use alternate symbol (instead of space)
           to indicate percent.
 OUTPUTS:
 COMMON BLOCKS:
       txtmeter_com
 NOTES:
       Notes: A meter will look something like this:
                    Process status
         **********|**.......|.........|...   24%
         0%        20%       40%       60%
         Except negative spaces will be used in place of *.
 MODIFICATION HISTORY:
       R. Sterner, 21 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtmeter.pro)


TXTPICK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTPICK
 PURPOSE:
       Select file(s) from a screen menu displaying a file list.
 CATEGORY:
 CALLING SEQUENCE:
       txtmenu_pick, list, file
 INPUTS:
       list = list of files (complete path).      in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE_TEXT=ttxt title text (def=Select file).
         ABORT_TEXT=qtxt quit text (def=Abort file selection).
         /MULTIPLE means allow multiple file selections.
         If /MULTIPLE is in effect then there are two exits:
         ACCEPT_TEXT=actxt quit text (def=Accept selected files).
         ABORT_TEXT=abtxt quit text (def=Abort file selection).
 OUTPUTS:
       file = selected file(s) (none means none). out
 COMMON BLOCKS:
       txtmenu_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 13 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtpick.pro)


TXTYESNO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TXTYESNO
 PURPOSE:
       Ask a yes/on question and read the answer.
 CATEGORY:
 CALLING SEQUENCE:
       ans = txtyesno(txt)
 INPUTS:
       txt = string or string array containing question.   in
 KEYWORD PARAMETERS:
       Keywords:
        /NOCLEAR inhibits the screen clear but will erase
          displayed text on exit.
        X=x text starting column (def=centered around col 40).
        Y=y text starting line (def=centered around line 10).
 OUTPUTS:
       ans = answer: 0=no, 1=yes.                          out
 COMMON BLOCKS:
 NOTES:
       Note: must enter Y for yes or N for no (case insensitive).
 MODIFICATION HISTORY:
       R. Sterner, 26 Feb, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\txtyesno.pro)


TYPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		TYPE
 VERSION:
		4.0
 PURPOSE:
		Finds the type class of a variable.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = TYPE(X)
 INPUTS:
   X
		Arbitrary, doesn't even need to be defined.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the type of X as a long integer, in the (0,9) range.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Extracts information from the SIZE function.
 MODIFICATION HISTORY:
		Created 15-JUL-1991 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\type.pro)


TYPECAST (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        TYPECAST (function)

 PURPOSE:
        Convert a numeric variable to a different type. This can also
        be achieved with the system function FIX using the TYPE
        keyword. Hence, this routine should be considered obsolete
        and is only kept for compatibility reasons.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        newdata = TYPECAST(data,newtype)

 INPUTS:
        DATA -> The data to convert. This can be a single value,
            a vector or array of any numeric type.

        NEWTYPE -> type code to convert data into. If not given,
            the function simply returns data as is.

 KEYWORD PARAMETERS:
        none

 OUTPUTS:
        The data value/array with new type.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        a=3.14159
        help,typecast(a,1)  ; prints    BYTE     = 3
        help,typecast(a,2)  ; prints    INT      = 3
        help,typecast(a,3)  ; prints    LONG     = 3
        help,typecast(a,4)  ; prints    FLOAT    = 3.14159
        help,typecast(a,5)  ; prints    DOUBLE   = (3.1415901, 0.0)
        help,typecast(a,6)  ; prints    COMPLEX  = 3.14159
        help,typecast(a,7)  ; prints    DCOMPLEX = (3.1415901, 0.0)

 MODIFICATION HISTORY:
        mgs, 24 Aug 1998: VERSION 1.00
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\typecast.pro)


TZCN2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       tzcn2js

 PURPOSE:
       converts date/hours to js

 CATEGORY:
       TIME

 CALLING SEQUENCE:
       js=tzcn2js(date, hour)

 INPUTS:
       date:   date as number ddmmyy.00
       hour:   hours of the day

 OPTIONAL INPUTS:
       none

 OUTPUTS:
   time in julian sec

 RESTRICTIONS:
   works between year 1970 and 2069

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected       T.B. Nov 1997
       Revised         T.B. Oct 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\tzcn2js.pro)


UARSDATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    uarsdate

 PURPOSE:
   This function convarts UARS day (days since 11-SEP-1991) into date string 

 CATEGORY:
  TIME

 CALLING SEQUENCE:
   result=uarsdate(uarsday)

 INPUTS:
uarsday: days since the launch of the UARS satellite (11-SEP-1991)

 PROCEDURE:

 EXAMPLE:

 MODIFICATION HISTORY:
       Written by:     J.-U.Grooss (ICG-1), 2000-Jan-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\jug_lib\uarsdate.pro)


UAV_PATH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:	uav_path

 PURPOSE:	dispay a time history of measured quantities obtained 
               on a moving ship or plane.  UAV_PATH provides an easy
               user interface to 1) select measured quantities to plot
               and 2) run SPRITE to hilight the correspondences of 
               different data channels as a function of time and position.

 USEAGE:	uav_path,buf,labels,coor,trange=trange,select=select

 INPUT:       
   buf         array of data values of dimension (number of variables) 
               x (number of samples). Two of the measured quantities
               should correspond to the horizontal coordiates of the
               sample location, for example longitude and latitude.
               A third quantity should provide the time coordinate of
               the measurements.

   labels      string array of variable names

   coor        Three element vector array of indecies in BUF which
               correspond to time and the "x" and "y" horizontal
               coordinates of the measurement.  For example the
               uav/tddr data set has GPS_TIME, GPS_LON and GPS_LAT at
               [7,3,2]. If COOR is not set, it defaults to [7,3,2].


 KEYWORD INPUT:

   trange      time range of interest

   select      array of variable indecies to plot.  You can also use
               SELECT to retrieve the indecies of the plot quantities
               selected interactively.  Just set SELECT to an
               undefined or zero valued variable on the first call to
               UAV_PATH and reuse the returned value of SELECT in the
               next call to UAV_PATH to repeat the plot set, (perhaps
               with a different setting of TRANGE).

   sprite      run SPRITE after plots are displayed 

   bad         a single scalor value which is interpreted as a "bad"
               measurement.  Any time sample returning this value for any
               particular plot quantity will be rejected.

  
 EXAMPLE:	

  get_uavtddr,buf,labels
  select=0              
  uav_path,buf,labels,select=select ; select uav quantities interactively
                                         ; save selections in SELECT

  uav_path,buf,labels,select=select,trange=[16,17],/sprite


; you can also use UAV_PATH with ZOOMBAR to zero in on a time range

  
  get_uavtddr,buf,labels,coor
  select=[0,5,11,12,17]

  uav_path,buf,labels,coor,select=select
  while zoombar(rng) do uav_path,buf,labels,select=select,trange=rng

 REVISIONS:

  author:  Paul Ricchiazzi                            feb95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
   

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\uav_path.pro)


UNDEFINE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       UNDEFINE

 PURPOSE:
       The purpose of this program is to delete or undefine
       an IDL program variable from within an IDL program or
       at the IDL command line. It is a more powerful DELVAR.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Utilities.

 CALLING SEQUENCE:
       UNDEFINE, variable

 REQUIRED INPUTS:
       variable: The variable to be deleted.

 SIDE EFFECTS:
       The variable no longer exists.

 EXAMPLE:
       To delete the variable "info", type:

        IDL> Undefine, info

 MODIFICATION HISTORY:
       Written by David Fanning, 8 June 97, from an original program
       given to me by Andrew Cool, DSTO, Adelaide, Australia.
       Simplified program so you can pass it an undefined variable. :-) 17 May 2000. DWF

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\undefine.pro)


UNDEFINE[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       UNDEFINE

 PURPOSE:
       The purpose of this program is to delete or undefine
       an IDL program variable from within an IDL program or
       at the IDL command line. It is a more powerful DELVAR.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       General Programming

 CALLING SEQUENCE:
       UNDEFINE, variable

 REQUIRED INPUTS:
       variable: The variable to be deleted.

 SIDE EFFECTS:
       The variable no longer exists.

 EXAMPLE:
       To delete the variable "info", type:

        IDL> Undefine, info

 MODIFICATION HISTORY:
       Written by David Fanning, 8 June 97, from an original program
       given to me by Andrew Cool, DSTO, Adelaide, Australia.
       mgs, 26 Oct 1998: - added test for undefined variable

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\undefine.pro)


UNIQUE[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       UNIQUE
 PURPOSE:
       Return the unique elements of an array.
 CATEGORY:
 CALLING SEQUENCE:
       out = unique(in, count)
 INPUTS:
       in = input array to process.                    in
 KEYWORD PARAMETERS:
       Keywords:
         /SORT means sort array before selecting unique elements.
 OUTPUTS:
       out = returned unique elements from in.         out
       count = cw# occurances of each unique element.  out
 COMMON BLOCKS:
 NOTES:
       Notes: unsorted arrays only have repeated elements
         dropped, use /SORT to drop all extra repeated elements.
 MODIFICATION HISTORY:
       R. Sterner, 4 Oct, 1993
       R. Sterner, 5 Oct, 1993 --- added count.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\unique.pro)


UNIQUE[2]

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  unique

 PURPOSE:  returns sorted list of unique elements in an array

 USEAGE:   result=unique(x)

 INPUT:    
   x       array of values

 EXAMPLE:  
    print,unique(dist(10))

 AUTHOR:   Paul Ricchiazzi                        25 Feb 99
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\unique.pro)


UNIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       UNIT
 PURPOSE:
       Returns unit vector along given vector.
 CATEGORY:
 CALLING SEQUENCE:
       u = unit(v)
 INPUTS:
       v = vector: [vx,vy,vz].               in
 KEYWORD PARAMETERS:
 OUTPUTS:
       u = unit vector along v: [ux,uy,uz].  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  24 Aug, 1986.
       R. Sterner, 14 Feb, 1991 --- converted to IDL V2.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\unit.pro)


UNIVEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		UNIVEC
 VERSION:
		4.0
 PURPOSE:
		Normalizes a vector.
 CATEGORY:
		Geometry, general.
 CALLING SEQUENCE:
		Result = UNIVEC (R)
 INPUTS:
	R
		Vector, numeric, otherwise arbitrary.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns a vector in the same direction as R, normalized to unity.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		A zero vector will cause error.
 PROCEDURE:
		Straightforward.  Uses FPU_FIX and VNORM from MIDL.
		Works also with complex vectors.
 MODIFICATION HISTORY:
		Created 30-JUN-1992 by Mati Meron.
		Added to MIDL 5-NOV-1997 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\univec.pro)


UNSORTED_UNIQ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   unsorted_uniq

 PURPOSE:
  Thisfunction returns the subscripts of the unique elements in an array without sorting of the array

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result=unsortded_uniq(data)

 INPUTS:
   data:  an array to be scanned

 OUTPUTS:
  This function returns an index field

 EXAMPLE:
   array=['ll','bb_aa','bb_cc','ff_gg','ff_ee','bb_cc','kk']
   result=unsorted_uniq(array)
   print,result
     0           1           2           3           4           6



 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1),2000-May-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\unsorted_uniq.pro)


UPCASE1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       UPCASE1
 PURPOSE:
       Capitalize first letter in string.
 CATEGORY:
 CALLING SEQUENCE:
       out = upcase1(in)
 INPUTS:
       in = Input text string.          in
 KEYWORD PARAMETERS:
 OUTPUTS:
       out = Output text string.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Jun 26

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\upcase1.pro)


UPDATE_VALID_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	update_valid_index

 PURPOSE:
	This procedure updates the values of the ICGS parameter tags
	'VALID', 'PLOT_MIN', 'PLOT_MAX', 'FILLED', 'MISSED'

 CATEGORY:
	ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
	update_valid_index, icgs [, name]

 INPUTS:
	icgs: ICG structure

 OPTIONAL INPUTS:
	name: Short name(s) of parameter(s) which will be updated.
		If omitted the valid index of all parameters will be updated.

 KEYWORD PARAMETERS:
	/TAG_NAME: If set entries in name_list will be interpreted as tag names.
	/EXCLUDE: If set the specified names are excluded from update

 OUTPUTS:
	icgs: ICG structure with updated parameter tags:
		'VALID', 'PLOT_MIN', 'PLOT_MAX', 'FILLED', 'MISSED'

 EXAMPLE:
	s0 = {H2O: {short_name: 'H2O', param: 4, units: 'mbar'}, O3: {short_name: 'O3', param: 17, units: 'ppb'}}
	s1 = change_tag_value(s0, 'param', [4., 5., -999., 3., -999.], SUB_STR = 'H2O')
	s1 = add_tag(s1, 'fill_value', -999., SUB_STR = ['H2O', 'O3'])
	update_valid_index, s1
	HELP, s1.h2o, /STR
	HELP, s1.o3, /STR

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 13.01.2000
	14.01.2000:	Bug removed
					Changed from FUNCTION to PRO
	19.02.2000: Some small changes in the code.
	14.03.2000:	Added keyword parameter /NO_SORT to calls to add_tag and change_tag_value
	17.03.2000:	Call to 'change_tag_value' changed to call to 'replace_tagvalue'
					All /NO_SORT keywords removed.
	21.03.2000:	Bug removed if short names were provided
	11.04.2000:	Added keyword parameter /EXCLUDE
					Temporary change of call to 'add_tag' to call to 'add_tag_fh'
	12.04.2000:	Changed 'add_tag_fh' back to 'add_tag'

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\update_valid_index.pro)


USAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        USAGE

 PURPOSE:
        Display help information on any routine in the IDL path
        that has a (more or less) standard header. Default is to
        print only the PURPOSE and CALLING SEQUENCE information, but
        a wide range of options can be selected via keywords.

 CATEGORY:
        General Programming

 CALLING SEQUENCE:
        USAGE, routinename [,/printall] [,/purpose] [,/calling] $
               [,/category] [,/modification] [,/author]         $
               [,/parameters] [,/keywords] [,/example]          $
               [,/input] [,/output]

 INPUTS:
        ROUTINENAME -> (string) name of the routine for which help information
             shall be provided. This can also be a file name with
             path information. Tip: to get help for the current routine use
             function routine_name().

 KEYWORD PARAMETERS:
;       If no keywords are set, this is equivalent to /PURPOSE,
;       /CALLING. Flags can be combined ad libitum.
;
;       PRINTALL (flag) -> prints complete header information. Normally, only 
;            "user relevant" information is displayed.
; 
;       PURPOSE (flag) -> prints all information listed under
;            CATEGORY or DESCRIPT[ion].
;
;       CALLING_SEQUENCE (flag) -> print information listed under
;            CALLING SEQUENCE, USAGE, PROCEDURE or [object] CREATION
;
;       CATEGORY (flag) -> print information listed under CATEGORY
;
;       MODIFICATION_HISTORY (flag) -> print information listed under
;            MODIFICATION HISTORY, PREV. HIST[ory] or REVISION
;
;       AUTHOR (flag) -> prints information listed under AUTHOR
;
;       PARAMETERS (flag) -> prints information listed under
;            PARAMETER, INPUT, OUTPUT, POSITIONAL, or REQUIRED
;
;       KEYWORDS (flag) -> prints information listed under KEYWORD or
;            OPTIONAL
;
;       EXAMPLE (flag) -> prints information listed under EXAMPLE[s]
;
;       INPUT (flag) -> prints information listed under INPUT[s],
;            REQUIRED INPUT[s], or OPTIONAL INPUT[s]
;
;       OUTPUT (flag) -> prints information listed under OUTPUT[s],
;            REQUIRED OUTPUT[s], or OPTIONAL OUTPUT[s]
;
;       
 OUTPUTS:
        prints usage information on the screen.

 SUBROUTINES:

 REQUIREMENTS:
        Uses file_exist routine

 NOTES:
        This routine is meant to replace /HELP constructs etc.
        Header must begin with single ';' to recognize tags.

 EXAMPLE:
;        Error checking :
;
;             if (n_params() ne 2) then begin
;                 print,'Invalid number of arguments!'
;                 usage,routine_name()
;             endif
;
;        Get the idea what to type from the command line: 
;             usage,'my_routine_with_too_many_arguments'
;
 MODIFICATION HISTORY:
        mgs, 27 Mar 1998: VERSION 1.00
        mgs, 16 Jun 1998: replaced close by free_lun
        mgs, 26 Aug 2000: - changed copyright to open source
                          - rewrite with plenty of keywords for more
                            controlled behaviour.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\usage.pro)


USERSYMBOL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:         UserSymbol 
 PURPOSE:      Make neat little user defined symbols 
 CATEGORY:     Plotting/Graphics 
 
 CALLING SEQUENCE:     UserSymbol,symbol_name,x,y,SYMSIZE=symsize,LIST=list,$
                                HELP=help,_EXTRA=_extra 
+ 
 
 INPUTS: 
       Symbol_name     a string containing the name of the desired symbol. 
                       Currently accepted values are:

                       'DIAMOND',  'PENTAGON', 'CLOVER',    'PACMAN',
                       'SPIRAL',   'BIGX',     'CIRCLE',    'SQUARE',
                       'TRIANGLE', 'STAR',     'HEXAGON',   'HEART',
                       'SPADE',    'CLUB'      'SUN',       'EYE',
                       'DASH0',    'DASH1',    'DASH2',     'DASH3',
                       'DASH4',    'DASH5',    'DTRIANGLE', 'RTRIANGLE',
                       'LTRINGLE'
 
                       if the symbol name is appended with the suffix
                       "_o" (e.g., "DIAMOND_O") then the symbol is
                       left unfilled. Filling has no effect on symbols
                       composed of open curves (e.g., "SPIRAL")
                       
 
 KEYWORD PARAMETERS:    
       SYMSIZE Symbol size      (default=1) 
       LIST    if set, puts the list of available symbol names 
                 in the input parameter Symbol_Name   
       HELP    if set, returns this documentation header 
       angle   symbol angle 
       
 
 and also the keywords which apply to USERSYM 
       THICK   Line thickness   (default=1) 
       COLOR   Symbol color  
 
 SIDE EFFECTS:         Calls  USERSYM to load the new symbol 

 EXAMPLE:  UserSymbol,'BigX'           ;to change to an X outline
           UserSymbol,list,/LIST       ;to get a list of possible symbols

  usersymbol & erase & plots, .5,.5,psym=8,/norm,symsize=5
  
 MODIFICATION HISTORY:      Brian Jackel   August 10 1992 
                            University of Western Ontario 

 Bjj June 2 1994      Fixed up the handling of no clear match.
 pjr feb 1996         "_o" suffix used to specify open non-filled symbols

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\usersymbol.pro)


USER_AT_HOST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   user_at_host

 PURPOSE:
   This function returns user and host names

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = USER_AT_HOST([/MESSAGE])

 KEYWORD PARAMETERS:
   MESSAGE:    if set a message is printed

 OUTPUTS:
   This function returns a string username@hostname

 EXAMPLE:
   print, user_at_host()
   IDL prints:
     ich306@ICH355

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-OKT

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\user_at_host.pro)


USE_TAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	use_tag

 PURPOSE:
   This function genereates a stringarray where are
   tag names and tag values are separated by a separator

 CATEGORY:
   PROG_TOOLS/STRUCTURES

 CALLING SEQUENCE:
   Result=use_tag(struct=struct,tag=tag,[separator=separator],[without=without],[/only],[/bottom_line],[/blanc],[/beginning])

 OPTIONAL INPUTS:
   struct:   The structure which should be scaned
   tag_such: The string which should be used for searching in the structure
   without:  A string which should not included in the result string array
   separator:   the string separator default is ':'

 KEYWORD PARAMETERS:
   only:        tag_such has to match exactly not a part of a tag
   bottom_line: last line of the array will be a line whith '====='
   blanc:       last line of the array will be a blanc
   begining:    search string will start at the first sign

 OUTPUTS:
   The return value is a stringarray


 EXAMPLE:
   Result=tag_such(struct=experiment,tag_such='exp')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), Jan. 1997
                       Dec-13, keyword begining added for explicitly start
                               search add first sign
 1998-Aug-26 keyword separator added
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\use_tag.pro)


VALID_PARAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   valid_param

 PURPOSE:
   This function returns the valid information arrays for one parameter short_name of a parameter structure

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   Result=valid_param(param_structure)

 INPUTS:
  param_structure: a parameter structure

 EXAMPLE:
  valid=valid_param(icg_Struct.(pos_icg_struct(icg_struct,'F12')))

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Sep-30

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\valid_param.pro)


VARF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VARF
 PURPOSE:
       Computes variance inside a moving window.
 CATEGORY:
 CALLING SEQUENCE:
       v = varf(x,w)
 INPUTS:
       x = array of input values.      in
       w = width of window.            in
 KEYWORD PARAMETERS:
 OUTPUTS:
       v = resulting variance array.   out
 COMMON BLOCKS:
 NOTES:
	Notes: This filter may have problems if the variance
	  is small relative to the values in x.  The performance
	  may be improved by subtracting the mean first:
	  v=varf(x-mean(x),w).
 MODIFICATION HISTORY:
       Written by R. Sterner, 3 Jan, 1984.
	R. Sterner, 25 Sep, 1991 --- added notes.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\varf.pro)


VARIAB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	variab

 PURPOSE:
   this function finds all momentanly used variabled
   without structures

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=variab()

 OUTPUTS:
   This function returns a stringarray of variable names sorted by
   value and array

 PROCEDURE:
   I am using the internal idl function routine_names
   Unfortunately I have no description about it

 EXAMPLE:
   Result=variab()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), May 15 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\variab.pro)


VARIANCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VARIANCE
 PURPOSE:
       Computes the variance of an array of numbers.
 CATEGORY:
 CALLING SEQUENCE:
       v = variance(a, [m])
 INPUTS:
       a = input array.                    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       v = variance of array a.            out
       m = optionally returned mean of a.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       blg 23-feb-86
       Johns Hopkins University Applied Physics Laboratory.
       Modified B. Gotwols, R. Sterner --- 1 Oct, 1986  error check.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\variance.pro)


VASE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VASE
 PURPOSE:
       Draw rotationally symetric shapes.
 CATEGORY:
 CALLING SEQUENCE:
       vase
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: This program allows you to enter a profile,
       then rotates this profile about the Y-axis and allows the
       shape to be displayed at any angle. There are two modes:
       Draw mode, and Display mode. Draw mode allows the profile
       to be drawn with the mouse.  Use button 1 to add new points,
       and button 2 to delete points.  Button 3 puts you in display
       mode. Display mode allows the rotated shape to be drawn at
       any angle. The mouse position determines the angle of the
       shape, the direction of the cursor from the window center
       determines the angle of the shape axis and the distance of
       the cursor from the center determines the angle of the shape
       toward or away from you
 MODIFICATION HISTORY:
       R. Sterner,  19 Jan, 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vase.pro)


VCLIP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VCLIP
 PURPOSE:
       Clip a vector to a clipping window.
 CATEGORY:
 CALLING SEQUENCE:
       vclip,x1,y1,x2,y2
 INPUTS:
       x1=[xa,xb]   Input vector endpoint x coordinates.  in
       y1=[yy,yb]   Input vector endpoint y coordinates.  in
 KEYWORD PARAMETERS:
       Keywords:
         XRANGE=[xlo,xhi] Clipping window x coordinates (def=[0,1]).
         YRANGE=[ylo,yhi] Clipping window x coordinates (def=[0,1]).
         FLAG=flg  flag for clipped result:
            0=no part in window, 1=some part in window.
 OUTPUTS:
       x2=[xc,xd]  Output vector endpoint x coordinates.  out
       y2=[yc,yd]  Output vector endpoint y coordinates.  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Dec 5

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vclip.pro)


VCOLORBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VCOLORBAR

 FILENAME:

       vcolorbar__define.pro

 PURPOSE:

       The purpose of this program is to create a vertical
       colorbar object to be used in conjunction with other
       IDL 5 graphics objects.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

       IDL Object Graphics.

 CALLING SEQUENCE:

       thisColorBar = Obj_New('VColorBar')

 REQUIRED INPUTS:

       None.

 INIT METHOD KEYWORD PARAMETERS:

       COLOR: A three-element array representing the RGB values of a color
          for the colorbar axes and annotation. The default value is
          white: [255,255,255].

       NAME: The name associated with this object.

       NCOLORS: The number of colors associated with the colorbar. The
          default is 256.

       MAJOR: The number of major tick divisions on the colorbar axes.
          The default is 5.

       MINOR: The number of minor tick marks on the colorbar axes.
          The default is 4.

       PALETTE: A palette object for the colorbar. The default palette
           is a gray-scale palette object.

       POSITION: A four-element array specifying the position of the
           colorbar in the arbitary coordinate system of the viewplane
           rectangle. The default position is [0.90, 0.10, 0.95, 0.90].

       RANGE: The range associated with the colorbar axis. The default
           is [0, NCOLORS].

       TITLE: A string containing a title for the colorbar axis
           annotation. The default is a null string.

 OTHER METHODS:

       Clamp (Procedure): Given a two-element array in the data range of
          the colorbar, the colorbar image is clamped to this range. In
          other words, the range of colors is clamped to the specified
          range. Values above or below the range in the colorbar are set to
          the minimum and maximum range values, respectively.

       GetProperty (Procedure): Returns colorbar properties in keyword
          parameters as defined for the INIT method. Keywords allowed are:

               COLOR
               MAJOR
               MINOR
               NAME
               PALETTE
               POSITION
               RANGE
               TITLE
               TRANSFORM

       SetProperty (Procedure): Sets colorbar properties in keyword
          parameters as defined for the INIT method. Keywords allowed are:

               COLOR
               NAME
               MAJOR
               MINOR
               PALETTE
               POSITION
               RANGE
               TITLE
               TRANSFORM

 SIDE EFFECTS:

       A VCOLORBAR object is created. The colorbar INHERITS IDLgrMODEL.
       Thus, all IDLgrMODEL methods and keywords can also be used. It is
       the model that is selected in a selection event, since the SELECT_TARGET
       keyword is set for the model.

 RESTRICTIONS:

       None.

 EXAMPLE:

       To create a colorbar object and add it to a plot view object, type:

       thisColorBarObject = Obj_New('VColorBar')
       plotView->Add, thisColorBarObject
       plotWindow->Draw, plotView

 MODIFICATION HISTORY:

       Written by David W. Fanning, 19 June 97.
       Changed the optional "colorbarmodel" parameter to an
           optional GETMODEL parameter. 26 June 97. DWF.
       Fixed bug in the way the color palette was assigned. 13 Aug 97. DWF.
       Added missing container object to self structure. 13 Aug 97. DWF.
       Removed image model, which was a workaround for
           broken 5.0 objects. 5 Oct 97. DWF
       Fixed cleanup procedure to clean up ALL objects. 12 Feb 98. DWF.
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Modified colorbar to INHERIT an IDLgrModel object. This allows me to
           add the colorbar to other models directly. 20 Sept 98. DWF.
       Added NAME keyword to give the colorbar a name. 20 Sept 98. DWF.
       Changed a reference to _Ref_Extra to _Extra. 27 Sept 98. DWF.
       Fixed bug when adding a text object via the TEXT keyword. 9 May 99. DWF.
       Fixed a bug with getting the text object via the TEXT keyword. 16 Aug 2000. DWF.
       Added the TRANSFORM keyword to GetProperty and SetProperty methods. 16 Aug 2000. DWF.
       Added RECOMPUTE_DIMENSIONS=2 to text objects. 16 Aug 2000. DWF.
       Added a polygon object around the image object. This allows rotation in 3D space. 16 Aug 2000. DWF.
       Removed TEXT keyword (which was never used) and fixed TITLE keyword. 8 Dec 2000. DWF.
       Added ENABLE_FORMATTING keyword to title objects. 22 October 2001. DWF.
       Added a CLAMP method. 18 November 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\vcolorbar__define.pro)


VECFLD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VECFLD
 PURPOSE:
       Plot a 2-d vector field.
 CATEGORY:
 CALLING SEQUENCE:
       vecfld, u, v, [l]
 INPUTS:
       u = 2-d array of vector x components.   in
       v = 2-d array of vector y components.   in
       l = Optional max length of vectors.     in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 8 Sep, 1989.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vecfld.pro)


VECTOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Vector

 PURPOSE:
	This function returns a one dimensional copy of a multidimensional array.

 CATEGORY:
	PROG_TOOLS

 CALLING SEQUENCE:
	Result = Vector(array)

 INPUTS:
	array: An array of any type and dimension.

 OUTPUTS:
	Using the IDL REFORM function this function returns
	a one dimensional copy of a multidimensional array.

 EXAMPLE:
	A = INDGEN(3, 4, 5)
	HELP, A, vector(A)
		A               INT       = Array[3, 4, 5]
		    INT       = Array[60]

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 25.05.98

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\vector.pro)


VECT_ANGLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VECT_ANGLE
 PURPOSE:
       Angular distance between vectors.
 CATEGORY:
 CALLING SEQUENCE:
       ang = vect_angle(x1,y1,z1, x2,y2,z2)
 INPUTS:
       x1,y1,z1 = coordinates of point 1.      in
       x2,y2,z2 = coordinates of point 2.      in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angles are in degrees, else radians.
 OUTPUTS:
       a = angular distance between points.    out
 COMMON BLOCKS:
 NOTES:
       Notes: points 1 and 2 may be arrays.
 MODIFICATION HISTORY:
       R. Sterner, 5 Feb, 1991
       R. Sterner, 26 Feb, 1991 --- Renamed from vector_angle.pro

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vect_angle.pro)


VEKLOGIK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	VekLogik

 PURPOSE:
	This function applies different boolean operators to two vectors.
	It's a wrapper for the functions a_and_b, a_or_b, a_xor_b, a_not_b

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	Result = VekLogik(vec1, vec2)

 INPUTS:
	vec1, vec2: The two vectors to which a boolean operation should be applied.

 KEYWORD PARAMETERS:
	LO: String parameter which spezifies the boolean operation:
		- 'A AND B' (default)
		- 'A OR B'
		- 'A XOR B'
		- 'A NOT B'

 OUTPUTS:
	This function returns a vector with elements which result from the boolean operation.
	In the case of an empty output vector, -1 is returned.

 RESTRICTIONS:
	Repeated elements in the input vectors are returned only once in the output vector
	(see example).

 EXAMPLE:
	see ex_veklogik.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 02.12.97
	History:	08.01.98 - entry in EXAMPLE was changed
				17.03.98 - corrected error in header (wrong spelling of keywords)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\veklogik.pro)


VER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VER
 PURPOSE:
       Plot a vertical line on a graph at specified x value.
 CATEGORY:
 CALLING SEQUENCE:
       ver, x
 INPUTS:
       x = X value of vertical line. Scalar or array.    in
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means work in device coordinates.
         /NORMALIZED means work in normalized coordinates.
           Default is data coordinates.
         LINESTYLE=s.    Linestyle (def=!p.linestyle).
         COLOR=c.        Line Color (def=!p.color).
         THICKNESS=thk   Line thickness (def=!p.thick).
         FILL=clr        Optional color to fill between line pairs.
           Fills between lines 0 and 1, 2 and 3, and so on.
         POINTER=pt      Draw arrowhead pointers at top and bottom
           instead of lines.  Arrowhead dimensions may be given as
           fraction of screen or plot window size, the value of
           pt is height, or [height, width].  For /pointer the
           default used is [.03,.03].
         /BOTTOM  used with POINTER to plot bottom pointers only.
         /TOP  used with POINTER to plot top pointers only.
         /OUT   Keep pointers outside axes (Data coord only).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: see hor.
 MODIFICATION HISTORY:
       R. Sterner, 2 Aug, 1989.
       R. Sterner, 21 May, 1992 --- fixed for log Y axes.
       R. Sterner,  3 Nov, 1992 --- Added /device.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner 20 Jun, 1993 --- added /norm.
       R. Sterner 1994 Feb 2 --- Add THICK.
       R. Sterner, 1994 Jun 3 --- Added FILL.
       R. Sterner, 1994 Jun 16 --- Added POINTER.
       R. Sterner, 1997 Jul 11 --- Added /OUT.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ver.pro)


VERI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VERI
 PURPOSE:
       Interactive vertical line on screen or plot.
 CATEGORY:
 CALLING SEQUENCE:
       veri, [x]
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   Causes data coordinates to be used (default).
         /DEVICE Causes window device coordinates to be used.
         /NORMAL Causes normalized coordinates to be used.
         COLOR=c Set color of line (ignored for /XOR).
         LINESTYLE=s Line style.
         XFORMAT=xfn  These keywords are given names of functions
         YFORMAT=yfn  that accept the numeric value of x or y
           and return a corresponding string which is displayed
           in place of the actual value.  For example, Julian
           days could be displayed as a date with jd2date.
         XSIZE=xs, YSIZE=ys  Coordinate display widths.
         /JS  Means X axis is time in Julian seconds.
         /NOSTATUS   Inhibits status display widget.
         SETSTAT=st  May use the same status display widget on
           each call to veri (stays in same position).
           On first call: the status widget structure is returned.
           Following calls: send st.  Must use with /KEEP.
           To delete status display widget after last box1 call:
             widget_control,st.top,/dest (or drop /KEEP)
         /KEEP   Do not delete status widget on exit.
         /XMODE  Means use XOR plot mode instead of tvrd mode.
         INSTRUCTIONS=t  String array with exit instructions.
           Default: Press any button to exit.
         /DIALOG Means give an exit dialog box.
         MENU=m  A string array with exit dialog box options.
           Def=Exit. An option labeled Continue is always added.
         EXITCODE=x Returns exit code.  Always 0 unless a dialog
           box is requested, then is selected exit option number.
         BUTTON=b   Returned button code: 1=left, 2=middle, 4=right.
 OUTPUTS:
       x = X coordinate of line.      in, out
 COMMON BLOCKS:
       js_com
 NOTES:
       Note: data coordinates are default.
         X may be set to starting position in entry.
 MODIFICATION HISTORY:
       R. Sterner, 11 Sep, 1990
       R. Sterner, 21 Oct, 1991 --- added /NOCOMMANDS, EXITCODE=x
       R. Sterner,  6 Nov, 1991 --- added EXITCODE=0.
       R. Sterner, 23 Dec, 1991 --- made x be both in and out.
       R. Sterner, 23 Dec, 1991 --- Added wait,.2 for HP workstation.
       R. Sterner, 21 May, 1992 --- fixed for log axes.
       R. Sterner, 1994 Jan 20 --- One mouse button,/NORMAL,/DATA.
       R. Sterner, 1994 jan 21 --- Added /NOSTATUS, SETSTAT, /KEEP.
       R. Sterner, 1994 Feb 16 --- Fixed a few minor bugs.
       R. Sterner, 1994 Mar  4 --- Added XFORMAT, YFORMAT, & BUTTON keywords.
       R. Sterner, 1994 May 17 --- Added XSIZE,YSIZE,/DIALOG,INSTRUCTIONS,
         MENU, and rearranged display.  Also added /JS for time in JS.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\veri.pro)


VERIFY_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		VERIFY_STRUCT
 VERSION:
		4.1
 PURPOSE:
		Verifying that a provided input is a structure, of the appropriate type.
 CATEGORY:
		Programing Utility.
 CALLING SEQUENCE:
		Result = VERIFY_STRUCT( STRUCT, NAME)
 INPUTS:
	STRUCT
		Arbitrary.
	NAME
		Character constant or variable, mandatory.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		If STRUCT is a structure, of the type corresponding to NAME,
		VERIFY_STRUCT returns 1b, else it returns 0b.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Checks whether the input is a structure and, if so, extracts the
		structure's name using IDL HELP and compares it with the provided NAME.
		Calls STREQ, STRPARSE_MM and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 25-JUL-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\verify_struct.pro)


VERSION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		VERSION
 VERSION:
		4.1
 PURPOSE:
		Finding the version number of a routine.
 CATEGORY:
		Programing utility.
 CALLING SEQUENCE:
		Result = VERSION ( [FNAME [, keywords]])
 INPUTS:
	FNAME
		Character scalar, representing a file name.  A .pro extension is
		assumed and appended if missing.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	NUMBER
		Optional output, see below.
	LOCATION
		Optional output, see below.
	/ALL
		Switch.  If set and multiple files with the same name are detected,
		the results for all are given.
 OUTPUTS:
		Returns the version number(s) (as it appears in the informational block
		as float.  If the routine exists but no version number is found,
		returns 0.  If the file is not found, returns -1.
 OPTIONAL OUTPUT PARAMETERS:
	NUMBER
		Returns the number of fitting files found.
	LOCATION
		Character array, returns the locations of all fitting files found.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Three possibilities:
			1)	If routine name alone is given, like in
				res = Version('my_rout'), VERSION scans the whole IDL path (as
				given by !PATH) as well as current directory (if not on path),
				locating all instances of MY_ROUT.
			2)	If a name with a directory path is given, like in
				res = version('c:\midl\_midl\my_rout') then VERSION finds the
				file if it exists, at the provided address.  No attempt to find
				additional files with same name is made in this case.
			3)	If a name is not provided, VERSION provides the user with
				a graphic interface to FINDFILE and allows to specify the file
				interactively.

		In all three cases the file(s) found (note that only in the first case
		there can be more than one file) are scanned and the version number (if
		present) is extracted from the info block (if present) into the result.
		If no version number is found, VERSION returns 0. and if the file
		itself isn't found, it returns -1.

		VERSION calls FILE_GET, STREQ and STRPARSE_MM, from MIDL, and SDEP
		from the ROger Dejus library.
 MODIFICATION HISTORY:
		Created 10-AUG-2001 by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\version.pro)


VIMGSEQ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VIMGSEQ
 PURPOSE:
       Display a sequence of byte images.
 CATEGORY:
 CALLING SEQUENCE:
       imgseq
 INPUTS:
       Prompts for all inputs.         in
 KEYWORD PARAMETERS:
       Keywords:
         XSIZE=sx  Size of display window to use.
         YSIZE=sy  The default is full screen.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Images should be scaled byte images
         saved using the save2 procedure.  A file
         with one image name per line should be setup.
         This file is the sequence file.  After imgseq
         has read in the file names the images may be
         sequenced through by using to move RETURN forward,
         and SPACE to move backwards.  Random access is
         also allowed.  Experiment with the other options.
 MODIFICATION HISTORY:
       R. Sterner 3 Jan, 1990
       R. Sterner, 7 Jun, 1990 --- converted to vms.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vimgseq.pro)


VINP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		VINP
 VERSION:
		4.0
 PURPOSE:
		Finds the scalar product of two vectors.
 CATEGORY:
		Geometry, General.
 CALLING SEQUENCE:
		Result = VINP ( U, V)
 INPUTS:
	U, V
		Vectors, numeric, of same length, otherwise arbitrary.  Scalars
		accepted as vectors of length 1.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the value of the scalar product, in Type FLOAT or higher.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		Vectors must have same length.
 PROCEDURE:
		Straightforward.  Uses CAST, FPU_FIX and ISNUM from MIDL.
		Works also with complex vectors.
 MODIFICATION HISTORY:
		Created 30-JUN-1992 by Mati Meron.
		Modified and added to MIDL on 5-NOV-1997, by Mati Meron.
		Modified on 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\vinp.pro)


VLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VLINE
 PURPOSE:
       Plot a vertical line after erasing last plotted line.
 CATEGORY:
 CALLING SEQUENCE:
       vline, [x]
 INPUTS:
       x = x coordinate of new line.   in
         If x not given last line is erased.
 KEYWORD PARAMETERS:
       Keywords:
         /DEVICE means use device coordinates (default).
         /DATA means use data coordinates.
         /NORM means use normalized coordinates.
         /NOERASE means don't try to erase last line.
         /ERASE means just erase last line without plotting another.
         RANGE=[ymin, ymax] min and max y coordinates of line.
         NUMBER=n line number (0 to 9, def=0).
         COLOR=c set plot color.
         LINESTYLE=s set line style.
 OUTPUTS:
 COMMON BLOCKS:
       vline_com
       vline_com
 NOTES:
 MODIFICATION HISTORY:
       R. sterner, 5 June, 1992
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vline.pro)


VNORM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		VNORM
 VERSION:
		4.0
 PURPOSE:
		Finds the norm of a vector.
 CATEGORY:
		Geometry, General.
 CALLING SEQUENCE:
		Result = VNORM (R)
 INPUTS:
	R
		Vector, numeric, otherwise arbitrary.  Can be complex.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the norm of the vector R.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Calls ABS_MM, CAST, FPU_FIX and ISNUM from MIDL.
 MODIFICATION HISTORY:
		Created 30-JUN-1992 by Mati Meron.
		Modified and added to MIDL 5-NOV-1997 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\vnorm.pro)


VOUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		VOUP
 VERSION:
		4.0
 PURPOSE:
		Finds the outer product of two vectors.
 CATEGORY:
		Geometry, General.
 CALLING SEQUENCE:
		Result = VOUP ( U, V)
 INPUTS:
	U, V
		Vectors, numeric, otherwise arbitrary.  Scalars accepted as vectors of
		length 1.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
		None.
 OUTPUTS:
		Returns the outer product in Type FLOAT or higher.  for U of length M
		and V of length N, the outer product is an array of dimension (M,N).
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Straightforward.  Uses CAST, FPU_FIX and ISNUM from MIDL.
		Works also with complex vectors.
 MODIFICATION HISTORY:
		Created 10-NOV-1997 by Mati Meron.
		Modified 10-SEP-1998 by Mati Meron.  Underflow filtering added.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\voup.pro)


VSCAT

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

 PURPOSE:        1. use the interactive graphics cursor and the 
                    DEFINE_REGION procedure to select a region

                 2. plot a x vs y scatter plots of two variables from that
                    region

 USEAGE          vscat,x,y,image
 
 INPUT:
   x             array ploted on x axis of scatter plot
   y             array ploted on y axis of scatter plot
   image         image used to select regions to plot

 KEYWORD INPUT:
   xrange        range of scatter plot x axis
   yrange        range of scatter plot y axis
   xtitle        title of scatter plot x axis
   ytitle        title of scatter plot y axis
   title         title of image plot

 EXAMPLE
       !p.multi=[0,1,2]
       x=20*randata(128,128,s=4)+(findgen(128) # replicate(1.,128))
       y=20*randata(128,128,s=4)+(replicate(1.,128) # findgen(128))
       image=x+y
       vscat,x,y,image



 OUTPUT:         none

  author:  Paul Ricchiazzi                            aug93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\vscat.pro)


VSTRUCT_FIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	vstruct_find

 PURPOSE:
 This function is used to find something given from x_replace in a vector of structure

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=vstruct_find(v_struct,  last_position=last_position,$
                                 replace_with=replace_with,$
                                 case_sensitive=case_sensitive,$
                                 whole_words_only=whole_words_only,$
                                 replace_all=replace_all,$
                                 forward_from_cursor=forward_from_cursor,$
                                 backward_from_cursor=backward_from_cursor,$
                                 entire=entire,$
                                 search_list=search_list,$
                                 search_in_list=search_in_list,$
                                 _EXTRA=Pkey)

 INPUTS:
   v_struct: the vector structure


 KEYWORD PARAMETERS:
    last_position:  if set to a two element vector it is used to initialize the start position
                    at the moment only [1] is used
    forward_from_cursor: if is set search direction is forward from cursor
                    at the moment default
    search_list:    the value to search for
    search_in_list: the position of the vector in the structure which is searched
    count         : is set gt 0 if data found else 0



 OUTPUTS:
	This function returns the positione in the structure and the index of the vector

 EXAMPLE:
   result=vstruct_find()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-MAY-04
   This routine is under construction
   1999-Sep-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\vstruct_find.pro)


VUMOV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       VUMOV
 PURPOSE:
       View a res file movie.
 CATEGORY:
 CALLING SEQUENCE:
       vumov
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         ORDER=ord, or /ORDER controls y reversal (1=reverse y).
         BUTTONS=txt  Label text for custom buttons.
           Each button entry must have a command entry.
         COMMAND=cmd  Names of custom routines.
           txt and cmd can be scalars or arrays.
           The given routines must take two args, file and
           frame number. File is the res file name, frame number
           is the movie frame.  The res file may be accessed by
           the routine without interferring.
 OUTPUTS:
 COMMON BLOCKS:
       vumov_event_com
 NOTES:
       Notes:  FORMAT OF THE MOVIE RES FILE.
         The movie file is an ordinary res file (see resopen,
         resput,rescom, resclose, resget).
         The movie frames are named FRAME_0, FRAME_1, and so on.
         Frames must be numbered consecutively (need not start at
         0).  Optional is an array of times as JS called TIME_JS.
         An optional color table may be given in the res file
         with tag names RED, GREEN, BLUE for the R,G,B components.
         Other data is allowed in the movie res file and may
         be used by the custom routines if desired.
         The custom commands may be embedded directly in the movie
         res file if desired.  Just include the keyword pair
         BUTTON and COMMAND for each custom command.  These values
         will be picked out of the file when opened and used as if
         given in the command line.  Do not give on command also.
 MODIFICATION HISTORY:
       res file.
       R. Sterner, 1998 Jun 19 --- from vuex.
       res file.
       R. Sterner, 1998 Oct 1
       R. Sterner, 1998 Nov 04 --- Removed need for XSIZE and YSIZE
       and made detect image type.

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\vumov.pro)


V_STRUCT2DATA_FILE_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   v_struct2data_file_struct

 PURPOSE:
   The result of this function is the read_data_file struct

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=v_struct2data_file_struct(v_struct)

 INPUTS:
   v_struct: A vectorized stucture

 EXAMPLE:
  a=v_struct2data_file_struct(icg_struct2v_struct(read_ncdf('ghost.nc')))
  help,a,/str
  HEADER          STRING    'TIME TIME@INTERVAL_T TIME@BEGIN_T TIME@END_T '...
  SEPARATOR       STRING    ' '
  DATA            DOUBLE    Array[10, 13]


 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Jun-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\v_struct2data_file_struct.pro)


V_STRUCT2ICG_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   v_struct2icg_struct

 PURPOSE:
   The result of this function is the icg_struct from a given v_struct

 CATEGORY:
   ICG_STRUCT/PROG_TOOLS

 CALLING SEQUENCE:
   result=v_struct2icg_struct(v_struct,icg_struct,[/set_flag])

 INPUTS:
   v_struct:   the corresponding v_struct given to the function icg_struct2v_struct
   icg_struct: the defined ICG data structure

 KEYWORD PARAMETERS:
   set_flag:  if set the param_flag attribute is set to the defined flags

 EXAMPLE:
  icg_Struct=read_ncdf('ghost.nc')
  v_struct=icg_struct2v_struct(icg_struct)
  idx=lindgen(4)
  result=v_struct2icg_struct(v_struct[idx],icg_struct)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-11
   1999-Aug-18 set_flag keyword added
   1999-Nov-20 bug with !filename removed
   2000-Feb-17 idl5.3 does not longer support '@' in a tag definition.  '@' will be replaced by '$'.
   2000-Feb-18 Bug with QUALITY removed
   2000-Feb-25: CATEGORY changed
   2000-Apr-11: bug removed if $QUALITY is not defined
   2000-Apr-12: bug removed if MISSING_VALUE or FII_VALUE are not defined


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\v_struct2icg_struct.pro)


W11X8

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  w11x8

 PURPOSE:  create a window which approximates the aspect ratio of a
           8.5 x 11 piece of paper in landscape orientation

 USEAGE:   w11x8

 INPUT:    none

 KEYWORD INPUT:
  free     if set, window,/free is used to create a new window

 EXAMPLE:  

    w11x8
    plot,dist(20)   

 AUTHOR:   Paul Ricchiazzi                        03 Aug 93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\w11x8.pro)


W8X11

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  w8x11

 PURPOSE:  create a window which approximates the aspect ratio of a
           8.5 x 11 piece of paper

 USEAGE:   w8x11

 INPUT:    none

 KEYWORD INPUT:
  free     if set, window,/free is used to create a new window

 EXAMPLE:  

    w8x11
    plot,dist(20)   

 AUTHOR:   Paul Ricchiazzi                        03 Aug 93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\w8x11.pro)


WAIT_UNTIL_DAYTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  wait_until_daytime

 PURPOSE:
   This function reaturns 1 if the submitted time is reached. It waits until the time is reached.

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=wait_until_daytime(day_time,[step])

 INPUTS:
   day_time: A time string e.g. '1998-10-01 00:20:10 000'

 OPTIONAL INPUTS:
   step: the time step in seconds

 OUTPUTS:
   This function returns 1 if the submitted time is reached. It waits until the time is reached

 EXAMPLE:
   result=wait_until_daytime('1998-10-01 16:00:00 000')

 MODIFICATION HISTORY:
    Written by:  R.Bauer ICG-1, 1998-10-01
                                1998-10-01 step added
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\wait_until_daytime.pro)


WASCII

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		WASCII
 VERSION:
		4.0
 PURPOSE:
		Writes an array into an ASCII file.
 CATEGORY:
		Input/Output.
 CALLING SEQUENCE:
		WASCII, ARR, FILNAM [, keywords]
 INPUTS:
	ARR
		Array, arbitrary, no more than 8 columns.
	FILNAM
		Char. value, the name of the data file.  On VMS, Default extension
		is '.DAT'.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	HEADER
		Character array, optional, if provided, the entries are used as column
		titles.  Null string entries translate to default column headings of
		TABULATE.  If not provided, no column headers appear in the file.
	FORMAT
		Character string translating to a valid format.  If provided will apply
		to all the columns.  If not provided. the default formats of TABULATE
		are used.

		In addition, all the TABULATE keywords are available.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
		None.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The number of columns (first index of array) is limited.  See
		restrictions in TABULATE.
 PROCEDURE:
		Straightforward, using TABULATE from MIDL.  Also calls DEFAULT, and
		TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 30-MAY-1996 by Mati Meron.
		Modified 10-JUL-1997 by Mati Meron.  Name changed from WRITE_ASCII to
		WASCII, to avoid potential conflicts with future IDL releases.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\wascii.pro)


WDELETEALL

[Previous Routine] [Next Routine] [List of Routines]
 delete all windows

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\wdeleteall.pro)


WEBCALTAB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WEBCALTAB
 PURPOSE:
       Generate HTML table code for a calendar.
 CATEGORY:
 CALLING SEQUENCE:
       webcaltab, mon, yr
 INPUTS:
       mon = optional month number (def=current).           in
       yr = optional year (def=year giving nearest month).  in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=ttl  optional calendar title (short, def=none).
         CODE=code  Returned HTML table code in text array.
         LINKS=lnks Text array of Hyperlinks (one per day).
         STATUS=stat Text array with status images (one per day).
           Intended for small vertical image aligned on left.
         BORDER=brd Table border thickness (def=10).
         FSIZE=fsz  Font size (like 4, +1, ..., def=0).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: If no year is given a default year will be used.
         The default will be selected to give the nearest calendar.
         For example: If in Dec a Jan calendar is requested the
         default year will be next year.  Nov will give current
         year.
              LINKS and STATUS are arrays with one more element
         than days for requested month.  Null entries in this array
         are ignored.  Array index is month day so element 0 not
         used.
 MODIFICATION HISTORY:
       R. Sterner, 1996 May 1

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\webcaltab.pro)


WEBSHADOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WEBSHADOW
 PURPOSE:
       Add a shadow to a web page image.
 CATEGORY:
 CALLING SEQUENCE:
       webshadow, image, back
 INPUTS:
       image = name of image to shadow (GIF or JPEG).  in
       back = name of background image (GIF).          in
         Alternately background color may be given here instead:
         Give as '#rrggbb' like '#ffffff' for white, '#000000' for
         black, '#ff0000' for red, ...  Must use # at front and
         R,G,B values as 2 digit hex.
         Standard Netscape gray is '#c0c0c0'.
 KEYWORD PARAMETERS:
       Keywords:
         /IJPEG  means image is a JPEG file, else GIF.
         /COLOR  means make shadows in color, else BW.
           Gives a translucent effect.
         WIDTH=wid  Shadow size (def=5).
         BLUR=bl    Shadow blurring (def=5).
         SHADOW=sh  Shadow darkness (def=0.5).
         /JPEG   means use JPEG method to combine RGB components.
           Else use color_quan.  Sometimes JPEG is a bit better.
         /DITHER means use dithering in color combine algorithm.
       Result is displayed on the screen.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 21
	R. Sterner, 1996 Sep 20 --- Added TRANS=trans.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\webshadow.pro)


WEBTILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WEBTILE
 PURPOSE:
       Generate a Netscape web page background tile.
 CATEGORY:
 CALLING SEQUENCE:
       webtile, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         INIT=[nx,ny]  Set tile size in pixels.
         COLOR=clr    Curve color (def=!p.color).
         FILL=fclr    If given fill polygon x,y.
         THICK=thk    Curve thickness (def=!p.thick).
         LINESTY=sty  Curve linestyle (def=!p.linestyle).
         /NOTES       List notes on making Netscape backgrounds.
 OUTPUTS:
 COMMON BLOCKS:
       webtile_com
 NOTES:
       Notes:
         Point coordinates are pixels into tile from lower
         left corner.  Curve gets repeated a total of 9 times
         so that tile edges match.  When all curves have been
         plotted resulting image may be modified in some way
         (like topo shading) and then an nx x ny patch read
         back from anywhere in the plotted area.  This patch
         may be used as a background tile.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Nov 20

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\webtile.pro)


WEB_BACK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WEB_BACK
 PURPOSE:
       Generate a random web background.
 CATEGORY:
 CALLING SEQUENCE:
       web_back, h, s, v
 INPUTS:
       h = [h1,h2] min and max hue.       in
       s = [s1,s2] min and max sat.       in
       v = [v1,v2] min and max val.       in
 KEYWORD PARAMETERS:
       Keywords:
         SMOOTH=sm  Smoothing window size (def=3) which
           gives a fine grained pattern.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: makes a 100 x 100 pixel background image
         with a random s[eckle pattern that tiles
         seamlessly.
 MODIFICATION HISTORY:
       R. Sterner, 1997 Oct 13

 Copyright (C) 1997, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\web_back.pro)


WEEKDAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WEEKDAY
 PURPOSE:
       Compute weekday given year, month, day.
 CATEGORY:
 CALLING SEQUENCE:
       wd = weekday(y,m,d,[nwd])
 INPUTS:
       y, m, d = Year, month, day (Like 1988, 10, 31).      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       wd = Returned name of weekday.                       out
       nwd = optional Weekday number.                       out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 31 Oct, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\weekday.pro)


WGS_84

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WGS_84
 PURPOSE:
       Return a structure with some WGS 84 Ellipsoid values.
 CATEGORY:
 CALLING SEQUENCE:
       s = wgs_84()
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         LAT=lat  Specified latitude in degrees (def=0).
 OUTPUTS:
       s = returned structure:              out
         s.a = semi-major axis (m).
         s.b = semi-minor axis (thru N-S pole) (m).
         s.f1 = Reciprocal of flattening.
         s.lat = Latitude for returned radius (deg).
         s.r = Radius at given latitude (m).
         s.d2m_lat = Meters/deg of lat at given lat (m).
         s.d2m_lon = Meters/deg of lon at given lat (m).
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1998 Nov 2

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\wgs_84.pro)


WHELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WHELP
 PURPOSE:
       Widget to display given help text.
 CATEGORY:
 CALLING SEQUENCE:
       whelp, txt
 INPUTS:
       txt = String array with help text to display.  in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=tt  Help window title text (def=none).
         LINES=lns maximum number of lines to display
           before added a scroll bar (def=30).
         EXIT_TEXT=txt Exit button text (def=Quit help).
         WID=id  returned widget ID of help widget.  This
           allows the help widget to be automatically
           destroyed after action occurs.
         GROUP_LEADER=grp  Assign a group leader to this
           widget.  When the widget with ID grp is destroyed
           this widget is also.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 29 Sep, 1993
       R. Sterner, 18 Oct, 1993 --- Added LINES and event handler.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\whelp.pro)


WHERE_INDICES_NOT_EQUAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	where_indices_not_equal

 PURPOSE:
   This function finds the non equal indices of two arrays

 CATEGORY:
   MATH


 CALLING SEQUENCE:
   Result=where_indices_not_equal(master,client)

 INPUTS:
   master: An array of different indices starting by 0
   client: An array of differnet indices

 OUTPUTS:
   This function returns an array with the non equal values

 EXAMPLE:
   print,where_indices_not_equal([0,1,2,3,4,5],[2,3])
         0       1       4       5

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jun-13
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\where_indices_not_equal.pro)


WHERE_IS_PARAMETER_MONOTONIC_INCREASING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  where_is_parameter_monotonic_increasing

 PURPOSE:
  This functions returns the indices of a parameter which belonging data are montonic increasing

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=where_is_parameter_monotonic_increasing(param)

 INPUTS:
   param: a vector of data, eg. icg_struct.time.param

 EXAMPLE:
    result=where_is_parameter_monotonic_increasing(param)

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1),  1999-Jun-22

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\where_is_parameter_monotonic_increasing.pro)


WHERE_IS_PARAMETER_NOT_MONOTONIC_INCREASING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  where_is_parameter_not_monotonic_increasing

 PURPOSE:
  This functions returns the near indices of a parameter which belonging data are not increasing

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=where_is_parameter_not_monotonic_increasing(param)

 INPUTS:
   param: a vector of data, eg. icg_struct.time.param

 EXAMPLE:
    result=where_is_parameter_not_monotonic_increasing(param)

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1),  1999-Jun-22
  2000-Jun-14 : bug removed if n_elements(param) eq 1

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\where_is_parameter_not_monotonic_increasing.pro)


WHERE_NEGZERO()

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
      WHERE_NEGZERO()

 PURPOSE:      
      Find positions of IEEE -0.0 values.

 EXPLANATION : 
       Finds the positions of all values within an array that correspond to the
       IEEE value -0.0, as determined from the bit pattern.  Prior to IDL V5.1,
       the VMS operating system had trouble coping with these values.  If using
       any other operating system, then no action is performed.

 CALLING SEQUENCE:     
       Result = WHERE_NEGZERO( ARRAY [, COUNT, /QUIET ] )

 INPUTS:       
       ARRAY   = Array to test against the IEEE -0.0 value.  Must be
               either floating point or double-precision.

 OUTPUTS:      
       The result of the function is the indices of all values of
       ARRAY corresponding to the IEEE -0.0 value, similar to the IDL
       WHERE function.

 OPTIONAL  OUTPUT:     
       COUNT   = Number of values found corresponding to IEEE -0.0.

 OPTIONAL INPUT KEYWORD:       
       /QUIET  = If set, then warning messages are not printed out.

 RESTRICTIONS: 
       ARRAY must be of type float or double-precision.

 SIDE EFFECTS: 
       If no -0.0 values are found, or if ARRAY is not of type float,
       or double precision, or if the operating system is something
       other than VMS, then -1 is returned, and COUNT is set to 0.

 REVISION HISTORY:
       Written,  31-Jan-1997, William Thompson, GSFC
        Converted to IDL V5.0   W. Landsman   September 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\where_negzero.pro)


WHERINSTRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		WHERINSTRUCT
 VERSION:
		4.0
 PURPOSE:
		Finding fields within a structure.
 CATEGORY:
		Programming.
 CALLING SEQUENCE:
		Result = WHERINSTRUCT( TAGNAM, STRUCTNUM [, COUNT] [,TAGS = TNAM])
 INPUTS:
	TAGNAM
		Character variable or constant.
	STRUCTNUM
		Name of a structure variable.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	TAGS
		Optional output, see below.
 OUTPUTS:
		If STRUCTNAM exists, is a structure, and has one or more tag names
		which match with TAGNAM, The return is a numeric (long integer) array
		which includes the indices of the matching fields (similar to the
		output of WHERE.  In all other cases the output is -1.
 OPTIONAL OUTPUT PARAMETERS:
	COUNT
		Same as in WHERE, returns the number of matches found.
	TAGS
		Accepts the name of the variable in which the names of the matching
		fields are returned as a string array.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		None.
 PROCEDURE:
		Uses the system routine TAG_NAMES to find all the tag names of the
		structure, and then uses STRMATCH_MM from MIDL to match these names
		with the input TAGNAM.  The number of characters in TAGNAM determines
		the number of characters used in the match.  For example, if
		TAGNAM = 't' then all the names starting with 't' will be picked but if
		TAGNAM = 'thor' then only those starting with 'thor' will be noticed.
		Calls STRMATCH_MM and TYPE from MIDL.
 MODIFICATION HISTORY:
		Created 15-JUN-1995 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\wherinstruct.pro)


WHICH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
              which

 PURPOSE:     Prints a list of all directory pathnames which match a
              given idl procedure name.  The directory precedence is
              set by the system variable !path.  The file name may
              contain any wild card characters understood by the
              operating system.  In the case that a given procedure
              is found in more than one directory, the first listed
              pathname is the one compiled by the IDL interpreter in
              response to a .run statement.

 USEAGE:      which,filename

 INPUT:
   filename   name of idl procedure (may include wild cards)

 KEYWORD INPUT:  none

 OUTPUT:         none

 EXAMPLE:
               which,'str*'  ; produces this output:

               /home/paul/idl/esrg/strip_fn.pro
               /home/paul/idl/esrg/strmatch.pro
               /home/paul/idl/esrg/strpack.pro
               /home/paul/idl/esrg/strwhere.pro
               /local/idl/lib/color/stretch.pro
               /local/idl/lib/prog/str_sep.pro


 AUTHOR:   Paul Ricchiazzi                        19 Nov 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\which.pro)


WHICH_INDICES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  which_indices

 PURPOSE:
   The result of this function is an indexfield where in master array client array is given

 CATEGORY:
   PROG_TOOLS

 CALLING SEQUENCE:
   Result=whicht_indices(master,client, [/no_sort])

 INPUTS:
   master:    The array of the master
   client:  The array of the client

 KEYWORD PARAMETERS:
   no_sort: result indices are not sorted and not uniqued

 OUTPUTS:
   Result is a vector holding the indices of master which values are equal to values from client

 EXAMPLE:
  result=which_indices([10,2,3,20,4,12],[10,20,30])
  print,result
    0           3

 MODIFICATION HISTORY:
 Written by: R.Bauer (ICG-1) , 1998-Sep-28
 1999-04-03 keyword no_sort added
 2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\which_indices.pro)


WHOAMI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WHOAMI
 PURPOSE:
       Returns to the calling routine its directory and name.
 CATEGORY:
 CALLING SEQUENCE:
       whoami, dir, file
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         LINE=n  Line number just after where whoami was called.
 OUTPUTS:
       dir = Source directory of calling routine.   out
       file = name of calling routine.              out
 COMMON BLOCKS:
 NOTES:
       Notes: It can be useful for a routine to know
         what directory it is located in.  This allows
         it to reference auxiliary files in the same
         directory without needed any special environmental
         variables defined.  The file name returned here is
         less important since it could always be hardwired
         into the calling routine itself, but this technique
         allows this to be avoided for more reusable code.
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 11

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\whoami.pro)


WHOCALLEDME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WHOCALLEDME
 PURPOSE:
       Returns to calling routine its parent's directory and name.
 CATEGORY:
 CALLING SEQUENCE:
       whocalledme, dir, file
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         LINE=n  Line number just after parent's last call.
         BACK=n  Look back, 0=self, 1=parent (def),
           2=grandparent, 3=great grandparent, ...
 OUTPUTS:
       dir = Source directory of parent routine.   out
       file = name of parent routine.              out
 COMMON BLOCKS:
 NOTES:
       Notes: It can be useful for a routine to know
         what routine called it.
         See also: whoami.
 MODIFICATION HISTORY:
       R. Sterner, 1995 May 23

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\whocalledme.pro)


WIDGET_CENTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     WIDGET_CENTER

 PURPOSE:
     Center an widget on the screen, or over an existing widget.

 CATEGORY:
     Widgets.

 CALLING SEQUENCE:
     WIDGET_CENTER, ID

 INPUTS:
     ID        ID of the widget to be centered.

 KEYWORD PARAMETERS:
     PARENT    ID of an existing widget over which
               the widget should be centered.

 OUTPUTS:
     None.

 EXAMPLE:
base = widget_base()
label = widget_label(base, value='Hello world')
widget_center, base
widget_control, base, /realize

 MODIFICATION HISTORY:
 Written by:   Liam.Gumley@ssec.wisc.edu
 $Id: widget_center.pro,v 1.2 1999/11/15 22:58:27 gumley Exp $

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\widget_center.pro)


WIDGET_EDIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        WIDGET_EDIT

 PURPOSE:
        creates a simple text editor with an OK and Cancel button
        and handles the events of this widget. Additional buttons 
        can be added via keywords.

 CATEGORY:
        general purpose widgets - modal widgets

 CALLING SEQUENCE:
        dlg = WIDGET_EDIT(parent, [keywords])

 INPUTS:
        PARENT --> widget ID of the parent widget

 KEYWORD PARAMETERS:
        TITLE --> window title for the editor window (default blank)

        TEXT --> initial text in the editor window (string array)

        PROMPT --> a prompt string for single line text fields. If
             this keyword is provided, the line length will be reduced
             by the length of prompt.

        YOFFSET --> position of the editor base widget.

        XSIZE --> default line length o fthe input field/text window.
             If a prompt i ssupplied, then this length will be reduced.
             Default value is 80 characters.

        LINES --> number of lines in edit line/text window. If not given,
             the vertical extent of the text field will be determined by
             the number of lines in TEXT (limited to 8..60). The maximum
             limit of LINES is 60.

        /NO_EDIT --> set this keyword to prevent editing of the text.

        EXTRABUTTONS --> a string array with optional additional button
             labels. OK (result=1) and Cancel (result=0) will be set
             automatically. The extra buttons wil return values starting
             from 2.

        GROUP_LEADER --> if this widget shall be used as a simple display
             window, you can specify a GROUP_LEADER (= widget-ID of a 
             dialog box). The window will then disappear as soon as the
             dialog box is closed. NOTE: the OK and Cancel buttons will
             not be shown in this case.

 OUTPUTS:
        widget_edit returns a widget ID of the editor. For implementation
        see example below.

 SUBROUTINES:
     WEDIT_EVENT --> handles editor events. Reacts only to OK or Cancel.

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
     create an edit dialog for a text array called comments
     and analyze results. Overwrite array contents only if 
     OK was pressed and a non-empty editor window is returned.

     dlg = widget_edit(title='Edit comments',text=comments)
     widget_control,dlg,/realize
     event = widget_event(dlg)
     if(event.value eq 1) then begin
         newcomments = event.info
         if (n_elements(newcomments) gt 1 OR newcomments(0) ne '') then $
              comments = newcomments
     endif
     widget_control,event.top,/destroy

 MODIFICATION HISTORY:
        mgs, 01 Dec 1997: VERSION 1.00
        mgs, 21 Dec 1997: - added group_leader keyword
        mgs, 08 Aug 1998: - added a couple of keywords, now makes
              w_simpleedit and XDisplayfile obsolete.
           - also handles more than one input field now if prompt 
             is given
        mgs, 29 Apr 1998: 
           - now modal widget, following example in D. Fanning's
             book, now uses xmanager internally

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\widget_edit.pro)


WIGGLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
		WIGGLINE
 VERSION:
		4.0
 PURPOSE:
		Draws a "wiggly line" (a sinusoid, to be exact) in the current plot
		area, from the FROM to the TO location (with a possible modification
		due to PHASE .  DATA coordinates are used, unless one of the keywords
		/DEVICE or /NORMAL is set.  Alternatively, a *SHAPE* representation
		(see SHAPE_VER) for definition) of the wiggly line may be returned
		through the SHAPEOUT keyword.  DATA coordinates are used unless one
		of the keywords /DEVICE or /NORMAL is set.
 CATEGORY:
		General Graphics.
 CALLING SEQUENCE:
		WIGGLINE, FROM = tail, TO = head [, keywords]
 INPUTS:
		None.
 OPTIONAL INPUT PARAMETERS:
		None.
 KEYWORD PARAMETERS:
	FROM
		Two dimensional vector, start location, mandatory.
	TO
		Two dimensional vector, end location, mandatory.
	PERIODS
		Scalar, specifies number of wiggle periods.  Default value is 1.  Note
		that if PERIODS isn't integer or half integer, the curve may miss the
		point provided by TO.
	AMPLITUDE
		Scalar, specifies amplitude of oscillation, relative to
		period_length/2*pi.  Default value is 1.
	PHASE
		Scalar, provides a phase offset, in fractions of a cycle. Default is 0.
		Note that when the phase is not 0, the curve may be offset from the
		points provided by FROM and TO.
	/EXACT
		Switch.  If set, PERIODS and PHASE are rounded to the nearest half-
		integer, assuring that the curve will pass through both FROM and TO.
	/DEVICE
		Standard IDL plotting interpretation.
	/NORMAL
		Ditto.
	/NO_SHOW
		Switch.  If set, no plotting is done, but the shape is generated and
		may be returned through SHAPEOUT.
	SHAPEOUT
		Optional output, see below.
	_EXTRA
		A formal keyword used to pass all plotting keywords.  Not to be used
		directly.
 OUTPUTS:
		None.
 OPTIONAL OUTPUT PARAMETERS:
	SHAPEOUT
		When provided with the name of a variable, on return the variable
		contains the *SHAPE* representation of the wiggly line.
 COMMON BLOCKS:
		None.
 SIDE EFFECTS:
		None.
 RESTRICTIONS:
		The keywords passed through _EXTRA are transferred to the PLOTS
		routine.  No keyword verification is performed by WIGGLINE.
 PROCEDURE:
		Uses DEFAULT, MAKE_GRID, ONE_OF, SHAPE_COCON and VNORM from MIDL.
		All the coordinates are converted to DEVICE coordinates for shape
		generation and plotting purposes.
 MODIFICATION HISTORY:
		Created 1-SEP-1999 by Mati Meron.
		Checked for operation under Windows, 30-JAN-2001, by Mati Meron.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\midl_lib\wiggline.pro)


WILD_CARD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      wild_card

 PURPOSE:
   The wild card function returns a string array containing the string matching to a wild card search string
   Following search definitions are defined: part_of_word*, *part_of_word, word

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=wild_card(text,search)

 INPUTS:
  text:   a string or array
  search: the search string


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-May-28

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\wild_card.pro)


WIND2POLAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   wind2polar

 PURPOSE:
   This functions calculates the wind speed and direction from ux and uy

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = wind2polar(ux, uy)

 INPUTS:
   ux:     wind speed in N-S direction (scalar or vector)
   uy:     wind speed in E-W direction (scalar or vector)

 KEYWORD PARAMETERS:
   DEGREES:    if this keyword is set the result is in degrees instead of radians

 OUTPUTS:
   This function returns the wind speed and direction

 PROCEDURE:
   This function converts the data from the Metek ultrasonic anemometer (ux, uy)
   into the respective speed and direction. The sign convention:
   ux  > 0   from N to S
   uy  > 0   from W to E
   dir = 0   from N
   dir = 90  from E

 EXAMPLE:
   ux=[1. , 1. , 0.,-1.,-1.,-1., 0., 1.]
   uy=[0.,  1. , 1., 1., 0.,-1.,-1.,-1.]
   print, wind2polar(ux,uy, /deg)
   IDL>
       1.41421      1.41421      1.41421      1.41421
        45.0000      135.000      225.000      315.000

 MODIFICATION HISTORY:
   Written by: Theo Brauers

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\wind2polar.pro)


WINDDIR1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   winddir1

 PURPOSE:
   This functions calculates the wind direction from ux and uy

 CATEGORY:
   MATH

 CALLING SEQUENCE:
   Result = winddir1(ux, uy)

 INPUTS:
   ux:     wind speed in N-S direction (scalar)
   uy:     wind speed in E-W direction (scalar)


 OUTPUTS:
   This function returns the win direction in radians

 EXAMPLE:
  ux=1. & uy=1.
  print, 180./!pi*winddir1(ux, uy)

 MODIFICATION HISTORY:
   Written by: Theo Brauers

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\winddir1.pro)


WINDOW2FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   window2file

 PURPOSE:
   This routine makes a screen dump into a gif file

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   window2file, name

 INPUTS:
   name: the name for the gif file

 KEYWORD PARAMETERS:
   JPEG: if this keyword is set create JPEG file
   GIF:  if this keyword is set create GIG file
       you must provide at least one keyword

 EXAMPLE:
   window2file, 'test'

 MODIFICATION HISTORY:
   Written by: Theo Brauers

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\window2file.pro)


WINDOWIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   WINDOWIMAGE

 PURPOSE:

       The purpose of this routine is to demonstrate how to interactively
       adjust the contrast and brightness (also called the window and level)
       of an image.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

       Graphics, Widgets.

 CALLING SEQUENCE:

       WINDOWIMAGE, image

 INPUTS:

       image:    A 2D image array. Typically, the image will be a 16-bit medical
                 image of some type. If this parameter is not present, a 16-bit
                 dicom image from the examples/data directory will be selected.

 KEYWORD PARAMETERS:

       COLORTABLE:    The index of an IDL-supplied color table to load. Gray-scale by default.


 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       None.

 RESTRICTIONS:

       The TVIMAGE and COLORBAR__DEFINE programs from the Coyote Library are
       required to run this program:

          http://www.dfanning.com/programs/tvimage.pro
          http://www.dfanning.com/programs/colorbar__define.pro

 EXAMPLE:

       To display a 16-bit medical image, type:

       IDL> WINDOWIMAGE

 MODIFICATION HISTORY:

       Written by: David Fanning, 7 November 2001.
       Modified the windowing algorithm to keep the window within
          the data range. Added colorbar and pixmap for smoother
          updating. 18 Nov 2001. DWF.
       Fixed a small problem with object cleanup. Added window and
          level readouts, window resizing. 23 Nov 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\windowimage.pro)


WINFULL

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  winfull

 PURPOSE:  create full screen window 

 USEAGE:   winfull

 INPUT:    

 KEYWORD INPUT:

 OUTPUT:

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

 AUTHOR:   Paul Ricchiazzi                        30 May 96
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\winfull.pro)


WINMEN

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  winmen

 PURPOSE:  set up a graphics window based button menu

 USEAGE:   winmen,nbt,blab        ; set up button window
           winmen_ev,nbt,ibt,mbt  ; receive button values

 INPUT:    

  nbt      number of buttons

 Optional INPUT:

  blab     button labels

 KEYWORD INPUT:

 OUTPUT:
  ibt      return value of selected button
  mbt      mouse button used to select menu button, lmb=1, mmb=2,  rmb=4

 DISCUSSION:

 LIMITATIONS:

 COMMON BLOCKS:

 SIDE EFFECTS:
  
 EXAMPLE:  

        winmen,3,['one','two','three']
        winmen_ev,3,ibt & print,ibt

 AUTHOR:   Paul Ricchiazzi                        12 Feb 99
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\winmen.pro)


WIN_COPY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WIN_COPY
 PURPOSE:
       Copies graphics from a hidden window to the target window.
 CATEGORY:
 CALLING SEQUENCE:
       win_copy
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
       win_redirect_com
 NOTES:
       Note: Call WIN_REDIRECT, then do graphics commands.
       The graphics will be sent to a hidden window.
       This routine will then move the hidden window to the
       target window and disable graphics redirection.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 11

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\win_copy.pro)


WIN_OPEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WIN_OPEN
 PURPOSE:
       Test if a given window is open.
 CATEGORY:
 CALLING SEQUENCE:
       state = win_open(win)
 INPUTS:
       win = Window ID to check.   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       state = state of win:       out
               0=not open, 1=open.
 COMMON BLOCKS:
 NOTES:
       Note: If window is open then it is available
         for use, otherwise it is not.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 15

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\win_open.pro)


WIN_REDIRECT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WIN_REDIRECT
 PURPOSE:
       Redirects all graphics to a hidden window.
 CATEGORY:
 CALLING SEQUENCE:
       win_redirect
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /STATUS lists available hidden windows and sizes.
         /CLEANUP deletes all hidden windows.
         /OFF means disable window redirection.
         /ON means enable window redirection (default).
           Turning off redirection is an easy way to see the
           effects of redirection.
 OUTPUTS:
 COMMON BLOCKS:
       win_redirect_com
 NOTES:
       Note: resets from current window to new hidden window
       of same size.  All graphics following go to the hidden
       window.  Use WIN_COPY to move the hidden window to the
       target window and disable graphics redirection.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 11
       R. Sterner, 1999 Aug 16 --- Added disable/enable options.

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\win_redirect.pro)


WITHIN_BRACKETS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   within_brackets

 PURPOSE:
   This function returns the string between brackets

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
   Result = WITHIN_BRACKETS(String, [BRACKETS=[b1,b2]], [/FIRST], [REMAIN=r])

 INPUTS:
   String:  Input string or string array

 KEYWORD PARAMETERS:
   BRACKETS:   string array of 2 elements with the delimiter
               if not given ['[', ']'] is default
   FIRST:      if this keyword is set the first occurence of the second delimiter is
               seached, default is the last occurence
   REMAIN:     if assigned to a named variable, the remaining part is returned

 OUTPUTS:
   This function returns the string or string array of the text
   between the delimiters

 EXAMPLE:
   str=['{t}est[123]=5', 'test{[123456]}={1}']
   print, transpose(within_brackets(str))
   IDL prints:
       123
       123456
   print, transpose(within_brackets(str, brackets=['{','}']))
   IDL prints:
       t
       [123456]}={1
   print,within_brackets('a{{[bc]}}[acg]}}d', remain=r, /FIRST, brackets=['{{','}}']) & print, r
       [bc]
       [acg]}}d

   IDL prints:
 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1998-JAN-6
   Modified    T.B. finds now [ from left and ] from right
   Modified    T.B. if no brackets found in string empty string is returned
   Modified    T.B. Oct 1998 new keywords Remain and first
   Modified    T.B. bug with only one identifier not found removed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\within_brackets.pro)


WITHIN_DELIMITER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	within_delimiter

 PURPOSE:
	This function returns the string within the outermost matching pair of delimiters

 CATEGORY:
   PROG_TOOLS/STRINGS

 CALLING SEQUENCE:
	result = within_delimiter(string)

 INPUTS:
	string:  Input string or string array

 KEYWORD PARAMETERS:
	DELIMITER = delimiter: string array of 2 elements with the
		opening and closing delimiter (default: ['[', ']']).
	HEAD = head: If set to a named variable, the part of the string which
		proceeds the opening delimiter will be returned.
	TAIL = tail: If set to a named variable, the part of the string which
		follows the closing delimiter will be returned.
	/RIGHT2LEFT: If set the string is evaluated from right to left
		(default: evaluate string from left to right)
	ERROR = err: If set to a named variable an error flag is returned
		(err = 0: no error, err = 1: error)
	REMAIN = remain: Same as tail; inserted for downward compatibility with within_brackets.
		Do not use this keyword since it will be removed again (e.g. use TAIL = tail instead).

 OUTPUTS:
	This function returns the string or string array of the text
	between the delimiters. If there are no delimiters in the string
	the null string is returned. In that case the original string will be
	returned in the optional keyword parameter HEAD = head.

 RESTRICTIONS:
	This routine handles only 1-char wide delimiters.

 EXAMPLE:
	string = 'AB[CD]F'
	HELP, within_delimiter(string, HEAD = head, TAIL = tail), head, tail
		    STRING    = 'CD'
		HEAD            STRING    = 'AB'
		TAIL            STRING    = 'F'

	string = '[A]B[CD]F'
	HELP, within_delimiter(string, HEAD = head, TAIL = tail), head, tail
		    STRING    = 'A'
		HEAD            STRING    = ''
		TAIL            STRING    = 'B[CD]F'

	string = '[A]B[CD]F'
	HELP, within_delimiter(string, HEAD = head, TAIL = tail, /RIGHT2LEFT), head, tail
		    STRING    = 'CD'
		HEAD            STRING    = '[A]B'
		TAIL            STRING    = 'F'

	string = 'Q[[A]BCD]'
	HELP, within_delimiter(string, HEAD = head, TAIL = tail), head, tail
		    STRING    = '[A]BCD'
		HEAD            STRING    = 'Q'
		TAIL            STRING    = ''

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 12.11.1999
	16.11.1999:	Added keyword parameter REMAIN = remain
	02.03.2000:	If str does not include delimiters, head will hold str on return.
	28.03.2000: Removed bug if /RIGHT2LEFT was set and no delimiter was found.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\within_delimiter.pro)


WMENU2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WMENU2
 PURPOSE:
       Like wmenu but allows non-mouse menus. Uses widgets if available.
 CATEGORY:
 CALLING SEQUENCE:
       i = wmenu2(list)
 INPUTS:
       list = menu in a string array.        in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=t  item number to use as title (def = no title).
         INITIAL_SELECTION=s  initial item selected (=default).
         /NOMOUSE   forces no mouse mode.
         /NOWIDGETS forces no widget mode.
 OUTPUTS:
       i = selected menu item number.        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 22 May 1990

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\wmenu2.pro)


WOPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WOPLOT

 PURPOSE:
       Overplots X,Y data in a resizeable, zoomable WPLOT window. If a call
       to WPLOT has not yet occurred, WOPLOT calls WPLOT.

 CATEGORY:
       Direct Graphics

 CALLING SEQUENCE:
       WOPLOT, X, Y

 INPUTS:
       X: abscissa data
       Y: ordinate data

 KEYWORD PARAMETERS:
       All the keywords allowed in the OPLOT command

 OUTPUTS:
       None

 COMMON BLOCKS:
       WPLOT_COMM: This common block contains the state and data pointers.

 SIDE EFFECTS:
       This routine will no longer work if the command
         PTR_FREE, PTR_VALID()
       is used, either on the command line or in any application programs.

 RESTRICTIONS:
       Cannot use the command
         PTR_FREE, PTR_VALID()
       anywhere when WPLOT windows are active.

 PROCEDURE:
       The data displayed in the WPLOT window, and the associated PLOT keywords used, are
       stored in a linked list for each WPLOT window. Each linked list is accessed
       through a data pointer array. The state information for each window is stored
       in a structure array. Both of these arrays are accessed via pointers in a
       common block.

 EXAMPLE:
       x = findgen(100)
       y = x
       wplot, x, y
       woplot, x, 0.01*y^2, color = 20
       woplot, x, 10.0*sqrt(y), color = 80

 MODIFICATION HISTORY:
 	Written by:     Paul van Delst, CIMSS/SSEC, 26-Nov-1997

 $Author: paulv $
 $Date: 1997/11/28 17:27:52 $
 $Id: woplot.pro,v 1.4 1997/11/28 17:27:52 paulv Exp $
 $Log: woplot.pro,v $
 Revision 1.4  1997/11/28 17:27:52  paulv
 Renamed X,Y parameters to allow overplotting of only Y data.

 Revision 1.3  1997/11/26 17:03:03  paulv
 Added X,Y parameter checks.

 Revision 1.2  1997/11/26 16:45:38  paulv
 Removed WPLOT_CREATE_GUI call. The condition that would lead
 to this call should *never* occur. However, we shall see.....
 Call replaced with an error message and a STOP command.

 Revision 1.1  1997/11/26 16:09:42  paulv
 Initial revision


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\vandelst\woplot.pro)


WORDARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WORDARRAY
 PURPOSE:
       Convert text string or string array to 1-d array of words.
 CATEGORY:
 CALLING SEQUENCE:
       wordarray, instring, outlist
 INPUTS:
       instring = string or string array to process.  in
 KEYWORD PARAMETERS:
       Keywords:
         IGNORE=string of characters to ignore (array allowed).
           These characters are removed before processing.
           Ex: wordarray,in,out,ignore=',;()'
               wordarray,in,out,ignore=[',',';','(',')']
         DELIMITERS = word delimiter characters, like IGNORE.
         /WHITE means include white space (spaces,tabs) along
           with the specified delimiters.
         NUMBER=num Number of elements in returned array.
 OUTPUTS:
       outlist = 1-d array of words in instring.      out
 COMMON BLOCKS:
 NOTES:
       Notes: Words are assumed delimited by given delimiters
        (defaults are spaces and/or tabs)
        Non-delimiters are returned as part of the words.
        Delimiters not needed at the front and end of the strings.
        See commalist for a near inverse.
 MODIFICATION HISTORY:
       R. Sterner, 29 Nov, 1989
       BLG --- Modified June 22,1991 to include tabs as delimiters
       R. Sterner, 11 Dec, 1992 --- fixed to handle pure white space.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.
       R. Sterner, 1998 Apr 1 --- Added DELIMITER.  Modified IGNORE.
       R. Sterner, 1998 Jul 31 --- Added NUMBER=nwds.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\wordarray.pro)


WORDORDER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WORDORDER
 PURPOSE:
       Re-arrange words in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       NEW = WORDORDER( OLD, ORDER)
 INPUTS:
       OLD = input text string. Words delimited by spaces.   in
       ORDER = array of word numbers.  Indicates             in
               order of words in NEW.
 KEYWORD PARAMETERS:
 OUTPUTS:
       NEW = resulting text string.  Any multiple spaces     out
             will be squeezed to single spaces.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  29 Oct, 1986.
       R. Sterner 27 Dec, 1989 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\wordorder.pro)


WORDPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WORDPOS
 PURPOSE:
       Gives word number in a reference string for a search word.
 CATEGORY:
 CALLING SEQUENCE:
       l = wordpos(ref,s)
 INPUTS:
       ref = reference string of words.                            in
       s = word to find in ref.                                    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       l = word number in ref where s was found. 0 is first word.  out
         -1 means not found.
 COMMON BLOCKS:
 NOTES:
       Notes: Example: wordpos('JAN FEB MAR APR MAY JUN', 'MAY') is 4. 
 MODIFICATION HISTORY:
       R. Sterner. 20 Aug, 1986.
       R. Sterner, 27 Dec, 1989 --- converted to SUN.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\wordpos.pro)


WORLD_SUNZD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WORLD_SUNZD
 PURPOSE:
       Compute Sun zenith distance for an array of world points.
 CATEGORY:
 CALLING SEQUENCE:
       zd = world_sunzd(time, res)
 INPUTS:
       time = time string (null strring = current time). in
       res = resolution in degrees fro lat and long.     in
 KEYWORD PARAMETERS:
       Keywords:
         ZONE=hrs  Hours ahead of GMT (def=0).  Ex: zone=-4 for EDT.
         SUNLNG=sunlng  Returned subsolar longitude.
         SUNLAT=sunlat  Returned subsolar latitude.
 OUTPUTS:
       zd = Returned zenith distance array in degrees.   out
         zd covers longitudes -180 to (+180-res) and
                   latitudes   -90 to (+90-res).
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1999 Oct 14

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\world_sunzd.pro)


WPLOT

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

 (C) Cooperative Institute for Meteorological Satellite Studies, 1997

 NAME:
       wplot

 PURPOSE:
       Plots X,Y data in a resizeable, zoomable graphics window. To zoom in
         press the LEFT mouse button and drag the rubber-band box over the region
         of interest. To return to the original plotting limits, press the RIGHT
         mouse button.
       An output menu bar allows the user to output the current plot as a PostScript
         file named wplot.ps.

 CATEGORY:
       Graphics

 CALLING SEQUENCE:
       wplot, x, y, new = new

 INPUTS:
       x: abscissa data
       x: ordinate data

 KEYWORD PARAMETERS:
       All the keywords allowed in the PLOT command

       new: Set this keyword to create a new WPLOT window rather than reusing
            an existing one.

 OUTPUTS:
       None (yet)

 COMMON BLOCKS:
       WPLOT_COMM: This common block contains the state and data pointers.

 SIDE EFFECTS:
       - This routine will no longer work if the command
           PTR_FREE, PTR_VALID()
         is used, either on the command line or in any application programs.
       - The graphics device is changed, if required, to allow WPLOT windows
         to be opened.
       - The !P.MULTI system variable is set to 0.
       - If the XSTYLE and YSTYLE keywords are not used on logarithmic plots,
         zooming in will only occur for decadal intervals.

 RESTRICTIONS:
       - Cannot use the command
           PTR_FREE, PTR_VALID()
         anywhere when WPLOT windows are active...at least if you want the WPLOT
         windows to keep working.
       - Cannot have more than one plot to a window, i.e. !P.MULTI must = 0

 PROCEDURE:
       The data displayed in the WPLOT window, and the associated PLOT keywords used, are
       stored in a linked list for each WPLOT window. Each linked list is accessed
       through a data pointer array. The state information for each window is stored
       in a structure array. Both of these arrays are accessed via pointers in a
       common block.

 EXAMPLE:
       x = findgen(100)
       y = x
       wplot, x, sqrt(y)

 MODIFICATION HISTORY:
 	Written by:     Paul van Delst, CIMSS/SSEC, 25-Nov-1997
                       paul.vandelst@ssec.wisc.edu

 $Revision: 1.11 $


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\vandelst\wplot.pro)


WRITEDATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        WRITEDATA

 PURPOSE:
        write a 2 dimensional data array and header information to a file

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        WRITEDATA,FILENAME,DATA [,HEADER,UNITS,CFACT,MCODE] [,keywords]

 INPUTS:
        FILENAME --> the name of the output file. If the output file
            exists, the user will be prompted for a new name unless
            keyword NO_WARN is set.

        DATA --> The data array to be written.

        HEADER --> An optional string array containing variable names.
            These will be composed to a string using the DELIM delimiter.
            Note that the HEADER information can also be passed in the
            pre-formatted COMMENTS keyword parameter.

        UNITS, CFACT, MCODE --> string arrays that will be added to the
            file header concatenated with blank delimiters. These parameters
            are optional and merely there to facilitate creating chem1d
            model input files.

 KEYWORD PARAMETERS:
        TITLE --> A title string that will be the first header line.
            It is also possible to pass a string array here, although for
            more complicate file headers it is recommended to pre-format
            the file header and pass it in the COMMENTS keyword.

        DELIM --> A delimiter character for the HEADER (variable name)
            items. Default is a blank ' '.

        COMMENTS --> A string array containing all the lines of the file
            header. Note that COMMENTS overrules the input of HEADER, UNITS,
            CFACT, and MCODE as well as TITLE.

        /NO_WARN --> Suppress warning message and user prompt for a new
            filename if the file already exists.

 OUTPUTS:
        A file containing a file header and the data array written
        line by line.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
        DATA = findgen(3,10)
        HEADER = ['A','B','C']
        writedata,'test.out',DATA,HEADER,TITLE='test file',DELIM=';'

        This will create a file like:
            test file
            A;B;C
                  0.00000      1.00000      2.00000
                  3.00000      4.00000      5.00000
            ...

 MODIFICATION HISTORY:
        mgs, 25 Nov 1997: VERSION 1.00
        mgs, 05 Apr 1999: - now uses formatted write statement
                 (looks like a bug in IDL for windows: sometimes no space
                  is printed between numbers if you simply
                  print,data)
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\writedata.pro)


WRITE_BDT0001

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        WRITE_BDT0001

 PURPOSE:
        Write a binary data file with size information and
        variable names and units.
        Note: I would now suggest to use netcdf instead or
        Liam Gumley's simpler binwrite/binread.

 CATEGORY:
        File I/O

 CALLING SEQUENCE:
        WRITE_BDT0001,filename,data,vardesc[,keywords]

 INPUTS:
        FILENAME -> Name of the file to write or a file mask
            which will be used in the PICKFILE dialog. If the 
            filemask is a named variable, it will return the 
            actual filename.

        DATA -> a 2D data array with dimensions LINES,VARIABLES

        VARDESC -> A variable descriptor structure array (see 
            GTE_VARDESC). This array must contain one structure 
            for each variable and the structure must have the 
            tags NAME and UNIT. Alternatively, you can use the
            NAMES and UNITS keywords to pass string arrays.

 KEYWORD PARAMETERS:
        NAMES -> A string array containing variable names. This 
            will only be used if no VARDESC structure array is 
            given.
 
        UNITS -> A string array with physical units for each 
            variable. (see NAMES)

        COMMENTS -> A string (or string array) with comment lines.
            Only the first 80 characters of each line will be stored.

        SELECTION -> An index array to select only a subset of
            variables from the data set. Indices are truncated 
            to lie in the range 0..n_elements(names), which can
            lead to multiple output of the same variable!

        _EXTRA keywords are passed on to OPEN_FILE

        Flags to determine the data type:
        Default is to store the data in its current type. Use the
        TYPE keyword to convert it to any other (numeric) type
        or use one of the following keywords. The type information
        is saved in the file, so READ_BDT0001 can automatically 
        read the data regardless of the format.

        /BYTE -> convert data to byte format
        /INT -> convert data to (2 byte) integer format
        /LONG -> convert data to (4 byte) integer format
        /FLOAT -> convert data to (4 byte) real format
        /DOUBLE -> convert data to (8 byte) double prec. real format
        /COMPLEX -> convert data to (8 byte) complex
        /DCOMPLEX -> convert data to (16 byte) double complex

 OUTPUTS:

 SUBROUTINES:

 REQUIREMENTS:
        Uses OPEN_FILE, STR2BYTE

 NOTES:
        Format specification:
        file_ID  :      80 byte character string
        NVARS, NLINES, NCOMMENTS, TYPE : 4 byte integer (long)
        NAMES :         NVARS*40 byte character string
        UNITS :         NVARS*40 byte character string
        COMMENTS :      NCOMMENTS records with 80 characters each
        DATA  :         8 byte float (double) array NLINES*NVARS

 EXAMPLE:
        WRITE_BDT0001,'~/tmp/*.bdt',data,vardesc

 MODIFICATION HISTORY:
        mgs, 24 Aug 1998: VERSION 1.00
        mgs, 28 Aug 1998: - changed specs to allow comments
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\write_bdt0001.pro)


WRITE_DATA_FILE

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   write_data_file

 PURPOSE:
   This routine writes the structure given by read_data_file to an ASCII file

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   write_data_file,file_name,read_data_file_struct

 INPUTS:
   file_name:  the filename to write to
   read_data_file_struct: the structure given from read_data_file
   These tags are used.
   DATA            the data array
   SEPARATOR       the separator between the data
   HEADER          the stringarray of comment lines before the data
   TRAILER         the stringarray of comment lines behind the data

 KEYWORD PARAMETERS:
  integer: if set write type will be integer
  long:    if set write type will be long
  float:   if set write type will be float
  double:  if set write type will be double
 if no keyword_set write type is double

 EXAMPLE:
  write_data_file,'test2.txt',read_data_file('dat.txt')


 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999-Jun-17

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\write_data_file.pro)


WRITE_DBD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   write_dbd

 PURPOSE:
   This procedure writes a database from the savinfo files

 CATEGORY:
   DATAFILES/DBD

 CALLING SEQUENCE:
   write_dbd,path,[/no_process]

 INPUTS:
   path: the start path to examine savinfo files.

  EXAMPLE:
   write_dbd,'S:\links\daten\experiments\stream1996'

 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 2000-05-25


(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\write_dbd.pro)


WRITE_ENZ

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   write_enz

 PURPOSE:
   This procedure writes a ICG structure into a enz file

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   WRITE_ENZ, filename, struct

 INPUTS:
   Struct:  data structure
   Filename: output file name

 OPTIONAL INPUTS:
   Tagnames:   string array of tagnames to be written
               if not present all tags will written

 KEYWORD PARAMETERS:
   ERROR:  returns 0 if succesfull
   STDEV:  if set the stdev of all parameters (if present) will be written
   INTERVAL_T:  if set the timeinterval of the time axis will be written
   ADDITIONAL_HEADER:  if supplied this text will be added to the header of the outfile

 EXAMPLE:

 MODIFICATION HISTORY:
   Written by: Theo Brauers    1999-Jul
   Modified:   Theo Brauers    1999-Aug-13 additional header keyword parameter
   Modified R.Bauer 1999-11-18 altered for compatibility to read_enz

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\write_enz.pro)


WRITE_IN_BOX

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SOHO - CDS

 Name        :	WRITE_IN_BOX

 Purpose     :	Writes a text message within a box in a graphics window.

 Explanation :	This procedure writes a short text message within a box-shaped
		area in a graphics window.  The message may be split at word
		boundaries into several lines, and the character size and
		orientation may be adjusted for the text to fit within the box.

 Use         :	WRITE_IN_BOX, X1, X2, Y1, Y2, TEXT

 Inputs      :	X1, X2	= X coordinates of the box limits.
		Y1, Y2	= Y coordinates of the box limits.
		TEXT	= ASCII text string containing the message.

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    :	DATA	    = If set, then the coordinates are in data units.
			      This is the default.
		DEVICE	    = If set, then the coordinates are in device units.
		NORMAL	    = If set, then the coordinates are in normalized
			      units.
		MAXCHARSIZE = The maximum charsize to use in displaying the
			      message.  If not passed, then determined from
			      !P.CHARSIZE.
		COLOR	    = Color to use to display the text.  The default is
			      !COLOR.

 Calls       :	None.

 Common      :	None.

 Restrictions:	X2 must be greater than X1, and Y2 must be greater than Y1.

 Side effects:	The appearance of the displayed message may not be optimal if
		any words are separated by multiple blanks, or by tab
		characters.

 Category    :	Planning, Science.

 Prev. Hist. :	None.

 Written     :	William Thompson, GSFC, 7 July 1993.

 Modified    :	Version 0.1, William Thompson, GSFC, 7 July 1993.

 Version     :	Version 0.1, 7 July 1993.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\write_in_box.pro)


WRITE_NCDF

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

 USERLEVEL:
   TOPLEVEL

 NAME:
   write_ncdf

 PURPOSE:
   This procedure writes the ICG Datastructure to a netCDF datafile

 CATEGORY:
   ICG_STRUCT/DATAFILES/NETCDF

 CALLING SEQUENCE:
  write_ncdf,file,structure,[/overwrite],[/ignore_test]

 INPUTS:
   file:   the name of the output file
   structure: the ICG defined data structure

 KEYWORD PARAMETERS:
   overwrite:   to overwrite a given datafile will create new paramaters which are not exist.
   ignore_test: if is set no checking of the structure

   _extra:
     COUNT :  An optional vector containing the counts to be used in writing Value.
              COUNT is a 1-based vector with an element for each dimension of the data to be written.
              Note that counts do not have to match the dimensions of Value.
              The default count vector is the dimensionality of Value.

     OFFSET : An optional vector containing the starting position to write.
              The default start position is [0, 0, ...].

     STRIDE : An optional vector containing the strides, or writing intervals,
              between written values of the netCDF variable.
              The default stride vector is that for a contiguous write, [1, 1, ...].


 OUTPUTS:
   A netCDF file

 EXAMPLE:
  PRO test_struct
    pi={name:'P.Mustermann',organisation:'FZ Jülich'}
    platform={name:'cessna',type:'AIRCRAFT'}
    dataset={campaign:'OTTO1999',DATA_CATEGORY:'EXPERIMENT',experiment:'QUATSCH4'}
    global=CREATE_STRUCT('pi',pi,'platform',platform,'dataset',dataset)
    n2o={param:FINDGEN(100),units:'ppm',long_name:'N2O',short_name:'N2O',flag='NONE'}
    time={param:DINDGEN(100),units:'seconds since 2000-01-01 00:00:00 UTC',long_name:'time',short_name:'time',flag='NONE'}
    s=CREATE_STRUCT('!global',global,'time',time,'n2o',n2o)
    write_ncdf,'output.nc',result
    write_ncdf,'output2.nc',result,offset=[0,2],count=[10]
  END


 MODIFICATION HISTORY:
       Written by:     R.Bauer (ICG-1), 1999-Mar-10
       1999-04-01: if keyword_Set(overwrite) cache file is removed
       1999-09-13: get_ownership added for users of ICG1
       1999-09-28: bug removed comment is written by now as global attribute

1999-02-17; 1999-02-28; 1999-03-01; 1999-03-11
flags schreiben muss noch dazugefügt werden OK
Struktur schreiben ohne status.dim muß noch implementiert werden. OK
wird extern implementiert get_ncdf_status() OK
CASE sensitive Einträge sind noch nicht berücksichtigt?. OK
history muß veerbt werden! bei overwrite auch! ? Testen OK
Bei FLAGS muß noch die description weggeschrieben werden OK
Abfrage auf relevante Einträge der Struktur muß dazugefügt werden.!! OK
   1999-Nov-06 help added
       2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\write_ncdf.pro)


WRITE_PRECOMPILED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	write_precompiled

 PURPOSE:
	Will write the precomiled idl code to a special directory

 CATEGORY:
   CASE_TOOLS

 CALLING SEQUENCE:
   write_precompiled,name

 INPUTS:
  name: the name of the output (sav) file

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Jul-05
   2000-Feb-18 help changed to call_help

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\write_precompiled.pro)


WRITE_WIN

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      write_win

 PURPOSE:      copy image on current window to a gif, tiff or pict image file

               NOTE: What you see is what you get.  Make sure the
                     image you are reading/writing is not obscurred 
                     by other windows, or is pushed off the edge of
                     your monitor's viewable area. 
               
               NOTE: You might get better results by writing to a
                     postscript file and then using the unix command:

                     convert -d 150x150 plot.ps plot.gif
                     convert -d 150x150 plot.ps plot.tiff

 USEAGE:       write_win,file

 INPUT:
   file        Output file name, file suffix determins what type of
               of graphic file format is used.  Acceptable suffix
               values are .gif, .tiff, and .pict.  If one of these 
               string values are not found the image format defaults
               to gif.

 KEYWORD INPUT:

   wid         index of the idl window from which to copy the image,
               if not set write_win copies from current default window

   bgc         background color.  sets color index 0 of gif image to 
               specified RGB value.  Does not affect current color table.
               A scalor value of BGC is automatically turned into a color
               triplet, i.e., bgc=255   =>  RGB=[255,255,255]

   fgc         foreground color.  sets color index 255 of gif image to 
               specified RGB value.  Does not affect current color table.
               A scalor value of FGC is automatically turned into a color
               triplet, i.e., fgc=0   =>  RGB=[0,0,0]

 OUTPUT:       none

 EXAMPLE:
           loadct,5
           window,0
           tvim,sin(20*hanning(200,200)*dist(200)),title='GIF test image',/sc
           write_win,'test_image.gif',fgc=0,bgc=[210,255,210]
           write_win,'test_image.tiff',fgc=0,bgc=[210,255,210]
           exit

; this example wont work unless 256 colors are used
; you may have to restart idl

           window,0,color=256
           loadct,5       
           confill,dist(20)
           write_win,'test_image.gif',fgc=0,bgc=[210,255,210]

           xv test_image.gif

  author:  Paul Ricchiazzi                            feb94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\write_win.pro)


WSELECT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    wselect

 PURPOSE:    wset to window selected by a mouse click

 USEAGE:     wselect

 DISCUSSION: the LMB selects the window and exits WSELECT, 
             the MMB kills the window and remains within the 
             WSELECT program loop.  The WSELECT program loop 
             ends when either the LMB is pressed within a window
             or when there are no remaining windows.

 OUTPUT:     none

  author:  Paul Ricchiazzi                            11jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\wselect.pro)


W_CALC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     w_calc
 PURPOSE:
     creates a widget that defines a calculation that is to be
     done lateron

 CATEGORY:
   Modal widgets.

 CALLING SEQUENCE:
   widget = w_calc(parent)

 INPUTS:
       PARENT - The ID of the parent widget.

 KEYWORD PARAMETERS:
   UVALUE - Supplies the user value for the widget.
     VALUE  - Supplies the initial entries of the list (string array)

 OUTPUTS:
       The ID of the created widget is returned.
       And an event value field that contains necessary information on
       the requested calculation

 COMMON BLOCKS:
   None.

 SIDE EFFECTS:
     AS OF 07 JULY, THIS ROUTINE MUST KNOW FUNCTION wheremissing !!

 PROCEDURE:
   WIDGET_CONTROL, id, SET_VALUE=value can be used to change the
       current value displayed by the widget.

   WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current
       value displayed by the widget.

 MODIFICATION HISTORY:
     mgs, 19 Dec 1998: - removed size specification for where... fields
            This was necessary because they would not appear in droplist
            mode.
     mgs, 05 Apr 1999: - make sure all array indices are LONG
                       - add SQRT function

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\w_calc.pro)


W_EDIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        W_EDIT

 PURPOSE:
        creates a simple text editor with an OK and Cancel button
        and handles the events of this widget.

 CATEGORY:
        general purpose widgets - modal widgets

 CALLING SEQUENCE:
        dlg = W_EDIT(parent, [keywords])

 INPUTS:
        PARENT --> widget ID of the parent widget

 KEYWORD PARAMETERS:
        TITLE --> window title for the editor window (default blank)

        TEXT --> initial text in the editor window (string array)

        PROMPT --> a prompt string for single line text fields. If
             this keyword is provided, the line length will be reduced
             by the length of prompt.

        YOFFSET --> position of the editor base widget.

        XSIZE --> default line length o fthe input field/text window.
             If a prompt i ssupplied, then this length will be reduced.
             Default value is 80 characters.

        LINES --> number of lines in edit line/text window. If not given,
             the vertical extent of the text field will be determined by
             the number of lines in TEXT (limited to 8..60). The maximum
             limit of LINES is 60.

        /NO_EDIT --> set this keyword to prevent editing of the text.

        EXTRABUTTONS --> a string array with optional additional button
             labels. OK (result=1) and Cancel (result=0) will be set
             automatically. The extra buttons wil return values starting
             from 2.

        COMMENTS --> a string or string array with extra comments that
             will be displayed below the entry field

        GROUP_LEADER --> if this widget shall be used as a simple display
             window, you can specify a GROUP_LEADER (= widget-ID of a 
             dialog box). The window will then disappear as soon as the
             dialog box is closed. NOTE: the OK and Cancel buttons will
             not be shown in this case.

 OUTPUTS:
        w_edit returns a widget ID of the editor. For implementation
        see example below.

 SUBROUTINES:
     EDIT_EVENT --> handles editor events. Reacts only to OK or Cancel.

 REQUIREMENTS:

 NOTES:

 EXAMPLE:
     create an edit dialog for a text array called comments
     and analyze results. Overwrite array contents only if 
     OK was pressed and a non-empty editor window is returned.

     dlg = w_edit(title='Edit comments',text=comments)
     widget_control,dlg,/realize
     event = widget_event(dlg)
     if(event.value eq 1) then begin
         newcomments = event.info
         if (n_elements(newcomments) gt 1 OR newcomments(0) ne '') then $
              comments = newcomments
     endif
     widget_control,event.top,/destroy

 MODIFICATION HISTORY:
        mgs, 01 Dec 1997: VERSION 1.00
        mgs, 21 Dec 1997: - added group_leader keyword
        mgs, 08 Aug 1998: - added a couple of keywords, now makes
              w_simpleedit and XDisplayfile obsolete.
           - also handles more than one input field now if prompt 
             is given
        mgs, 15 Sep 1998: - added COMMENTS keyword

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\w_edit.pro)


W_MEAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	w_mean

 PURPOSE:
	This function calculates a weighted mean and its error.

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	result = w_mean(data [,weights])

 INPUTS:
	data:	The data set for which the mean will be calculated.

 OPTIONAL INPUTS:
	weights:	Weights to be used to calculate the weighted mean (see procedure
		below). This array must have the same number of elements as data.
		If not supplied the weights are assumed to be one.
		Usually weights are choosen as: weights = 1 / s^2
		where s defines the error of data.

 KEYWORD PARAMETERS:
	STERR = sterr: If set to a named variable the error of the weighted mean is returned.
	/NAN: Set this keyword to cause the routine to check for occurrences of the
		IEEE floating-point value NaN in the input data. Elements with the value NaN
		are treated as missing data.

 OUTPUTS:
	This function returns the weighted mean of the input array.

 PROCEDURE:

         TOTAL(weights * data)                 TOTAL(weights * (data - mean)^2)
	mean = ---------------------       sterr^2 = --------------------------------
         TOTAL(weights)                        (N - 1) * TOTAL(weights)

	All calculations are performed in double precision

 EXAMPLE:
	data = [1., 2., 3., 4., 5.]
	weights = [0.7, 0.4, 0.2, 0.9, 1.3]
	PRINT, w_mean(data, weights, STERR = sterr), sterr
	--->	3.4857143      0.77801422

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 05.08.1999

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\w_mean.pro)


W_SORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        W_SORT

 PURPOSE:
     hierarchical sorting of a data set, each column can be sorted 
     reversely. W_SORT is a widget interface for MULTISORT that handles 
     up to three sort levels/columns.

 CATEGORY:
	Modal widgets.

 CALLING SEQUENCE:
	widget = w_sort(NAMES [,uval=uval])

 INPUTS:
     NAMES --> a string array with variable names which will fill
         the 3 selection lists of the W_SORTR widget.

 KEYWORD PARAMETERS:

 OUTPUTS:
     The function returns a widget ID. 

 SUBROUTINES:
     handle_sort : interpret results from widget call W_SORT and call
         multisort procedure.

 REQUIREMENTS:
     This routine requires MULTISORT.PRO in order to actually do the
     sorting.

 NOTES:

 EXAMPLE:
        This is how to call the sort widget:
            dlg = w_sort(NAMES=header)   ; pass the variable names
            widget_control,dlg,/realize
            event = widget_event(dlg)
            if(event.value) then begin   ; OK returned
               info = event.info
               handle_sort,data,event.info  ; do the sorting
            endif
            widget_control,event.top,/destroy

 MODIFICATION HISTORY:
        mgs, 30 Jun 1997: VERSION 1.00
        mgs, 06 Apr 1998: - improved documentation
        mgs, 09 Apr 1998: - extracted multisort as stand-alone routine

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\w_sort.pro)


XAUTOHELP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XAUTOHELP
 PURPOSE:
       Display auto help when mouse moves over a widget.
 CATEGORY:
 CALLING SEQUENCE:
       xautohelp, ev, text
 INPUTS:
       ev = Event structure.  Give widget ID to init.     in
       text = Text to display.  Init only.                in
         Only given to intialize, to display call with ev only.
         May be multiline, delimited by / or DELIMETER=del.
 KEYWORD PARAMETERS:
       Keywords:
         DISPLAY=label_id  Widget ID of label area for display.
           Must give to display text.  May be array of label IDs.
         /NOCLEAR means do not clear the given event structure.
         DELIMITER=del Set multiline delimiter if not /.
         /MORE_HELP  displays a text file with more details.
 OUTPUTS:
 COMMON BLOCKS:
       xautohelp_com
 NOTES:
       Notes on how to use: This routine is used in two phases:
         Initialization and Display.  It is initialized as the
         widgets are added to the total widget device.  Set
         tracking_events for each widget that will display autohelp
         text.  Right after adding the widget give xautohelp
         its help text using its widget ID as the index.
         On the display call give the event structure itself.
         If the event structure is a tracking_event it is used to
         display or clear the autohelp text and then set to 0 for
         return.  Test the event structure when it comes back from
         xautohelp, if it is still a structure continue in the
         event handler normally, else just return:
            xautohelp, ev, display=lab
            if (size(ev))(2) ne 8 then return
 MODIFICATION HISTORY:
       R. Sterner, 1998 May 1

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xautohelp.pro)


XAUTOHELP_EXAMPLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XAUTOHELP_EXAMPLE
 PURPOSE:
       This routine shows how to use xautohelp.
 CATEGORY:
 CALLING SEQUENCE:
       xautohelp_example
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /TEXT use text widget for help, else label widget.
           This example uses multiple label widgets for help.
         /DETACHED means use detached help area, else attached.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1998 May 1

 Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xautohelp_example.pro)


XAXIS_MONTH

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    xaxis_month

 PURPOSE:    label x axis with month names when the x axis plot quantity
             is day of year

 USEAGE:     xaxis_month,year

 INPUT:      
   year      year, reqiured to set leap year calendar.  if not set a
             non-leap-year is used. 

 OUTPUT:     none

 SIDE EFFECTS:
             draws in the x axis with month labels and tick marks 
             between months
  
 EXAMPLE:
             x=indgen(365)+1
             zensun,x,12,35,0,zen
             plot,x,zen,xstyle=5,title='solar zenith angle',ytitle='zenith'
             xaxis_month

 REVISIONS:

  author:  Paul Ricchiazzi                            jan94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xaxis_month.pro)


XBB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XBB
 PURPOSE:
       Widget bill board utility for text display.
 CATEGORY:
 CALLING SEQUENCE:
       xbb
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
        LINES=txt  Text array of initial lines to display.
        RES=RES    Specified array of reserved line numbers.
          Top line is number 0.
        NID=nid    Returned widget IDs of reserved lines.
        WID=wid    Returned xbb widget ID so this widget may
          be destroyed at a later time.
        TITLE=tt   Optional title text (def=none).
        GROUP_LEADER=grp  specified group leader.  When the
          group leader widget is destroyed this widget is also.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: this utility is useful for displaying varying
         text such as a status update and so on.  It is designed
         to be positioned somewhere out of the way by the user
         It is initialized to display some specified lines of text
         and one or more lines are requested as reserved.  The
         widget IDs of the requested reserved lines are returned
         and are used to update the corresponding lines.  When
         this widget is no longer needed it may be destroyed.
         Use widget_control to update a line:
           widget_control,nid(2),set_val='New value'
         To delete do: widget_control,wid,/destroy
 MODIFICATION HISTORY:
       R. Sterner, 16 Nov, 1993
       R. Sterner, 1997 Nov 12 --- Better help.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xbb.pro)


XCD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   xcd

 PURPOSE:
   Change current directory via mouse.

   Two lists are displayed side by side.  The one on the left shows
   directories.  Click on a directory to cd there.  The list
   on the right shows files to help you see where you are.
   (The list on the right does not respond to mouse clicks.)
 CATEGORY:
   Utility.
 CALLING SEQUENCE:
   xcd
 INPUTS:
   None.
 KEYWORD PARAMETERS:
   None
 OUTPUTS:
   None.
 SIDE EFFECTS:
   Your current directory can be changed.
 RESTRICTIONS:
   Windows & OpenVMS platforms only.  Originally written on Windows95.
   Should work on other Windows platforms, but I (Paul) havn't tried it.

   With a little effort, one probably could port Xcd to other platforms
   (i.e. Unix or Mac).

   Note that drive names (e.g. "a:", "c:", etc.) are hardcoded in
   xcd::init.  Change that line of code to show drive letters
   appropriate for your system.

 PROCEDURE:
   Xcd creates an object that has a reference to a DirListing, and
   widgets for displaying that DirListing.  If the user clicks on a
   sub-directory (or "..\") in the xcd object, or droplist-selects
   a different drive via the xcd object, the xcd object changes
   IDL's current directory to that location, and refreshes with a
   new current-directory DirListing.

 MODIFICATION HISTORY:
   Paul C. Sorenson, July 1997. paulcs@netcom.com.
        Written with IDL 5.0.  The object-oriented design of Xcd is
        based in part on an example authored by Mark Rivers.
   Jim Pendleton, July 1997. jimp@rsinc.com
        Modified for compatability with OpenVMS as a basis for
        platform independent code
   Paul C. Sorenson, July 13 1997.  Changes so that DirListing class
        methods do not return pointers to data members.  (Better
        object-oriented design that way.)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xcd.pro)


XCED1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCED1
 PURPOSE:
       Simple widget to edit a single color table entry.
 CATEGORY:
 CALLING SEQUENCE:
       xced1, index
 INPUTS:
       index = color table index to edit.   in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=txt  Title text to display.
         /HSV  means work in Hue, Saturation, and Value
           coordinates (def=Red, Green, Blue).
         GROUP_LEADER=grp  Assign a group leader to this
           widget.  When the widget with ID grp is destroyed
           this widget is also.
         /WAIT  means wait for returned result.
         EXIT_CODE=excode Exit code: 0=Done, 1=Cancel.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 29 Oct, 1993
       R. Sterner, 1995 Mar 2 --- Added /WAIT.
       R. Sterner, 1995 Mar 16 --- Added EXIT_CODE.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xced1.pro)


XCOLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCOLORS

 PURPOSE:

       The purpose of this routine is to interactively change color tables
       in a manner similar to XLOADCT. No common blocks are used so
       multiple copies of XCOLORS can be on the display at the same
       time (if each has a different TITLE). XCOLORS has the ability
       to notify a widget event handler, an object method, or an IDL
       procedure if and when a new color table has been loaded. The
       event handler, object method, or IDL procedure is then responsibe
       for updating the program's display on 16- or 24-bit display systems.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object, Command line.

 CALLING SEQUENCE:

       XCOLORS

 INPUTS:

       None.

 KEYWORD PARAMETERS:

       BLOCK: If this keyword is set, the program will try to block the
          IDL command line. Note that this is only possible if no other
          widget program is currently blocking the IDL command line. It
          is much more reliable to make XCOLORS a modal widget (see the MODAL
          keyword), although this can generally only be done when XCOLORS
          is called from another widget program.

       BOTTOM: The lowest color index of the colors to be changed.

       COLORINFO: This output keyword will return either a pointer to
          a color information structure (if the program is called in
          a non-modal fashion) or a color information structure (if the program
          is called in modal or blocking fashion). The color information
          structure is an anonymous structure defined like this:

             struct = { R: BytArr(!D.Table_Size), $ ; The current R color vector.
                        G: BytArr(!D.Table_Size), $ ; The current G color vector.
                        B: BytArr(!D.Table_Size), $ ; The current B color vector.
                        NAME: "", $                 ; The name of the current color table.
                        INDEX: 0 }                  ; The index number of the current color table.

          If a pointer to the structure is obtained, you will be responsible
          for freeing it to prevent memory leakage:

             XColors, ColorInfo=colorInfoPtr
             Print, "Color Table Name: ", (*colorInfoPtr).Name
             Ptr_Free, colorInfoPtr

          Note that that Name field will be "Unknown" and the Index field will
          be -1 until a color table is actually selected by the user. You are
          responsible for checking this value before you use it.

          When called in modal or blocking fashion, you don't have to worry about freeing
          the pointer, since no pointer is involved:

             XColors, /Block, ColorInfo=colorInfoData
             Help, colorInfoData, /Structure
             Print, "Color Table Name: ", colorInfoData.Name

       DATA: This keyword can be set to any valid IDL variable. If
          the variable is defined, the specified object method or notify
          procedure will be passed this variable via a DATA keyword. This
          keyword is defined primarily so that Notify Procedures are compatible
          with the XLOADCT way of passing data. It is not strictly required,
          since the _EXTRA keyword inheritance mechanism will allow passing
          of *any* keyword parameter defined for the object or procedure that is
          to be notified.

       DRAG: Set this keyword if you want colors loaded as you drag
          the sliders. Default is to update colors only when you release
          the sliders.

       _EXTRA: This keyword inheritance mechanism will pick up and
          pass along to any method or procedure to be notified and keywords
          that are defined for that procedure. Note that you should be sure
          that keywords are spelled correctly. Any mis-spelled keyword will
          be ignored.

       FILE: A string variable pointing to a file that holds the
          color tables to load. The normal colors1.tbl file is used by default.

       GROUP_LEADER: The group leader for this program. When the group
          leader is destroyed, this program will be destroyed.

       MODAL: Set this keyword (along with the GROUP_LEADER keyword) to
          make the XCOLORS dialog a modal widget dialog. Note that NO
          other events can occur until the XCOLORS program is destroyed
          when in modal mode.

       NCOLORS: This is the number of colors to load when a color table
          is selected.

       NOTIFYID: A 2-column by n-row array that contains the IDs of widgets
          that should be notified when XCOLORS loads a color table. The first
          column of the array is the widgets that should be notified. The
          second column contains IDs of widgets that are at the top of the
          hierarchy in which the corresponding widgets in the first column
          are located. (The purpose of the top widget IDs is to make it
          possible for the widget in the first column to get the "info"
          structure of the widget program.) An XCOLORS_LOAD event will be
          sent to the widget identified in the first column. The event
          structure is defined like this:

          event = {XCOLORS_LOAD, ID:0L, TOP:0L, HANDLER:0L, $
             R:BytArr(!D.N_COLORS < 256), G:BytArr(!D.N_COLORS < 256), $
             B:BytArr(!D.N_COLORS < 256), INDEX:0, NAME:""}

          The ID field will be filled out with NOTIFYID[0, n] and the TOP
          field will be filled out with NOTIFYID[1, n]. The R, G, and B
          fields will have the current color table vectors, obtained by
          exectuing the command TVLCT, r, g, b, /Get. The INDEX field will
          have the index number of the just-loaded color table. The name
          field will have the name of the currently loaded color table.

          Note that XCOLORS can't initially tell *which* color table is
          loaded, since it just uses whatever colors are available when it
          is called. Thus, it stores a -1 in the INDEX field to indicate
          this "default" value. Programs that rely on the INDEX field of
          the event structure should normally do nothing if the value is
          set to -1. This value is also set to -1 if the user hits the
          CANCEL button. (Note the NAME field will initially be "Unknown").

          Typically the XCOLORS button will be defined like this:

             xcolorsID = Widget_Button(parentID, Value='Load New Color Table...', $
                Event_Pro='Program_Change_Colors_Event')

          The event handler will be written something like this:

             PRO Program_Change_Colors_Event, event

                ; Handles color table loading events. Allows colors be to changed.

             Widget_Control, event.top, Get_UValue=info, /No_Copy
             thisEvent = Tag_Names(event, /Structure_Name)
             CASE thisEvent OF

                'WIDGET_BUTTON': BEGIN

                     ; Color table tool.

                   XColors, NColors=info.ncolors, Bottom=info.bottom, $
                      Group_Leader=event.top, NotifyID=[event.id, event.top]
                   ENDCASE

                'XCOLORS_LOAD': BEGIN

                     ; Update the display for 24-bit displays.

                   Device, Get_Visual_Depth=thisDepth
                   IF thisDepth GT 8 THEN BEGIN
                   WSet, info.wid

                    ...Whatever display commands are required go here. For example...

                    TV, info.image

                 ENDIF
                 ENDCASE

              ENDCASE

              Widget_Control, event.top, Set_UValue=info, /No_Copy
              END

       NOTIFYOBJ: A vector of structures (or a single structure), with
          each element of the vector defined as follows:

             struct = {XCOLORS_NOTIFYOBJ, object:Obj_New(), method:''}

          where the Object field is an object reference, and the Method field
          is the name of the object method that should be called when XCOLORS
          loads its color tables.

             ainfo = {XCOLORS_NOTIFYOBJ, a, 'Draw'}
             binfo = {XCOLORS_NOTIFYOBJ, b, 'Display'}
             XColors, NotifyObj=[ainfo, binfo]

          Note that the XColors program must be compiled before these structures
          are used. Alternatively, you can put this program, named
          "xcolors_notifyobj__define.pro" (*three* underscore characters in this
          name!) in your PATH:

             PRO XCOLORS_NOTIFYOBJ__DEFINE
              struct = {XCOLORS_NOTIFYOBJ, OBJECT:Obj_New(), METHOD:''}
             END

          Or, you can simply define this structure as it is shown here in your code.

          "Extra" keywords added to the XCOLORS call are passed along to
          the object method, which makes this an alternative way to get information
          to your methods. If you expect such keywords, your methods should be defined
          with an _Extra keyword.

       NOTIFYPRO: The name of a procedure to notify or call when the color
          tables are loaded. If the DATA keyword is also defined, it will
          be passed to this program via an DATA keyword. But note that *any*
          keyword appropriate for the procedure can be used in the call to
          XCOLORS. For example, here is a procedure that re-displays and image
          in the current graphics window:

             PRO REFRESH_IMAGE, Image=image, _Extra=extra, WID=wid
             IF N_Elements(wid) NE 0 THEN WSet, wid
             TVIMAGE, image, _Extra=extra
             END

          This program can be invoked with this series of commands:

             IDL> Window, /Free
             IDL> TVImage, image, Position=[0.2, 0.2, 0.8, 0.8]
             IDL> XColors, NotifyPro='Refresh_Image', Image=image, WID=!D.Window

          Note that "extra" keywords added to the XCOLORS call are passed along to
          your procedure, which makes this an alternative way to get information
          to your procedure. If you expect such keywords, your procedure should
          be defined with an _Extra keyword as illustrated above.

       TITLE: This is the window title. It is "Load Color Tables" by
          default. The program is registered with the name 'XCOLORS:' plus
          the TITLE string. The "register name" is checked before the widgets
          are defined. If a program with that name has already been registered
          you cannot register another with that name. This means that you can
          have several versions of XCOLORS open simultaneously as long as each
          has a unique title or name. For example, like this:

            IDL> XColors, NColors=100, Bottom=0, Title='First 100 Colors'
            IDL> XColors, NColors=100, Bottom=100, Title='Second 100 Colors'

       XOFFSET: This is the X offset of the program on the display. The
          program will be placed approximately in the middle of the display
          by default.

       YOFFSET: This is the Y offset of the program on the display. The
          program will be placed approximately in the middle of the display
          by default.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       Colors are changed. Events are sent to widgets if the NOTIFYID
       keyword is used. Object methods are called if the NOTIFYOBJ keyword
       is used. This program is a non-blocking widget.

 RESTRICTIONS:

       None.

 EXAMPLE:

       To load a color table into 100 colors, starting at color index
       50 and send an event to the widget identified at info.drawID
       in the widget heirarchy of the top-level base event.top, type:

       XCOLORS, NCOLORS=100, BOTTOM=50, NOTIFYID=[info.drawID, event.top]

 MODIFICATION HISTORY:
       Written by:     David Fanning, 15 April 97. Extensive modification
         of an older XCOLORS program with excellent suggestions for
         improvement by Liam Gumley. Now works on 8-bit and 24-bit
         systems. Subroutines renamed to avoid ambiguity. Cancel
         button restores original color table.
       23 April 1997, added color protection for the program. DWF
       24 April 1997, fixed a window initialization bug. DWF
       18 June 1997, fixed a bug with the color protection handler. DWF
       18 June 1997, Turned tracking on for draw widget to fix a bug
         in TLB Tracking Events for WindowsNT machines in IDL 5.0. DWF
       20 Oct 1997, Changed GROUP keyword to GROUP_LEADER. DWF
       19 Dec 1997, Fixed bug with TOP/BOTTOM reversals and CANCEL. DWF.
        9 Jun 1998, Fixed bug when using BOTTOM keyword on 24-bit devices. DWF
        9 Jun 1998, Added Device, Decomposed=0 for TrueColor visual classes. DWF
        9 Jun 1998, Removed all IDL 4 compatibility.
       21 Oct 1998, Fixed problem with gamma not being reset on CANCEL. DWF
        5 Nov 1998. Added the NotifyObj keyword, so that XCOLORS would work
         interactively with objects. DWF.
        9 Nov 1998. Made slider reporting only at the end of the drag. If you
         want continuous updating, set the DRAG keyword. DWF.
        9 Nov 1998. Fixed problem with TOP and BOTTOM sliders not being reset
         on CANCEL. DWF.
       10 Nov 1998. Fixed fixes. Sigh... DWF.
        5 Dec 1998. Added INDEX field to the XCOLORS_LOAD event structure. This
         field holds the current color table index number. DWF.
        5 Dec 1998. Modified the way the colorbar image was created. Results in
         greatly improved display for low number of colors. DWF.
        6 Dec 1998. Added the ability to notify an unlimited number of objects. DWF.
       12 Dec 1998. Removed obsolete Just_Reg keyword and improved documetation. DWF.
       30 Dec 1998. Fixed the way the color table index was working. DWF.
        4 Jan 1999. Added slightly modified CONGRID program to fix floating divide
          by zero problem. DWF
        2 May 1999. Added code to work around a Macintosh bug in IDL through version
          5.2 that tries to redraw the graphics window after a TVLCT command. DWF.
        5 May 1999. Restore the current window index number after drawing graphics.
          Not supported on Macs. DWF.
        9 Jul 1999. Fixed a couple of bugs I introduced with the 5 May changes. Sigh... DWF.
       13 Jul 1999. Scheesh! That May 5th change was a BAD idea! Fixed more bugs. DWF.
       31 Jul 1999. Substituted !D.Table_Size for !D.N_Colors. DWF.
        1 Sep 1999. Got rid of the May 5th fixes and replaced with something MUCH simpler. DWF.
       14 Feb 2000. Removed the window index field from the object notify structure. DWF.
       14 Feb 2000. Added NOTIFYPRO, DATA, and _EXTRA keywords. DWF.
       20 Mar 2000. Added MODAL, BLOCK, and COLORINFO keywords. DWF
       20 Mar 2000. Fixed a slight problem with color protection events triggering
          notification events. DWF.
       31 Mar 2000. Fixed a problem with pointer leakage on Cancel events, and improved
          program documentation. DWF.
       17 Aug 2000. Fixed a problem with CANCEL that occurred only if you first
          changed the gamma settings before loading a color table. DWF.
       10 Sep 2000. Removed the requirement that procedures and object methods must
          be written with an _Extra keyword. DWF.
        5 Oct 2000. Added the File keyword to LOADCT command, as I was suppose to. DWF.
        5 Oct 2000. Now properly freeing program pointers upon early exit from program. DWF.
        7 Mar 2001. Fixed a problem with the BLOCK keyword. DWF.
       12 Nov 2001. Renamed Congrid to XColors_Congrid. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xcolors.pro)


XCONTOUR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCONTOUR

 PURPOSE:
       The purpose of this program is to demonstrate how to
       create a contour plot with axes and a title in the
       new IDL 5 object graphics.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, IDL 5 Object Graphics.

 CALLING SEQUENCE:
       XCONTOUR, data, x, y

 REQUIRED INPUTS:
       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       CBARTITLE: A string used as the title of the colorbar.

       _EXTRA: This keyword collects otherwise undefined keywords that are
       passed to the old IDL contour command. Most of the keywords will
       have absolutely no effect.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       NLEVELS: The number of equally spaced contour intervals to draw.
       Default is 10. Note that contour levels are acutally calculated,
       since the NLEVELS keyword to the contour object does not always
       result in the correct number of contour levels.

       TITLE: A string used as the title of the plot.

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To use this program with your 2D data, type:

        IDL> XContour, data

 MODIFICATION HISTORY:
       Written by David Fanning, 9 June 97.
       Added a colorbar to the plot. 19 June 97, DWF.
       Modified the way VCOLORBAR was called. 14 July 97. DWF.
       Fixed cleanup procedure to clean up ALL objects. 12 Feb 98. DWF.
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Modified to use the IDLgrColorbar object. 20 Sept 98. DWF.
       Added the ability to do a filled contour. 27 Sept 98. DWF.
       Fixed a bug in the way the data was scaled into the view. 9 May 99. DWF.
       Fixed a bug in the filled contours. 11 May 99. DWF.
       Added a line to make sure 256 colors are available in Z buffer. 19 Dec 99. DWF.
       Fixed a small bug where the X and Y vectors weren't sent to IDLgrContour. 19 Sept 2000. DWF.
       Added CBARTITLE keyword and fixed a small memory leak. Updated VCOLORBAR code. 8 Dec 2000. DWF.
       Fixed a minor problem with the Colorbar. Removed GIF support for IDL 5.4 and higher. 27 Mar 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xcontour.pro)


XCURSOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCURSOR
 PURPOSE:
       Cursor coordinate display in a pop-up widget window.
 CATEGORY:
 CALLING SEQUENCE:
       xcursor, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   display data coordinates (default).
         /DEVICE display device coordinates.
         /NORMAL display normalized coordinates.
         /ORDER  Reverse device y coordinate (0 at window top).
         XOFFSET=xoff, YOFFSET=yoff Widget position.
         TEXT=txt text to display (def=Press any button to exit).
           May be a text array.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1 Nov, 1993
       R. Sterner, 1995 Jun 30 --- Added x,y and /ORDER.
       R. Sterner, 2000 Aug 17 --- Added XOFFSET, YOFFSET
       R. Sterner, 2000 Aug 18 --- Added TEXT, handled changed !map.
       R. Sterner, 2001 Jan 12 --- Corrected map case.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xcursor.pro)


XCURSOR1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCURSOR1
 PURPOSE:
       Cursor coordinate display in a pop-up widget window.
 CATEGORY:
       PROG_TOOLS/WIDGETS
 CALLING SEQUENCE:
       xcursor1, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   display data coordinates (default).
         /DEVICE display device coordinates.
         /NORMAL display normalized coordinates. 
         /JS     display time format for x axis defined in Julian Seconds,
                 display y data coordinates ;
         /ORDER  Reverse device y coordinate (0 at window top).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1 Nov, 1993
       R. Sterner, 1995 Jun 30 --- Added x,y and /ORDER.
       M. Busch, 1997 Dec 23 --- added /JS
 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\mb_lib\xcursor1.pro)


XCURVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCURVE
 PURPOSE:
       Draw a curve in the display window.
 CATEGORY:
 CALLING SEQUENCE:
       xcurve, x, y
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   means use data coordinates (default).
         /DEVICE means use device coordinates.
         /NORMAL means use normalized coordinates.
         /MAG    means display a magnification window.
                 Default mag is 10x, MAG=pwr to set to other.
         SIZE=sz Approx mag window size (def=200).
         STEP_MIN = minimum step size between points.
           Must be > 0 for data,normal, or >1 for device.
 OUTPUTS:
       x,y = coordinates of curve.   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Mar 28
       R. Sterner, 2000 Aug 08 --- Fixed repeated points. Still has erase
       problems.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xcurve.pro)


XCYPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCYPH
 PURPOSE:
       Widget based cycle/phase images.
 CATEGORY:
 CALLING SEQUENCE:
       xcyph, data, time
 INPUTS:
       data = Time series data.                    in
       time = time tag for each point in data.     in
 KEYWORD PARAMETERS:
       Keywords:
         RANGE=[min,max]  Set slice length range limits.
         CPOUT=out  Returned output image.
         TOUT=t     Returned times of bottom edge of out.
         SLICE=s    Returned slice length.
         OFFSET=fr  Returned offset into data as fraction of slice.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Time series is divided into slices which are arranged
         into an image in a graphics window.  Time slice length
         is adjusted using the slider.
         See also cyph.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Jan 25

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xcyph.pro)


XDATAFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XDATAFILE
 PURPOSE:
       Explore a text file of unkown format.
 CATEGORY:
 CALLING SEQUENCE:
       xtextfile
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         MAXBUFF=n  Max number of bytes to read (def=30000).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 3.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xdatafile.pro)


XDATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XDATE
 PURPOSE:
       Widget based date selection tool.
 CATEGORY:
 CALLING SEQUENCE:
       xdate
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=tt   Widget title (def="Select date").
         YLIST=ylist  Allowed list of years.
           Default is +/- 5 years from default year.
         MLIST=mlist  Allowed list of months.
           Default is all months.
         YDEF=ydef  Default year.
         MDEF=mdef  Default month.
         DDEF=ddef  Default day.
           Defaults are current.  If negative lock selection.
         YOUT=yout  Returned year.
         MOUT=mout  Returned month.
         DOUT=dout  Returned day.
           These are null strings for CANCEL.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 10 Nov, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xdate.pro)


XDATENT

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  xdatent

 PURPOSE:  widget for text data entry.  

 USEAGE:   xdatent,labels,value,ncol=ncol,group=group

 INPUT:    
   labels  string array of labels for data entry field

 KEYWORD INPUT:
   ncol    number of columns of data entry fields
   font    text font to use
   group   group leader widget, when this widget dies, so does xdatent

 INPUT/OUTPUT
   value   float, double, long or int array of values
           on input: used to set default values
           on exit:  edited values

 
 COMMON BLOCKS:
   xdatentblk

 EXAMPLE:  

   labels=['min latitude','max latitude','min longitude','max longitude']
   value=[30.,40.,-130.,-120.]
   xdatent,labels,value,ncol=2
   table,labels,value

; NOTE: the input focus can be moved by hitting the tab key.  


 AUTHOR:   Paul Ricchiazzi                        05 Jul 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xdatent.pro)


XFILES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XFILES
 PURPOSE:
       Select files, individual or ranges.
 CATEGORY:
 CALLING SEQUENCE:
       xfiles
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=t  menu title.
         FILES=f output array of selected files.
         DIRECTORY=d initial directory (def=current).
         PATTERN=p initial filename pattern (def=*.*).
         NEWDIRECTORY=nd last directory used.        out
         NEWPATTERN=np last file name pattern used.  out
         /WAIT  means wait for a selection before returning.
           Needed if called from another widget routine.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1 Jul, 1991
       R. Sterner, somewhat reworked 8,9 Nov, 1993

 Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xfiles.pro)


XGETFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XGETFILE
 PURPOSE:
       Widget based file selection routine.
 CATEGORY:
 CALLING SEQUENCE:
       f = xgetfile()
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TEXT=txt  Text string or array to display at top
           of widget (def=Select a file).
         DEF_DIR=name  Name of default directory initialization
           file.  Will read in list of directories when at start
           and save updated list on exit.  Created if none exists.
           If not given _def_dir.txt is used.
         SET_PATH=p1  Set initial path (def=current).
         GET_PATH=p2  Return final path.
         SET_FILE=f1  Set initial file (def=none).
         GET_FILE=f2  Return final file.
         WILD_CARD=w  Set wildcard (filter, def=*).
 OUTPUTS:
       f = return full file name (includes path).   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 15

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xgetfile.pro)


XGLOBE

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     XGLOBE

 USEAGE:      XGLOBE

 PURPOSE:     Display a world map and allow user to zoom in on a given region

 INPUT:       none
 OUTPUT:      none

 BUTTONS:
   DONE       quit XGLOBE

 ZOOM         Pull down menu 
     ZOOM IN: The IDL routine BOX_CURSOR is used to select the region.
              use left mouse button to point and drag the cursor box
              use middle mouse button to resize cursor box
              use right mouse to select region and draw the map

              To reduce distortion on zoomed regions near the poles
              it is a good idea to choose a short, wide map region.

    ZOOM OUT: The latitude and longitude limits are increased by 20% and
              the map is redrawn.

       WORLD: Redisplay world map (equivalent to hitting ZOOM OUT many times)

        PLOT: Replot map with current lat-lon limits.

 PRINT        Pull down menu
        TERM: Print current map to device TERM 
     GAUTIER: print current map to device GAUTIER 
      PHASER: print current map to device PHASER (color plots)
         DUP: print current map to device DUP


   COLOR      Pull down menu
  CONTINENTS: adjust color value of continental boundaries
    US STATE: adjust color value of US state boundaries
   POLITICAL: adjust color value of political boundaries
      RIVERS: adjust color value of rivers

	 NOTE: Each of these options use the procedure PICK_COLOR
	       to adjust the color value for a single color index.
	       Motion of the cursor inside the PICK_COLOR window 
              adjusts the Hue and Saturation values.
	       Holding down the left mouse button decreases brightness.
	       Holding down the middle mouse button increases brightness. 
	       Pressing the right mouse button selects the color and returns.

   HELP       print this help file


 TEXT WIDGET  (labeled WHERE IS:)

              Enter the latititude   longitude 
              A symbol is drawn to indicate point on map.
              NOTE: the code will bomb if you mess up the format

 DRAW WIDGET  The lat-lon coordinates under the cursor are
              printed when the left mouse button is held down
              (This feature is disabled in "ZOOM IN" region selection
              mode)

  author:  Paul Ricchiazzi                            DEC92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xglobe.pro)


XHELP[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XHELP
 PURPOSE:
       Widget to display given help text.
 CATEGORY:
 CALLING SEQUENCE:
       xhelp, txt
 INPUTS:
       txt = String array with help text to display.  in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=txt  title text or text array (def=none).
         LINES=lns maximum number of lines to display
           before added a scroll bar (def=30).
         EXIT_TEXT=txt Exit button text (def=Quit help).
         WID=id  returned widget ID of help widget.  This
           allows the help widget to be automatically
           destroyed after action occurs.
         /NOWAIT  means do not wait for exit button to be
           pressed.  Use with WID for to display help.
         /WAIT  means wait for OK button without using xmanager
           to register xmess.  Will not drop through if button
           is not pressed as in default case.
         SAVE=file  If a file name is given a SAVE button is
           added and the contents may be saved.  Given name is
           used as the default. Use /WAIT with SAVE=file.
         GROUP_LEADER=grp  Assign a group leader to this
           widget.  When the widget with ID group is destroyed
           this widget is also.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 29 Sep, 1993
       R. Sterner, 18 Oct, 1993 --- Added LINES and event handler.
       R. Sterner, 1994 Feb 21 --- Changed title text.
       R. Sterner, 1994 Sep  7 --- Added /WAIT keyword.
       R. Sterner, 1998 Jun  4 --- Added /NO_BLOCK to xmanager.
       R. Sterner, 1998 Jul 27 --- Added SAVE=sv option.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xhelp.pro)


XHELP[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	xhelp

 PURPOSE:
	Display an IDL procedure header using widgets and the widget manager.

 CATEGORY:
	Widgets.

 CALLING SEQUENCE:
	xhelp, Filename, TITLE = TITLE, GROUP = GROUP, WIDTH = WIDTH, $
		HEIGHT = HEIGHT, TEXT = TEXT, FONT = font, unmanaged=unmanaged

 INPUTS:
     Filename:	A scalar string that contains the filename of the file
		to display.  If FILENAME does not include a complete path
               specification, xhelp will search for the file in
               the current working directory and then each of the
               directories listed in !PATH environment variable.  The
               ".pro" file suffix will be appended if it is not supplied.

 KEYWORD PARAMETERS:
	FONT:   The name of the font to use.  If omitted use the default
		font. If font is set to 1 then a fixed width font is used:
               "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1"

	GROUP:	The widget ID of the group leader of the widget.  If this 
		keyword is specified, the death of the group leader results in
		the death of xhelp.

	HEIGHT:	The number of text lines that the widget should display at one
		time.  If this keyword is not specified, 24 lines is the 
		default.

	TEXT:	A string or string array to be displayed in the widget
		instead of the contents of a file.  This keyword supercedes
		the FILENAME input parameter.

	TITLE:	A string to use as the widget title rather than the file name 
		or "xhelp".

	WIDTH:	The number of characters wide the widget should be.  If this
		keyword is not specified, XHELP checks the input file for
               the maximum line length.

   UNMANAGED:  do not call xmanager and do not include a "DONE" button
               on the widget.  In this case the x window manager must be
               used to kill the widget.

 OUTPUTS:
	No explicit outputs.  A file viewing widget is created.

 SIDE EFFECTS:
	Triggers the XMANAGER if it is not already in use.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Open a file and create a widget to display its contents.

 MODIFICATION HISTORY:
	Written By Steve Richards, December 1990
	Graceful error recovery, DMS, Feb, 1992.
       Modified to extract .pro documentation headers, PJR/ESRG mar94

  author:  Paul Ricchiazzi                            jun93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xhelp.pro)


XHISTPICK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XHISTPICK
 PURPOSE:
       Widget routine to select image scaling based on a histogram.
 CATEGORY:
 CALLING SEQUENCE:
       xhistpick, xx, hh
 INPUTS:
       xx = Histogram bin positions.  in
       hh = Histogram counts.         in
 KEYWORD PARAMETERS:
       Keywords:
         MIN=mn  Returned selected lower image value cutoff.
         MAX=mx  Returned selected upper image value cutoff.
           If defined these values will also be used as initial
           values of the cutoffs.
         TITLE=txt  Title text string or array.
         ERROR=err  Error flag: 0=OK, 1=CANCEL
         CLIP=n  Clip max histogram count to the n'th below the
           highest count.  Good for ignoring spikes in histogram.
           /clip may work well, or try clip=2 or 3.
         IMAGE=img  Image to display (def=none).  If given, this
           image will be displayed in the specified window with
           the currently selected scaling limits.
         WINDOW=win  Window for image display (def=0).  Only
           needed if an image is given.
         /ON_FREEZE redisplay image every time a limit is frozen
           in a new position.  Else a Redisplay button appears.
         /WAIT  means wait for returned result.
        GROUP_LEADER=grp  specified group leader.  When the
          group leader widget is destroyed this widget is also.
        Any valid PLOT keywords will be passed on to PLOT.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: Histogram and bin position array may be made using
         hist.  Ex:   hh=hist(img,xx)
                      xhistpick,xx,hh,image=img
         Try xx(2:0),hh(2:*) to drop a large count of image zeros
         and the bottom added bin.  See h=hist(/help)).
         Image may be floating.
 MODIFICATION HISTORY:
       R. Sterner, 7 Dec, 1993
       R. Sterner, 13 Dec, 1993 --- Added clip and _extra.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xhistpick.pro)


XHOTLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XHOTLIST
 PURPOSE:
       Widget based hotlist of items.
 CATEGORY:
 CALLING SEQUENCE:
       xhotlist
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         FILE=f    Full name of hotlist file (format below).
         OUT=t     Returned selected item (null for cancel).
            This will be a directory if browse option used.
         BROWSE=bfile  Returned file selected by browse if any.
            If this is not null then it was the selected file.
         TITLE=tt  Hotlist title (def=none).
         VALUE=v   Current incoming value (def=none).
         DESCRIPTION=d  Current incoming description (def=none).
           Above two keywords used for Add Current. For example:
           VALUE might be a subdirectory and DESCR its description.
         /READONLY Suppress file modification buttons (no update).
         XSIZE=xs  Max text window width in characters (def=30).
         YSIZE=ys  Max text window height in characters (def=12).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: A hotlist is a good way to provide easy access to a
         a number of frequently used items such as directories.
         The hotlist resides in a text file of the following format.
           Line 1:  Title line
           Line 2:  Title line
           Line 3:  Value_1
           Line 5:  Description_1.
           Line 6:  Value_2
           Line 4:  Description_2.
            . . .
         First two lines (title lines) are ignored.
         Values and descriptions are text strings.
         Descriptions are what are actually displayed in the
         hotlist.  The corresponding value is returned.
       
         The hotlist modification buttons (along widget bottom)
         update the hotlist file.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Apr 28
       R. Sterner, 1997 Sep 26 --- Added BROWSE button and keyword.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xhotlist.pro)


XHSBC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XHSBC
 PURPOSE:
       Adjust image hue, saturation, brightness, & contrast. Widget.
 CATEGORY:
 CALLING SEQUENCE:
       xhsbc
 INPUTS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 14
       R. Sterner, 1994 Oct 14

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xhsbc.pro)


XIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XIMAGE

 PURPOSE:

       The purpose of this program is to demonstrate how to
       create a image plot with axes,a title, and the ability
       to select a location and image value using object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       XImage, image

 REQUIRED INPUTS:

       None. The image "worldelv.dat" from the examples/data directory
       is used if no data is supplied in call.

 OPTIONAL INPUTS

       image: An 8-bit or 24-bit image.

 OPTIONAL KEYWORD PARAMETERS:

       COLORTABLE: The number of a color table to use as the image palette.
       Color table 0 (grayscale) is used as a default. (Keyword ignored if
       a 24-bit image is used.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       KEEP_ASPECT_RATIO: Set this keyword if you wish the aspect ratio
       of the image to be preserved as the graphics display window is resized.

       TITLE: A string used as the title of the plot.

       XRANGE: A two-element array specifying the X axis range.

       XSIZE: The initial X window size. Default is 400 pixels.

       XTITLE: A string used as the X title of the plot.

       YRANGE: A two-element array specifying the Y axis range.

       YSIZE: The initial Y window size. Default is 400 pixels.

       YTITLE: A string used as the Y title of the plot.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       None.

 RESTRICTIONS:

       Requires the XColors program from the Coyote library to change color tables.

          http://www.dfanning.com/programs/xcolors.pro

 EXAMPLE:

       To use this program with your 8-bit or 24-bit image data, type:

        IDL> XImage, image

 MODIFICATION HISTORY:

       Written by David Fanning, 13 June 97.
       Added Keep_Apect_Ratio keyword and Zoom buttons. DWF 15 JUNE 97.
       Improved font handling and color support. DWF 4 OCT 97.
       Fixed memory leakage from improper object cleanup. 12 FEB 98. DWF
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Modified program to show how image values can be selected. 8 May 2000. DWF.
       Made several modifications to resize event handler. Much improved. 2 June 2000. DWF.
       Completely updated program to reflect current (IDL 5.5) capabilities. 12 Nov 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\ximage.pro)


XLESS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:    xless

 PURPOSE:    create a text widget to scroll through a string array or
             a file

 USEAGE:     xless,text,file=file,space=space,xsize=xsize,ysize=ysize,$
                   xpad=xpad,ypad=ypad,title=title,font=font,group=group,$
                   unmanaged=unmanaged

 INPUT:
   text      string array containing text.  if TEXT is set FILE is ignored

 KEYWORD INPUT:
   file      pathname of text file to display
   space     space to put around text widget
   xsize     x size of text widget (characters)
   ysize     y size of text widget (lines)
   xpad      padding 
   ypad      padding
   title     title of text widget (default = XLESS)
   font      text font to use
   group     widget group leader 
   unmanaged don't put widget under control of the XMANAGER. This
             also means there will be no DONE button: to kill the widget
             use a XWINDOW manager command (EG, menu option "close")
             

 OUTPUT:
   none

 EXAMPLE:

; list a string array

             text=string(indgen(40)) & text(*)=text(*)+' this is a test'
             xless,text

             xless,text,/unman ; notice how control returns to the terminal
                               ; imediately after this command

; list a file
             
             xless,file=pickfile(/noconfirm)

 REVISIONS:

  author:  Paul Ricchiazzi                            Jul94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xless.pro)


XLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XLINE
 PURPOSE:
       Interactive line on image display.
 CATEGORY:
 CALLING SEQUENCE:
       xline
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         /DATA   display data coordinates (default).
         /DEVICE display device coordinates.
         /NORMAL display normalized coordinates.
         START=[x1,y1] Specified line start point (def=[0,0]).
         STOP=p2  Returned line stop point ([x,y]).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1995 Feb 21

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xline.pro)


XLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XLIST
 PURPOSE:
       Pop-up list selection widget.
 CATEGORY:
 CALLING SEQUENCE:
       out = xlist(list)
 INPUTS:
       list = string array of possible selections.  in
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=txt  title text or text array (def=Select item).
         MAXSCOLL=n Max allowed lines before scrolling list used
           (def=20).
         HIGHLIGHT=i Line to highlight (def=none).
         TOP=j       Line to make be the top of the list.
         INDEX=indx  Returned index of selected item.
         /WAIT  means wait for a selection before returning.
           Needed if called from another widget routine.
 OUTPUTS:
       out = selected element.                      out
         Null if Cancel button pressed.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 11 Nov, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xlist.pro)


XLS2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  xls2js

 PURPOSE:
   This function converts EXCEL-time values to JulianSeconds

 CATEGORY:
   TIME

 CALLING SEQUENCE:
   result=xls2js(xls_date)

 INPUTS:
   xls_date: EXCEL time value, scalar or array

 OUTPUTS:
   result: JulianSeconds

 EXAMPLE:
   result=xls2js(39000)
   print,js2str(result)
     00:00:00 10.10.2006 000

   MODIFICATION HISTORY:
   Written by: Franz Rohrer November 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\xls2js.pro)


XMAKEDRAW

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      xmakedraw

 PURPOSE:      create a simple draw widget with a done button

 USEAGE:       xmakedraw,group=group,x_window_size=x_window_size,$
                 y_window_size=y_window_size,widget_label=widget_label,$
                 make_draw_index=make_draw_index,nowait=nowait

 INPUT:        none required

 KEYWORD INPUT:

  group                widget id of parent widget 

  x_window_size        width of draw widget

  y_window_size        height of draw widget

  widget_label         widget label 

  base_id              widget id of base widget

  nowait               if set do not call xmanager, return immediately
                       after draw widget is realized

                       This keyword should be used when XMAKEDRAW is
                       not called by another widget procedure (see example)
 EXAMPLE:

; called from non-widget application (e.g., interactive input)

   xmakedraw,base_id=base_id,x_w=500,y_w=500,/nowait
   !p.multi=[0,2,2]
   loadct,5
   plot,dist(10)
   tvim,dist(100)
   plot,hanning(10,10)
   tvim,hanning(10,10)
   xmanager,'xmakedraw',base_id

;  in this example control is returned from the XMANAGER routine only
;  after the operator hits the DONE button.  If instead, this program
;  segment were called from another widget application, the highest
;  level call to the XMANAGER would supercede all lower level calls.
;  That is, program flow in not halted and normal widget event
;  processing would continue. In this case the NOWAIT parameter should
;  not be set and the call to XMANAGER is not required.
 
 Author:       Jeff Hicke                                      sep93
               Earth Space Research Group, UC Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xmakedraw.pro)


XMAP

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:     xmap

 PURPOSE:     Display a world map and allow user to zoom in on a given region

 INPUT:       none
 OUTPUT:      none

                         INTERACTIVE CONTROLS:

 BUTTON EVENTS WITHIN MAP FRAME:

   Left mouse button --- Display lat-lon coordinates under cursor.

   Middle mouse button - Display distance between the last LMB click
                         and the current cursor position

   Right mouse button -- Enter region selection mode.  An interactive
                         cursor box appears.  The user selects the ZOOM
                         region by moving the cursor and using the
                         left/middle mouse buttons to decrease/increase
                         the box size.  Hitting the right mouse
                         button again selects the region, draws the
                         map and displays the MAP_SET command line
                         which duplicates the displayed map.  NOTE: to
                         improve performance, the whole world map is
                         drawn at low resolution whereas the zoomed
                         in maps are drawn at high resolution.

 BUTTONS:

 DONE
    quit XMAP

 WORLD
    Redisplay world map

 ROTATE
    Rotates the central longitude by 180 degrees.

 COLOR
    Adjust color values of lines used to indicate continental
    boundaries, US state boundaries, political boundaries, and
    rivers.

    NOTE: Color adjustment is accomplished via the PICKC widget.
    Motion of the cursor inside the PICKC window adjusts
    the Hue and Saturation values.  The intensity is adjusted
    with a horizontal slider.

 SPAWN
    Copy current map to a new window. The spawned window will
    remain visible after XMAP terminates.
              

 PRINT
    Pull down menu  
      TERM:     Print current map to device TERM 
      TREE:     Print current map to device TREE
      PSCOLOR:  Print current color map to device PSCOLOR
      BW PS:    create a BW postscript file named plot.ps
      COLOR PS: create a color postscript file named plotc.ps

 PATH
    trace a path on the map and compute total distance
    LMB adds a new path line segment
    MMB erases last path segment
    RMB computes total distance of path in km, and return to normal mode

 CITIES
    mark major city locations 

 HELP       
   Display this help file in a scrollable widget.


 TEXT WIDGET  (labeled WHERE IS:)
   Enter the latititude  longitude.   A symbol is drawn to
   indicate point on map.  NOTE: the code will bomb if you mess up
   the format

  author:  Paul Ricchiazzi                            Dec92
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xmap.pro)


XMERGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XMERGE
 PURPOSE:
       Widget based routine to merge multiple color images in one.
 CATEGORY:
 CALLING SEQUENCE:
       xmerge
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         DIRECTORY=dir  optional initial directory (def=current).
         /DEBUG  means add a few debug buttons.
 OUTPUTS:
 COMMON BLOCKS:
       xmerge_event_com
 NOTES:
       Notes: Click on HELP button for details.
 MODIFICATION HISTORY:
       R. Sterner, 1995 Mar 14
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1995, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xmerge.pro)


XMESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XMESS
 PURPOSE:
       Display a message using a widget.
 CATEGORY:
 CALLING SEQUENCE:
       xmess, txt
 INPUTS:
       txt = Message to display as a string or string array.  in
 KEYWORD PARAMETERS:
       Keywords:
         WID=id  Returned widget ID of message widget.  May use
           this to automatically destroy the message widget
           when an action is completed.  To destroy widget do:
           widget_control, /dest, id
         /NOWAIT  means don't wait for OK button to be pressed.
           Useful with WID to fill in long pauses, can display
           what is happening, then destroy message.
         /WAIT  means wait for OK button without using xmanager
           to register xmess.  Will not drop through if button
           is not pressed as in default case.
         OKTEXT=txt  Set text for OK button (def=OK).
         XOFFSET=xoff, YOFFSET=yoff Widget position.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 25 Oct, 1993
       R. Sterner, 11 Nov, 1993 --- added /NOWAIT.
       R. Sterner, 1994 Sep 6 --- Added /WAIT.
       R. Sterner, 1998 Jun  3 --- Added xoff, yoff.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xmess.pro)


XMESSAGE

[Previous Routine] [Next Routine] [List of Routines]
 routine:      xmessage
 purpose:      create a simple set of widget labels

 useage:       xmessage,labels,charsize=charsize,wbase=wbase,group=group,$
                   title=title,kill=kill,relabel=relabel,wlabels=wlabels,$
                   done=done,font=font

 input:        
  labels       string array of labels

 keyword input:
  charsize     size of characters
               
  wbase        widget id of xmessage base widget
               
  group        widget id of parent widget 
               
  title        widget label 
               
  kill         kills xmessage widget if KILL is set to the value 
               of WBASE returned from a previous call of XMESSAGE
               
 relabel       scalor or integer array of widget id's.  Used to relabel
               xmessage labels, relabel should be set to the values
               (possibly a subset) of WLABELS from a previous call of
               XMESSAGE.  When XMESSAGE is used with RELABEL, the
               LABELS parameter should be set to a string array of
               the new labels

  done         if set, the XMESSAGE widget will have a "DONE" button
               which can be used to destroy the widget.  Otherwise
               the XMESSAGE widget is destroyed by calling XMESSAGE
               with the KILL keyword set to the XMESSAGE widget id.
               It is also destroyed when it is part of a widget
               hierarchy whose group leader is killed

  font         the hardware font used in the labels

 keyword output:
  wbase        widget id of xmessage base widget
  wlabels      widget id's of xmessage label widgets (intarr)

 EXAMPLE:

; create xmessage widget
   
    labels=['here is an example','of the xmessage widget']
    xmessage,labels,wbase=wbase,wlabel=wlabels

; relabel 2'nd label

    xmessage,'of The XMESSAGE WIDGET',relabel=wlabels(1)

; kill the message

    xmessage,kill=wbase

  author:  Paul Ricchiazzi                            Jan93
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xmessage.pro)


XMETER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XMETER
 PURPOSE:
       Display a 0 to 100% meter on a text screen.
 CATEGORY:
 CALLING SEQUENCE:
       txtmeter, fr
 INPUTS:
       fr = fraction, 0 to 1.00 to display as %.  in
 KEYWORD PARAMETERS:
       Keywords:
         /INITIALIZE must be called to start meter.
         /CLEAR will erase the specified meter.
         TITLE=txt set meter title (def=no title). Only on /INIT.
 OUTPUTS:
 COMMON BLOCKS:
       xmeter_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Feb 27

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xmeter.pro)


XMOVIE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     XMOVIE

 PURPOSE:
     This program is a simplified version of XINTERANIMATE. It is written
     to illustrate the proper way to write an animation loop in a widget
     program using the WIDGET_TIMER functionality.

 CATEGORY:
     Widgets.

 CALLING SEQUENCE:

      XMOVIE, image3d

 INPUTS:
     image3d: A three-dimensional image array. The animation occurs over
              the third dimension.

 KEYWORD PARAMETERS:
     GROUP:   The group leader of the program. When the group leader dies,
              this program dies as well.

     TITLE:   The window title of the program. The default is "Animation
              Example...".

 COMMON BLOCKS:
     None.

 SIDE EFFECTS:
     None.

 EXAMPLE:
     To open the abnormal heart data and animate it, type:

        filename = FILEPATH(SUBDIR=['examples', 'data'], 'abnorm.dat')
        OPENR, lun, filename, /GET_LUN
        data = BYTARR(64, 64, 15)
        READU, lun, data
        FREE_LUN, lun
        data = REBIN(data, 256, 256, 15)

        XMOVIE, data

 MODIFICATION HISTORY:
      Written by: David Fanning, June 96.
      Added slider for controlling animation speed. 30 June 99.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xmovie.pro)


XMULTI

[Previous Routine] [Next Routine] [List of Routines]
 routine:      xmulti

 purpose:      set up margins for horizontally stacked multi frame plot

 input:        

   p           named variable, contains stuff you don't need to know
               the contents of p are changed after each call
 
 Keyword input

   np          number of frames in plot, set on first call only

   xmargin     2 element vector specifying overall margin setting 
               left (0) and right (1) of the multiframe plot
               if xmargin is not set the left and right margin is taken
               from !x.margin. This keyword is ignored when NP not set

   space       space between frames of multiframe plots in units of 
               character width.  This keyword is ignored when NP not set


 SIDE EFFECTS: Changes the values !p.multi(4) to 0 to enforce row
               major ordering of plots. Also changes the value of
               !y.charsize to a very small value to disable y-axis
               labeling.  The original value of !y.charsize is
               restored when xmulti is called with no arguments,
               e.g., p=xmulti()
               

 EXAMPLE:      create a three frame plot stacked horizontally

 y1=randf(200,1.5)
 y2=randf(200,2)
 y3=randf(200,2.5)
 y4=randf(200,3)
 
 !p.multi=[0,3,1]
 plot,y1, xmargin=xmulti(p,np=3,xmargin=[5,3],space=1)
 plot,y2, xmargin=xmulti(p)
 plot,y3, xmargin=xmulti(p) & p=xmulti()

;  Now try a four frame plot with no space between frames

 !p.multi=[0,4,1]
 plot,y1,            xmargin=xmulti(p,np=4)
 plot,y2,            xmargin=xmulti(p)
 plot,smooth(y2,5),  xmargin=xmulti(p)
 plot,smooth(y2,7),  xmargin=xmulti(p) & p=xmulti()

;  now try two four frame plots on the same page
;

 !p.multi=[0,4,2]

 plot,y1,xmargin=xmulti(p,np=4,space=1) & xl=!x.window(0)
 plot,y2,xmargin=xmulti(p)
 plot,y3,xmargin=xmulti(p) 
 plot,y4,xmargin=xmulti(p) & p=xmulti()
 xl=(!x.window(1)+xl)/2
 yl=!y.window(1)+.5*!y.margin(1)*!d.y_ch_size/float(!d.y_vsize)
 xyouts,xl,yl,'top',align=.5,/norm

 plot,y1^2,xmargin=xmulti(p,np=4,space=1)
 plot,y2^2,xmargin=xmulti(p)
 plot,y3^2,xmargin=xmulti(p)
 plot,y4^2,xmargin=xmulti(p) &  p=xmulti()
 yl=!y.window(1)+.5*!y.margin(1)*!d.y_ch_size/float(!d.y_vsize)
 xyouts,xl,yl,'bottom',align=.5,/norm

  author:  Paul Ricchiazzi                            Mar94
           Institute for Computational Earth System Science
           University of California, Santa Barbara

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\xmulti.pro)


XN_TABLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xn_table

 PURPOSE:
This procedure is used to show as a widget table data of a netCDF File.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xn_table,[file=file],[name=name],[inhalt=inhalt],[/no_block],[/xp] OPTIONAL INPUTS: file: the name of the netCDF File name: the name to show in the table inhalt: the by ncdf_gr defined structure OPTIONAL OUTPUTS: inhalt: the by ncdf_gr defined structure KEYWORD PARAMETERS: no_block: if true xmanager would not blocked xp : dialog_pickfile is launched to choose a file EXAMPLE: xn_table MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Jun-11

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xn_table.pro)


XOPTION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XOPTION
 PURPOSE:
       Widget option selection panel.
 CATEGORY:
 CALLING SEQUENCE:
       opt = xoption(menu)
 INPUTS:
       menu = string array, one element per option.  in
         These are the option button titles (from top down).
 KEYWORD PARAMETERS:
       Keywords:
         VALUES=val  Array of values corresponding to each option.
           Default value is the menu element index (numeric).
         DEFAULT=n Button to use as default value (top is val(0)).
           Sets mouse to point at this element.  If VALUES are
           given DEFAULT must be one of those values.
         TITLE=txt A scalar text string to use as title (def=none).
         SUBOPTIONS=sopt Array of optional suboption names.
           If given this creates a new bank of buttons, one for
           each suboption name.
         /EXCLUSIVE means make the suboption buttons exclusive
           (only one active at a time), else non-exclusive.
         SUBSET=set  Suboption initial settings, an array of
           0 (off) or 1 (on), one for each suboption button.
           The updated button status is returned here also.
           For exclusive buttons only the active button number
           is returned, -1 for none.
         SUB2OPTIONS=s2opt Optional second suboption menu.
         /EX2 Second suboption buttons are exclusive.
         SUB2SET=set2  Second suboption initial settings.
         XOFFSET=xoff, YOFFSET=yoff Widget position.
 OUTPUTS:
       opt = returned option value.                 out
 COMMON BLOCKS:
 NOTES:
       Notes: An example calls:
         opt = xoptions(['OK','Abort','Continue'])
         opt = xoptions(['A','B','C'],val=['a','b','c'],def='b')
 MODIFICATION HISTORY:
       R. Sterner, 1994 Jan 10.
       R. Sterner, 1994 Jan 13 --- Added DEFAULT keyword.
       R. Sterner, 1994 Apr 12 --- Added TITLE keyword.
       R. Sterner, 1995 Dec 22 --- Added suboptions.
       R. Sterner, 1998 Jun  3 --- Added xoff, yoff.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xoption.pro)


XPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XPLOT

 PURPOSE:
       The purpose of this program is to demonstrate how to
       create a line plot with axes and a title in the
       new IDL 5 object graphics.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, IDL 5 Object Graphics.

 CALLING SEQUENCE:
       XPlot, x, y

 REQUIRED INPUTS:
       x: A vector of input values used as the dependent data.

 OPTIONAL INPUTS
       y: A vector of input values used as the dependent data.
          If both x and y parameters are present, x is the independent data.

 OPTIONAL KEYWORD PARAMETERS:

       COLORPRINT: Set this keyword to obtain printed output in color.
       If not set (the default), printed output is in black and white.

       EXACT: Set this keyword to a one- or two-element array to set exact axis
       scaling for the axes. If Exact is a one-element array, both axes are
       set to the same value. If Exact is a two-element array, the first
       elements sets the X axis property and the second element sets the Y
       axis property. For example, to set the X axis to exact scaling and
       the Y axis to normal scaling, type:

           IDL> x = Findgen(10)
           IDL> XPlot, x, Sin(x), Exact=[1,0], XRange=[0,8.5]

       _EXTRA: This keyword collects otherwise undefined keywords that are
       passed to new Plot command. To some extent these are similar to the
       old IDL Plot command. For example: Linestyle=2, Thick=3,
       XRange=[-100,100], etc.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       PSYM: The index of a plotting symbol to use on the plot. Integers 0-7
       are valid values.

       SYMSIZE: Sets the size of the symbols. By default, symbols are sized
       so that they are 0.015 percent of the axis range.

       VECTOR: Set this keyword if you want the printed output to be in
       vector (as opposed to bitmap) form. This is faster, but not as accurate.

       TITLE: A string used as the title of the plot.

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 EXAMPLE:
       To use this program, pass a 1D vector or vectors, like this:

        IDL> XPlot, RandomU(seed, 11) * 9, YRange=[0, 10]

 MODIFICATION HISTORY:
       Written by David Fanning, 13 June 97.
       Modified axis font handling. 17 Sept 97. DWF.
       Was not destroying all objects on exit. 12 Feb 98. DWF.
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Fixed a bug in the way symbols were (NOT!) sized. 11 May 99. DWF.
       Added non-exact axis scaling. 12 May 99. DWF.
       Fixed bug that changed data when calling with single parameter. 13 May DWF.
       Added VECTOR, LANDSCAPE and COLORPRINT keywords and improved printing
          capabilities. 16 Feb 2000. DWF.
       Modified the EXACT keyword to accept values for X and Y axes
          independently. 10 May 2000. DWF.
       Updated for IDL 5.4. 13 June 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xplot.pro)


XPRINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XPRINT
 PURPOSE:
       Print text on graphics device.  After initializing use just like print.
 CATEGORY:
 CALLING SEQUENCE:
       xprint, item1, [item2, ..., item10]
 INPUTS:
       txt = text string to print.     in
 KEYWORD PARAMETERS:
       Keywords:
         COLOR=c set text color.
         ALIGNMENT=a set text alignment.
         /INIT to initialize xprint.
           xprint,/INIT,x,y
             x,y = coord. of upper-left corner of first line of text.    in
         /DATA use data coordinates (def). Only needed on /INIT.
         /DEVICE use device coordinates. Only needed on /INIT.
         /NORM use normalized coordinates. Only needed on /INIT.
         /NWIN use normalized window coordinates. Only needed
           on /INIT.  NWIN coordinates are linear 0 to 1
           inside plot window (inside axes box).
         CHARSIZE=sz  Text size to use. On /INIT only.
         CHARTHICK=thk  Text thickness to use. On /INIT only.
           Text is thickened by shifting and overplotting.
           Thk is total number of overplots wanted. To shift by
           > 1 pixel per plot do CHARTHICK=[thk,step]
           where step is in pixels (def=1).
         DY=factor.  Adjust auto line space by this factor. On /INIT only
           Try DY=1.5 for PS plots with the printer fonts (not PSINIT,/VECT).
         YSPACE=out return line spacing in Y.
         x0=x0 return graphics x-position of text in normalized coordinates.
         y0=y0 return graphics y-position of text in normalized coordinates.
 OUTPUTS:
 COMMON BLOCKS:
       xprint_com
 NOTES:
       Notes: Initialization sets text starting location and text size.
         All following xprint calls work just like print normally does except
         text is output on the graphics device.
 MODIFICATION HISTORY:
       R. Sterner, 9 Oct, 1989.
       H. Cohl, 19 Jun, 1991.  (x0, y0)
       R. Sterner, 25 Sep, 1991 --- fixed a bug that made line spacing
       wrong when the window Y size varied from the normal value. The
       bug showed up for psinit,/full with !p.multi=[0,1,2,0,0] where
       the line spacing appeared to be 2 times too much.  Was using
       xyouts to print a dummy letter to get its size.  Now just use
       the value !d.y_ch_size (dev coord) as a good guess.
       R. Sterner, 10 Mar, 1992 --- added CHARTHICK.
       R. Sterner, 18 Mar, 1992 --- Modified CHARTHICK to do shifted
       overplots and added shift size in pixels.
       R. Sterner, 27 Mar, 1992 --- fixed a bug added with the modified
       CHARTHICK.
       R. Sterner, 20 May, 1993 --- Allowed CHARSIZE.
       R. Sterner, 30 Jul, 1993 --- coordinate system used only to set
       initial point, not needed for each print.
       Handle log axes.

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xprint.pro)


XP_AXIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_axis

 PURPOSE:
 
This procedure is used to set for the plot Structure the axis.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_axis,uvalue,x=x,y=y,[z=z],[group_leader=group_leader],[/time],[/no_remove],[/no_comment],[/no_replace],[/wait] INPUTS: uvalue: The by pl_init defined plot Structure x: The x vector of data y: The y vector of data OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: time: to indicate x values as a time wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax OUTPUTS: This procedure returns the input structure COMMON BLOCKS: js_com defined in js_plot with js_off the offset to the julian seconds EXAMPLE: pro tst_xpaxis x=findgen(20)+1 y=x z=makez(20,20) @init ; plotinit,plot plot.xtitle='X' plot.ytitle='Y' plot.nlevels=0 defp2d,plot,'levels',dindgen(10)/10. xp_axis,plot,x=x,y=y,z=z plot.cbar=1 plot2d,plot,x=x,y=y,z=z plotend,plot end MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAY-27 1998-May-31 str_find_ex included 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_axis.pro)


XP_ICG_TS_SYNC

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

 USERLEVEL:
   TOPLEVEL

 NAME:
	xp_icg_ts_sync

 PURPOSE:
 
This procedure is used to set the syntax for icg_ts_sync.
IMAGE
CATEGORY: ICG_STRUCT/WIDGETS CALLING SEQUENCE: xp_icg_ts_sync,[master],[client],[result=result],[/no_remove],[/no_comment],[/no_replace],[group_leader=group_leader],[/wait] INPUTS: master: a nc file name or a icg_struct as master client: a nc file name or a icg_struct as client KEYWORD PARAMETERS: result: the resulting icg_struct of synchronized data goup_leader: the group id of the major widget wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax this feature should not be used in combination with one of the other no_ keys EXAMPLE: PRO test xp_icg_ts_sync,'avionik.nc','fish_falcon.nc',result=master --> master=read_ncdf('avionik.nc') client_icg=read_ncdf('fish_falcon.nc') short_name=['H2O'] master=icg_ts_sync(master,client_icg,LINEAR_INTERPOLATION=1) M=read_ncdf('avionik.nc') c=read_ncdf('fish_falcon.nc') xp_icg_ts_sync,m,c,result=master --> short_name=['H2O'] master=icg_ts_sync(m,c,linear_interpolation=1) --> M=read_enz('popc11a.cs') xp_icg_ts_sync,m,result=master END IDL> xp_icg_ts_sync,result=result MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999-Sep-06 2000-Feb-07 time, xp_icg_ts_sync_global_mask added 2000-Feb-25: CATEGORY changed

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_icg_ts_sync.pro)


XP_LAYOUT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_layout

 PURPOSE:
 
This procedure is used to set for the plot Structure the layout page style.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_layout,uvalue,[group_leader=group_leader],[/no_remove],[/no_comment],[/no_replace],[/wait],[/no_edit_page],[/not_show_rcl_phpw] INPUTS: uvalue: The by pl_init defined plot Structure OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax no_edit_page : to switch of posible changing of no of rows and columns not_show_rcl_phpw : to switch of from the widget the row, column, landscape, paper_height and paper_width OUTPUTS: uvalue: the altered input structure EXAMPLE: xp_layout,plot MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-May-24 code reformed 1998-May-31 str_find_ex included 1998-Jun-23 keyword no_remove added 1998-Jun-24 keyword not_show_rcl_phpw added 1999-Sep-18 bug with x and y vector removed 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_layout.pro)


XP_LEGEND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_legend

 PURPOSE:
 
This procedure is used to set for the plot Structure the legend position.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_legend,uvalue,[group_leader=group_leader],[/no_remove],[/no_comment],[/no_replace],[/wait] INPUTS: uvalue: The by pl_init defined plot Structure OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax OUTPUTS: This procedure returns the input structure EXAMPLE: pro tst_xp_legend @init plotinit,plot a=findgen(100) b=sin(a) plot.xtitle='X' plot.ytitle='sin' plot.legend_name='Values' plotxy,plot,x=a,y=b plot.psym=208 c=sin(a)/2. plot.legend_name='Cell' plotxy,plot,x=a,y=c plot.psym=5 c=sin(a)/4 plot.legend_name='Cell2' plotxy,plot,x=a,y=c xp_legend,plot plotend,plot end RESTRICTIONS: sometimes if more than 256 colors avaiable the legend is in widget mode unvisble MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-May-24: much more comfort in altering of the legend 1998-May-28: linestyle problem fixed 1998-May-31 str_find_ex included 1998-May-31 failure with more than one "zeilen" and "spalten" removed 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check 2000-Apr-20 legend features of rb_legend added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_legend.pro)


XP_MAP_SET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_map_set

 PURPOSE:
 
This procedure is used to set for map projection.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_map_set,uvalue,[group_leader=group_leader],[/no_remove],[/no_comment],[/no_replace],[/wait] INPUTS: uvalue: The by pl_init defined plot Structure OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax no_remove : means that's the procedure will not be commented and the plot Syntax will be added too OUTPUTS: uvalue: the altered input structure EXAMPLE: @init plotinit,plot xp_map_set,plot plotmap,plot plotmap_boundaries,plot plotend,plot END MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Jun-23 1998-Jun-24 xp_layout added 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_map_set.pro)


XP_SYMBOLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_symbols

 PURPOSE:
 
This procedure is used to set for the plot Structure the symbols style.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_symbols,uvalue,[group_leader=group_leader],[/no_remove],[/no_comment],[/no_replace],[/wait] INPUTS: uvalue: The by pl_init defined plot Structure OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax OUTPUTS: This function returns the input structure EXAMPLE: xp_symbols,plot MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-Mar-31 mistake in the initializing of the start colorindex resolved 1998-Apr-04 create_widget_button_symbol included for all symbols 1998-May-31 str_find_ex included 1998-May-31 plot could not be used inside the widget to draw the symbol because oplot of an application will do an oplot inside the widget No result will be shown on screen. Therefore the plotxy sequence was replaced by plots 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_symbols.pro)


XP_TEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_text

 PURPOSE:
 
This procedure is used to find out the right position for a text and will display it.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_text,plot,text,[color=color],[charsize=charsize],[align=align],[group_leader=group_leader],[/no_remove],[/no_comment],[/no_replace],[/no_show],[/wait] INPUTS: plot: the by pl_init defined plot structure text: The text which should be displayed OPTIONAL INPUTS: goup_leader: the group id of the major widget color=color: the textcolor charsize=charsize: the charsize align=align the alignment KEYWORD PARAMETERS: wait: to set the widget waiting no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax no_show: don't execute the output statement OUTPUTS: The xyouts will be momentanly used to display a text EXAMPLE: x=findgen(100) y=sin(x) @init plotinit,plot plotxy,plot,x=x,y=y xp_text,plot,'TEST',/no_replace plotend,plot MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-Apr-05 excluded use in ps devices 1998-May-31 str_find_ex included 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_text.pro)


XP_TITLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_title

 PURPOSE:
 
This procedure is used to set for the plot Structure the titles.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_title,uvalue,[group_leader=group_leader],[wait=wait],[/time],[/no_remove],[/no_comment],[/no_replace] INPUTS: uvalue: The by pl_init defined plot Structure OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax no_remove : means that's the procedure will not be commented and the plot Syntax will be added too OUTPUTS: This function returns the input structure EXAMPLE: x=findgen(100) y=sin(x) @init plotinit,plot plotxy,plot,x=x,y=y xp_title,plot plotend,plot MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-May-31 str_find_ex included 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_title.pro)


XP_ZOOM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xp_zoom

 PURPOSE:
 
This procedure is used to set for the plot Structure the range style.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xp_zoom,uvalue,[/time],[/no_remove],[/no_comment],[/no_replace],[color=color] INPUTS: uvalue: The by pl_init defined plot Structure KEYWORDS: time: to define data on X Axis is in Julian Seconds no_remove : means that's the procedure will not be commented and the plot Syntax will be added too no_comment: no comment lines will be included to the plotscript no_replace: means that's the procedure line will not be replaced by the plot Syntax OUTPUTS: This function returns the input structure EXAMPLE: xp_zoom,plot MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-28 1998-Apr-05 excluded use in ps devices 1998-May-31 str_find_ex included 1998-Jun-23 keyword no_remove added 1999-Oct-20 Syntax check 2000-Mar-13 keyword color added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xp_zoom.pro)


XSPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XSPEC
 PURPOSE:
       Compute an ensemble averaged cross spectrum of real data.
 CATEGORY:
 CALLING SEQUENCE:
       sxy = xspec(x,y,n,sr,[freq])
 INPUTS:
       x = input signal number 1.                      in
       y = input signal number 2.                      in
         If x or y have too few points, -1 is returned.
       n = number of points to use in each transform   in
         May be arbitrary.
       sr = sample rate in Hz (Def=1 Hz)               in
         Needed to get actual units.
 KEYWORD PARAMETERS:
       Keywords:
         OVERLAP=novr  number of points to overlap spectra.
           (Def=0).
         TRANSFER_FUNCT = transfer function, Txy = Sxy/Sxx
           in units of y/x
         CA_ARRAY = ca :  Coherence and autospectra array.
           ca(*,0)=Cxy(f)  Coherence=|Sxy|^2/(Sxx*Syy) dimensnless
           ca(*,1) = Sxx(f)  Autospectrum of x in units of x**2/Hz.
           ca(*,2) = Syy(f)  Autospectrum of y in units of y**2/Hz.
         N_ENSEMBLE=n  returned # spectra ensemble averaged.
         /NOTES lists some additional comments.
 OUTPUTS:
       sxy = spectral density in units of x*y/Hz.      out
         First value is DC, last is Nyquist.
       freq = optionally output frequency array.       out
 COMMON BLOCKS:
       xspec_com
 NOTES:
       Notes: Restricted to one dimensional data only.
         Reference: 
 MODIFICATION HISTORY:
       B. L. Gotwols Mar. 1, 1993
       R. E. Sterner Mar. 1, 1993 --- cleaned up some.
       BLG, RES ---  Mar. 10, 1993 --- renamed variables.
       BLG --- 19 May, 1993 --- made loop index long.
       Fixed ntimes to be correct.  Also floated sr.
       Made OVERLAP default to 0 to be consistent with
       future addition of OVERLAP in rspec and cspec.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xspec.pro)


XSTRETCH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XSTRETCH

 PURPOSE:

       The purpose of this program is to interactively apply a simple
       linear stretch to an image by moving two lines on a histogram
       plot of the image. The portion of the image data between the
       two lines is stretched over the available colors in the color table.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics, Widgets

 CALLING SEQUENCE:

       XSTRETCH, image

 INPUT PARAMETERS:

       image:    The image data to be stretched.It must be 2D. (This may now
                 be a pointer to the image data rather than the image itself.)

 KEYWORD PARAMETERS:

       COLORTABLE: The index of a colortable you would like to load.
                 The current colortable is used if this keyword is undefined.

       _EXTRA:   This keyword collects any keyword appropriate for the
                 Plot command.

       GROUP_LEADER: Keyword to assign a group leader (so this program can be
                 called from within another widget program).

       MAX_VALUE: Keyword to assign a maximun value for the Histogram Plot.
                 Images with lots of pixels of one color (e.g. black) skew
                 the histogram. This helps make a better looking plot.

       NCOLORS:  Keyword to assign the number of colors used to display
                 the image. The default is !D.Table_Size-4.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 DEPENDENCIES:

       The following programs are required from the Coyote Library:

           tvimage.pro
           pswindow.pro
           psconfig.pro
           fsc_inputfield.pro
           fsc_droplist.pro
           fsc_fileselect.pro
           fsc_plotwindow.pro
           fsc_psconfig__define.pro

 EXAMPLE:

       If you have a 2D image in the variable "image", you can run this
       program like this:

       XSTRETCH, image

 MODIFICATION HISTORY:

       Written by: David Fanning, April 1996.
       October, 1996 Fixed a problem with not restoring the color
          table when the program exited. Substituted a call to XCOLORS
          instead of XLOADCT.
       October, 1998. Added NO_BLOCK keyword and modified to work with
          24-bit color devices.
       April, 1999. Made lines thicker. Offered default image. DWF.
       April, 1999. Replaced TV command with TVIMAGE. DWF.
       April, 1999. Made both windows resizeable. DWF.
       April, 2000. Made several modifications to histogram plot and to
          the way colors were handled. Added ability to pass pointer to
          the image as well as image itself. DWF.
       February 2001. Removed GIF file support for IDL 5.4 and fixed
          a problem with cleaning up the pixmap. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xstretch.pro)


XSUBDIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XSUBDIR
 PURPOSE:
       Widget based subdirectory selection tool.
 CATEGORY:
 CALLING SEQUENCE:
       xsubdir, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         START=dir  Starting directory (def=current).
         TITLE=tt   Widget title (def="Select directory").
         /WAIT  means wait for returned result.
 OUTPUTS:
       out = name of selected directory.  out
         Null string means no change.
 COMMON BLOCKS:
 NOTES:
       Notes: May move up or down in directory tree.
 MODIFICATION HISTORY:
       R. Sterner, 9 Nov, 1993

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xsubdir.pro)


XSUBDIR2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       xsubdir2
 PURPOSE:
       Widget based subdirectory selection tool.
 CATEGORY:
 PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
       xsubdir2, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         START=dir  Starting directory (def=current).
         TITLE=tt   Widget title (def="Select directory").
         /WAIT  means wait for returned result.
 OUTPUTS:
       out = name of selected directory.  out
         Null string means no change.
 COMMON BLOCKS:
 NOTES:
       Notes: May move up or down in directory tree.
 MODIFICATION HISTORY:
       R. Sterner, 9 Nov, 1993
       R. Bauer,   2 Jun, 1997 replaced spawn by findfile

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xsubdir2.pro)


XSURFACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XSURFACE

 PURPOSE:

       The purpose of this program is to demonstrate how to
       create a surface with axes and a title in the new IDL 5
       object graphics.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object Graphics.

 CALLING SEQUENCE:

       XSURFACE, data, x, y

 REQUIRED INPUTS:
       None. Fake data will be used if no data is supplied in call.

 OPTIONAL INPUTS

       data: A 2D array of surface data.

       x: A vector of X data values.

       y: A vector of Y data values.

 OPTIONAL KEYWORD PARAMETERS:

       COLORTABLE: Set this keyword to a number between 0 and 40 to select one
       of the pre-selected IDL color tables for elevation shading.

       ELEVATION_SHADING: Set this keyword to put elevation shading into effect.

       EXACT: Set this keyword to a one-, two-,or three-element array to set exact axis
       scaling for the X, Y, and Z axes, respectively. If Exact is a one-element array,
       all three axes are set to the same value. For example, to set the X axis to
       exact scaling and the Y and Z axes to normal scaling, type:

           IDL> FSC_Surface, Exact=[1,0,0]

       _EXTRA: This keyword collects otherwise undefined keywords that are
        passed to the IDLgrSURFACE initialization routine.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       LANDSCAPE: Set this keyword if you are printing in landscape mode. The
       default is Portrait mode. The Landscape keyword on the PRINTER object
       is set, but not all printers will honor this keyword setting. If yours
       does not, set Landscape mode in the Printer Setup dialog.

       SHADED: Set this keyword to set up a shaded surface plot rather than a wire
       mesh surface, which is the default.

       TITLE:  A string used as the title of the plot.

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

       ZTITLE: A string used as the Z title of the plot.


 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 DEPENDENCIES:
       This program requires the following additional files from the Coyote Library:

          error_message.pro
          fsc_droplist.pro
          getcolor.pro
          loaddata.pro
          pickcolor.pro
          xcolors.pro

 EXAMPLE:
       To use this program with your data, type:

        IDL> XSurface, data

 MODIFICATION HISTORY:
       Written by David Fanning, 8 June 97.
       Made axis scaling more robust. 17 Sept 97. DWF.
       Minor modifications to incorporate better understanding
          of how objects work. 4 Oct 97. DWF.
       Fixed error cleaning up all of my created objects. 12 Feb 98. DWF.
       Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF.
       Fixed mis-spelling of HELVETICA14. 29 June 98. DWF.
       Added the EXACT keyword to the X and Y axes to force axis ranging. 27 July 98. DWF
       Added the ability to select rendering "drag" quality for faster operation. 22 Aug 98. DWF.
       Added ability to get non-exact axis scaling. 12 May 99. DWF.
       Improved documentation and readability of code. 12 May 99. DWF.
       Added VECTOR and LANDSCAPE keywords and improved printing capability. 16 Feb 2000. DWF.
       Added different lights and a Light Controller option. 28 April 2000. DWF.
       Added elevation shading. 8 May 2000. DWF.
       Removed VECTOR keyword. Replaced with VECTOR/BITMAP/COLOR Print buttons. 8 May 2000. DWF.
       Added HIDDEN_LINE keyword. 8 May 2000. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\xsurface.pro)


XTEXTFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XTEXTFILE
 PURPOSE:
       Explore a text file of unkown format.
 CATEGORY:
 CALLING SEQUENCE:
       xtextfile
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         MAXBUFF=n  Max number of bytes to read (def=30000).
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Feb 18

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xtextfile.pro)


XTEXTIMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XTEXTIMG
 PURPOSE:
       Create an image with text.  Widget based.
 CATEGORY:
 CALLING SEQUENCE:
       xtextimg, file
 INPUTS:
       file = name of text file to write to image.  in
         If not given this is prompted for.
 KEYWORD PARAMETERS:
       Keywords:
         OUT=out   Name of TIFF image file where text was saved.
           Null string means no image was saved.
         XSIZE=xs  Initial image X size in pixels.
         YSIZE=ys  Initial image Y size in pixels.
         /WAIT  means wait for returned result.
 OUTPUTS:
 COMMON BLOCKS:
       xtextimg_com
       xtextimg_com
 NOTES:
       Notes: image may be resized just by using the mouse.
         Text is obtained from a text file.  Default
         file name is *.cap.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Oct 7.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xtextimg.pro)


XTICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XTICS
 PURPOSE:
       Draw labeled tics for an X type axis.
 CATEGORY:
 CALLING SEQUENCE:
       XTICS, X1, X2, DX, Y1, Y2, [YL, LB, SZ]
 INPUTS:
       X1, X2, DX = tic mark start X, end X, step.    in
       Y1, Y2 = start and end Y of tic marks.         in
       YL = label Y (def = 0 means no labels).        in
       LB = string array of labels (def = none).      in
       SZ = Text size (def = 1).                      in
 KEYWORD PARAMETERS:
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 12 Sep, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 15 Sep, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xtics.pro)


XTXTIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XTXTIN
 PURPOSE:
       Widget based text input.
 CATEGORY:
 CALLING SEQUENCE:
       xtxtin, out
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         TITLE=tt   Widget title text (def="Enter text").
           May be a text array.
         DEFAULT=def  Initial text string (def=null).
         MENU=txt   Optional text array with additional entries.
           To select one of these items its button is pressed.
         /TOP means put optional buttons on top (def=bottom).
         /WAIT  means wait for returned result.
         XSIZE=text entry area size in characters (minimum).
         XOFFSET=xoff, YOFFSET=yoff Widget position.
         Presets: May give a selection of preset text.
           Selected using an optional drop down menu button.
         PTITLE=pttl Title on preset text drop down menu button.
         PTAGS=ptags Text array with short tags for preset text.
         PVALS=pvals Text array of preset text strings.
          Must give all 3 of the above to use preset text.
 OUTPUTS:
       out = Returned text string (null for CANCEL).    out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1994 Mar, 14
       R. Sterner, 1995 Mar 21 --- Added optional buttons.
       R. Sterner, 1998 Jun  3 --- Added xoff, yoff.
       R. Sterner, 2000 Aug 22 --- Added preset text keywords.
       R. Sterner, 2000 Aug 30 --- Ignored null strings for ptags.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xtxtin.pro)


XVARSHOW

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
	xvarshow

 PURPOSE:
 
This procedure displays in a non blocking widget_table a given array
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: xvarshow,data,[group_leader=group_leader],[/WAIT], [xsize=xsize],[ysize=ysize],[_extra=pkey] INPUTS: data: a vector or array to display OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting xsize: the number of columns ysize: the numner of rows _extra: to submit keywords to widget_table EXAMPLE: xvarshow,FINDGEN(5,3)

xvarshow,FINDGEN(5,3),xsize=3,ysize=2

MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Nov-12

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\xvarshow.pro)


XVIEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XVIEW
 PURPOSE:
       View and/or convert images (GIF, TIFF, ...).
 CATEGORY:
 CALLING SEQUENCE:
       xview
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         SCROLL_SIZE=[mx,my]  Max size before scrolling sets in.
         DIRECTORY=dir        Set initial directory.
         HOTLIST=hfile        Name of directory hotlist file.
           File has list of directories of interest.  For file
           format do xhotlist, /help.  Default is the file named.
           xview_dir.txt in local directory first, then $HOME.
         TYPE=typ  Initial image type:
           GIF=def,JPEG,TIFF,XWD,BMP,XBM,PICT,SRF
         WILD=wild Initial wildcard (def depends on TYPE).
         MAG=mag Initial magnification (def=1.0).
         ICTXT=txt Text string to execute after each image load.
           Intended to set data coordinates for data cursor.
           Image name is available in the variable called NAME at
           the point where this text is executed.  If a file name
           contains coordinate info a routine which extracts that
           info may be called.  Ex: for file N40W120.gif the
           routine could pick off the 40 and 120 and use that to
           set the scaling. Something like ICTXT="set_scale,name"
         READ_CUSTOM=rc  Name of an optional custom image
           read routine.  May also include default wild card
           as 2nd element of a string array. Routine syntax:
           img = rdcust(filename, r, g, b) where r,g,b may
           be set to scalar 0 for no new color table.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 11 Oct, 1993
       R. Sterner, 1994 Dec 13 --- Added JPEG.  Also allowed initial
       mag factor to be given.  Added more mag factors to pulldown menu.
       R. Sterner, 1994 Dec 30 --- Added XBM.
       R. Sterner, 1995 May 5 --- Added PRINT.
       R. Sterner, 1995 May 18 --- Added TRANSPARENCY.
       R. Sterner, 1995 Nov 9 --- Added SRF.
       R. Sterner, 1997 Feb 27 --- Added vivid color print option.
       R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors.
       R. Sterner, 1999 Sep 28 --- Switched to read_tiff (from tiff_read).

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xview.pro)


XWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XWINDOW

 PURPOSE:
       This routine implements a "smart" resizeable graphics window.
       It is used as a wrapper for built-in IDL graphics procedures
       such as SURFACE, CONTOUR, PLOT, SHADE_SURF, etc. In additon,
       it can be used to display any user-written graphics procedure
       so long as that procedure follows three simple rules: (1) It
       does not open it's own graphics windows, (2) It is defined with
       no more than ten positional arguments (an unlimited number
       of keyword arguments are allowed), and (3) It is defined
       with an _EXTRA keyword.

       Keyword arguments permit the window to have its own portion
       of a color table and to be able to change the colors loaded in
       that portion of the color table. Colors are updated
       automatically on both 8-bit and 24-bit color displays. In
       addition, the window colors can "protect" themselves. I mean
       by this that the window can re-load its own colors into the
       color table when the cursor is moved over the window. This
       prevents other applications from changing the colors used to
       display data in this window. (This is an issue mainly in
       IDL 5.x applications where widget applications can run
       concurrently with commands from the IDL command line.)

       Keyword arguments also permit the window to create output
       files of its contents. These files can be color and
       gray-scale PostScript, GIF, TIFF, or JPEG files.

 AUTHOR:
       ************* CM 19 Jan 1999 VERSION **********
       Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
       craigm@lheamail.gsfc.nasa.gov

       Originally by:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, Graphics.

 CALLING SEQUENCE:
       XWINDOW, command, P1, P2, ... , keywords=..., ...

 REQUIRED INPUTS:
       COMMAND: The graphics procedure command to be executed. This parameter
       must be a STRING. Examples are 'SURFACE', 'CONTOUR', 'PLOT', etc.

 OPTIONAL INPUTS:
       Pn: A positional parameter appropriate for the graphics command.
           Any number of parameters between 0 and 10 may be given.

 INPUT KEYWORD PARAMETERS:
       CPMENU: Setting this keyword adds a "Color Protection" button to the
       "Controls" menu. Color protection can then be turned ON or OFF for the
       window. Otherwise, the color protection scheme used to open the window
       cannot be changed once the window is open. (See the PROTECT keyword.)
       The default is to have this keyword OFF.

       ERASE: Setting this keyword "erases" the contents of the current
       graphics window before re-executing the graphics command. For example,
       this keyword might need to be set if the graphics "command" is TVSCL.
       The default is to NOT erase the display before reissuing the graphics
       command.

       _EXTRA: This keyword forms an anonymous structure of any unrecognized
       keywords passed to the program. The keywords must be appropriate
       for the graphics command being executed.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       OUTPUT: Set this keyword if you want a "File Output" menu on
       the menu bar. The default is to have this item turned OFF.

       JUST_REGISTER: If this keyword is set, the XWINDOW program is just
       registered with XMANAGER, but XMANAGER doesn't run. This is
       useful, for example, if you want to open an XWINDOW window in
       the widget definition module of another widget program.

       NO_CHANGE_CONFIG: Normally as the XWINDOW graphics window is resized
       the size (or aspect ratio, in the case of PostScript) of the
       hardware configuration dialogs change to reflect the new size of
       the graphics window. This results in file output that resembles
       the current graphics window in size and aspect ratio. If you want
       the file output dialogs to remember their current configuration
       even as the window is resized, set this keyword.

       NOMENU: Setting this keyword results in a graphics window without
       menu items. The default is to have a "Controls" menu item in the
       window menu bar with a "Quit" button. Setting this keyword
       automatically turns of the COLORS, OUTPUT, and CPMENU menu
       choices. (Note that the values specified by the COLORS keyword
       will still be valid for color protection, but no "Change Colors..."
       menu item will appear.)

       PROTECT: If this keyword is set, color protection for the draw
       widget is turned ON. What this means is that the window colors
       (see the XCOLOR keyword) will be restored when the cursor enters
       the draw widget window. This prevents someone at the IDL command
       line in IDL 5.0 from changing the window display colors permanently.

       WTITLE: This is the window title. It is the string "Resizeable
       COMMAND Window (1)" by default, where COMMAND is the input
       parameter. And the number (1 in this case) is the window
       index number of the draw widget.

       WXPOS: This is the initial X offset of the window. Default is to
       position the window in the approximate middle of the display.

       WYPOS: This is the initial Y offset of the window. Default is to
       position the window in the approximate middle of the display.

       WXSIZE: This is the initial X size of the window. Default is 400
       pixels.

       WYSIZE: This is the initial Y size of the window. Default is 400
       pixels.

       XCOLORS: Using this keyword adds a "Change Colors..." button to the
       "Controls" menu. Set this keyword to the number of colors available
       in the window and the starting index of the first color. For example,
       to allow the window access to 100 colors, starting at color index 50
       (i.e., color indices 50 to 149), use XColor=[100, 50]. If you use the
       keyword syntax "/XColor", all the colors available will be used, not just
       one color. If the keyword is set to a scalar value greater than 1, the
       starting color index is set to 0. The default value for this keyword
       is [(!D.N_COLORS < 256), 0]. Note that color "protection" may be
       turned on (via the PROTECT keyword) even if this keyword is NOT used.

 OUTPUT KEYWORD PARAMETERS:
       DRAWID: This keyword returns the draw widget identifier of the draw
       widget created in XWINDOW.

       TOP: This keyword returns the identifier of the top-level base widget
       created by XWINDOW.

       WID: This keyword returns the window index number of the draw widget
       created in XWINDOW.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       If color protection is ON, the window colors are reloaded when the
       cursor enters the XWINDOW graphics windows.

 RESTRICTIONS: This program requires three additional programs from
       the Fanning Software Consulting library: PSWINDOW, PS_FORM (CM
       version; available at
       http://astrog.physics.wisc.edu/~craigm/idl), and XCOLORS. You
       might also want to get the program TVIMAGE if you will be
       displaying images in XWINDOW graphics windows.

       If the "command" program requires keywords that are also keywords
       to XWINDOW, then you must use the keyword twice on the command line.

 EXAMPLE:
       To display a surface in the window, type:

       XWINDOW, 'SURFACE', Dist(20), Charsize=1.5

       To enable the Change Colors and File Output menu items, type:

       XWINDOW, 'SHADE_SURF', Dist(30), /XColors, /Output

 MODIFICATION HISTORY:
       Written by: David Fanning, October 96.
       XSIZE and YSIZE keywords changed to WXSIZE and WYSIZE so as not to
          conflict with these keywords on other programs. 14 April 1997, DWF.
        Updated as non-blocking widget for IDL 5.0. 14 April 1997, DWF.
        Extensively modified to work on either 8-bit or 24-bit displays,
          to enable color protection schemes, to send the contents to a
          number of different output files, and to give the user choices
          about which menu items to enable. 21 April 1997, DWF.
        Renamed COLORS keyword to XCOLORS and fixed a problem cancelling
           out of File Configuration dialogs. 23 April 1997, DWF.
        Modification: Craig Markwardt, 21 October 1997
           Added capability for up to ten positional parameters
        Modification: CM 15 May 1998
           PS_FORM dependencies are not hardcoded now.  Requires
           CM version of PS_FORM function.
        Modification: CM 19 Jan 1999
           Added Parent keyword to widget invocation of PS_FORM, and
           make widgets MODAL-safe.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\craigm\xwindow.pro)


XYESNO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XYESNO
 PURPOSE:
       Widget Yes/No selection panel.
 CATEGORY:
 CALLING SEQUENCE:
       ans = xyesno(qtxt)
 INPUTS:
       qtxt = Question text.  Must have a Yes or No answer.  in
 KEYWORD PARAMETERS:
       Keywords:
         DEFAULT=x Default answer: 'Y' or 'N' (else none).
         TITLE=txt A scalar text string or array to use
           as title (def=none).
 OUTPUTS:
       ans = returned answer, Y or N.                        out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Jul 28

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xyesno.pro)


XYOUTB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XYOUTB
 PURPOSE:
       Bold text version of xyouts.
 CATEGORY:
 CALLING SEQUENCE:
       xyoutb, x, y, text
 INPUTS:
       x,y = text position.           in
       text = text string to plot.    in
 KEYWORD PARAMETERS:
       Keywords:
         /DATA use data coordinates (default).
         /DEVICE use device coordinates.
         /NORM use normalized coordinates.
         BOLD=N  Text is replotted N X N times,
           shifting by P pixel in x or y each time.
           Default N=2.  For hardcopy try about 5.
           BOLD may also be set to an N x M array which defines
           a brush stroke by non-zero elements.  For example:
           BOLD=shift(dist(3),-2,-2) lt 1.2
         PIXELS=P number of pixels to use for each shift (def=1).
           For hardcopy try 5 or 10.
         SHIFT=shft 2 element array giving pixel shift for each
           value of bold and color (def=0).  Good for drop shadows.
         Other keywords: ALIGNMENT,COLOR,FONT,ORIENTATION,CHARSIZE.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Notes: BOLD and COLOR may be 1-d arrays to outline text in
         one or more colors.  Put thickest first.
 MODIFICATION HISTORY:
       R. Sterner, 21 June, 1990
       R. Sterner, 1994 Apr 4 --- Allowed 2-d BOLD.
       R. Sterner, 2000 Aug 4 --- Fixed bug for bold=0.
       R. Sterner, 2000 Nov 14 --- Added SHIFT for drop shadows.

 Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\xyoutb.pro)


XYOUTP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XYOUTP

 PURPOSE:
       print a string into plot using the normal coordinates of
       the last plot command

 CATEGORY:
   PLOT/MPLOT

 CALLING SEQUENCE:
       XYOUTP, x, y, text, framepos=fpos

 INPUTS:
       x:      x0-position
       y:      y0-position
               in normal coordinates of the last plot frame
       text:   string to print

 OPTIONAL INPUTS:
       framepos:       an array of 4 number specifying the last position
                       of a plot, if not given x and y are normal coordinates
       alignment:      see xyouts
       charsize:       see xyouts
       charthick:      see xyouts
       color:          see xyouts
       orientation:    see xyouts

 OUTPUTS:
       width:          see xyouts

 SIDE EFFECTS:
       None

 RESTRICTIONS:
       None.

 EXAMPLE:
       INIT_MPLOT, 5, 5, fpos
       XYOUTP, x, y, 'TEXT', framepos=fpos(*,0)

 REVISION HISTORY:
       Written         Theo Brauers, Frank Holland, June 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\xyoutp.pro)


XYOUTS_AUTO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	xyouts_auto

 PURPOSE:
	Use this procedure to very simply position text in a plot window.

 CATEGORY:
	PLOT

 CALLING SEQUENCE:
	xyouts_auto[, hs, vs[, hv_shift]], text

 INPUTS:
	text: text to be written to the plot (scalar or array)

 OPTIONAL INPUTS:
	hs (vs): scalars to identify horizontal (vertical) position of the text
		allowed entries are:
			0.0: left (lower) end of x (y) axis (default)
			0.5: centered along x (y) axis
			1.0: right (upper) end of x (y) axis
	hv_shift: 2-element vector identifying a shift of the text from inside
		the plot to outside.
		allowed entries are:
			[0, 0]: no shift, text stays within the axes system.
			[1, 0]: text is shifted horizontally across the nearest y axis.
			[0, 1]: text is shifted vertically across the nearest x axis.
			[1, 1]: text is shifted horizontally and vertically across the nearest axes.

 KEYWORD PARAMETERS:
	/NO_AUTO: If set the entries hs and vs are interpreted as x and y coordinate
		of the text (e.g. all input is directly transfered to the IDL XYOUTS procedure).
	/BOX: If set the text will be surrounded by a box. If this keyword is set more
		keyword parameters become available - e.g. BOXCOLOR, FILLCOLOR. For a complete list
		see the header of the procedure xyouts_box.
	SPACE = space: Amount of space between x (y) axis and text expressed
		in fraction of y (x) axis length (default: inside: 0.05, outer: 0.10).
	/LOCK2PP: If set together with /NO_AUTO and /NORMAL (IDL XYOUTS keyword)
		hs and vs are interpreted as normal coordinates referring to the currend plot position.
	/B_ALIGN = b_align: Two-element vector. If set together with /NO_AUTO the alignment
		of the complete text block can be changed.
		allowed entries are: 0.0, 0.5, 1.0 for each of the two elements.
			0:		hs (vs) defines left (lower) corner of text block
			0.5:	text block horizontally (vertically) centered around hs (vs).
			1:		hs (vs) defines right (upper) corner of text block
	LINE_SPACING = line_spacing: Factor which will be applied to the IDL default line spacing.

 EXAMPLE:
	PLOT, FINDGEN(10), PSYM = 4, XMARGIN = [10, 10], YMARGIN = [8, 4]
	text = ['xyouts_auto, 1, 0, [0, 1], $', 'text, ALIGN = 1.0, /BOX, $', 'CHARSIZE = 0.75']
	xyouts_auto, 1, 0, [0, 1], text, ALIGN = 1.0, /BOX, CHARSIZE = 0.75
	text = ['xyouts_auto, 0, 1, text, $', 'CHARSIZE = 0.75']
	xyouts_auto, 0, 1, text, CHARSIZE = 0.75
	text = ['xyouts_auto, 1, 0.5, [1, 0], $', 'text, ORIENT = -90, $', 'ALIGN = 0.5, CHARSIZE = 0.75']
	xyouts_auto, 1, 0.5, [1, 0], text, ORIENT = -90, ALIGN = 0.5, CHARSIZE = 0.75

	see also demo_xyouts_auto.pro

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 28.10.1999
	29.10.1999:	New keyword parameter: /LOCK2PP, B_ALIGN = b_align
	07.12.1999:	Bug removed: if hardware fonts were used the 'invisible' xyouts
					call (with negative CHARSIZE to determine width of text)
					left a visible trace! Now the 'invisible' text will by at
					normal coordinates [1.5, 1.5], thus outside the plot window.
	23.03.2000:	New keyword added: LINE_SPACING
	05.04.2000: Replaced call to 'arr2string' by call to IDL 5.3 routine 'STRJOIN'
					since arr2string returns wrong result for ['Zeile1', '', 'Zeile3']
					(no extra line feed).

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\xyouts_auto.pro)


XYOUTS_BOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   xyouts_box

 PURPOSE:
   This XYOUTS_BOX procedure draws text surrounded by a box
   with specified fillcolor on the currently-selected
   graphics device starting at the designated coordinate

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   XYOUTS_BOX, X, Y, Str

 INPUTS:
   X:      x-position (can be array)
   Y:      y-position (can be array)
   Str:    String to be drawn (can be array)

 KEYWORD PARAMETERS:
   FILLCOLOR:  color to fill the box
   TEXTCOLOR:  color for text
   BOXCOLOR:   color for outline of the box
   CHARSIZE:   charsize of text (see xyouts)
   ALIGNMENT:  alignment of text and box (see xyouts)
   ORIENTATION: orientation of text and box (see xyouts)
   ADDSPACE:   additional space of box around text, in
               terms of charsize
   Further Keyword parameters are parsed to the
       XYOUTS, POLYFILL, and PLOTS routines

 OUTPUTS:
   text and box on the grafic device

 EXAMPLE:
   In order to create a text with out interferring
   data points or lines:

   plot, findgen(10)
   x=randomu(1, 1000)*10 & y=randomu(2, 1000)*10
   oplot, x,y, psym=1
   oplot, findgen(10)-0.5 & oplot, findgen(10)-0.6
   xyouts_box, 1, 1, 'test    11', /DATA $
    , textcolor=black, fillcolor = -1, boxcolor= red $
    , charsize=3

 MODIFICATION HISTORY:
   Written by: Theo Brauers, 1997-DEC-6
   Modified:   T.B. 1997-DEC-7 using XYOUTS,..,width=width
                               correct with orientation
                               device coordinates
               T.B. 1997-DEC-9 width -> abs(width)
                               loop thru different arrays
               T.B. 1997-DEC-16 colors -> !p. ...
               F.R./T.B. 1997-Dec-17
                               xyouts,2., 2.,charsize=-1,...
                               test in outer space

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\xyouts_box.pro)


X_ANIMATE

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

 USERLEVEL:
   TOPLEVEL

 NAME:
  x_animate

 PURPOSE:
 
This widget plays multiple gif files or data which is submitted to optional keywords
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: x_animate,anim_struct,[column=column],[loop=loop],[wait_time=wait_time],[scale_factor=scale_factor],[file=file],[/no_file_button], [/no_column_input] OPTIONAL INPUTS: anim_struct: The data structure for animations KEYWORD PARAMETERS: loop: Optional: If set the loop switch is on column: Optional: To define the arrangement of the images in column wait_time: Optional: The time between each image to wait scale_factor: Optional: The scale factor to scale each sequence file: Optional: The file names of the sequences to animate no_file_button: if keyword is set to 1 the input file button is no shown on the widget no_column_input: if keyword is set to 1 the input file button is no shown on the widget; RESTRICTIONS: This widget is under construction. PROCEDURE: This widget don't use the xmanager all events done by widget_event. So you can select all function during one function is running. You should use QUIT to exit. Only in this case all used pointers are removed. The reducing of the white border is default and the routine looks at the first image of each sequence It is not possible to play more gif files reading from files at once. This was the reason why I load all images into memory. Be careful that you don't exeed the memory limit. At the moment only one colortable is used!! This means all sequences need to have the same colortable. EXAMPLE: x_animate,animation=bindgen(500,500,20) x_animate,file=['aps_film_TRACER_mix.gif','chem_film_HBr.gif'] x_animate,file=['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],scale=0.5 x_animate,file=['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],scale=0.5,wait_time=0.2,/loop x_animate,file=['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],scale=0.5,wait_time=0.2,/loop,col=1 x_animate,gif2anim_struct(['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],/cut_white_off) x_animate,gif2anim_struct(['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],/cut_white_off),col=1 seq1=gif2anim_struct(['aps_film_TRACER_mix.gif','chem_film_HBr.gif'],/cut_white_off) save,file='sequence1.sav',seq1 restore,'sequence1.sav' x_animate,seq1 MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1999, June 11 1999-Aug-09 call of reduce_image_size changed 1999-Aug-13 scale_factor added 1999-Aug-19 column added 1999-Sep-1 keywords no_column_input and no_file_button added cursor changed 2000-Mar-31 del_Tag replaced by delete_tag

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_animate.pro)


X_AXIS

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:  x_axis

 PURPOSE:  label x axis tick marks with the actual values of the x
           vector.  

 USEAGE:   x_axis,x,y,xticknames=xticknames,xtitle=xtitle, $
                  charsize=charsize,yspace=yspace,ticklen=ticklen, $
                  gridstyle=gridstyle,extend=extend

 INPUT:    
   x
     a vector of x-axis points (data coordinates) to label or mark

   y
     a scalor or two element vector. First element specifies the
     vertical subnormal coordinates of the x-axis line.  Y=0 puts
     x-axis at bottom of the plot while Y=1 puts x-axis at top of
     plot.  The second element, if present, specifies an additional
     vertical offset of the x-axis in units of the character
     height. (default=0)

   labels
     x axis tick labels, a string or number array the same size as x

 keyword input:
   xticknames
     string array of x axis tickmark labels, if not of type
     string, will be coerced into string


   xtitle
     x axis title, If XTICKNAME is undefined, XTITLE appears immediately
     below (YSPACE>0) or above (YSPACE<0) the x axis. Otherwise it
     appears below/above the XTICKNAME labels.

   yspace  
     controls vertical spacing between x-axis, tick labels and x-axis
     title.  By default the centerline of the tick labels appear 1
     character height below the x-axis while the x-axis title appears
     2.5 character heights below the x-axis.  The YSPACE factor
     multiplies these vertical offsets. YSPACE < 0 causes the titles
     to appear above the x-axis.  (default=1)

   ticklen   
     length of tickmarks as a PERCENTAGE of the entire y coordinate range
     TICKLEN=2 produces the standard major tickmark length, while
     TICKLEN=1 produces the standard minor tickmark length. (defualt=0)
     
   charsize
     character size used for x-axis annotation.  If more than two
     plots are ganged in either the X or Y direction, the character
     size is halved.
     
   extend
     if set and y lt 0 or y gt 1 then the y-axis lines are extended to 
     to intersect the new x-axis line.  This produces an enclosed
     rectangular area between the new x-axis and the old x-axis (if it
     exists).

   color
     color index used to color axis

   tcolor
     color index used to color axis and tick titles (just for the characters)

 DISCUSSION:
     Calling X_AXIS with no arguments causes the system variables
     !x.ticname and !x.ticklen to be reset to values which eliminate
     tickmarks and tick labeling on the following plot.  After the
     plot is drawn, X_AXIS is called again to draw the specified
     x-axis scale and reset the !x system variable.

 EXAMPLE:  

    
    y=randomn(iseed,6)^2 & y(0)=0 & y(5)=0
    x_axis
    plot,y,psym=10
    x_axis,1+findgen(5),xtitle='Surface type for 1993 field campagn', $
      xticknames=['dirt','snow','ocean','grass','forrest'],/ticklen

; x_axis may be called repeatedly to build up fairly
; elaborate x axis labeling 

    xx=findrng(1.5,7.5,100)
    x=2+indgen(6)
    x_axis
    plot,xx,planck(2^xx,200,/mic),ymargin=[10,10],/xstyle
    oplot,xx,planck(2^xx,190,/mic)
    oplot,xx,planck(2^xx,180,/mic)
    oplot,xx,planck(2^xx,170,/mic)
    x_axis,x,0,xtickn=2^x,ticklen=1,xtitle='wavelength (microns)'
    x_axis,x,[1,3],ysp=-.5,xtitle='test',charsize=1.3,/ext
    x_axis,x,1,xtickn=10000./2^x,ticklen=-1,yspace=-1,$
          xtitle='wavenumber (cm!a-1!n)'

; fancy log axis labeling

    v=.2*(20/.2)^(findgen(100)/99)
    w=-4*(.2/v)^2+ 2*(v/10) - 10*(v/10)^2 + 5*(v/10)^3
    x_axis
    plot_oi,v,w,/xsty & oplot,v,w^2,li=1 & oplot,v,w^3,li=2
    x_axis,[.2,.5,2,5,20],0,xtickname=['0.2','0.5','2','5','20'],/tickl
    x_axis,[1,10],0,xtickname=['1','10'],charsize=1.3,tickl=2
    x_axis,[.2+indgen(8)*.1,2+indgen(8)],0,/tickl


 AUTHOR:   Paul Ricchiazzi                        24 Aug 95
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\x_axis.pro)


X_CHOOSER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_chooser

 PURPOSE:
 
This function is used to choose something nonexclusive
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: result=x_chooser(structure,[group_leader=group_leader],[/wait],[/no_own_command]) INPUTS: structure: holding .array for the strings .on for the switches OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting no_own_command: switch off of the input field OUTPUTS: This function returns the input structure EXAMPLE: result=x_chooser({array:['a-b','c-d'],on:intarr(2)},/no_own) MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-MAR-14 2000-Mar-20 title: to structure added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_chooser.pro)


X_CHOOSE_ORDER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_choose_order

 PURPOSE:
 This function is used to choose something in a defined order

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=x_chooser_order(names,[group_leader=group_leader],[/wait],[/no_own_command])

 INPUTS:
	names: a stringarray of names

 OPTIONAL INPUTS:
   goup_leader: the group id of the major widget

 KEYWORD PARAMETERS:
       wait:           to set the widget waiting


 OUTPUTS:
	This function returns the input structure

 EXAMPLE:
   result=x_chooser({array:['a-b','c-d'],on:intarr(2)},/no_own)

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-MAR-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_choose_order.pro)


X_DEF_COLORTABLE

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

 USERLEVEL:
  TOPLEVEL

 NAME:
  x_def_colortable

 PURPOSE:
 
This widgets is used to define a linear interpolated colorsystem.
The result could be saved to an idl script.
For documentation a gif picture holding the palette is saved too.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: x_def_colortable PROCEDURE: The result of this widget could be used by color_scheme e.g. color_scheme,plot,scheme_code='ct_yellow_red_blue_green_black' MODIFICATION HISTORY: Written by: R.Bauer 1998-Jul-14 1998-09-20 will work now in 24bit, 16bit and 8bit mode 1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_def_colortable.pro)


X_DISPLAYTEXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_displaytext

 PURPOSE:
	This function is used to find out the right position for displaying text

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   Result=x_displaytext(text,[color=color],[charsize=charsize],[align=align],[group_leader=group_leader],[/wait]

 INPUTS:
	text: The text which should be displayed


 OPTIONAL INPUTS:
   goup_leader: the group id of the major widget
   color=color: the textcolor
   charsize=charsize: the charsize
   align=align the alignment

 KEYWORD PARAMETERS:
       wait: to set the widget waiting


 OUTPUTS:
	This function returns an xyouts statement


 EXAMPLE:
   result=x_displaytext('TEST')

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-MAR-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_displaytext.pro)


X_DISPLAYTEXT_MOVTXT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       x_displaytext_movtxt
 PURPOSE:
       This function return the xyouts Statement describing where the text is interactivetly positioned
 CATEGORY:
  PROG_TOOLS

 CALLING SEQUENCE:
       x_displaytext_movtxt, txt
 INPUTS:

 KEYWORD PARAMETERS:
       Keywords:
         /DATA use data coordinates (def).
         /DEVICE use device coordinates.
         /NORMAL use normalized coordinates.
 OUTPUTS:

 NOTES:
       Notes: click mouse button for options (right button exits).
         May change text size and angle.
         May list xyouts call to plot text in current position.
 MODIFICATION HISTORY:
       R. Sterner, 1994 Nov 1.

 Copyright (C) 1994, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.;


 R.Bauer 1998-Mar-14 changed the mechanism to a function and a bit shorter now original is movtxt

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_displaytext_movtxt.pro)


X_FIELDPLOT

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

 USERLEVEL:
   TOPLEVEL

 NAME:
  x_fieldplot

 PURPOSE:
   This is a widget to show fieldplot data

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   x_fieldplot,icg_struct

 OPTIONAL INPUTS:
  icg_struct: the defined ICG Data Structure

 RESTRICTIONS:
  This widget is under construction.

 PROCEDURE:
 This widget is able to create a gif animation sequence.


 EXAMPLE:
  x_fieldplot

 MODIFICATION HISTORY:
   Written by: R.Bauer (ICG-1), 1999, Dez 05

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_fieldplot.pro)


X_GET_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_get_file

 PURPOSE:
 
This function is used to read with get_file an ASCII file< /TD>
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: INPUTS: file_name: The file name of the ASCII File OPTIONAL INPUTS: goup_leader: the group id of the major widget KEYWORD PARAMETERS: wait: to set the widget waiting OUTPUTS: This widget returns the get_file structure EXAMPLE: dat=x_get_file('ghost.nas') help,dat,/str ** Structure <1188698>, 5 tags, length=936, refs=1: FILE STRING 'ghost.nas' SEPARATOR STRING ' ' DATA FLOAT Array[3, 63] HEADER STRING Array[20] MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Nov-09

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_get_file.pro)


X_ICGS_ADD_QUALITY

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

 USERLEVEL:
   TOPLEVEL

 NAME:
    x_icgs_add_quality

 PURPOSE:
    This procedure is a graphical interface to set the quality flags 0 or 32 for a given icg_struct

 CATEGORY:
   ICG_STRUCT/WIDGETS

 CALLING SEQUENCE:
   x_icgs_add_quality,[icg_struct],[short_name],[GROUP_LEADER=group_leader],[/WAIT]


 OPTIONAL INPUTS:
  icg_struct: the icg data structure
  short_name: a short_name from icg_struct


 KEYWORD PARAMETERS:
  group_leader: the base of the calling widget
  wait:         if set this event_handler waits for input

 EXAMPLE:
   icg_Struct=read_ncdf('fish.nc')
   result=x_icgs_add_quality(icg_struct,'H2O')

 MODIFICATION HISTORY:
       Written by      R.Bauer (ICG-1), 2000-Mar-13
    2000-Mar-14 now defined as procedure

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_icgs_add_quality.pro)


X_MOVBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       x_movbox

 PURPOSE:
       Interactive box on image display.

 CATEGORY:
  PROG_TOOLS

 CALLING SEQUENCE:
       x_movbox, x, y

 INPUTS:
     X:  norm coordinates of X start position
     Y:  norm coordinates of X start position

   Commands:
           Right button:  Normal exit (erases box).
 MODIFICATION HISTORY:

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

 R.Bauer 1998-Mar-31 learned much from the previos version movbox
                     will use it in this version for positioning of a legend

 R.Bauer 2000-Apr-18 instead of tvrd2 changed to graphicsmode XOR

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_movbox.pro)


X_NCDF_GR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_ncdf_gr

 PURPOSE:

This procedure is the widget interface for ncdf_gr.
IMAGE
CATEGORY: PROG_TOOLS/WIDGETS CALLING SEQUENCE: x_ncdf_gr, file=file, name=name, Inhalt = Inhalt,[experiment=experiment],[history=history],[array_index=array_index],[use_units=use_units],[local_cache_path=local_cache_path],[/new_cache],[/no_cache],[/xp] INPUTS: file = name of the netCDF file name = parameter short name OPTIONAL INPUTS: array_index: the index position of the parameter to read in file_path: the path where are the netCDF File will be use_units: the new unit in which the data should be caclulated in local_cache_path: to define an own cache_path doing this most cases you could not share your cache files KEYWORD PARAMETERS: new_cache: ignore previous cache files and write a new one no_cache: don't use cache files xp: use dialog_pickfile to choose a file OUTPUTS OUTPUTS: Inhalt: structure experiment: structure of experiment specific attributes history: an array holding the history of the netCDF File MODIFICATION HISTORY: Written by: R.Bauer (ICG-1), 1998-Jun-11 1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_ncdf_gr.pro)


X_REPLACE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_replace

 PURPOSE:
    This function is a mask for to replace or search something

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=x_replace( names, GROUP_LEADER=wGroup,WAIT=wait, search_list=search_list, replace_list=replace_list,$
                     [/replace_with],[/case_sensitive],[/whole_words_only],[/replace_all],$
                     [/forward_from_cursor],[/backward_from_cursor],[/entire],$
                     [/find_next],[/replace_next], [search_in_list=search_in_list],[_EXTRA=Pkey] )


 INPUTS:
   names: the names of the items to look for

 KEYWORD PARAMETERS:
       wait                 :   to set the widget waiting
       group_leader         :   if set wait also this value has to be set to the corresonding widget_base
       search_list          :   the values to search (at the moment only one value)
       replace_list         :   the values to replace to (at the moment only one value)
       replace_with         :   if is set the widget is in replace mode else find mode
       case_sensitive       :   if is set search is case_sensitive
       whole_words_only     :   if is set search looks for whole words only
       replace_all          :   if is set all comparing values to searchlist are replaced by replace_list
       forward_from_cursor  :   if is set serch direction is forward from cursor
       backward_from_cursor :   if is set serch direction is backward from cursor
       entire               :   if is set entire search
       find_next            :   if is pressed search mode is selected
       replace_next         :   if is set replace mode is selected
       search_in_list       :   if is set to the position index of names for precelection


 OUTPUTS:
	This function returns the keywords as structure

 EXAMPLE:
   result=x_replace()

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-MAY-03

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_replace.pro)


X_SELECT_COLOR_INDEX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  x_select_color_index

 PURPOSE:
	x_select_color_index returns the selected color index

 CATEGORY:
	PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
	result=x_select_color_index()

 KEYWORD PARAMETERS:
	UVALUE:       The user value to be associated with the widget.
	XSIZE:        The width of the color bar in pixels. The default =192.
	YSIZE:        The height of the color bar in pixels. The default = 12.

 MODIFICATION HISTORY:
	DMS,	June, 1993.	Written.
	TAC,	Oct, 1993.	Changed name to plot_s_clr_index
   R.Bauer 1996   removed color indexfield
   1999-Feb-05 because of idl5.2 interpretation of !d.n_colors this constant is replaced by def_n_colors()
   2000-Apr-20 defined as x_select_color_index

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_select_color_index.pro)


X_SELECT_FROM_LIST

[Previous Routine] [Next Routine] [List of Routines]
 USERLEVEL:
   TOPLEVEL

 NAME:
   x_select_from_list

 PURPOSE:
   This routine interactively selects entries from string array

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   Result=X_SELECT_FROM_LIST(x, [base], [PRE_SELECTED=p], [/VERBOSE], [CANCEL=cancel])

 OUTPUTS:
   This orutine returns an index filed into the input array

 KEYWORD PARAMETERS:
   PRE_SELECTED:   index of pre -selected entries
   VERBOSE:        do some talking
   CANCEL:         on exit: 0 done / 1 cancel
                   (the cancel button returns the origianl list of pre selected)

 EXAMPLE:
   IDL> x=x_select_from_list(sindgen(100), PRE=[5,7], CANCEL=c) & print, x, 'cancel=', c & help, x
       5       7
       cancel=       1
       X               INT       = Array[2]
   IDL> print, x_select_from_list(sindgen(100), TITLE='abc', LIST_MULTIPLE=0)

 MODIFICATION HISTORY:
   Written by Theo Brauers, JAN 2000

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\x_select_from_list.pro)


X_SLIDER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_slider

 PURPOSE:
  This widget function is used to place a slider in front to show steps of actions like an increment of a do loop.
  The break key is used to set if pressed a breakpoint into the source code.
  This widget don't use the xmanager

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=x_slider(minimum,maximum,[title=title],[/BREAK])

 INPUTS:
	minimum: the start value
   maximum: the end value

 KEYWORD PARAMETERS:
   title: the title for the base
   break: if set the break key is defined - if pressed a breakpoint will be generated where x_slider_widget_event was started

 OUTPUTS:
	The result is a structure:
    base: the base id
    slider: the slider id

 EXAMPLE:
   result=x_slider(0,10000)
   widget_control,result.slider,set_val=100
   widget_control,result.base,/destroy


   PRO x_slider_example
       result=x_slider(0,1000,title='CC',/break)
       FOR I=0,10 DO BEGIN
           WAIT,1
           WIDGET_CONTROL,result.slider,set_val=100*I
           X_SLIDER_WIDGET_EVENT,result
       ENDFOR

   WIDGET_CONTROL,result.base,/destroy

   END

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-Nov-18
   1998-12-02: keyword break added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_slider.pro)


X_SYNCHRONIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   x_synchronize

 PURPOSE:
 This widget is used to find time lags between a master and a client data set

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   x_synchronice,[master_icg_struct],[client_icg_struct],$
                  [/SPLINE_INTERPOLATION],$
                  [/LINEAR_INTERPOLATION],$
                  [/WINDOW_AVERAGE],$
                  [/LINEAR_WITH_LIMIT],$
                  [MASTER_WINDOW=MASTER_WINDOW] ,$
                  [INTERPOL_LIMIT=INTERPOL_LIMIT] ,$
                  [SPLINE_TENSION=SPLINE_TENSION]

 OPTIONAL INPUTS:
    master_icg_struct: the master values for the processing
    client_icg_Struct: the client values for the processing

 KEYWORD PARAMETERS:
   the following keywords are used to invoke different procedures by time_series_sync

   SPLINE_INTERPOLATION    if set the build-in spline interpolation (SPLINE) is used
   LINEAR_INTERPOLATION    if set the build-in linear interpolation (INTERPOL) is used
   LINEAR_WITH_LIMIT       if set a linear interpolation with limits in in the
                           interpolation interval is used. Also returning the length
                           of the interval and the slope if requested (was verf2b)
   WINDOW_AVERAGE          if set the client data will be averaged over the provided time intervals (was verf1b)

   MASTER_WINDOW           time interval for WINDOW_AVERAGE mode in units of master (and client) time (scalar or array)

   INTERPOL_DISTANCE       if set the returned struct contains the time distance from the nearest neighbours
                           used for the interpolation
   INTERPOL_LIMIT          use this keyword to provide the maximum time distance between 2 data points used for
                           interpolation
   SPLINE_TENSION          use this keyword to provide the "tension" used by the build in spline procedure


 PROCEDURE:
    This widget is used to shift a parameter again time.
    Alway the correlation of the master parameter to the client parameter is calculated.
    All SQR(R) are logged.
    In the report you see the best time shift with the best correlation.

 EXAMPLE:
   x_synchronize,read_ncdf('avionik.nc'),read_ncdf('fish_cessna.nc')

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-10
   1999-Jun-10 order of routines changed
   1999-Jun-31 sensitive modus added
   1999-Nov-20 changed to icg_ts_sync
   1999-Dec-16 icg_ts_sync fill_value parameter  set to client.missing_value
   2000-Mar-30 cw_list added
   2000-Jun-14 known formats changed to netCDF and ENZ

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_synchronize.pro)


X_TABLE_FOR_CACHED_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_table_for_cached_data

 PURPOSE:
	This procedure is used to show as a widget table the data which is stored in the cache

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   x_table_for_cached_data,plot,[/valid],[/no_block]

 COMMON BLOCK:
 plot_data,pl_data: Holding the cached data

 INPUTS:
	plot: the structure plot defined for ICG plots


 KEYWORD PARAMETERS:
   valid: To switch bettween only valid data or all data
   no_block: if true xmanager would not blocked


 EXAMPLE:
   x_table_for_cached_data,plot

 RESTRICTIONS:
 Dear programmers,
 If you're using this as an example for other widgets which uses the common block pl_data
 I have to tell you that's this structure will be changed to a more effective one in future.
 At the moment only the last used x, y and z parameters are stored and a view attributes.
 Later on I'll like to use substructures which could hold more attributes and more parameters.
 I will discuss the changes in the idl.forum.
 I hope you can agree to this!




 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1998-MAR-14

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_table_for_cached_data.pro)


X_TIME_SERIES_SYNC

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


 NAME:
   x_time_series_sync

 PURPOSE:
    This widget returns the _EXTRA Argument structure for use by time_series_sync

 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
    result= x_time_series_sync( GROUP_LEADER=wGroup, WAIT=WAIT,_EXTRA=pkey)


 KEYWORD PARAMETERS:
    GROUP_LEADER: the main base of the callers widget
    WAIT:  if set widget is waiting until closing


   _EXTRA=PKEY:
   the following keywords are used to invoke different procedures by time_series_sync

   SPLINE_INTERPOLATION    if set the build-in spline interpolation (SPLINE) is used
   LINEAR_INTERPOLATION    if set the build-in linear interpolation (INTERPOL) is used
   LINEAR_WITH_LIMIT       if set a linear interpolation with limits in in the
                           interpolation interval is used. Also returning the length
                           of the interval and the slope if requested (was verf2b)
   WINDOW_AVERAGE          if set the client data will be averaged over the provided time intervals (was verf1b)

   MASTER_WINDOW           time interval for WINDOW_AVERAGE mode in units of master (and client) time (scalar or array)

   INTERPOL_DISTANCE       if set the returned struct contains the time distance from the nearest neighbours
                           used for the interpolation
   INTERPOL_LIMIT          use this keyword to provide the maximum time distance between 2 data points used for
                           interpolation
   SPLINE_TENSION          use this keyword to provide the "tension" used by the build in spline procedure


 PROCEDURE:
    This widget is used to configure time_series_sync. It returns the _EXTRA Arguments Structure

 EXAMPLE:
   result=x_time_series_sync()

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-May-19

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_time_series_sync.pro)


X_VSTRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   x_vstruct

 PURPOSE:
   This function is used to generate views of a vector organised structure.
   The result could be saved to an idl source and as view to html
   Result is a pointer to the data


 CATEGORY:
   DATAFILES

 CALLING SEQUENCE:
   result=x_vstruct(data)

 INPUTS:
    data: a vector of structures


 EXAMPLE:
   data=reform_struct({a:findgen(10),b:sin(findgen(10))},10,/struct_arr)
   result=x_vstruct(data)

 MODIFICATION HISTORY:
   Written by:     R.Bauer (ICG-1), 1999-Apr-23
   1999-June-07 RESET button added
   1999-June-28 Output pro Script Syntax changed for better understanding.
   1999-Oct-03  replace included but replace of e.g. 10 by 100 will give trouble because 10 is part of 100
   1999-Nov-06 help added

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_vstruct.pro)


X_WHERE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	x_where

 PURPOSE:
 This function is the widget interface for the where function

 CATEGORY:
   PROG_TOOLS/WIDGETS

 CALLING SEQUENCE:
   result=x_where(names,[group_leader=group_leader],[/wait])

 INPUTS:
	name: the tag_names of a structure

 KEYWORD PARAMETERS:
   goup_leader: the group id of the major widget
   wait:        to set the widget waiting

 OUTPUTS:
	This function returns a structure
     .short_name
     .operator
     .value

 EXAMPLE:
   result=x_where(['A','B'])

 MODIFICATION HISTORY:
 	Written by:	R.Bauer (ICG-1), 1999-Apr-29

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\x_where.pro)


YDN2DATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YDN2DATE
 PURPOSE:
       Convert year and day of the year to a date string.
 CATEGORY:
 CALLING SEQUENCE:
       date = ydn2date(Year, dn)
 INPUTS:
       Year = year.                      in
       dn = day of the year.             in
 KEYWORD PARAMETERS:
       Keywords:
         FORMAT = format string.  (see dt_tm_mak(/help)).
 OUTPUTS:
       date = returned date string.      out
              (like 1984 Apr 25 06:00:00 Wed).
 COMMON BLOCKS:
 NOTES:
       Notes: Default format has changed.  If this causes
         problems add form='d$-n$-Y$' to ydn2date call for
         old format.
 MODIFICATION HISTORY:
       Ray Sterner,    25 APR, 1986.
       Johns Hopkins University Applied Physics Laboratory
       R. Sterner, 1994 May 27 --- Renamed from dn2date.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ydn2date.pro)


YDN2MD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YDN2MD
 PURPOSE:
       Convert from year and day number of year to month and day of month.
 CATEGORY:
 CALLING SEQUENCE:
       ydn2md,yr,dy,m,d
 INPUTS:
       yr = year (like 1988).               in
       dy = day number in year (like 310).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       m = month number (like 11 = Nov).    out
       d = day of month (like 5).           out
 COMMON BLOCKS:
 NOTES:
       Note: On error returns m = d = -1.
 MODIFICATION HISTORY:
       R. Sterner 20 June, 1985 (for budget workspace).
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ydn2md.pro)


YDNS2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YDNS2JS
 PURPOSE:
       Convert year, day of the year, and seconds to Julian Seconds.
 CATEGORY:
 CALLING SEQUENCE:
       js = ydns2js(Year, dn, sec)
 INPUTS:
       Year = year (like 1996).                  in
       dn = day number of the year.              in
       sec = optional seconds into day (def=0).  in
 KEYWORD PARAMETERS:
 OUTPUTS:
       js = returned Julian Seconds.             out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 1996 Mar 19

 Copyright (C) 1996, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ydns2js.pro)


YESNO (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        YESNO  (function)

 PURPOSE:
        This functions queries the user for decisions with only two
        possible answers and an optional QUIT option.

 CATEGORY:
        Input/Output

 CALLING SEQUENCE:
        answer = YESNO(Question [,default=default] [,/STRING])

 INPUTS:
        QUESTION -> A string containing the query. The following
            will automatically be added to QUESTION: ' (Y/N) [x] : '
            where x is replaced by the default selection.

 KEYWORD PARAMETERS:
        DEFAULT (int) -> either 0 (for 'NO') or 1 (for
            'YES'). Default is 0. 

        QUIT_OPTION (flag) -> if set, the user can quit with
            'Q'. This option is appended to the (Y/N) string. YesNo
            returns -1 if quit was selected.

        STRING (flag) -> set this keyword to return a 'Y' or 'N'
            instead of the numerical values 0 or 1.

        GERMAN (flag) -> If this keyword is set, "J" ("Ja") is also
            taken for yes.

 OUTPUTS:
        An integer 0 or 1 that can be used in boolean expressions,
        or a 1 character string if /STRING is set. -1 is returned if
        QUIT was allowed and used.

 SUBROUTINES:

 REQUIREMENTS:

 NOTES:
        '0' or '1' are also accepted as input. Everything but 
        'y', 'Y', '1' is treated as 'N'. 'Q' or 'C' can both
        be used to quit.

 EXAMPLE:
        if (yesno('Shall we meet today?',default=1)) then goto,meeting

        ans = yesno('Do you really want to quit?')
        if ans then return

        ans = yesno('Save data ?',/QUIT,default=1)
        if (ans lt 0) then return

 MODIFICATION HISTORY:
        mgs, 22 Jan 1999: VERSION 1.00
        mgs, 23 Mar 1999: - added /QUIT option
                          - bug fix: '0' was recognized as 'Y'
        mgs, 26 Aug 2000: - changed copyright to open source

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\yesno.pro)


YMD2DATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YMD2DATE
 PURPOSE:
       Convert from year, month, day numbers to date string.
 CATEGORY:
 CALLING SEQUENCE:
       date = ymd2date(Y,M,D)
 INPUTS:
       y = year number (like 1986).                         in
       m = month number (1 - 12).                           in
       d = day of month number (1 - 31).                    in
 KEYWORD PARAMETERS:
       Keywords:
         FORMAT = format string.  Allows output date to be customized.
            The following substitutions take place in the format string:
         Y$ = 4 digit year.
         y$ = 2 digit year.
         N$ = full month name.
         n$ = 3 letter month name.
         d$ = day of month number.
         0d$ = day of month number with leading 0 if < 10.
         W$ = full weekday name.
         w$ = 3 letter week day name.
 OUTPUTS:
       date = returned date string (like 24-May-1986).      out
 COMMON BLOCKS:
 NOTES:
       Notes:
         The default format string is 'd$-n$-Y$' giving 24-Sep-1989
         Example: FORMAT='w$ N$ d$, Y$' would give 'Mon 
 MODIFICATION HISTORY:
       R. Sterner.  16 Jul, 1986.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 28 Feb, 1991 --- modified format.
       R. Sterner, 16 Dec, 1991 --- added space to 1 digit day.
       R. Sterner, 1996 Jan 5 --- Added leading 0 to day of month.
       R. Sterner, 1999 Aug 04 --- Improved the Y2K fix.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ymd2date.pro)


YMD2DN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YMD2DN
 PURPOSE:
       Convert from year, month, day to day number of year.
 CATEGORY:
 CALLING SEQUENCE:
       dy = ymd2dn(yr,m,d)
 INPUTS:
       yr = year (like 1988).               in
       m = month number (like 11 = Nov).    in
       d = day of month (like 5).           in
 KEYWORD PARAMETERS:
 OUTPUTS:
       dy = day number in year (like 310).  out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       Written by R. Sterner, 20 June, 1985.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 1997 Feb 3 --- Made work for arrays.

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ymd2dn.pro)


YMD2JD[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YMD2JD
 PURPOSE:
       From Year, Month, and Day compute Julian Day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd = ymd2jd(y,m,d)
 INPUTS:
       y = Year (like 1987).                    in
       m = month (like 7 for July).             in
       d = month day (like 23).                 in
 KEYWORD PARAMETERS:
 OUTPUTS:
       jd = Julian Day number (like 2447000).   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  23 June, 1985 --- converted from FORTRAN.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ymd2jd.pro)


YMD2JD[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YMD2JD
 PURPOSE:
       From Year, Month, and Day compute Julian Day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd = ymd2jd(y,m,d)
 INPUTS:
       y = Year (like 1987).                    in
       m = month (like 7 for July).             in
       d = month day (like 23).                 in
 KEYWORD PARAMETERS:
 OUTPUTS:
       jd = Julian Day number (like 2447000).   out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner,  23 June, 1985 --- converted from FORTRAN.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ymd2jd.pro)


YMDS2JS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YMDS2JS
 PURPOSE:
       Convert to year, month, day, second to "Julian Second".
 CATEGORY:
 CALLING SEQUENCE:
       js = ymds2js(y,m,d,s)
 INPUTS:
       y,m,d = year, month, day numbers.   in
       s = second into day.                in
 KEYWORD PARAMETERS:
 OUTPUTS:
       js = "Julian Second".               out
 COMMON BLOCKS:
 NOTES:
       Notes: Julian seconds (not an official unit) serve the
         same purpose as Julian Days, interval computations.
         The zero point is 0:00 1 Jan 2000, so js < 0 before then.
         Julian Seconds are double precision and have a precision
         better than 1 millisecond over a span of +/- 1000 years.
       
       See also js2ymds, dt_tm_fromjs, dt_tm_tojs, jscheck.
 MODIFICATION HISTORY:
       R. Sterner, 2 Sep, 1992

 Copyright (C) 1992, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\ymds2js.pro)


YMULTI

[Previous Routine] [Next Routine] [List of Routines]
 routine:      ymulti

 purpose:      set up margins for vertically stacked multi frame plot 

 input:        

   p           named variable, contains stuff you don't need to know
               the contents of p are changed after each call
 
 Keyword input

   np          number of frames in plot, set on first call only (see examples)

   ymargin     2 element vector specifying overall margin setting 
               below (0) and above (1) multiframe plot
               if ymargin is not set the top and bot margin is taken
               from !y.margin.  This keyword is ignored when NP not set

   space       the separation distance between frames of a multiframe
               plot in units of the character height. This keyword is
               ignored when NP not set. Default is no space between plots


 SIDE EFFECTS: Changes the value of !p.multi(4) to enforce column
               major ordering of plots.  To reinsate the default row
               major ordering, set !p.multi=0 or !p.multi(4)=0.
               System variables !x and !y are changed, but restored
               to default after last plot.

 EXAMPLE:      create a three frame plot

 y1=smooth(randomu(iseed,200),3)
 y2=smooth(y1,11)
 y3=smooth(randomu(iseed,200),11)
 y4=smooth(y3,3)
 
 !p.multi=[0,1,3]
 plot,y1,ymargin=ymulti(p,np=3,ymargin=[5,3],space=1)
 plot,y2,ymargin=ymulti(p)
 plot,y3,ymargin=ymulti(p)

;  Now try a four frame plot with no space between frames

 !p.multi=[0,1,4]
 plot,y1, ymargin=ymulti(p,np=4),ytitle='test'
 plot,y2, ymargin=ymulti(p),ytitle='test'
 plot,y3, ymargin=ymulti(p),ytitle='test'
 plot,y4, ymargin=ymulti(p),ytitle='test'

;  Now try a multi-column plot

 !p.multi=[0,2,4] 

 plot,y1,title='top left',ymar=ymulti(p,np=2)
 plot,y2,ymargin=ymulti(p)

 plot,y3, title='bottom left',ymar=ymulti(p,np=2)
 plot,y4, ymargin=ymulti(p)

 plot,y1*y1, title='top right',ymar=ymulti(p,np=2)
 plot,y2*y2, ymargin=ymulti(p)

 plot,y3^2,  title='bottom right',ymar=ymulti(p,np=2)
 plot,y4^2,  ymargin=ymulti(p)


 AUTHOR        Paul Ricchiazzi                                    mar94
               Institute for Computational Earth System Science
               Univerity of California, Santa Barbara

 MODIFIED	Gwyn Fireman 7 Oct 1998
		better way to disable intermediate X-axis labeling
		disable intermediate Y-axis tick label

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\ymulti.pro)


YY2YYYY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       YY2YYYY
 PURPOSE:
       Convert a 2 digit year to a 4 digit year.
 CATEGORY:
 CALLING SEQUENCE:
       yyyy = yy2yyyy( yy)
 INPUTS:
       yy = 2 digit year.          in
 KEYWORD PARAMETERS:
       Keywords:
         /PAST means 4 digit year is current or past.
           Use this for birthdates or any dates known to be past.
           By default closest 4 digit year is returned.
         BASE=base  Use the year given in base instead of the
           current year to figure out the 4 digit years.
 OUTPUTS:
       yyyy = 4 digit year.        out
 COMMON BLOCKS:
 NOTES:
       Notes: 2 digit years will always be useful, so a
        good way to convert them to 4 digit years is also
        useful.  This routine should not break in the future.
        If incoming value is a string, returned value will be
        a string with no spaces on ends.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Aug 2
       R. Sterner, 2001 Jan 05 --- Added special check for string values.

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\yy2yyyy.pro)


Y_WIDTH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      y_width

 PURPOSE:
   This function returns the height in normal units of a string

 CATEGORY:
   PLOT

 CALLING SEQUENCE:
   result=y_width(text,[x_width=x_width],_extra=extra)

 INPUTS:
  text:  the text

 KEYWORD PARAMETERS:
  x_width:  if arg_present the result of thestring length in normal units
  _extra:    all arguments of xyouts without charthick

 EXAMPLE:
  print,y_width('Hallo!CDWelt!!')
  0.0601852

 MODIFICATION HISTORY:
      Written by:     R.Bauer (ICG-1), 1999-Oct-26
                      F.Holland

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\rb_lib\y_width.pro)


ZATWT

[Previous Routine] [Next Routine] [List of Routines]
	pro zatwt,atwt,z_array

	Given z_array (as set by compound or zcompound), calculates
	the atomic/molecular weight of the compound.

 CJJ Feb 93

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\zatwt.pro)


ZCHN_KEYS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
         Zchn_keys

 PURPOSE:
         writes the data of an ENZ- file into a structure
         with keys for header of ZCHN and keys for ncdf-structure INHALT

 CATEGORY:
         DATAFILES/ZCHN

 CALLING SEQUENCE:
         zchn_keys, header,lz,zchnkeys

 INPUTS:
         header: a string array containing the whole header

 OPTIONAL INPUTS:

 OUTPUTS:
       zchnkeys:  structure containing the keys of the header
                  and the keys of the ncdf_structure INHALT,
                  if they are found, and their values
       zchnkeys = {kl,found_key: 0, type: 0, zchn: ' ', ncdf: ' ', exec: ' '}

       found_key = 1 if a key of header of ZCHN is found
       found_key = 2 if the key is also a ncdf-key
       found_key =-1 if the key is not found in the predefined structure
       type :  type code of exec
       exec :  contains the value of the found key  
       example:
       zchnkeys[3]= {kl,2 ,7, 'INSTITUTE', 'pi_institute=', 'Inst.f.Atmos.Chem. (ICG3)'}
      
            lz: number of elements of headkeys

 SIDE EFFECTS:
       uses the function headkeys
       if there are not the necessary informations in the header
       they are set by program

 RESTRICTIONS:
       none

 EXAMPLE:
       irzn,'t2.enz',dvalue,ix,iy,fb,text,header,err
       zchn_keys,header,lz,zchnkeys

 MODIFICATION HISTORY:
       written           Marsy Lisken,   DEC  1997
       revised           M.L.  Feb 1998  predefined values for header

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zchn_keys.pro)


ZCNTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   zcntime

 PURPOSE:
       converts time info in ZEICHN file to jul sec
   (uses: tzcn2js)

 CATEGORY:
   DATAFILES/ZCHN

 CALLING SEQUENCE:
   js= ZCNTIME(dvalue, ix, fb)

 INPUTS:
   dvalue:   array of values (output of IRZN)
   ix:       number of records (output of IRZN)
   fb:       error bar flag (output of IRZN)

 OPTIONAL INPUTS:
   none

 OUTPUTS:
   array with julian seconds

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written     Theo Brauers, June 1997
       Revised     T.B. Sep 1997
       Corrected   T.B. 1998 Mar 29
                   loop index long, array subscript [..] IDL 5.
                   IF SIZE .. FR/TB Okt 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\zcntime.pro)


ZCOMPOUND

[Previous Routine] [Next Routine] [List of Routines]
 pro zcompound,compound_string,z_array,paren_multiplier=paren_multiplier

 compound_string: like 'Si3N4'

 if called without paren_multiplier set to anything, it makes
	zarr=fltarr(92)

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\HENKE\zcompound.pro)


ZENDAY

[Previous Routine] [Next Routine] [List of Routines]
 purpose:      compute daylight average of solar zenith, daylight
               hours per day and maximum solar zenith as a function of
               latitude and day of year

 useage:       zenday,day,lat,mubar,mumax,hours

 input:
   day         day of year
   lat         latitude

 output:
   mubar       cosine of solar zenith angle (SZA) averaged over 
               daylight hours

   mumax       maximum value of cos(SZA)

   hours       hours of sunlight 

               NOTE: mubar*hours*Fo = average daily insolance

                     where Fo is the solar constant

 EXAMPLE:      as a function of latitude and season make plots of 
;
;                         1. hours of sunlight
;                         2. average daylight value of cos(SZA)
;                         3. daily average insolation
;                         4. maximum cos(SZA)
      
    !p.multi=[0,2,2]
    day = findgen(365)+1
    lat=findrng(-90,90,37)
    gengrid,day,lat
    zenday,day,lat,mubar,mumax,hours

    ytickv=[-90,-75,-60,-45,-30,-15,0,15,30,45,60,75,90] & ytitle='Latitude'
    contour, hours,day,lat, ytitle=ytitle,xstyle=5,/follow,$
    ytickv=ytickv,yticks=14,levels=indgen(25),$
    title='Daylight Hours'
    xaxis_month
    contour, mubar,day,lat, ytitle=ytitle,xstyle=5,/follow,$
    ytickv=ytickv,yticks=14,levels=indgen(20)*.05,$
    title='Average Daylight cos(zenith)'
    xaxis_month
    contour, 1371*hours*mubar/24.,day,lat, ytitle=ytitle,xstyle=5,/follow,$
    ytickv=ytickv,yticks=14,levels=indgen(12)*50,$
    title='Daily Average Insolation (W/m2)'
    xaxis_month
    contour, mumax,day,lat, ytitle=ytitle,xstyle=5,/follow,$
    ytickv=ytickv,yticks=14,levels=indgen(20)*.05,$
    title='Maximum cos(zenith)'
    xaxis_month

;
  AUTHOR:      Paul Ricchiazzi        23oct92
               Earth Space Research Group,  UCSB
 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\zenday.pro)


ZENITW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	zenitw

 PURPOSE:
       This procedure calculates zenith and azimuth angle for a given location/time

 CATEGORY:
	MATH

 CALLING SEQUENCE:
       zenitw,date,time,long,lat,zenit,azimut

 INPUTS:
       date:    the speciefied day; scalar string
       time:    the time in UT    ; scalar string
       long:    longitude of the geograhical position; scalar float
       lat:     latitude  of the geograhical position; scalar float

 OUTPUTS:
       zenithw: zenith angle
       azimutw: azimuth angle

 PROCEDURE:
  For this program the publication by Sirri Aydinli, was used:
  Fortschrittberichte der VDI-Zeitschriften (Fortschr.Ber. VDI-Z.), 1981, Reihe 6, Nr.79, p5-12,
  'Ueber die Berechnung der zur Verfuegung stehenden Solarenergie und des Tageslichtes'

 EXAMPLE:
       zenitw,'08.11.1996','12:00:00',6.35,50.92,zenit,azimut

 MODIFICATION HISTORY:
 	Written by:	Franz Rohrer August 1997

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zenitw.pro)


ZENSUN

[Previous Routine] [Next Routine] [List of Routines]
 ROUTINE:      zensun

 PURPOSE:      Compute solar position information as a function of
               geographic coordinates, date and time.
               
 USEAGE:       zensun,day,time,lat,lon,zenith,azimuth,solfac,sunrise,sunset,
                  local=local

 INPUT:
   day         Julian day (positive scalar or vector)
               (spring equinox =  80)
               (summer solstice= 171)
               (fall equinox   = 266)
               (winter solstice= 356)

   time        Universal Time in hours (scalar or vector) 

   lat         geographic latitude of point on earth's surface (degrees)

   lon         geographic longitude of point on earth's surface (degrees)

 OUTPUT:

   zenith      solar zenith angle (degrees)

   azimuth     solar azimuth  (degrees) 
               Azimuth is measured clockwise from due north 

   solfac      Solar flux multiplier.  SOLFAC=cosine(ZENITH)/RSUN^2
               where rsun is the current earth-sun distance in
               astronomical units.

               NOTE: SOLFAC is negative when the sun is below the horizon 


 KEYWORD INPUT:

   local       if set, TIME is specified as a local time and SUNRISE
               and SUNSET are output in terms of local time
 
               NOTE: "local time" is defined as UT + local_offset
                     where local_offset is fix((lon+sign(lon)*7.5)/15)
                     with -180 < lon < 180

                     Be aware, there are no fancy provisions for
                     day-light savings time and other such nonsense.

 KEYWORD OUTPUT:

   sunrise     Time of sunrise (hours)
   sunset      Time of sunset  (hours)

   latsun      the latitude of the sub-solar point (fairly constant over day)
               Note that daily_minimum_zenith=abs(latsun-lat)

   lonsun      the longitude of the sub-solar point
               Note that at 12 noon local time (lon-lonsun)/15. is the
               number of minutes by which the sun leads the clock.

;              Often used           lat,   lon 

               Santa Barbara:        34.410,-119.727
               Ellison Hall:         34.415,-119.846
               SGP Cart Site:        36.605,-97.485
               North Slope:          69.318,-151.015
               Palmer Station:       -64.767,-64.067
 
; EXAMPLE 1:   Compute the solar flux at Palmer Station for day 283

               time=findgen(1+24*60)/60
               zensun,283,time,-64.767,-64.067,z,a,sf
               solflx=sf*s
               plot,time,solflx

               where s is the TOA solar irradiance at normal incidence:

               s=1618.8   ; W/m2/micron for AVHRR1 GTR100 
               s= 976.9   ; W/m2/micron for AVHRR2 GTR100
               s=1685.1   ; W/m2/micron for 410nm GTR100
               s= 826.0   ; W/m2/micron for 936nm GTR100
               s=1.257e17 ; photons/cm2/s PAR GTR100
               s=1372.9   ; w/m2 total broadband


; EXAMPLE 2:   Find time of sunrise and sunset for current day
 
     doy=julday()-julday(1,0,1994)                          
     zensun,doy,12,34.456,-119.813,z,a,s,sunrise=sr,sunset=ss,/local &$
     zensun,doy,[sr,.5*(sr+ss),ss],34.456,-119.813,z,az,/local &$
     print,'sunrise: '+hms(3600*sr)+      ' PST   azimuth angle: ',az(0)  &$
     print,'sunset:  '+hms(3600*ss)+      ' PST   azimuth angle: ',az(2)  &$
     print,'zenith:  '+hms(1800*(ss+sr))+ ' PST   zenith angle:  ',z(1) 
   
  AUTHOR:      Paul Ricchiazzi        23oct92
               Earth Space Research Group,  UCSB
 
  REVISIONS:
  
 jan94: use spline fit to interpolate on EQT and DEC tables
 jan94: output SUNRISE and SUNSET, allow input/output in terms of local time 
 jan97: declare eqtime and decang as floats.  previous version 
         this caused small offsets in the time of minimum solar zenith

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\zensun.pro)


ZERO_INT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZERO_INT
 PURPOSE:
       Return a zero of the requested data type.
 CATEGORY:
 CALLING SEQUENCE:
       z = zero_int(val)
 INPUTS:
       val = given value.                         in
 KEYWORD PARAMETERS:
 OUTPUTS:
       z = returned zero of the same data type.   out
 COMMON BLOCKS:
 NOTES:
       Note: Undefined, Structures, Pointers, and Objects
         return a 16 bit 0.  To get a 1 of the same data type do:
         one = zero_int(val)+1B (except for String type).
       Useful for promoting a value or array to a higher
       precision data type.  Some examples:
       If A is long int and B is int then B+zero_int(A)
       will be long int.
 MODIFICATION HISTORY:
       R. Sterner, 1999 Jun 30

 Copyright (C) 1999, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\zero_int.pro)


ZIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZIMAGE

 PURPOSE:

       The purpose of this program is to display an image which
       can be zoomed by drawing a rubberband box on top of it. The
      "zoomed" image appears in its own window.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

      Image Processing, Widgets.

 CALLING SEQUENCE:

      ZIMAGE, image

 INPUTS:

      image:     A 2D array of image data.

 KEYWORD PARAMETERS:

       BOTTOM:   The lowest color index of the colors to be used (see
                 NCOLORS). The default is 0.

       COLORINDEX: The color index for the rubberband box. This index will
                 be loaded with a green color. Whatever color is there will
                 be restored when the ZIMAGE program exits. The default is
                 NCOLORS + BOTTOM.

       NCOLORS:  This is the number of colors to use when displaying the
                 image. The default is !D.N_COLORS-2.

       GROUP_LEADER: This keyword is used to assign a group leader to this
                 program. This program will be destroyed when the group
                 leader is destroyed. Use this keyword if you are calling
                 ZIMAGE from another widget program.

       NOINTERPOLATION: Setting this keyword causes nearest neighbor resampling of
                 of the zoomed image instead of the default bilinear interpolation
                 of resampled pixels.


 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:

       The COLORINDEX color is turned to green while the rubberband box
       is being drawn. The color is restored after the box is drawn.

 RESTRICTIONS:

       Uses XCOLORS from the Coyote Library:
          http://www.dfanning.com/programs/xcolors.pro

 PROCEDURE:

       Clicking the left mouse button allows you to drag a rubberband box
       over the portion of the window you want to zoom into.

       Clicking the right mouse button calls up hidden controls that allow
       you to load different color tables and set the zoom factor.

       The rubberband box is drawn with pixmaps and the "device copy"
       technique.

       This is an excellent example of how you can take advantage of the
       widget program *as* the loop do to something (i.e., draw the box)
       that in a regular IDL program would have to be done in a loop. Motion
       events are only turned on for the draw widget when the box has to be
       drawn.

 EXAMPLE:

        To display an image you can zoom into, type:

        ZIMAGE, image

 MODIFICATION HISTORY:

        Written by: David Fanning, 15 August 96.
        Fixed a !D.N_Colors problem. 17 June 98.
        Made modifications so program works in 24-bit environment. 28 July 98. DWF.
        Fixed a problem with the pop-up controls under certain circumstances.
          13 Oct 98. DWF.
        Added 24-bit color response. 13 Oct 98. DWF.
        Added ability for each window to have its own color changing tool. 9 Oct 99. DWF.
        Small changes, error checking. 24 April 2000. DWF.
        Modified draw widget error handling to be consistent with current programming
         practices. 26 April 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\zimage.pro)


ZMID (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ZMID  (function)

 PURPOSE:
        Computes altitude centers from altitude edges.

 CATEGORY:
        Atmospheric Sciences

 CALLING SEQUENCE:
        RESULT = ZMID( EDGE )

 INPUTS:
        EDGE -> Vector of altitude edges that defines the grid.  
             EDGE will be sorted in ascending order.

 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        The vector of altitude centers is returned in RESULT.  

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        The relationship between altitude centers and edges is:

              ZMID[N] = ( ZEDGE[N] + ZEDGE[N+1] ) / 2.0
   
 EXAMPLE:
        Result = ZMID( [ 0.0, 2.0, 4.0, 6.0, 8.0 ] )
        print, Result
             1.00000      3.00000      5.00000      7.00000


 MODIFICATION HISTORY:
        bmy, 21 Jun 1999: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\zmid.pro)


ZNINFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       zninfo

 PURPOSE:
       returns a structure array with info about
       a ZEICHN file (KFA ICG3 data format)

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       inf=ZNINFO(dvalue,ix,iy,fb,text,header,/SCREEN)

 INPUTS:
       the output of the irzn

 OPTIONAL INPUTS:
       SCREEN: if set output to screen

 EXAMPLE:
       ....................

 REVISION HISTORY:
       Written         Theo Brauers, June 1997
       Corrected
       Revised         T.B. Sep 1997, 1.02

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\tb_lib\zninfo.pro)


ZOOMBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	zoombar

 USEAGE:    while zoombar(range) do ...

 PURPOSE:
	Emulate the operation of a variable-sized box cursor (also known as
	a "marquee" selector).

 CATEGORY:
	Interactive graphics.

 CALLING SEQUENCE:
	result = zoombar(range, INIT=init,message=message,$
                        ybar=ybar,xbar=xbar)

 INPUTS:
	No required input parameters.

 OPTIONAL INPUT PARAMETERS:
	x0, y0, nx, and ny give the initial location (x0, y0) and 
	size (nx, ny) of the box if the keyword INIT is set.  Otherwise, the 
	box is initially drawn in the center of the screen.

 KEYWORD PARAMETERS:

  INIT
    Sets the initial x or y range of the cursor bar.  INIT should be
    specified in data coordinates.

  ybar
    If this keyword is set, the horizontal size of the box
    is fixed.  Set this keyword to set vertical range

  xbar
    If this keyword is set, the vertical size of the box
    is fixed.  Set this keyword to set horizontal range
    (default)

  message
    if set, an instructional pop-up widget appear
    if MESSAGE is a string or string array, the contents of
    MESSAGE are pre-pended to ZOOMBARs default instructions.
                 

 OUTPUTS:
    result: 1 if exit is caused by RMB clicked inside bar
    result: 0 if exit is caused by RMB clicked outside bar

    range:  the vertical (if ybar is set)  or horizontal 
               (if xbar is set) range of the cursor bar.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       A box is drawn in the currently active window.  It is erased
       on exit.

 RESTRICTIONS:
       Works only with window system drivers.

 PROCEDURE:
       The graphics function is set to 6 for eXclusive OR.  This
       allows the box to be drawn and erased without disturbing the
       contents of the window.

       Operation is as follows:

       Left mouse button:   Move the box by dragging.

       Middle mouse button: Resize the box by dragging.  The corner
               nearest the initial mouse position is moved.

       Right mouse button:  Exit this procedure, returning the 
                            current xrange or yrange parameters.  
                            RMB click inside the bar,  return value = 1
                            RMB click outside the bar, return value = 0

;; Example:  

    x=randf(1000,1.5) & plot,x & while zoombar(r,/mes) do plot,x,xr=r,/xst 

;; select range in one window, plot zoomed plot in another:

  window,1 & wset,0 & x=randf(1000,1.5) & plot,x & xs=!x & r=0
  while zoombar(r,/mes,init=r) do begin &$
     wset,1 & plot,x,xr=r & !x=xs & wset,0 & end

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ESRG\zoombar.pro)


ZOOMBOX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZOOMBOX

 PURPOSE:

       The purpose of this program is to display an image which
       can be zoomed by drawing a rubberband box on top of it. The
      "zoomed" image appears in its own window. The program is written
       in object graphics. Either 8-bit or 24-bit images may be used.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

      Image Processing, Widgets.

 CALLING SEQUENCE:

      ZOOMBOX, image

 INPUTS:

       image:    An 8-bit or 24-bit image.

       GROUP_LEADER: This keyword is used to assign a group leader to this
                 program. This program will be destroyed when the group
                 leader is destroyed. Use this keyword if you are calling
                 ZOOMBOX from another widget program.

       HARDWARE_RENDERING: Set this keyword if you want to render the scene using
                 the hardware renderer. This is NOT recommended, since this makes
                 rendering exceedingly slow on most machines.

       INSTANCE: Set this keyword to use instancing to draw the rubberband zoom box.
                 The default is not to use instancing.

       INTERPOLATE: Set this keyword to use bilinear interpolation on the sub-image
                 defined by the box when zooming. The default is to use nearest neighbor
                 interpolation.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:

 DEPENDENCIES:

       Uses XCOLORS and PICKCOLOR from the Coyote Library:

          http://www.dfanning.com/programs/xcolors.pro
          http://www.dfanning.com/programs/pickcolor.pro

 PROCEDURE:

       Clicking the left mouse button allows you to drag a rubberband box
       over the portion of the window you want to zoom into.

 EXAMPLE:

        IDL> ZOOMBOX

 RESTRICTIONS:

       Object graphics programs are really meant to be used on 24-bit displays.
       Colors are decidedly ugly in 256 color environments.

 MODIFICATION HISTORY:

       Written by: David W. Fanning, 24 April 2000.
       Modified draw widget event handling.  22 October 2001. DWF.
       Added INSTANCE keyword to demonstrate instancing in object. 14 February 2002. Mark Hadfield.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\zoombox.pro)


ZPAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZPAN
 PURPOSE:
       Zoom and pan around an image using the mouse.
 CATEGORY:
 CALLING SEQUENCE:
       pan
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         INWINDOW=w1  input window (window to zoom, def=0).
         OUTWINDOW=w2 output window (magnified image, def=1).
         ZOOM=zm  Initial zoom factor (def=2).
         SIZE=sz  Approximate size of zoom window (def=250).
 OUTPUTS:
 COMMON BLOCKS:
       zpan_com
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 8 Oct, 1993
       R. Sterner, 1999 Oct 05 --- Modified for true color.

 Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\zpan.pro)


ZPLOT[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZPLOT
 PURPOSE:
       Plot symbols in various colors.
 CATEGORY:
 CALLING SEQUENCE:
       zplot, x, y, [z]
 INPUTS:
       x, y = arrays of coordinates of symbols to plot.   in
       z = array of symbol colors (def =!p.color).        in
 KEYWORD PARAMETERS:
       Keywords:
         PSYM=p  symbol number to plot.  Must have 0 < p < 8.
         /DATA to work in data coordinates (default).
         /DEVICE to work in device coordinates.
         /NORMAL to work in normalized coordinates.
 OUTPUTS:
 COMMON BLOCKS:
 NOTES:
       Note: z values should be from 0 to 255.
         Z should have the same number of values as x and y.
 MODIFICATION HISTORY:
       Written by R. Sterner, 2 Feb, 1987 from ZPLOT.
       Johns Hopkins University Applied Physics Laboratory.
       R. Sterner, 18 Apr, 1990 --- converted to SUN.

 Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\zplot.pro)


ZPLOT[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZPLOT

 PURPOSE:

       The purpose of this program is to display a line plot in a resizeable
       graphics window which can be zoomed by drawing an "arrow box" on top
       of it. To return to the un-zoomed plot, click and release anywhere in the window.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

      Widgets.

 CALLING SEQUENCE:

      ZPlot, x, y

 OPTIONAL INPUTS:

      x: If only one positional parameter, this is assumed to be the
         dependent data. If there are two positional parameters, this
         is assumed to be the independent data in accordance with the
         PLOT command.

      y: The dependent data, if the X parameter is present.

 KEYWORD PARAMETERS:

       Any valid PLOT keyword can be used with this program. In additon,
       the following keywords are defined specifically.

       GROUP_LEADER: This keyword is used to assign a group leader to this
                 program. This program will be destroyed when the group
                 leader is destroyed. Use this keyword if you are calling
                 ZIMAGE from another widget program.

       XLOG: Set this keyword if you wish the X axis to be logarthmic style.

       YLOG: Set this keyword if you wish the Y axis to be logarthmic style.

       ZOOM_XSIZE: The initial X size of the plot window. Default is 400 pixels.

       ZOOM_YSIZE: The initial Y size of the plot window. Default is 400 pixels.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       Drawing colors are loaded into the color table.

 RESTRICTIONS:

       Zooms only along the X axis.

 PROCEDURE:

       Click and drag the cursor to create an "arrow box". The plot
       is zoomed into the X coordinates of the box, when released.
       To restore unzoomed plot, click and release anywhere in the
       window.

 EXAMPLE:

        To display an plot you can zoom into, type:

        ZPLOT

 MODIFICATION HISTORY:

        Written by: David Fanning, 15 February 2000.
        Modified the original rubberband box to be an "arrow box". 1 April 2000. DWF.
        Added the ability to produce log style plots. 20 November 2001. DWF.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\coyote\zplot.pro)


ZSTAR (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        ZSTAR  (function)

 PURPOSE:
        Computes pressure-altitudes from pressures.

 CATEGORY:
        Atmospheric sciences

 CALLING SEQUENCE:
        RESULT = ZSTAR( PRESS )

 INPUTS:
        PRESS -> The input pressure value, in mb.
             PRESS can be either a scalar or a vector.
             
 KEYWORD PARAMETERS:
        None

 OUTPUTS:
        RESULT contains the output pressure-altitudes.

 SUBROUTINES:
        None

 REQUIREMENTS:
        None

 NOTES:
        Pressure-altitude is defined as:

            Z* = 16 * log10[ 1000 / P(mb) ]

        which, by the Laws of Logarithms, is equivalent to

            Z* = 48 - ( 16 * log10[ P(mb) ] ).

 EXAMPLE:
        print, zstar( [ 900, 700, 500 ] )
            0.732121      2.47843      4.81648

 MODIFICATION HISTORY:
        bmy, 21 Jun 1999: VERSION 1.00

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\mschultz\zstar.pro)


ZTEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ztest

 PURPOSE:
	This function performs a statistical test on the hypothesis H0:
	"the values in a given data set are identical within their errors"
	versus its negation (hypothesis H1).

 CATEGORY:
	MATH

 CALLING SEQUENCE:
	result = ztest(data, error)

 INPUTS:
	data: Array of input data.
	error: Array (of same dimension as data) with error of data.

 KEYWORD PARAMETERS:
	ALPHA = alpha: The level of significance to use (between 0 and 1).
		This value specifies the probability of committing a Type I error,
		e.g. of rejecting the hypothesis H0 (values are equal) although H0 is true.
		The default is 5%. However, the probability of committing a
		Type II error (e.g. failing to reject H0 although H1 is true) is unknown.
	Z = z: If set to a named variable the ratio external_error / internal_error is returned.
	CONF_INTV = z_conf_intv: If set to a named variable the confidence interval of z is returned.
	EX_ERR = exf: If set to a named variable the external error of the (weighted) mean of data is returned.
	INT_ERR = inf: If set to a named variable the internal error of the (weighted) mean of data is returned.
	WMEAN = wmean: If set to a named variable the weighted mean is returned.
	/VERBOSE: If set error information is printed to the log window.

 OUTPUTS:
	This function returns 1 if the test was passed (hypothesis H0 is true, e.g. values
	are equal) otherwise 0 is returned. In case of an error -1 is returned.

 PROCEDURE:
	The internal and external error of the data set are calculated.
	If there are no systematic deviations between the single data points
	the ratio z = external_error / internal_error is expected to be close to 1.0.
	If the value of z is within the expected statistical confidence interval
	(which depends on alpha and the number of data) then the test is passed.

 EXAMPLE:
	data = [1.,2.,3., 3., 2., 1.]
	error = [0.4, 1.9, 1.2, 0.7, 0.9, 2.3]
	print, ztest(data, error, Z=z, CONF=conf, ALPHA=0.32, EX_ERR = exf, INT_ERR = inf)
		--->	1
	print, exf, inf, z
		--->	0.38429404      0.30591094       1.2562285
	print, conf
		--->	0.793930      1.55584

 MODIFICATION HISTORY:
 	Written by:	Frank Holland, 06.08.1999
	20.08.1999:	Added keyword parameters EX_ERR, INT_ERR
	24.08.1999:	Function returns -1 if number of data is two or less.
					New keyword parameter /VERBOSE
	01.12.1999:	Removed arithmetic error: Floating underflow
					caused by CHISQR_CVF for f GT 120
	20.03.2000:	Added keyword parameter WMEAN
	22.03.2000:	New error condition: some or all entries in 'error' are NaN.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fh_lib\ztest.pro)


ZUSJSTIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    ZUSJSTIME

 PURPOSE:
       converts seconds of a Zus-file with ref date
       to julian seconds

 CATEGORY:
       TIME

 CALLING SEQUENCE:
       js=zusjstime(sec,ix,fb,ref)

 INPUTS:
       sec:    seconds
        ix:    length of seconds
        fb:    error bar flag
       ref:    string with ref date dd.mm.yy hh:mm:yy

 OPTIONAL INPUTS:
       none

 OUTPUTS:
      time in julian sec: if fb=1 THEN 3 columns, if fb=0 then one column

 SIDE EFFECTS:
      uses the procedure tenz2js

 RESTRICTIONS:
       None.

 EXAMPLE:
       js=zusjstime(sec,ix,fb,ref)

 MODIFICATION HISTORY:
       written           Marsy Lisken, January 1998
       corrected         M.L. Feb. 1998

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zusjstime.pro)


ZUS_FB_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZUS_FB_INFO

 PURPOSE:
       returns a structure with info about a zus-file (KFA ICG3 data format)
       and about error-bars if fb=1

 CATEGORY:
       DATAFILES/ZCHN

 CALLING SEQUENCE:
       file_info=ZUS_FB_INFO(dvalue,ix,iy,fb,text,header,filename)

 INPUTS:
       the output of the irzn

 OPTIONAL INPUTS:

 OUTPUTS:
    a structure of info about a ncdf-file see create_info_struct for details
      .file_info.name                : name of file
      .info_file.info.path           : path of the file
      .file_info.info.filetype       : 'zus'
      .file_info.info.filedate       : date of file
      .record_info.jstime[0] : start-time in julian seconds (double)
      .record_info.jstime[1] : end-time in julian seconds   (double)
      .record_info.ntime[0]  : start-time in normal date and time (string)
      .record_info.ntime[1]  : end-time in normal date and time   (string)
      .record_info.n_records :number of rows
      .record_info.n_sets    :number of columns
      .pi.pi_name   :
      .pi.email     :
      .pi.phone_number :
      .pi.organisation :
      .hrefs.ps   : 'ps'  (reference to ps-file: filename+.ps )
      .hrefs.data : 'data'
      .hrefs.html : 'html' (reference to html-file: filename + .savinfo.html )
      .data.text   :string-array : description of a data columnstring-array
      .data.nvalid :array containing the number of valid values of a column
      .data.mean   :array containing the avarage values of a data column
      .data.median :array containing the median values of a data column
      .data.stdev  :array containing the standard deviation of a column
      .data.minimum:array containing the lowest values of a data column
      .data.maximum:array containing the greatest values of a data column
      .header.text :string array containing the header of the file (like output of IRZN)
      .experiment.text  :containing the text of structure experiment

 EXAMPLE:
       IRZN, filename, dvalue, ix, iy, fb, text, header, err
       file_info=ZUS_FB_INFO(dvalue,ix,iy,fb,text,header,filename)

 REVISION HISTORY:
       Written         Marsy Lisken, June 1998
       Corrected          28.7.98
       Revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zus_fb_info.pro)


ZUS_NCDF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     ZUS_NCDF

 PURPOSE:
     This Procedure generates the structure INHALT for a ZUS-file
     and writes it to a ncdf-file

 CATEGORY:
     DATAFILES/ZCHN

 CALLING SEQUENCE:
     zus_ncdf, fname,new_fname,fillvalue=xl,err,errmess=errmess,options

 INPUTS:
     fname:     the name of the ZUS-file (string-var)
     new_fname: the name of the ncdf-file (string-var)
                optional, default: new_fname=fname.nc
     options:   optional

 KEYWORD PARAMETERS:
     fillvalue: the numeric value for '====' input
                default: -12345
     errmess:   returns a error message

 OUTPUTS:
     err:       flag indicating error  err=1 : no parameter
                                       err=2 : filesize <0   (output of IRZN)
                                       err=3 : no header found        (  "  )
                                       err=4 : number of columns=0    (  "  )
                                       err=5 : overwriting label      (  "  )
 SIDE EFFECTS:
     uses the procedures IRZN,RPL_STR, ZCHN_KEYS,HEADKEYS,ZUSJSTIME,
                         TENZ2JS,JS2INST,ZCNTIME
                         JD2YMD (Ray Sterner Lib)
                         @gen_inh2, NCDF_W, NCDF_CH

 EXAMPLE:
     ZUS_NCDF,'t.zus','test.nc',err

     result=f_history('test.nc') --> (history contains the whole header)

 MODIFICATION HISTORY:
     Written       Marsy Lisken, January 1998
     Revised       M.L. Feb 1998  Search for 'TIME/SEC' in text
                   M.L. Apr 1998  destination of time in zus_time
    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zus_ncdf.pro)


ZUS_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     ZUS_TIME

 PURPOSE:
       defines the time of a Zus-file
        

 CATEGORY:
       TIME

 CALLING SEQUENCE:
       zus_time,js,dvalue,ix,fb,text,ja

 INPUTS:
       dvalue:  matrix of ix * iy double values,the first 4 columns contain the time-values
           ix:  length of rows
           fb:  error bar flag 
         text:  text array of column descriptions

 OPTIONAL INPUTS:
        none

 OUTPUTS:
        js:  time in julian sec
             if fb=1 an array with 3 columns, if fb=0 then one column
        ja:  index of column,where data of param begins

 SIDE EFFECTS:
      uses the functions: zusjstime,zcntime

 RESTRICTIONS:
       None.

 EXAMPLE:
       zus_time,js,dvalue,ix,fb,text,ja
                time= js[*,0]
                l=ix
                IF fb THEN BEGIN
                  BEGIN_T  =js[*,1]
                  END_T    =js[*,2]
                ENDIF

 MODIFICATION HISTORY:
       written           Marsy Lisken, January 1998
       corrected         M.L. Feb. 1998 
                         F.R. Mar. 1998
                         M.L. Apr. 1998 text taken out of zus_ncdf
       revised

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\ICG\IDL_SOURCE\IDL_WORK\fr_lib\zus_time.pro)


ZWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ZWINDOW
 PURPOSE:
       Z buffer window like normal x window.
 CATEGORY:
 CALLING SEQUENCE:
       zwindow
 INPUTS:
 KEYWORD PARAMETERS:
       Keywords:
         XSIZE=xs  X size of window (def=!d.x_size).
         YSIZE=ys  Y size of window (def=!d.y_size).
         N_COLORS=n  Number of colors to use (def=!d.table_size).
         /CLOSE  Terminate z window and restore previous window.
         /COPY   Copy z window to visible window.
         /LIST   List zwindow status.
         /GET    Get image and color table:
           IMAGE=img, RED=r, GRN=g, BLU=b.
 OUTPUTS:
 COMMON BLOCKS:
       zwindow_com
 NOTES:
       Notes: Easy 8 bit graphics on a 24 bit display.
         Set up z window, then graphics commands use it.
         Can read back image and color table with tvrd, tvlct,/get.
         Use /copy to display results, /close when done.
 MODIFICATION HISTORY:
       R. Sterner, 2000 Mar 28
       R. Sterner, 2000 Apr 17 --- removed the close on /COPY.
       R. Sterner, 2000 May 07 --- Fixed an entry device bug.
       R. Sterner, 2000 May 22 --- Will resize X window on /copy if needed.
       R. Sterner, 2001 Jan 29 --- Added /GET,IMAGE=img,R=r,G=g,B=b

 Copyright (C) 2000, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\STERNER\zwindow.pro)


[10]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CW_PLOTSTYLES

 PURPOSE:
 
       A compound widget used to set values for the graphics keywords
       COLOR, LINESTYLE, THICK, PSYM, and SYMSIZE, for several plot
       variables.  A CW_PLOTSTYLE (single variable) widget is created
       for each element of the LABELS input parameter. The widget
       also includes an Apply button, and (optionally) a Done button.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTSTYLES(PARENT,LABEL)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

       LABELS - a string array of labels to be drawn to the left
               (or top) of each of the CW_PLOTSTYLE widgets.

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.

       VALUE - an (n,5) array of initial values, where 
               n = n_elements(LABELS), and each row has
               the form VALUE(i,*)=[color,linestyle,thick,psym,symsize]

       FRAME - set to draw a frame around the widget.
       
       FONT - font keyword for labels etc.

       ROW - set to create a row of column-oriented CW_PLOTSTYLE widgets.

       COLUMN - set to create a column of row-oriented CW_PLOTSTYLE
                widgets. (default)
 
       DONE - set this to add a Done button, in addition to the standard
              Apply button.

       STYLE_IDS - an array of widget id's for the individual
                   CW_PLOTSTYLE widgets.

       X_SCROLL_SIZE, Y_SCROLL_SIZE - if these values are non-zero,
                                      then the base widget which
                                      holds the CW_PLOTSTYLE widgets
                                      will include scroll bars.


 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         The idea is that this compound widget would be used in a
         widget intended to allow the user to interactively adjust
         the style settings for several variables contained in a
         plot.  For instance, you might have a menu item such as Plot
         Options->Styles, which would create a popup widget
         containing a CW_PLOTSTYLES subwidget, allowing the user to
         affect each of the variables in the plot.  When the user
         makes changes to the Color, Linestyle, Thick, Psym, and
         Symsize values, the popup widget event handler would re-draw
         the plot accordingly.
 
         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

         Example:

         style=CW_PLOTSTYLE(BASE,['A','B'],/DONE, $
                            VALUE=TRANSPOSE([[FLTARR(5)],[FLTARR(5)]]))

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plotstyles.pro)


[11]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CW_PLOTTITLE_CHAR

 PURPOSE:
 
       A compound widget used to set values for the graphics keywords
       CHARSIZE, SUBTITLE, and TITLE.  The widget contains fields for
       these parameters, an Apply button, and (optionally) a Done
       button.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTTITLE_CHAR(PARENT)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.
 
       FRAME - set to draw a frame around the widget.

       VALUE - a structure, containing initial values for
               the charsize, subtitle and title fields, of
               the form {charsize:_float_, subtitle: _string_,
               title:_string_}

       FONT - font keyword for labels etc.

       DONE - set this to add a Done button, in addition to the standard
              Apply button.
 
       IDS - widget ids of the title, subtitle, and charsize cw_field
             widgets, and the apply button widget.

       NO_RETURN - The default behavior is that the user must press
                    after entering new values.  Set this
                   keyword so that new values are accepted even if
                   the user just changes a value and then moves the
                   cursor outside of the text entry area.

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         The idea is that this cw would be used in a widget intended
         to allow the user to interactively adjust the settings for a
         plot.  For instance, you might have a menu item such as Plot
         Options->Titles/Charsize, which would create a popup widget
         containing a CW_PLOTTITLE_CHAR subwidget.  When the user
         makes changes to the CW_PLOTTITLE_CHAR fields, and then
         presses the Apply button, the popup widget event handler
         would re-draw the plot accordingly.

         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

         Example:
 
         title_char=CW_PLOTTITLE_CHAR(BASE,/DONE, $
                          VALUE={CHARSIZE:!P.CHARSIZE,SUBTITLE:!P.SUBTITLE,
                                 TITLE:!P.TITLE}

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       DLW, June 1997, Added NO_RETURN keyword.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plottitle_char.pro)


[12]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CW_VECTOR

 PURPOSE:
 
       A compound widget used to get input necessary to create a
       "vector", in the spirit of the VECTOR function in this
       directory, i.e, get input for the MIN, MAX, and PTS values.
       The widget also lets the user specify the increment between
       points, and whether the point spacing is linear or
       logarithmic.
      
 CATEGORY:
 
	compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_VECTOR(PARENT)

 INPUTS:
 
       PARENT - the id of the parent widget.  

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.
 
       FRAME - Set to draw a frame around the widget.

       FONT - Font keyword for labels etc.

       TITLE - A string used to label the widget

       XSIZE - An explicit horizontal size (in characters) for the
               min, max and increment input areas.  The default is to
               let the window manager size the widget.  

       NXSIZE - An explicit horizontal size (in characters) for the
                pts field area.  The default is to let the window
                manager size the widget.  

       YSIZE - An explicit vertical size (in lines) for the text input
               areas.  The default is 1.

       VALUE - A structure used to set the initial value of the
               widget, containing the following tags:

               min, max, n and log - the parameters used to specify a
                                     vector (see vector.pro)

               format - a valid format command string used to format
                        the min, max, and increment values. a null
                        string will result in default floating-point
                        formatting.

               nformat - a valid format command string to format the
                         pts field.  a null string will result in
                         default integer formatting.
 
               units - a string used to label the vector units. for
                       example, if the CW_VECTOR widget is being used
                       to get input to create a vector of lengths in
                       feet, then set value.units='feet'

               uunits - a flag to indicate whether or not to actually
                        update the units label.
             
               The same value structure is used with WIDGET_CONTROL
               to set the value of a CW_VECTOR, as in
               WIDGET_CONTROL,WIDGET,SET_VALUE=VALUE

               When using the GET_VALUE keyword with WIDGET_CONTROL,
               however, the returned value is a structure with only
               four tags: {min,max,pts,log}

      MINRANGE, MAXRANGE - These keywords define the range of
                           acceptable values for the min and max
                           fields.  If not set, any values for min
                           and max are allowed; otherwise, (min >
                           MINRANGE) < MAXRANGE, and (max > MINRANGE)
                           < MAXRANGE.  None, one or both of these
                           keywords can be specified.

      MINN - The minimum allowable value for n. default is 1.

      NO_RETURN - The default behavior is that the user must press
                   after entering new values.  Set this
                  keyword so that an event is returned even if the
                  user just changes a value and then moves the
                  cursor outside of the text entry area.

 OUTPUTS:
 
       The id of the created widget is returned.

 PROCEDURE:
 
      Entering a value in the pts, min or max fields will set the
      increment field.  Entering a value in the increment field will
      set the points field, and possibly the max field if the
      increment doesn't divide evenly into the range specified by min
      and max.

 EXAMPLE:
 
     Create a CW_VECTOR to get input to create a vector of lengths in
     [feet]:
     
      
        base=WIDGET_BASE()
        length_widget=CW_VECTOR(BASE,VALUE={MIN:0.,MAX:10.,N:11,LOG:0, $
                                            UNITS:'feet', $
                                            FORMAT:'(F10.2)',
                                            NFORMAT:'(I4)',
                                            UUNITS:1}
                                TITLE='LENGTHS')

     Later, get the widget values and create the length vector:
 
        WIDGET_CONTROL,length_widget,GET_VALUE=value
        lengths=VECTOR(value.min,value.max,value.n,log=value.log)

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       DLW, June 1997, Added NO_RETURN keyword.

       DLW, November 1997, Removed TRACKING keyword; corrected bug
       that caused improper updates when NO_RETURN was set and the
       user toggled between linear and logarithmic step sizes.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_vector.pro)


[13]

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

       DGTZ_IMAGE
       
 PURPOSE:

       A widget application to interactively measure distances in an
       image, either between two points, two horizontal lines, or two
       vertical lines.
       
 CATEGORY:

       Image analysis
       
 CALLING SEQUENCE:
 
       DGTZ_IMAGE,IMAGE
		
 INPUTS:
 
      IMAGE = 2-D array containing image.

 OUTPUTS:

      The measured distances are listed on the widget, and
      can also be saved to a text file (using MORE.)
		
 KEYWORD PARAMETERS:
 
	UNITS - String specifying units.  Default is 'units'.
	
 COMMON BLOCKS:
 
	dgtz_image, internal to this program.

 MODIFICATION HISTORY:
 
      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

      Jul 1997: Corrected problem with widget labels

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\dgtz_image.pro)


[14]

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

          DGTZ_PLOT

 PURPOSE:

          A widget application used to extract (X,Y) values from an
          image of plot.  For example, you can use this program to
          extract data from a published plot that you've scanned and
          converted to an image array.

 CALLING SEQUENCE:
 
         DGTZ_PLOT,IMAGE,XRANGE,YRANGE

 INPUTS:
 
         IMAGE - 2D array containing the plot image.
         
         XRANGE - 2-element array specifying data range of X axis on
                  plot image.
                  
         YRANGE - 2-element array specifying data range of Y axis on
                  plot image.
                               
 KEYWORD PARAMETERS:
 
         XTYPE - set if plot image has log x axis.

         YTYPE - set if plot image has log x axis.

         SXMAX - Visible size of draw widget along x direction, in pixels.
                 Default=512.
                 
         SYMAX - Visible size of draw widget along y direction, in pixels.
                 Default=512.

 OUTPUTS:

         The digitized X,Y pairs are listed on a widget. You can
         also save these data to a file (using MORE.)
         
 COMMON BLOCKS:
 
         DGTZ_PLOT internal to this procedure.
         
 PROCEDURE:
 
         The image of the plot is displayed on a widget, and the user
         can digitize points which are converted to X,Y values.  The
         first step,however, is generally to calibrate the X and Y
         axes; the endpoints of the specified axis are digitized,
         after pressing the Calibrate X Axis or Calibrate Y Axis
         button.

         
 MODIFICATION HISTORY:
 
         David L. Windt, Bell Laboratories, May, 1997

         September, 1998 - Addex SXMAX and SYMAX keywords.

         windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\dgtz_plot.pro)


[15]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	DIALOG

 PURPOSE:
 
       A popup widget dialog box to get user input. Like
       WIDGET_MESSAGE, which is better in some cases, but this widget
       also includes fields and lists.

 CATEGORY:
 
	Widgets.

 CALLING SEQUENCE:

	Result = DIALOG([TEXT])

 OPTIONAL INPUTS:
 
	TEXT - The label seen by the user.
	
 KEYWORD PARAMETERS:
 
   There are 6 types of dialogs, each with unique behavior.  With
   each default dialog type are associated buttons; these buttons can
   be overridden with the BUTTONS keyword, except in the case of the
   LIST and FIELD dialogs.

       One of the following six keywords MUST be set:

       ERROR - Display an error message; default BUTTONS =
               ['Abort','Continue']

       WARNING - Display a warning message.  default BUTTONS = ['OK']

       INFO - Display an informational message; 
              default BUTTONS = ['Cancel','OK']
 
       QUESTION - Ask a question.  default BUTTONS =
                  ['Cancel','No','Yes']

       LIST - Get a selection from a list of choices.  default
              BUTTONS = ['Cancel','OK'] Must specify CHOICES = string
              array of list choices.

              Set the RETURN_INDEX keyword to cause the returned
	       value to be the zero-based index of the selected
	       list item.  

       FIELD - Get user input, using CW_FIELD.  default BUTTONS =
               ['Cancel','OK']. FLOAT, INTEGER, LONG, and STRING
               keywords apply here, as does the VALUE keyword to set
               an initial value.

   GROUP - Group leader keyword.

   TITLE - title of popup widget.
	
 COMMON BLOCKS:

       DIALOG

 OUTPUTS:
 
       In the case of LIST or FIELD dialogs, this function returns
       the selected list element or the user input, respectively.
       Otherwise, this function returns the name of the pressed
       button.

 EXAMPLE:
 
	1. Create a QUESTION DIALOG widget.

       D = DIALOG(/QUESTION,'Do you want to continue?')

       2. Get the user to enter a number.

       D = DIALOG(/FLOAT,VALUE=3.14159,'Enter a new value for pi.')
 
       3. Get the user to choose from a list of options.

       D = DIALOG(/LIST,CHOICES=['Snoop','Doggy','Dog'])

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997

       May 1997 - Added GROUP keyword, and modified use of MODAL
                  keyword to work with changes in IDL V5.0
                  
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\dialog.pro)


[16]

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

       DISPLAY_FONT
       
 PURPOSE:

       Display the font sets listed in the IDL User's Guide.
       
 CALLING SEQUENCE:
 
       DISPLAY_FONT[,FONT_NUMBER,HARDWARE=HARDWARE]
       
 OPTIONAL INPUT PARAMETERS:
 
      FONT_NUMBER - The font index. If not supplied, the user is
                    prompted for input.
			
 KEYWORD PARAMETERS:
 
      HARDWARE - set to use the hardware fonts (i.e. PostScript for
                 !d.name='PS') set; otherwise Hershey sets are used.
			
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, Sept. 1991
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\display_font.pro)


[17]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	DLIB
	
 PURPOSE:
 
	A cheesy alias to DOC_LIBRARY, with a name that's easier to
	type.

 CATEGORY:
 
	Cheesy aliases.

 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Labs, April 1990.
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\dlib.pro)


[18]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       EPLOT
		
 PURPOSE:

       Plot x vs y, with vertical error bars on y.

 CALLING SEQUENCE:

       EPLOT,Y,SIGY
       EPLOT,X,Y,SIGY
       EPLOT,Y,SIGY_UP,SIGY_DOWN
       EPLOT,X,Y,SIGY_UP,SIGY_DOWN

 INPUTS:

       X, Y -  1-D arrays

       SIGY - Uncertainty in Y, i.e. Y+/-SIGY

       SIGY_UP, SIGY_DOWN - +/- uncertainties in Y, i.e.,
                           Y +SIGY_UP -SIGY_DOWN

 KEYWORD PARAMETERS:

       BARLINESTYLE = Linestyle for error bars.

               plus all valid IDL plot keywords.  Only the COLOR,
               THICK, NOCLIP, and T3D keywords apply to the error
               bars.

 MODIFICATION HISTORY:

      D. L. Windt, Bell Laboratories, November 1989
      Replaced specific plot/oplot keywords with _EXTRA,
      April, 1997

      windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\eplot.pro)


[19]

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

      EROM
      
 PURPOSE:

       Read up to ten columns of data from a text file.

       This program can be used to read data written by the MORE
       program.

       The file to be read must be such that if the data are
       space-separated, then all variables are numeric; String
       variables are allowed only if the data are separated by tabs,
       colons, etc.

       The file may contain any number of comment lines - which MUST
       begin with a semicolon, and MUST be positioned before all data
       lines.

 CALLING SEQUENCE:
 
	EROM,V0[,V1,V2,...V9]
	     
 KEYWORD PARAMETERS:
 
   FILE - String specifying the name of a file; if not supplied, the
          user is queried.
   
   SKIP - The number of lines at the beginning of the file that
          should be skipped.
          
   TAB - Specify /TAB for tab-separated data.  (The default is space-
         separated data.)  It is only necessary to specify this
         keyword if the file contains any string data columns.
         
   SEPARATOR - A string specifiying the character separating the data
               columns.
               
 OUTPUTS:
 
	V0, V1, V2, ... variables to hold the data.  There must be as many
       v's specified in the call to EROM as there are columns of
       data.  The V's are floating point arrays, unless the TAB
       keyword is specified in which case they are all string arrays.
	
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Labs, March 1990

	January, 1997 - DLW
         Modified to ignore lines beginning with semicolons, and to
         accept data separated by tabs, etc.; Removed the notitle and
         comment keyword; included pickfile to prompt for filenames
         when not specified.

       June, 1997 - DLW
         Returned numeric variables are now double-precision instead
         of floating-point.
	
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\erom.pro)


[1]

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

      ATOMIC_WEIGHT

 PURPOSE:

      Function to return the atomic weight of specified chemical
      elements.

 CALLING SEQUENCE:

      Result=ATOMIC_WEIGHT(SYMBOL)
 
 INPUTS:

      SYMBOL - A string or string array specifying the name or names
               of the chemical elements. Each element of SYMBOL must
               be a one or two character string, corresponding to the
               chemical symbol of the atom.  Case is ignored.

 KEYWORD PARAMETERS:

      ALL - Set this to return all 92 atomic weights and symbols.

 OUTPUTS:

      Result - The atomic weight of the specified atom or atoms.

 RESTRICTIONS:

      Only the first 92 elements are available.

 PROCEDURE:

      The mass of the proton is first calculated using quantum field
      theory, and then...actually, it's just a lookup table.

 EXAMPLE:

      Print the atomic weight of carbon:

      print,ATOMIC_WEIGHT('C')

 MODIFICATION HISTORY:

      David L Windt, Bell Labs, May 1997
      windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\atomic_weight.pro)


[20]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	ERRORF_FIT
	
 PURPOSE:
 
 	fit y=f(x) where:
 	f(x) = a0*errorf((x-a1)/a2))+a3+x*a4
 	
 CALLING SEQUENCE:
 
	YFIT = ERRORF_FIT(X,Y,A)
	
 INPUTS:
 
       X - independent variable, must be a vector.
       
       Y - dependent variable, must have the same number of points ;
           as x.
		
	A - initial values of adjustable parameters.
	
 OUTPUTS:
 
	YFIT = fitted function.
	
 MODIFICATION HISTORY:
 
	Adapted from GAUSSFIT
	
	D. L. Windt, Bell Laboratories, June 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\errorf_fit.pro)


[21]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	EXPO_FIT
	
 PURPOSE:
 
 	Fit y=f(x) where:
 	F(x) = a0*exp(-abs(x-a1)/a2)+a3
	a0 = height of exp, a1 = center of peak, a2 = 1/e width,
 	Estimate the parameters a0,a1,a2,a3 and then call curvefit.
 	
 CALLING SEQUENCE:
 
	YFIT = EXPO_FIT(X,Y,A)
	
 INPUTS:
 
	X - independent variable, must be a vector.
	
       Y - dependent variable, must have the same number of points ;
           as x.
		
 OUTPUTS:
 
	YFIT - fitted function.
	
 OPTIONAL OUTPUT PARAMETERS:
 
       A - Fit coefficients. a four element vector as described
           above.

 MODIFICATION HISTORY:
 
	Adapted from GAUSSFIT
	
	D. L. Windt, Bell Laboratories, March, 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\expo_fit.pro)


[22]

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

     FILE_DATE


 PURPOSE:

    Determine Unix file creation date.


 CALLING SEQUENCE:

   Result=FILE_DATE(FILE_NAME)

 
 INPUTS:

   FILE_NAME - A string specifying the name of the file


 OUTPUTS:

   Result - a string specifying the file creation date.

 RESTRICTIONS:

   Probably won't work the way you want.  So sue me.

 MODIFICATION HISTORY:

   David L. Windt, Bell Labs, May 1997
   windt@bell-labs.com 

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\file_date.pro)


[23]

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

           FINDEX

 PURPOSE:  Compute "floating point index" into a table using binary
           search.  The resulting output may be used with INTERPOLATE.

 USEAGE:   result = findex(u,v)

 INPUT:    
   u       a monitically increasing or decreasing 1-D grid
   v       a scalor, or array of values

 OUTPUT:
   result  Floating point index. Integer part of RESULT(i) gives
           the index into to U such that V(i) is between
           U(RESULT(i)) and U(RESULT(i)+1).  The fractional part
           is the weighting factor

                          V(i)-U(RESULT(i))
                          ---------------------
                     U(RESULT(i)+1)-U(RESULT(i))


 DISCUSSION: 
           This routine is used to expedite one dimensional
           interpolation on irregular 1-d grids.  Using this routine
           with INTERPOLATE is much faster then IDL's INTERPOL
           procedure because it uses a binary instead of linear
           search algorithm.  The speedup is even more dramatic when
           the same independent variable (V) and grid (U) are used
           for several dependent variable interpolations.

  
 EXAMPLE:  

; In this example I found the FINDEX + INTERPOLATE combination
; to be about 60 times faster then INTERPOL.

  u=randomu(iseed,200000) & u=u(sort(u))
  v=randomu(iseed,10)     & v=v(sort(v))
  y=randomu(iseed,200000) & y=y(sort(y))

  t=systime(1) & y1=interpolate(y,findex(u,v)) & print,systime(1)-t
  t=systime(1) & y2=interpol(y,u,v)            & print,systime(1)-t
  print,f='(3(a,10f7.4/))','findex:   ',y1,'interpol: ',y2,'diff:     ',y1-y2

 AUTHOR:   Paul Ricchiazzi                        21 Feb 97
           Institute for Computational Earth System Science
           University of California, Santa Barbara
           paul@icess.ucsb.edu

 REVISIONS:

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\findex.pro)


[24]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	FRACTAL_FIT
	
 PURPOSE:
 
 	Fit y=f(x) where:
 	F(x) = a0/(x^a1) [+a2]
 	Estimate the parameters a0,a1[,a2] and then call curvefit.
 	
 CALLING SEQUENCE:
 
	YFIT = FRACTAL_FIT(X,Y,A,BACKGROUND=BACKGROUND)
	
 INPUTS:
 
	X = independent variable, must be a vector and MUST BE POSITIVE!
	
	Y = dependent variable, must have the same number of points as x.
	
	BACKGROUND = set to add a background term (a2).
	
 OUTPUTS:
 
	YFIT = fitted function.
	
 OPTIONAL OUTPUT PARAMETERS:
 
	A = coefficients. a two [three] element vector as described above.
	
 RESTRICTIONS:
 
	X must be positive.
	
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, March, 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\fractal_fit.pro)


[25]

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

      FWHM
      
 PURPOSE:
 
       Interactively measure the full-width-half-max of a region of a
       curve that has been previously plotted.
	
 CALLING SEQUENCE:
 
	RESULT=FWHM(XAXIS,YAXIS)
	
 INPUTS:
 
	XAXIS - The x axis variable which has been plotted.
	
	YAXIS - The y axis variable which has been plotted.
	
 OPTIONAL INPUT PARAMETERS:
 
       RANGE - Vector of subscripts, which refers to the range of X,Y
               values over which the FWHM is to be determined.  If
               not supplied, then GET_ROI is used to interactively
               define the range.  To use FWHM with a non-interactive
               graphics device, range MUST be supplied.
	    
 KEYWORD PARAMETERS:
 
       YZERO - The zero point level. If not specified, the zero point
               level is determined from the endpoints of the region
               of interest of the curve.
		
       YHM - The value at which the full-width is computed.
             Allowable range is 0. to 1. If not specified, .5 is
             used.
		
       INVERT - Set to get width of 'absorption line' rather than
                'emission line'.
		
       NOHIGHLIGHT - Set to inhibit highlighting the region of
                     interest.
		
       H_COLOR - The color index for highlighting the region of
                 interest. Default is 7 (Yellow.)
		
       H_THICK - The thickness for highlighting the region of
                 interest.
		
	NOLABEL - Set to inhibit labelling the fwhm.
	
       L_HEADER - String specifying the label header. Default=''.
	
       L_COLOR - Color index for the label.
	
       L_FORMAT - Format string for label (eg. '(F4.2)').
	
       UNITS - String specifying units along x axis, used in label.
	
       CHARSIZE - Size of label text.
	
       PSYM - PSYM
   
 OUTPUTS:

        Result - The full-with-half-max of the region of interest 
                 of the curve, in x-axis data units.
		
 OPTIONAL OUTPUT PARAMETERS:
 
	ROI - The subscripts of the digitized region of interest.
	
       FWHM_ROI - The subscripts of the region between the fwhm
                  points and the max (min) of the function.
	    
       LINE_PTS - A 4-element array containing the coordinates of
                  the line drawn on the plot: [x0,x1,y0,y1]
	    
	LABEL - The label for the plot.
	
       L_POS - A two element array containing the x,y coordinates
               of the label, in data coords.

 SIDE EFFECTS:
 
	TEK_COLOR is used to load in the tektronix colors.  The region of
       interest of the curve is highlighted. The fwhm is labelled.
	
 RESTRICTIONS:
 
	The data must be plotted prior to calling FWHM.
	
 PROCEDURE:
 
       The user is asked to digitize the endpoints of the region of
       interest with the mouse.  The region is highlighted, and the
       fwhm is labelled.
	
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, November 1989

	March 1998 - Removed MANUAL keyword. 

	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\fwhm.pro)


[26]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	GAUSSEXPO_FIT
	
 PURPOSE:
 
 	Fit y=f(x) where:
 	
 	f(x) = a0*exp(-z^2/2)+a3*exp(-abs(x-a4)/a5)+a6 and z=(x-a1)/a2
 		
       a0 = height of gaussian, a1 = center of gaussian, a2 = 1/e
       width of ; gaussian, a3 = height of exponential, a4 = center
       of exponential, ; a5 = 1/e width of exponential,
       a6=background.
	
 	Estimate the parameters a0,a1,a2,a3,a4,a5,a6 and then call curvefit.
 	
 CALLING SEQUENCE:
 
	YFIT = GAUSSEXPO_FIT(X,Y,A)
	
 INPUTS:
 
	X = independent variable, must be a vector.
	
	Y = dependent variable, must have the same number of points as x.
		
 OUTPUTS:
 
	YFIT = fitted function.
	
 OPTIONAL OUTPUT PARAMETERS:
 
       A = Fit coefficients. A six element vector as described above.

 MODIFICATION HISTORY:
 
	Adapted from GAUSSFIT
	
	D. L. Windt, Bell Laboratories, March, 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\gaussexpo_fit.pro)


[27]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       GAUSS_FIT
	
 PURPOSE:
 
 	Fit y=f(x) where:
 	f(x) = a0*exp(-z^2/2) + a3
 		and z=(x-a1)/a2
	a0 = height of gaussian, a1 = center of gaussian, a2 = 1/e width,
	a3 = background.
 	Estimate the parameters a0,a1,a2,a3 and then call CURFIT.
 	
 CALLING SEQUENCE:
 
	YFIT = GAUSS_FIT(X,Y,A)
	
 INPUTS:
 
       X - independent variable, must be a vector.
	
       Y - dependent variable, must have the same number of points ;
           as x.
		
 OUTPUTS
 
	YFIT - fitted function.
	
 OPTIONAL OUTPUT PARAMETERS:
 
       A - Fit coefficients. a three element vector as described
           above.

 MODIFICATION HISTORY:
 
	Adapted from GAUSSFIT
	
	D. L. Windt, Bell Laboratories, March, 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\gauss_fit.pro)


[28]

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

        GET_PEAK
        
 PURPOSE:
 
        Interactively find the local maximum of a previously plotted
        curve, and indicate it on the plot.
        
 CALLING SEQUENCE:
 
        Result=GET_PEAK(XAXIS,YAXIS)
		
 INPUTS:
 
         XAXIS = the x axis variable which has been plotted.
         
         YAXIS = the y axis variable which has been plotted.
         
 KEYWORD PARAMETERS:
 
         COLOR - the color index for marking the local maximum.
         
         NOMARK - set to disable marking the location of the peak.
		    
         NOHIGHLIGHT - set to disable highlighting the region of
                       interest.
			
         H_COLOR - the color index for highlighting the region of
                   interest. Default is 7 (Yellow).
			
         H_THICK- the thickness for highlighting the region ; of
                  interest.
			
         PRINT - set to print the x,y values of the peak.
		
 OUTPUTS:

         Result = the array subscript of the local max.
         
 SIDE EFFECTS:
 
         TEK_COLOR is used to load in the tektronix colors.
         The region of interest of the curve is highlighted.
         A vertical line is drawn through the local maximum.
		
 PROCEDURE:	

        The user is asked to digitize the endpoints of the region of
        interest with the mouse using GET_ROI.
		
 MODIFICATION HISTORY:
 
        D. L. Windt, Bell Laboratories, February 1990.

        windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\get_peak.pro)


[29]

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

       GET_PT
       
 PURPOSE:
 
        Digitize a point on a previously plotted curve, and return
        the corresponding array element.

 CALLING SEQUENCE:
 
        Result = GET_PT(XAXIS,YAXIS,XPOINT,YPOINT)
        
 INPUTS:
 
        XAXIS - the x axis vector which was used to make the plot.
        
        YAXIS - the y axis vector which was used to make the plot.
		
 KEYWORD PARAMETERS:
 
        NOHIGHLIGHT - set to inhibit putting a red mark on the curve
                      at the digitized point.
			
        MESSAGE - a string to print as the message to the user.
                  Default = 'Digitize a point: '
			
        NOINIT - set to inhibit placing the cursor in the center of
                 the plot window.
		    
 OUTPUTS:
 
        Result - The array subscript of the digitized point.

 OPTIONAL OUTPUT PARAMETERS:
 
        XPOINT, YPOINT - the digitized points.

 SIDE EFFECTS:
 
        A mark is drawn on the plot at the digitized point.

 PROCEDURE:

        The user is asked to digitize a point on the curve using the
        mouse.  The VALUE_TO_INDEX function is used to find the
        closest array element.
		
 MODIFICATION HISTORY:
 
        D. L. Windt, Bell Laboratories, November 1989
        Feb. 1991, Removed call to TEK_COLOR
        Mar. 1997, replaced index search code with call to
        VALUE_TO_INDEX function.

        windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\get_pt.pro)


[2]

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

       BESELI_FRACT

 PURPOSE:

       This function returns the Modified Bessel Function of the
       First Kind of Order N, for any N, i.e., including fractional
       and negative orders.

 CALLING SEQUENCE:

	Result = BESELI_FRACT(X, N)


 INPUTS:
 
       X - The value for which the I Bessel function is required. X
           must be greater than 0. The result will have the same
           dimensions as X.
        
       N - The Bessel function order.

 PROCEDURE:

       The series expansion

       I_n(x) = SUM_(k=0->inf) [ (x/2)^(n+2k) / k! Gamma(n+k+1) ]

       is used, and is terminated when the k'th term is less than .001.

 MODIFICATION HISTORY:

       David L. Windt, Bell Laboratories, June 1993
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\beseli_fract.pro)


[2]

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

       BESELK_FRACT

 PURPOSE:

       This function returns the Modified Besel Function of the Second
       Kind of order N, for any N, i.e., including fractional and
       negative orders.

 CALLING SEQUENCE:

	Result = BESELK_FRACT(X, N)


 INPUTS:

       X - The value for which the K Bessel function is required. X
           must be greater than 0. The result will have the same
           dimensions as X.
        
       N - The Bessel function order.

 PROCEDURE:

       This function uses the BESELI_FRACT function:

       Results=(BESELI_FRACT(X,-N)-BESELI_FRACT(X,B))*!PI/2./SIN(N*!PI)

 MODIFICATION HISTORY:

       David L. Windt, Bell Laboratories, June 1993
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\beselk_fract.pro)


[30]

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

        GET_ROI
        
 PURPOSE:

       Get a region-of-interest of a previously plotted curve.
       
 CALLING SEQUENCE:
 
	Result=GET_ROI(XAXIS,YAXIS)
	
 INPUTS:
 
         XAXIS = the x axis variable which has been plotted.
         
         YAXIS = the y axis variable which has been plotted.
         
 KEYWORD PARAMETERS:

         NOHIGHLIGHT - set to disable highlighting the region of
                       interest.
			
         H_COLOR - the color index for highlighting the region of
                   interest. Default is 7 (Yellow).
			
         H_THICK - the thickness for highlighting the region ; of
                  interest.
			
         PSYM - PSYM.
         
 OUTPUTS:

         Result = the array of subscripts of the roi.
         
 SIDE EFFECTS:
 
       TEK_COLOR is used to load in the tektronix colors.
       The region of interest of the curve is highlighted.
       
 PROCEDURE:
 
       The user is asked to digitize the endpoints of the region of
       interest with the mouse using GET_PT.  The region is
       highlighted (unless nohighlight is set.)
		
 MODIFICATION HISTORY:
 
       D. L. Windt, Bell Laboratories, November 1989

       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\get_roi.pro)


[31]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       GHOSTVIEW

 PURPOSE:
 
       Use the Unix ghostview program to view an IDL postscript file

 CALLING SEQUENCE:
 
       GHOSTVIEW [,FILE=FILE]
 
 KEYWORD PARAMETERS:
 
       FILE - the name of the file to view.  Default is idl.ps

 RESTRICTIONS:

       Since the procedure spawns a "ghostview" process, 
       such an executable must exist or it ain't goin' nowhere.

 PROCEDURE:
     
       If the current device is PS, the program will issue
       a DEVICE,/CLOSE command.

       It will then SPAWN,'ghostview file_name&'

 MODIFICATION HISTORY:
 
            David L. Windt, Bell Labs, March 1997
            windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\ghostview.pro)


[32]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	GREEK

 PURPOSE:
 
       This function returns the string needed to draw the specified
       greek character using either the vector graphics font no. 4,
       or PostScript font 9.

       If (!d.name eq 'PS') and (!p.font eq 0), then the PostScript
       font will be used.  Otherwise, the vector font will be used.

 CALLING SEQUENCE:
 
	Result = GREEK(Name)

 INPUTS:
 
       Name - String specifying the greek character name. Valid
              inputs are:

              alpha, beta, gamma, delta, epsilon, zeta, eta, theta
              iota, kappa, lambda, mu, nu, xi, omicron, pi, rho,
              sigma, tau, upsilon, phi, chi, psi, omega

              Alpha, Beta, Gamma, Delta, Epsilon, Zeta, Eta, Theta
              Iota, Kappa, Lambda, Mu, Nu, Xi, Omicron, Pi, Rho,
              Sigma, Tau, Upsilon, Phi, Chi, Psi, Omega

              Although not greek, the following characters are also
              valid (but will only work with the 'default' font !3):

              angstrom, Angstrom, degrees, plus_minus

 KEYWORDS:

       FORCE_PS - Set to use PostScript font, regardless of the value
                  of !d.name and !p.font.

       PLAIN - Set to just return Name in plain text.

       APPEND_FONT - Set to append the characters specifying a
                     'default' font: !3. That is, if this keyword is
                     set, then the command

                     Result=GREEK(theta,/APPEND_FONT)

                     will return the string

                     '!9q!3' for PostScript and '!4h!3' for vector
                     fonts.
 

 OUTPUTS:
 
       Result - The string containing the specified greek character.

 EXAMPLE:

	Result=GREEK(theta)
	
       In this case, Result='!9q' if !d.name is 'PS' and !p.font is
       0; otherwise, Result='!4h'

 MODIFICATION HISTORY:
 
 	David L. Windt, Bell Labs, September 1998.
       windt@bell-labs.com
                    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\greek.pro)


[33]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	KAISER_BESSEL

 PURPOSE:
 
	Window function for Fourier Transform filtering.  

 CATEGORY:
 
	Signal, image processing.

 CALLING SEQUENCE:
 
	Result = KAISER_BESSEL(N1) (for 1D)

	Result = KAISER_BESSEL(N1,N2) (for 2D)

 INPUTS:
 
	N1 - The number of columns of the result.

	N2 - The number of rows of the result.
	
 KEYWORD PARAMETERS:
 
       ALPHA - The value of Pi*Alpha is half of the time-bandwidth
               product.  Default = 3.0

 OUTPUTS:
 
   Result(i) = BESELI(!pi*alpha*sqrt(1-( (findgen(N)-N/2) / (N/2) )^2),0) / $
	            BESELI(!pi*alpha,0)

 MODIFICATION HISTORY:
 
	David L Windt, Bell Labs, August 1996
	May, 1997 - Added 2D option.
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\kaiser_bessel.pro)


[34]

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

       LPRINT
       
 PURPOSE:

       Close an IDL graphics file and print it.
       
 CALLING SEQUENCE:
 
       LPRINT
       
 KEYWORD PARAMETERS:

       NORETURN - set this keyword to inhibit executing
                  set_plot,getenv('IDL_DEVICE') followed by
                  !p.font=-1
                          
       FILE - the name of the file to print. Default is device
              dependent: idl.ps for PS, idl.hp for HP, and idl.pcl
              for PCL devices.
		       
       PRINTER - set to the name of the printer to use. Default = lp
		
       COMMAND - set to the name of the printer command to 
                 use. Default = lpr.
		          
		          
       Note: the COMMAND, PRINTER, and FILE keywords are combined as
               follows:

       if COMMAND='lpr', then the program spawns the unix command
                        "lpr -Pprinter file"
                        
       if COMMAND='lp', then the program spawns the unix command
                        "lp dprinter file"

       if COMMAND is anything else, the program simply ignores the
                        printer and file keywords, and spawns the
                        command as is.
 
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, November 1989
	Added PRINTER keyword, June 1993.
		
       Added COMMAND keywrd, replaced RETURN with NORETURN keyword,
                     and added code to execute !p.font=-1 unless
                     NORETURN keyword is set. March, 1997.
		      
      windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\lprint.pro)


[35]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	LS
	
 CATEGORY:
 
       Stupid little convenience routines.
   
 PURPOSE:
 
	List the contents of the current directory, like the Unix 'ls'
       command.
	
 CALLING SEQUENCE:
 
       LS[,NAME]

       NAME - An optional string specifying the names of the files to
              be listed.  Wild cards are allowed. For example,
              ls,'*.pro' will list all files ending in .pro.

 MODIFICATION HISTORY:

       David L. Windt, Bell Labs, November 1989
       windt@bell-labs.com

       February, 1998 - Now works under Windows and MacOS, making use
                        of FINDFILE.  But the old DIR keyword is gone.
       

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\ls.pro)


[36]

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

      MAKE_LATEX_TBL

 PURPOSE:
 
	Create a LaTeX format table.
	
 CALLING SEQUENCE:
 
	MAKE_LATEX_TBL,ARRAY,TFILE
	
 INPUTS:
 
	ARRAY - (n,m) array of data.
	
	TFILE - string specifying the name of the '.tex' file to create.
	
 KEYWORD PARAMETERS:
 
	COLUMNS - An n-element string specifying the LaTeX column
                 format. For example, if array = (3,m), then an
                 acceptable value for columns would be
                 ['|l|','|c|','|c|'], which would left-justify the
                 first column of data, and center the remaining two.
	    
       FORMAT - an n-element string specifying the FORMAT used to
                PRINTF the data.  This must conform to IDL FORMAT
                standards.  If not set, the default the data are
                printed using the IDL free format.
	    
	TITLE - a string specifying the title of the table.
	
       HEADINGS - an n-element string array containing the table
                  headings.
	    
	NOHLINES - set to inhibit printing \hline between rows of data.
	
 SIDE EFFECTS:
 
		The '.tex' file is created.
		
 RESTRICTIONS:
 
	The TITLE is printed with vertical lines on either ; side,
       regardless of how the COLUMNS parameter may be ; set.  It is
       thus necessary to edit the file to remove the vertical line
       commands if desired.
	
 PROCEDURE:
 
	The data contained in ARRAY are printed to a file ; with the
       appropriate '&' and '\\' symbols necessary ; for use as in the
       LaTeX tabular environment.  If ; COLUMNS is not set, the
       default is '|c|' which centers the data in columns, with
       vertical line separators.
	
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Laboratories, December 1989.
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\make_latex_tbl.pro)


[37]

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

      MORE
      
 PURPOSE:

       Print one or more variables on the screen or to a file, using
       the MORE keyword to printf.

 CALLING SEQUENCE:

       MORE,v0[,v1,v2,...v19]

 INPUTS:

       V0,V1,...V19 - Any type of array variables; they must all be
                      the same length.

 KEYWORD PARAMETERS:

   FILE - string specifying the name of an output file.

   INDEX - set this to one to print the array indices in the first
           column.

   TITLE - string array of variable names.

   COMMENT - string array of comments

   TAB - set this keyword to create tab-separated data; this is
         useful when writing to a file if any of the variables are
         strings, in which case the data can be read using EROM,/TAB

 MODIFICATION HISTORY:
 
	David L. Windt, Bell Labs, March 1990

	Added comment keyword, August 1992
	
       March 1997 - Title and comment lines are now written with
                    preceding semicolons.  Fixed bug to correctly
                    deal with string arrays.  Added TAB keyword.
                    Removed NOINDEX keyword.  Added INDEX keyword.

       November 1997 - Removed Unix-specific stuff, so that it now
                       works (somewhat) under Windows and MacOS.
                    
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\more.pro)


[38]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       OEPLOT
		
 PURPOSE:

       Overplot x vs y, with vertical error bars on y.

 CALLING SEQUENCE:

       OEPLOT,Y,SIGY
       OEPLOT,X,Y,SIGY
       OEPLOT,Y,SIGY_UP,SIGY_DOWN
       OEPLOT,X,Y,SIGY_UP,SIGY_DOWN

 INPUTS:

       X, Y -  1-D arrays

       SIGY - Uncertainty in y, i.e. Y+/-SIGY

       SIGY_UP, SIGY_DOWN - +/- uncertainties in Y,
                                i.e., Y +SIGY_UP -SIGY_DOWN

 KEYWORD PARAMETERS:

       BARLINESTYLE = Linestyle for error bars.
 
               plus the IDL keywords color, linestyle,thick, psym,
               symsize, noclip, and t3d.

 MODIFICATION HISTORY:

       D. L. Windt, Bell Laboratories, November 1989
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\oeplot.pro)


[39]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	PLOT_MOVIE

 PURPOSE:

	Display an animated sequence of X-Y plots in a window.

 CALLING SEQUENCE:

	PLOT_MOVIE,X,Y[,Y1,Y2,Y3,Y4]
 
 INPUT PARAMETERS:
 
	X = N_x-element array, common to all Y vectors
	
	Y = 2D array, N_x x N_plots
 
 OPTIONAL INPUT PARAMETERS:

       Y1, Y2, Y3, Y4 - additional Y arrays to be overplotted; these
                        must all have the same dimensions as Y.

 KEYWORD PARAMETERS:

       XRANGE- A two-element vector specifying the xrange of the
               plot.  Default = [0, max(x)]

       YRANGE- A two-element vector specifying the yrange of the
               plot. Default = [0 < min(y)*1.05,max(y)*1.05]

       COLOR- array of colors for each Y plot

       LINESTYLE - array of linestyles for each Y plot

       THICK - array of thicknesses for each Y plot

       _EXTRA - This keyword is use to pass additional parameters to
                the plot command.

 EXAMPLE:

      Make a movie of two 'travelling' sin waves:

      X=VECTOR(0.,100.,100)
      Y=FLTARR(100,30)
      for i=0,29 do Y(*,i)=sin((x+i*!pi)/!pi)
      Y1=-Y
      PLOT_MOVIE,X,Y,Y1

 MODIFICATION HISTORY:

 	Written by:	David L. Windt, Bell Labs, April 1994

 	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\plot_movie.pro)


[3]

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

      CHEM2LBL

 PURPOSE:

      Convert a 'chemical name', i.e. a string containing characters
      and numbers - H2O, for example - into a string containing
      formatting commands so that the numbers become subscripts when
      using the result in IDL graphics.

      For example: "H2O" would come back as "H!d2!nO".

 CALLING SEQUENCE:

      Result = CHEM2LBL(CHEMICAL)
 
 INPUTS:

     CHEMICAL - a string specifying the chemical name

 KEYWORD PARAMETERS:
 
     NOREFERENCE - if this keyword is set, text following an
                   underscore character in CHEMICAL will be
                   ignored.  The default behavior is that
                   any text following an underscore character
                   will be surrounded by brackets (i.e. < >)
                   and subscripted.  For example, "SiO2_tetragonal"
                   will be returned as "!nSiO!d2 !n"

 MODIFICATION HISTORY:

     David L. Windt, March 1997
     windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\chem2lbl.pro)


[40]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
        PLOT_TEXT

 PURPOSE:
 
        Add text in a box to a plot.  The text is located in one
        of 12 possible positions (i.e., upper left corner, lower
        right corner, etc.)

 CALLING SEQUENCE:
 
       PLOT_TEXT,TEXT_ARRAY[,POSITION=POSITION]
 
 INPUTS:
 
       TEXT_ARRAY - a string array of text

 KEYWORD PARAMETERS:

       POSITION - an integer, specifying the location of the text box:
 
                  0: no text is drawn
                  1: below plot, left
                  2: below plot, center
                  3: below plot, right
                  4: lower left
                  5: lower center
                  6: lower right
                  7: middle left
                  8: middle center
                  9: middle right
                  10: upper left
                  11: upper center
                  12: upper right
         
                  if not specified, default position=10

        CHARSIZE - the charsize value for the text

        COLOR - an array of colors to be used for each line of text

        NOBOX - set to inhibit drawing a box around the text

        BOXPADX - padding in character units, between text and box,
                  in x. default=2.0

        BOXPADY - padding in character units, between text and box,
                  in y. default=0.5

        FONT - Set to an integer from 3 to 20, corresponding to the
               Hershey vector font sets, referring to the font used
               to display the text.  If a font other than !3 is used
               in the text string, then FONT should be set
               accordingly. (Any font commands embedded in the text
               string are ignored.)

        BOXFUDGEX - A scaling factor, used to fudge the width of the
                    box surrounding the text.  Default=1.0.

        Plus all valid graphics keywords for xyouts and plots
       
 RESTRICTIONS:
 
       When specifying a position of 1,2 or 3, you'll need to (a) use
       the same charsize value for the plot and for the plot_text,
       and (b) draw the plot with an extra ymargin(0).  i.e., set
       ymargin(0)=7+n_elements(text_array)


 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       October, 1997, dlw:

       Now using the TEXT_WIDTH function, in order to do a somewhat
       better job of drawing the box around the text.

       NONPRINTER_SCALE keyword parameter is now obsolete.

       BOXFUDGEX keyword parameter added.

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\plot_text.pro)


[41]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	PROFILE_NI

 PURPOSE:

	Extract a profile from an image noninteractively.
	
 CALLING SEQUENCE:
 
	Result = PROFILE_NI(IMAGE,COORDS)
	
 INPUTS:
 
	IMAGE - data array.  May be any type except complex.
		
	COORDS - 2 x 2 array of x and y coordinate of profile endpoints,
                [[X0,Y0],[X1,Y1]]
	
 KEYWORD PARAMETERS:
 
       XSTART, YSTART - starting (x,y) location of lower left corner
                        of image.
	
 OUTPUTS:
 
	Result = 1-D array of image values along the line from

 MODIFICATION HISTORY:
 
	Adapted from PROFILE
	
	D. L. Windt, Bell Laboratories, November 1991.
	windt@bell-labs.com
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\profile_ni.pro)


[42]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	PWD
	
 CATEGORY:
 
       Stupid little convenience routines.
   
 PURPOSE:
 
       Print the current directory, like the Unix 'pwd' command.
	
 CALLING SEQUENCE:
 
       PWD
 MODIFICATION HISTORY:

       David L. Windt, Bell Labs, February 1998
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\pwd.pro)


[43]

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

        RECROI
        
 PURPOSE:

        Define a rectangular region of interest of an image using the
        image display system and the cursor/mouse.
		
 CATEGORY:

        Image processing.
        
 CALLING SEQUENCE:
 
	Result=RECROI(SX,SY[,XVERTS,YVERTS])
	
 INPUTS:
 
	SX, SY = size of image, in pixels.
	
 KEYWORD PARAMETERS:
 
       X0, Y0 - coordinate of lower left corner of image on display.
                if omitted, (0,0) is assumed.  Screen device
                coordinates.
	    
       ZOOM - zoom factor, if omitted, 1 is assumed.
	
       XAXIS, YAXIS - optional 1-d arrays corresponding to the x and
                      y scales of image. Needed only if XROI and/or
                      YROI are specified.
	    
       XROI, YROI - optional output vectors associated with the
                    digitized rectangular region of interest.  XAXIS
                    and YAXIS keyword parameters must be supplied.
	    
 OUTPUTS:
 
	Result = vector of subscripts of pixels inside the region.
	
 OPTIONAL OUTPUTS:
 
       XVERTS, YVERTS - optional output parameters which will contain
                        the vertices enclosing the region.  Setting
                        NOREGION inhibits the return of the pixel
                        subscripts.
	    
 COMMON BLOCKS:
 
	Colors is used to obtain the current color table which is modified
       and then restored.
	
 SIDE EFFECTS:
 
	For this implementation, bit 0 of each pixel is used to draw ; the
       outline of the region.  You WILL have to change this to fit
       the capabilities and procedures of your display.  ; The lowest
       bit in which the write mask is enabled is changed.
	 
 PROCEDURE:
 
	The write mask for the display is set so that only bit 0 may be
       written.  Bit 0 is erased for all pixels.  The color tables
       are loaded with odd values complemented, even values
       unchanged.  A message is printed, assuming a mouse, indicating
       the effect of the three buttons.  The operator marks opposite
       corners of the rectangle.
	
 MODIFICATION HISTORY:
 
	Adapted from DEFROI
	
	D. L. Windt, Bell Laboratories, November 1989
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\recroi.pro)


[44]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       RECTANGLE
		
 PURPOSE:
 
	Draw a rectangle on a plot.
		
 CALLING SEQUENCE:
 
	RECTANGLE,X0,Y0,XLENGTH,YLENGTH
		
 INPUTS:

       X0, Y0 - Points specifying a corner of the rectangle.

       XLENGTH, YLENGTH - the lengths of the sides of the rectangle,
                          in data coords.
       
 KEYWORD PARAMETERS:
 
       FILL = set to fill rectangle.
		
       FCOLOR = fill color.
		
       Graphics keywords: CHARSIZE,COLOR,LINESTYLE,NOCLIP,
       T3D,THICK,Z,LINE_FILL,ORIENTATION,DEVICE
		
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, September 1990.
	
       Added device keyword, January 1992.

       windt@bell-labs.com
		

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\rectangle.pro)


[45]

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

       REC_IMAGE
       
 PURPOSE:
 
       Extract a rectangular portion of a previously displayed image.
       
 CALLING SEQUENCE:
 
	SMALL_IMAGE=REC_IMAGE(BIG_IMAGE)
	
 INPUTS:
 
       BIG_IMAGE = array containing original image
		
 OUTPUTS:
 
	SMALL_IMAGE = portion of big_image
		
 PROCEDURE:
 
	RECROI is used to digitize a portion of the image.
		
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Labs, Feb. 1992.
	windt@bell-labs.com
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\rec_image.pro)


[46]

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

      ROI_WIDTH
      
 PURPOSE:
 
	Measure the width of a region of curve that has been previously
       plotted. The region is defined to be within ymin and ymax of a
       digitized region of the curve.
	
 CALLING SEQUENCE:
 
	Result=ROI_WIDTH(XAXIS,YAXIS)
	
 INPUTS:
 
       XAXIS - the x axis variable which has been plotted.
	
       YAXIS - the y axis variable which has been plotted.
	
 KEYWORD PARAMETERS:
 
       YMIN - minimum value of digitized region of interest.
	
       YMAX - maximum value of digitized region of interest.
	
       NOHIGHLIGHT - set to inhibit highlighting the region of 
                     interest.
		
       H_COLOR - the color index for highlighting the region of 
                 interest. Default is 7 (Yellow).
		
       H_THICK - the thickness for highlighting the region of
                 interest.
		
       NOLABEL - set to inhibit labelling fwhm.
	
       MANUAL - set to disable automatic location selection for
                labels.
	    
       L_HEADER - string specifying the label header. Default-''.
	
       L_COLOR - color index for the label.
	
       L_FORMAT - format string for label (eg. '(f4.2)').
	
       UNITS - string specifying units along x axis.
	
       CHARSIZE - size of label text.
	
       PSYM - psym
   
 OUTPUTS:

       Result - the full-with-half-max of the region of interest of
                the curve, in x-axis data units.
		
 OPTIONAL OUTPUT PARAMETERS:
 
       ROI - the subscripts of the digitized region of interest.
	
       WIDTH_ROI - the subscripts of the region between the ymin and
                   ymax points.
	    
       LINE_PTS - a 4-element array containing the coordinates of the
                  line drawn on the plot: [x0,x1,y0,y1]
	    
       LABEL - the label for the plot.
	
       L_POS - a two element array containing the x,y coordinates of
               the label, in data coords.
	    
		
 SIDE EFFECTS:
 
       TEK_COLOR is used to load in the tektronix colors.
       The region of interest of the curve is highlighted.
       The width is labelled.
	
 RESTRICTIONS:
 
	The data must be plotted prior to calling ROI_WIDTH
	
 PROCEDURE:
 
	The user is asked to digitize the endpoints of the
	region of interest with the mouse.  The region is
	highlighted, and the width is labelled.
	
 MODIFICATION HISTORY:
 
	D. L. Windt, Bell Laboratories, October 1990.
	windt@bell-labs.com
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\roi_width.pro)


[47]

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

           ROTATION
 
 PURPOSE:
 
	    Rotate two vectors by a specified amount.
	    
 CALLING SEQUENCE:
 
	    ROTATION,X,Y,DEG,NX,NY
	    
 INPUTS:

           X,Y   :orignal data point pairs
           
	    DEG   :degrees to rotate.
	    
 OUTPUTS:
 
	    Nx, Ny = rotated point pairs.
	    
 MODIFICATION HISTORY:
 
	    Jeff Bennett, U of Colorado

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\rotation.pro)


[48]

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

       SHIFT_PLOT
       
 PURPOSE:
 
       Interactively slide a previously plotted array using the mouse.
   
 CALLING SEQUENCE:
 
       SHIFT_PLOT,X[,Y,SHIFT=SHIFT]
   
 INPUTS:
 
        X,Y - array variables
   
 KEYWORD PARAMETERS:
 
        Same as for oplot
   
 OPTIONAL OUTPUT PARAMETERS:
 
        SHIFT - the shift along the x-axis
   
 PROCEDURE:
 
   MENUS is used to get input. The previously plotted array is first
   erased, then oplot'ed, with the incremental shift.
   
 MODIFICATION HISTORY:
 
   David L. Windt, Bell Labs, February, 1990
   windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\shift_plot.pro)


[49]

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

       SHOW_CT
       
 PURPOSE:

       Make a window and show the first 32 colors in the current
       color table.
	    
 CALLING SEQUENCE:
 
	SHOW_CT
	
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Labs, November 1989
	windt@bell-labs.com

	DLW, November, 1997 - Removed default window position values, so
                             that the window is now visible on any
                             size display.
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\show_ct.pro)


[4]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	CLEAR
	
 CATEGORY:
 
       Stupid little convenience routines.
   
 PURPOSE:
 
	Clear the screen, just like the Unix command.
	
 CALLING SEQUENCE:
 
       CLEAR

 RESTRICTIONS:

       Only works on Unix platforms.
	
 MODIFICATION HISTORY:

       David L. Windt, Bell Labs, November 1989
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\clear.pro)


[50]

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

         SINC

 PURPOSE:

         Function to return the value of the SINC function,
         i.e., sin(x)/x.

 CALLING SEQUENCE:

         Result = SINC(X)
 
 INPUTS:

         X - Input value.  Scalar or array.

 OUTPUTS:

         Result - Value of SIN(X)/X. 

 PROCEDURE:

         Straightforward; except Result is explicitly set to
         one when X=0.

 MODIFICATION HISTORY:

         David L. Windt, Bell Laboratories, May 1997

         March 1999:
         
         Returned X values are no longer changed when X=1.

         DLW (thanks to Paul Woodford.)
         
         windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\sinc.pro)


[51]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	SINCSQUARE_FIT
	
 PURPOSE:
 
 	Fit y=f(x) where:
 	F(x) = a0*( sin(a1*(x-a2))/(a1*(x-a2)) )^2 + a3
 	Estimate the parameters a0,a1,a2,a3 and then call curvefit.
 	
 CALLING SEQUENCE:
 
	YFIT = SINC_FIT(X,Y,A)
	
 INPUTS:
 
	X - independent variable, must be a vector.
	
       Y - dependent variable, must have the same number of points as
           x.
		
 OUTPUTS:
 
	YFIT = fitted function.
	
 OPTIONAL OUTPUT PARAMETERS:
 
	A = Fit coefficients. A four element vector as described above.

 MODIFICATION HISTORY:
 
	Adapted from GAUSSFIT
	
	D. L. Windt, Bell Laboratories, March, 1990
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\sincsquare_fit.pro)


[52]

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

       SMALL_WINDOW
       
 PURPOSE:

       Make a 500x400 graphics window.
       
 CATEGORY:
 
       Stupid little convenience routines.
       
 CALLING SEQUENCE:
 
	SMALL_WINDOW [,WINDOW_NUM]
	
 OPTIONAL INPUT PARAMETERS:
 
	WINDOW_NUM - the window number.
	
 KEYWORD PARAMETERS:
 
       LAPTOP - set this to make a nice window (400x300) for a
                small-screened laptop
	
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Laboratories, March 1990.
	windt@bell-labs.com
	
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\small_window.pro)


[53]

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

       SP

 PURPOSE:  

       Execute SET_PLOT, and optionally some handy settings.

 CALLING SEQUENCE:

       SP[,DEVICE,N_PLOTS]

 OPTIONAL INPUTS:
 
	    DEVICE = 0 for set_plot,'PS' 
                    1 for set_plot,'HP'
                    2 for set_plot,'PCL'
                    3 for set_plot,'X'
                    4 for set_plot,'MAC'
                    5 for set_plot,'WIN'
                    6 for set_plot,'SUN'
                    7 for set_plot,'TEK'
                    8 for set_plot,'CGM'
 
           if DEVICE is not set, the graphics device will be set
           to the platform-dependent default.

           N_PLOTS = 1 for !p.multi=0
                     2 for !p.multi=[0,1,2]
                     3 for !p.multi=[0,1,3]
                     4 for !p.multi=[0,2,2]
                     
 KEYWORD PARAMETERS:
 
           SMALL - Set to make a small plot.
           
           LANDSCAPE - Set for landscape mode when device=0,1, or 2.
           
           FULL_PAGE - Set for full page plotting when device=0, 1,
                       or 2. Only has an effect when in portrait mode
                       (landscape=0) for PS and PCL devices.
                       FULL_PAGE is set automatically if N_PLOTS is
                       greater than 1.
                       
           HARDWARE - Set for hardware fonts.
           
           FILE - Name of output file.
           
           ISOTROPIC - Set for isotropic (equal x and y) scaling.
           
           COLOR - Set to enable color for PS and PCL devices.

           PLOTSIZE - A four-element array specifying the
                      [XSIZE,YSIZE,XOFFSET,YOFFSET] keywords (in
                      INCHES) to the DEVICE procedure.  If PLOTSIZE
                      is set, then the SMALL and FULL_PAGE keywords
                      are ignored.  If PLOTSIZE is not set, then
                      default values are used for these parameters
                      that make decent-looking plots on 8-1/2 x 11"
                      paper.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs November 1989
       Added DEVICE=4, November 1990.
       Added ISOTROPIC keyword, August 1991.
       Added COLOR keyword, Sept 1991.
       Added pcl support, completely changed device<->number mapping,
             and changed functionality of small/full_page/landscape/size
             keywords, May 1997.

       DLW, September 1997: On Unix platforms, if DEVICE is not
       set, the graphics device is set to 'X' if the IDL_DEVICE
       environment variable is not defined.

       DLW, January 1998: Added support for CGM graphics; this
       routine will do nothing more than issue the SET_PLOT,'CGM'
       command, but is included for compatability with the PLOT_PRINT
       routine.  When using the CGM device, you will likely want to
       set the color table entry for !p.color to black; otherwise
       you'll get a white plot on a white background.

       Also, fixed bug that caused graphics output to anything but PS
       to fail!  (Doh!)

       windt@bell-labs.com
       

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\sp.pro)


[54]

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

      SQUARE_PLOT
      
 PURPOSE:
 
       Define !p.region so plots come out with aspect ratio of 1.
	
 CALLING SEQUENCE:
 
       SQUARE_PLOT
		
 KEYWORD PARAMETERS:
 
       CENTER - set to center plot in window.
		
 MODIFICATION HISTORY:
 
	David L. Windt, Bell Laboratories, December 1991.
	windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\square_plot.pro)


[55]

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

         SYMBOLS
         
 PURPOSE:

         Create custom plotting symbols
         
 CALLING SEQUENCE:
 
	  SYMBOLS,SYMBOL_NUMBER,SCALE
	    
 INPUTS:
	 SYMBOL_NUMBER:
	 
                1 = open circle
                2 = filled circle
                3 = arrow pointing right
                4 = arrow pointing left
                5 = arrow pointing up
                6 = arrow pointing down
                7 = arrow pointing up and left (45 degrees)
		 8 = arrow pointing down and left
		 9 = arrow pointing down and right.
		 10 = arrow pointing up and right.
		 11 through 18 are bold versions of 3 through 10
		 19 = horizontal line
		 20 = box
		 21 = diamond
		 22 = triangle
		 30 = filled box
		 31 = filled diamond
		 32 = filled triangle
		 
	 SCALE - size of symbols.
	 
 KEYWORD PARAMETERS:
 
		COLOR - color of symbols
		
 SIDE EFFECTS:
 
           The desired symbol is stored in the user buffer and 
	    will be plotted if !P.PSYM = 8.

 MODIFICATION HISTORY:
 
		Jeff Bennett, U of Colorado, 198?

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\symbols.pro)


[56]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
        TEXT_WIDTH

 PURPOSE:
 
        Function to determine the actual displayed width
        (approximately!) of a string of text, in normalized character
        units, accounting for the fact that non-equal spacing is used
        when such a string is displayed on a plot using XYOUTS.

        This function is used, for example, by the PLOT_TEXT and
        LEGEND procedures to ~correctly draw a box around displayed
        text.

 CALLING SEQUENCE:
 
       Result=TEXT_WIDTH(TEXT_STRING)
 
 INPUTS:
 
       TEXT_STRING - a string of text

 KEYWORD PARAMETERS:

       FONT - Set to an integer from 3 to 20 (corresponding to the
              Hershey vector font sets,) referring to the font that
              will be used to display the text. (Any font commands
              embedded in the text string are ignored.)

 RESTRICTIONS:

       This function hardly works perfectly, especially when the text
       string contains a mix of fonts; superscripts and subscripts
       will really mess things up as well.  But it comes close in
       many instances.

 PROCEDURE:

       A table of normalized character widths (determined using the
       !3 font) is used to determine the width of the text string.
       In order to account for the use of IDL font manipulation
       commands, the '!' symbol and the character immediately
       following it are not counted, except for the case of two
       consecutive '!' symbols.

 EXAMPLE:

       Determine the width of a text string:

       width=TEXT_WIDTH('!3This is some displayed text',font=3)

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, October 1997
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\text_width.pro)


[57]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       TRACK_PLOT
		
 PURPOSE:

       A procedure to plot X vs Y in a widget, track the cursor
       position, and interactively display the Y(X) value.

 CALLING SEQUENCE:

       TRACK_PLOT,X,Y

 INPUTS:

       X, Y -  1-D arrays

 KEYWORD PARAMETERS:

       WXSIZE - Draw widget X size, in pixels. (Default=640)

       WYSIZE - Draw widget Y size, in pixels. (Default=480)

       CROSSHAIR - Set this to display a crosshair at the current
       Y(X) value.

       plus all valid IDL PLOT keywords.  

 RESTRICTIONS:
 
       Requires widgets.  Requires use of the VALUE_TO_INDEX function
       in the windt library.

 EXAMPLE:

      Create some X,Y data and plot it using TRACK_PLOT:
 
      X=VECTOR(0.,100.,256)
      Y=SIN(X/5.)*EXP(-X/20.)
      TRACK_PLOT,X,Y

 MODIFICATION HISTORY:

      D. L. Windt, Bell Laboratories, August 1997
      windt@bell-labs.com

      March, 1998 - Added crosshair display option and CROSSHAIR
                    keyword.
      

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\track_plot.pro)


[58]

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

    VALUE_TO_INDEX

 PURPOSE:

    Given a (1D) ARRAY and a scalar VALUE, determine the array INDEX
    corresponding to the element of the array that is closest in
    magnitude to the specified value.

 CALLING SEQUENCE:

   Index=VALUE_TO_INDEX(ARRAY, VALUE)
 
 INPUTS:

   ARRAY = 1D array of values
   
   VALUE = scalar value

 EXAMPLE:

  ARRAY=findgen(100)/99.*5          ; create an array of 100 pts from 0 to 5.

  Index=VALUE_TO_INDEX(ARRAY,3.125) ; find the element of ARRAY whose value
                                    ; is closest to 3.125.
                                   
  In this case, Index=62 (i.e., ARRAY(62)=3.13131)
 
 MODIFICATION HISTORY:

   David L. Windt, Bell Labs, March 1997.

   May 1998 - Realized that this function is hardly necessary, as one
              can just make wise use of the min function and
              the !c system variable.  Duh!
   
   windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\value_to_index.pro)


[59]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	VECTOR

 PURPOSE:
 
       Make a vector of PTS points, with values ranging from MIN to
       MAX.

 CALLING SEQUENCE:
 
	Result = VECTOR(MIN,MAX,PTS)

 INPUTS:
 
       MIN - Starting value for vector.
	
       MAX - Ending value for vector.
	
       PTS - Number of points.

 KEYWORDS:
 
       LOGARITHMIC - set for logarithmic spacing between points.
                     [MIN and MAX must be positive, i.e., gt 0]

 OUTPUTS:
 
       This function returns a vector of PTS points, ranging from MIN
       to MAX.  The returned vector is of the same type as MIN/MAX.

 EXAMPLE:

	X=VECTOR(5.,100.,1000)
	
	This example returns a 1-D Floating point array X, made up of 
	1000 points, ranging from 5. to 100.

	X=VECTOR(5.d,100.d,1000)
	
	This example returns a 1-D Double point array X, made up of 
	1000 points, ranging from 5. to 100.

 MODIFICATION HISTORY:
 
 	David L. Windt, Bell Labs, June 1993.
 	
       March, 1997- modified code so returned vector is same type as
                    MAX.  added LOGARITHMIC keyword.

       May, 1998 - corrected a bug which occurred when LOGARITHMIC
                   was set and PTS=1.

       October, 1998 - corrected a bug which, when LOGARITHMIC was
                       set, had caused the log of MIN and MAX to be
                       returned if these parameters are passed as
                       named variables (rather than constants.)
                    
       windt@bell-labs.com
                    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\vector.pro)


[5]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CONT_IMAGE
	
 PURPOSE:
 
       Overlay an image and a contour plot.
	
 CALLING SEQUENCE:
 
	CONT_IMAGE, IMAGE[,X,Y]
	
 INPUTS:
 
       IMAGE - 2 dimensional array to display.
	
 OPTIONAL INPUTS:
 
	X - 1 dimensional array of x-axis values.
	
	Y - 1 dimensional array of y-axis values.
	
 KEYWORD PARAMETERS:
 
       WINDOW_SCALE - Set to scale the window size to the image size,
                      otherwise the image size is scaled to the
                      window size.  Ignored when outputting to
                      devices with scalable pixels.
		
       ASPECT - Set to retain image's aspect ratio.  Assumes square
                pixels.  If ASPECT is set, the aspect ratio is
                retained.
		
       INTERP - Set to bi-linear interpolate if image is resampled.
	
       NOCONTOUR - Set to just display the image with plot axes.
	
       INVERT - Set to invert the image scale, ie image=255-image

       TOP - The maximum value of the scaled image. If not set, then
             it's set to (!d.n_colors < 255)-1.

       MIN_VALUE - The minimum value of IMAGE to be displayed.

       MAX_VALUE - The maximum value of IMAGE to be displayed.

       COLORBAR - Set to display a color bar alongside the image.

       BAR_TITLE - A text string to be used as the colorbar title if
                   COLORBAR is set.

       BAR_WIDTH - Width of the colorbar, in pixels. Default is 10
                   pixels for non-scalable pixel devices, or 2% of
                   the plot width for scalable pixel devices.
 
       BAR_OFFSET - Offset spacing between plot and colorbar. Default
                    is 10.
 
	
 MODIFICATION HISTORY:
 
       Adapted (i.e. stolen) from IMAGE_CONT.
	
       D. L. Windt, Bell Laboratories, Nov 1989.
	
       April 1994:
       Changed image scaling to go from 32 to !d.n_colors, so that
       TEK_COLOR can be called to use first 32 colors for other plotting.
	
       Added _EXTRA keyword.

       March 1998 - Added TOP, MIN_VALUE, MAX_VALUE, COLORBAR, and
                    BAR_TITLE keywords.  Also fixed quite a few bugs.
                    Note that setting the XSTYLE, XTYPE, YSTYLE, and
                    YTYPE keywords has no effect: these parameters
                    are always set to 0,1,0, and 1, respectively.

       August 1998 - Plots are now drawn properly when !p.multi is
                     different from 0. Added BAR_OFFSET keyword.

	windt@bell-labs.com
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cont_image.pro)


[60]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	XWD2GIF

 PURPOSE:
 
       Convert an XWD image file to a GIF image file.

 CALLING SEQUENCE:
 
	XWD2GIF[,FILE=FILE]

 KEYWORDS:
 
       FILE - The name of the XWD file.  If the XWD file is called
              file.xwd, then the newly created gif file will be called
              file.gif.  

 PROCEDURE:

       The procedure is just a simple interface to the READ_XWD and
       WRITE_GIF routines.

 MODIFICATION HISTORY:
 
 	David L. Windt, Bell Labs, May 1998.
 	
       windt@bell-labs.com
                    

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\xwd2gif.pro)


[6]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
	CONT_IMAGE2
	
 PURPOSE:
 
	Display an image and overlayer the contours from a second image.
	
 CALLING SEQUENCE:
 
	CONT_IMAGE2, IMAGE1, IMAGE2, X, Y
	
 INPUTS:
 
	IMAGE1 = Image to display.
	
	IMAGE2 = Image from which contours are drawn.
	
 KEYWORD PARAMETERS:
 
	WINDOW_SCALE = set to scale the window size to the image size,
		otherwise the image size is scaled to the window size.
		Ignored when outputting to devices with scalable pixels.
		
	ASPECT = set to retain image's aspect ratio.  Assumes square
		pixels.  If /WINDOW_SCALE is set, the aspect ratio is
		retained.
		
	INTERP = set to bi-linear interpolate if image is resampled.
	
	Plus IDL graphics keywords: XTITLE, YTITLE, SUBTITLE, TITLE
	
 PROCEDURE:
 
	If the device has scalable pixels then the image is written over the
       plot window.
	
 MODIFICATION HISTORY:
 
	Adapted (i.e. stolen) from IMAGE_CONT
	
	D. L. Windt, Bell Laboratories, June 1991.
	
	April 1994:
	Changed image scaling to go from 32 to !d.n_colors, so that
	TEK_COLOR can be called to use first 32 colors for other plotting.
	Added _EXTRA keyword.

	windt@bell-labs.com
	

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cont_image2.pro)


[7]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CW_PLOTAXIS

 PURPOSE:
 
       A compound widget used to change the type, range and style
       (bit 0 only) values of plot axis structure variable.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTAXIS(PARENT,LABEL)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

       LABEL - a label to be drawn to the left of the widget.

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.
 
       FRAME - set to draw a frame around the widget.

       VALUE - a 4-element array of the form [type,min,max,style].
               type and min,max correspond to the !axis.type and
               !axis.range variables, and style is bit 0 of
               !axis.style.

       FONT - font keyword for labels etc.
       
       ROW - set to orient the subwidgets in a row (default.)

       COLUMN - set to orient the subwidgets in a column.

       NO_RETURN - The default behavior is that the user must press
                    after entering new values.  Set this
                   keyword so that new values are accepted even if
                   the user just changes a value and then moves the
                   cursor outside of the text entry area.

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

       The idea is that one or more instances of this cw would be
       used in a widget intended to allow the user to interactively
       adjust the settings for a plot.  For instance, you might have
       a menu item such as Plot Options->Scaling, which would create
       a popup widget containing CW_PLOTAXIS subwidgets for the X and
       Y plot variables.  When the user makes changes to the Type,
       Range, and Style values, the popup widget event handler would
       re-draw the plot accordingly.

       The widget returns events when any of it's children generate
       events.  The returned event has the form
       {CW_PLOTAXIS_EVENT,ID:id,TOP:top,HANDLER:handler,TAG:tag}
       where TAG indicates which child widget generated the event:
       possible values for EVENT.TAG are TYPE, MIN, MAX, and STYLE.

       NOTE: you probably really want to use the CW_PLOTAXES (plural)
       widget, not this one.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

       DLW, June 1997, Added NO_RETURN keyword.

       DLW, November 1997, Text fields for Range values are now
       updated when the user makes a change; the specified values are
       converted to floating point.
       

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plotaxis.pro)


[8]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 
       CW_PLOTLABEL

 PURPOSE:

       A compound widget used to select the position for a plot label
       or legend.  This widget is intended to be used in conjunction
       with the PLOT_TEXT or LEGEND procedures in this directory, in
       that this widget lets the user select one of 13 pre-defined
       positions corresponding to the POSITION keyword in PLOT_TEXT
       and LEGEND.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTLABEL(PARENT)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

 KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.

       VALUE - initial value for the widget: an integer between 0 and
               12, corresponding to the POSITION keyword in plot_text
               or legend.
 
       TITLE - a title for the widget. 

       FRAME - set to draw a frame around the widget; ignored if
               PARENT is present.

       FONT - fonts to use for labels and buttons.

       DONE - set this to add a Done button, in addition to the standard
              Apply button.
 
       NO_BELOW - set this to inhibit drawing the three buttons that
                  correspond to label positions below the plot, i.e.,
                  position values of 1, 2 and 3.

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

         A widget is created in which the user can select one of 13
         position values.  By pressing the "Apply" button, an event
         is returned, allowing the calling procedure to redraw the
         plot label or legend if desired.

         This widget generates an event when the user presses the
         Apply button or the Done button, if present. The EVENT.TAG
         keyword will return either "APPLY" or "DONE" accordingly.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, April 1997
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plotlabel.pro)


[9]

[Previous Routine] [List of Routines]
 NAME:
 
       CW_PLOTSTYLE

 PURPOSE:
 
       A compound widget used to set values for the graphics keywords
       COLOR, LINESTYLE, THICK, PSYM, and SYMSIZE.
      
 CATEGORY:
 
	Compound widgets.

 CALLING SEQUENCE:
 
	Result = CW_PLOTSTYLE(PARENT,LABEL)

 INPUTS:
 
       PARENT - The ID of the parent widget.  

       LABEL - a label to be drawn to the left (or top, for /column)
               of the widget.

 OPTIONAL KEYWORD PARAMETERS:
 
	UVALUE - Supplies the user value for the widget.

       VALUE - an array of initial values:
               [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE]

       FRAME - set to draw a frame around the widget.
       
       FONT - font keyword for labels etc.

       ROW - set to orient the subwidgets in a row (default.)

       COLUMN - set to orient the subwidgets in a column.

       NO_PSYM - set to delete the PSYM and SYMSIZE widgets. If set,
                 PSYM=0 and SYMSIZE=0 will be returned when using
                 WIDGET_CONTROL,GET_VALUE; PSYM and SYMSIZE are
                 ignored when using WIDGET_CONTROL,SET_VALUE

 OUTPUTS:
 
       The ID of the created widget is returned.

 PROCEDURE/EXAMPLE:

       The idea is that one or more instances of this cw would be
       used in a widget intended to allow the user to interactively
       adjust the settings for a plot.  For instance, you might have
       a menu item such as Plot Options->Styles, which would create a
       popup widget containing CW_PLOTSTYLE subwidgets for each of
       the variables being plotted.  When the user makes changes to
       the Color, Linestyle, Thick, Psym, and Symsize values, the
       popup widget event handler would re-draw the plot accordingly.
 
       The user is presented with:

       - a droplist of color choices, by name, referring to the first
         19 colors (i.e., the ones I was able to describe by name)
         defined by the TEK_COLOR procedure.  It's therefore
         necessary for the plotting program to call TEK_COLOR before
         drawing the plot using these color settings.

       - a droplist of linestyle choices.

       - a droplist of thickness choices, from 1 to 9

       - a droplist of psym choices, by name.

       - a droplist of symsize choices, from 0.25 to 2.00, in
         0.25 increments.

       The widget returns events when any of it's children generate
       events.  The returned event has the form
       {CW_PLOTSTYLE_EVENT,ID:id,TOP:top,HANDLER:handler,TAG:tag}
       where TAG indicates which child widget generated the event:
       Possible values for EVENT.TAG are COLOR, LINESTYLE, THICK
       PSYM, and SYSMSIZE.

       NOTE: you probably really want to use the CW_PLOTSTYLES (plural)
       widget, not this one.

 MODIFICATION HISTORY:
 
       David L. Windt, Bell Labs, March 1997
       windt@bell-labs.com

(See D:\MIRROR\BW1\TASCOM\IDL_PUB\windt\cw_plotstyle.pro)