IDL 3.6.1 Procedures Library

This page is a listing of the entire contents of this library for IDL. This listing is the long version. Viewing the much more compact listing may be handier.

[Go Back to Main IDL Libraries Search Page]


Last modified: Thu Dec 21 21:36:00 2000.

List of Routines


Routine Descriptions

ANNOTATE

[Next Routine] [List of Routines]
 NAME:
	ANNOTATE

 PURPOSE:
	This procedure is a general purpose drawing program/widget to
	annotate displays. Drawing objects include text, lines, arrows,
	polygons, rectangles, circles, and ellipses.

 CATEGORY:
	Widgets.  Will also work with plain windows.

 CALLING SEQUENCE:
	ANNOTATE

 INPUTS:
	No required inputs.

 KEYWORD PARAMETERS:
	COLOR_INDICES:	an array of color indices from which the user
			can choose colors. For example, to allow the user
			to choose 10 colors, spread evenly over the
			available indices, set the keyword as folows:
			COLOR_INDICES = INDGEN(10) * (!D.N_COLORS-1) / 9
	DRAWABLE:	the widget ID of the draw widget for the annotations.
			This is mutually exclusive with WINDOW.
	LOAD_FILE:	the name of an annotation format file to load after
			initialization.
	TEK_COLORS:	if set, the Tektronix color table is loaded
			starting at color index TEK_COLORS(0), with
			TEK_COLORS(1) color indices. The Tektronix color
			table contains up to 32 distinct colors suitable
			for graphics.
	WINDOW:		the window index number of the window to receive the
			annotations.

 OUTPUTS:
	This procedure has no explicit outputs. Menu choices exist to
	write TIFF, GIF, or PostScript bitmap files. Encapsulated
	or standalone PostScript files may also be created.

 SIDE EFFECTS:
	Annotations are made in the designated window or draw widget.

 RESTRICTIONS:
	This is a simple drawing program.

 PROCEDURE:
	If neither TEK_COLORS or COLOR_INDICES are specified, the default
	is to load 10 colors, evenly distributed over those available.

	If neither WINDOW or DRAWABLE are specified, the current window
	is used.

 EXAMPLE:
	TVSCL, HANNING(300,200)	;Output an image in the current window
	ANNOTATE		;Annotate it

 MODIFICATION HISTORY:
	DMS, RSI, July, 1993.  Original version.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/annotate.pro)


ANOVA

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

 NAME:
	ANOVA

 PURPOSE:
	Perform one-way analysis of variance with
	equal and unequal sample size, two-way analysis
	of variance with and without interactions.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	ANOVA, X

 INPUTS: 
	X:	An array of experimental data. For one-way and two-way 
		analysis of variance without interactions, X must be
		dimensioned (Treatment#,B),  where B is the maximum
		sample size (one-way anova) or number of blocks
		(two-way analysis).  With interactions, X is dimensioned 
		(Treatment#,I,B), where I is the number of iterates in each
		cell.
             
 OUTPUT:
	Anova table displaying Sum of Squares, Mean Squares,
	and F Ratio for sources of variation.

 KEYWORDS:
	FCTest = if present and set, returns the value of F for
		treatment or column variation.
	FRTest	if present and set, returns value of F for row
		or block variation.
	FRCTest	if present and set, returns value of F for column
		variation.
	DFE	if present and set, returns denominator degrees of
		freedom for FCTest,FRTest,FRCTest.
	DFC	if present and set, returns numerator degrees of
		for FCTest 
	DFR	if present and set, returns numerator degrees of for
		FRTest. 
	DFRC	if present and set, returns numerator degrees of
		for FRCTest. 

	Missing	missing data value. If undefined,
		assume no missing data.If unequal
		sample sizes, set M to place holding
		value.

    List_Name:	name of output file. Default is to the
		screen.

  Type of design structure. Options a
	ONE_WAY         =  if set, perform 1-way anova.
	Unequal_ONE_WAY =  if set, perform 1-way ANOVA with
                             unequal sample sizes.
	TWO_WAY = if set, perform a 2-way ANOVA.
	Interactions_TWO_WAY = if set, perform a
                                2-way ANOVA with
                                interactions.
  One and Only one of the options above must be set.

    TContrast:	1- or 2- dimensional array 
		of treatment contrasts.
		Each row of TC represents a contrast.
		TC(i,j) = the coefficient of the mean of
		the ith treatment in the jth contrast. 

    BContrast:	1- or 2- dimensional array of block
		contrasts. Each row of BC represents
		a contrast. BC(i,j) = the coefficient
		of the mean of the ith block in the jth
		contrast.                 

    IContrast:	1- or 2- dimensional array of interaction contrasts.  Each 
		row of TC represents a contrast.  IC(i,j) = the coefficient of
		the mean of the ith treatment in the jth contrast. 

	TName:	name to be used in the output for treatment type.

	BName:	name to be used in the output for block type.
	TCName:	vector of names to be used in the output to identify 
		treatment contrasts.
	BCName:	vector of names to be used in the output to identify block
		contrasts.
	ICName:	vector of names to be used in the output to identify
		interaction contrasts.
  No_Printout:	flag, when set, to suppress printing of output.

 RESTRICTIONS:
	NONE.

 SIDE EFFECTS:
	None.

 PROCEDURE:
	Calculation of standard formulas for sum of squares, mean squares and 
	F ratios.        
  

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/anova.pro)


ANOVA_UNEQUAL

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

 NAME:
	ANOVA_UNEQUAL

 PURPOSE:
	Perform two way analysis of variance with interactions and unequal
	cell sizes - that is, not every treatment / block combination
	has the same number of iterations.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	ANOVA_UNEQUAL, Data, FT_Test, FB_Test, FI_Test

 INPUTS: 
	Data:	Array of experimental data, dimensioned (Treatment#, I, B),
		where I is the number of repetitions in each cell.

 OUTPUT:
	Anova table displaying  Sum of Squares, Mean Squares, and F Ratio 
	for sources of variation.

 OPTIONAL OUTPUT PARAMETERS: 
      FC_Test:	value of F for treatment or column variation.

      FB_Test:	value of F for row or block variation.

      FI_Test:	value of F for column variation.

 KEYWORDS:
      MISSING:	missing data value.  If undefined, assume no missing data. If 
		unequal sample sizes, set M to place holding value.

    LIST_NAME:	name of output file. Default is to the screen.

	TNAME:	name to be used in the output for treatment type.

	BNAME:	name to be used in the output for block type.

	INAME:	name to be used in the output for interaction type
 
  NO_PRINTOUT:	flag , when set,  to suppress printing
                       of output
 RESTRICTIONS:
	Each treatment/block combination must have at least 1 observation.

 SIDE EFFECTS:
	None.

 PROCEDURE:
	Overparameterized least squares procedure with sum to zero 
	restrictions.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/anova_unequal.pro)


ARROW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:				ARROW
 PURPOSE:	Draw a vector(s) with an arrow head
 CATEGORY:	Graphics
 CALLING SEQUENCE:
	ARROW, x0, y0, x1, y1
 INPUTS:
	(x0, y0) = coordinates of beginning of vector(s).  May be arrays
		or scalars. Coordinates are in DEVICE coordinates
		unless otherwise specified.
	(x1, y1) = coordinates of endpoint (head) of vector.  
		x0, y0, x1, y1 must all have the same number of elements.
 KEYWORD PARAMETERS:
	DATA - if set, implies that coordinates are in data coords.
	NORMALIZED - if set, coordinates are specified in normalized coords.
	HSIZE = size of arrowhead.  Default = 1/64th the width of the device,
		(!D.X_SIZE / 64.).
		If the size is positive, it is assumed to be in device
		coordinate units.  If it is NEGATIVE, then the head length
		is set to the vector length * abs(hsize), giving heads
		proportional in size to the bodies.  The size is defined as
		the length of each of the lines (separated by 60 degrees) 
		that make the head.
	COLOR = drawing color.  Default = highest color index.
	HTHICK = thickness of heads.  Default = 1.0.
	SOLID = if set, make a solid arrow, using polygon fills, looks better
		for thick arrows.
	THICK = thickness of body.    Default = 1.0.
	
 OUTPUTS:
	No explicit outputs.
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	Straightforward.
	Examples:
  		Draw an arrow from (100,150) to (300,350) in DEVICE units.
	ARROW, 100, 150,  300, 350

		Draw a sine wave with arrows from the line Y=0 to
		sin(x/4).
	X = FINDGEN(50)
	Y = SIN(x/4)		;Make sin wave
	PLOT, X, Y
	ARROW, X, REPLICATE(0,50), X, Y, /DATA
 MODIFICATION HISTORY:
	DMS, Feb, 1992.
	DMS, Sept, 1992.  Added /SOLID.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/arrow.pro)


BAR_PLOT

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

 PURPOSE:
	Create a bar graph, or overplot on an existing one.

 CATEGORY:
	Graphics.

 CALLING SEQUENCE:
	BAR_PLOT, Values

 INPUTS:
	Values:	A vector containing the values to be represented by the bars.
		Each element in VALUES corresponds to a single bar in the
		output.

 KEYWORD PARAMETERS:
   BASELINES:	A vector, the same size as VALUES, that contains the
		base value associated with each bar.  If not specified,
		a base value of zero is used for all bars.

      COLORS:	A vector, the same size as VALUES, containing the color index
		to be used for each bar.  If not specified, the colors are
		selected based on spacing the color indices as widely as 
		possible within the available colors (specified by D.N_COLORS).

    BARNAMES:	A string array, containing one string label per bar.
		If the bars are vertical, the labels are placed beneath
		them.  If horizontal (rotated) bars are specified, the labels
		are placed to the left of the bars.

	TITLE:	A string containing the main title to for the bar plot.

	XTITLE:	A string containing the title for the X axis.

	YTITLE:	A string containing the title for the Y axis.

   BASERANGE:	A floating-point scalar in the range 0.0 to 1.0, that
		determines the fraction of the total available plotting area
		(in the direction perpendicular to the bars) to be used.
		If not specified, the full available area is used.

    BARWIDTH:	A floating-point value that specifies the width of the bars
		in units of "nominal bar width".  The nominal bar width is
		computed so that all the bars (and the space between them, 
		set by default to 20% of the width of the bars) will fill the 
		available space (optionally controlled with the BASERANGE 
		keyword).

    BARSPACE: 	A scalar that specifies, in units of "nominal bar width",
		the spacing between bars.  For example, if BARSPACE is 1.0,
		then all bars will have one bar-width of space between them.
		If not specified, the bars are spaced apart by 20% of the bar
		width.

   BAROFFSET:	A scalar that specifies the offset to be applied to the
		first bar, in units of "nominal bar width".  This keyword 
		allows, for example, different groups of bars to be overplotted
		on the same graph.  If not specified, the default offset is
		equal to BARSPACE.

     OUTLINE:	If set, this keyword specifies that an outline should be 
		drawn around each bar.

    OVERPLOT:	If set, this keyword specifies that the bar plot should be
		overplotted on an existing graph.

  BACKGROUND:	A scalar that specifies the color index to be used for
		the background color.  By default, the normal IDL background
		color is used.

	ROTATE:	If set, this keyword indicates that horizontal rather than
		vertical bars should be drawn.  The bases of horizontal bars
		are on the left, "Y" axis and the bars extend to the right.

 OUTPUTS:
	A bar plot is created, or an existing one is overplotted.

 EXAMPLE:
	By using the overplotting capability, it is relatively easy to create
	stacked bar charts, or different groups of bars on the same graph.

	For example, if ARRAY is a two-dimensional array of 5 columns and 8
	rows, it is natural to make a plot with 5 bars, each of which is a
	"stacked" composite of 8 sections.  First, create a 2D COLORS array,
	equal in size to ARRAY, that has identical color index values across
	each row to ensure that the same item is represented by the same color
	in all bars.

	With ARRAYS and COLORS defined, the following code fragment
	illustrates the creation of stacked bars (note that the number of rows
	and columns is arbitrary):

	!Y.RANGE = [0,ymax] ; Scale range to accommodate the total bar lengths.
	BASE = INTARR(NROWS)
	FOR I = 0, NROWS-1 DO BEGIN
	   BAR_PLOT, ARRAY(*,I), COLORS=COLORS(*,I), BASELINES=BASE, $
	             BARWIDTH=0.75, BARSPACE=0.25, OVER=(I GT 0)
	   BASE = BASE + ARRAY(*,I)
	ENDFOR

	To plot each row of ARRAY as a clustered group of bars within the same
	graph, use the BASERANGE keyword to restrict the available plotting
	region for each set of bars.  The sample code fragment below
	illustrates this method:

	FOR I = 0, NROWS-1 DO $
	   BAR_PLOT, ARRAY(*,I), COLORS=COLORVECT, BARWIDTH=0.8,BARSPACE=0.2, $
	     BAROFFSET=I*((1.0+BARSPACE)*NCOLS), OVER=(I GT 0), BASERANGE=0.19

	where NCOLS is the number of columns in ARRAY, and COLORVECT is a
	vector containing the color indices to be used for each group of
	bars.  (In this example, each group uses the same set of colors, but
	this could easily be changed.)

 MODIFICATION HISTORY:
	August 1990, T.J. Armitage, RSI, initial programming.  Replacement
	for PLOTBAR and OPLOTBAR routines written by William Thompson.

	September 1990, Steve Richards, RSI, changed defaults to improve the
	appearance of the bar plots in the default mode. Included
	spacing the bars slightly.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bar_plot.pro)


BASE_ALLOC

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

 $Id: base_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidBase
   Base object class definition.

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  BASE_Icon
       Return the base toolbar icon

UNCTION BASE_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/base_alloc.pro)


BETAI

[Previous Routine] [Next Routine] [List of Routines]
 $Id: betai.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.

unction betac, a,b,x

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/betai.pro)


BGROUP_ALLOC

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

 $Id: bgroup_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidBGroup
   Widget Button Group (CW_BGROUP) class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  BGROUP_Icon
       Return the button group icon

UNCTION BGROUP_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bgroup_alloc.pro)


BILINEAR

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

 PURPOSE:
	Bilinearly interpolate a set of reference points.

 CALLING SEQUENCE:
	Result = BILINEAR(P, IX, JY)

 INPUTS:                 
	P:  A two-dimensional data array.

	IX and JY:  The "virtual subscripts" of P to look up values
	  for the output.
  
	IX can be one of two types:
	     1)	A one-dimensional, floating-point array of subscripts to look
		up in P.  The same set of subscripts is used for all rows in
		the output array.
	     2)	A two-dimensional, floating-point array that contains both 
		"x-axis" and "y-axis" subscripts specified for all points in
		the output array.

	In either case, IX must satisfy the expression,
		    0 <= MIN(IX) < N0  and 0 < MAX(IX) <= N0
	where N0 is the total number of subscripts in the first dimension
	of P.

	JY can be one of two types:
	     1) A one-dimensional, floating-point array of subscripts to look
		up in P.  The same set of subscripts is used for all rows in
		the output array.
	     2) A two-dimensional, floating-point array that contains both
               "x-axis" and "y-axis" subscripts specified for all points in
               the output array.

	    In either case JY must satisfy the expression,
		    0 <= MIN(JY) < M0  and 0 < MAX(JY) <= M0
	    where M0 is the total number of subscripts in the second dimension
	    of P.

  	It is better to use two-dimensional arrays for IX and JY when calling
  	BILINEAR because the algorithm is somewhat faster.  If IX and JY are 
  	one-dimensional, they are converted to two-dimensional arrays on
  	return from the function.  The new IX and JY can be re-used on 
	subsequent calls to take advantage of the faster, 2D algorithm.  The 
	2D array P is unchanged upon return.

 OUTPUT:
	The two-dimensional, floating-point, interpolated array.  

 SIDE EFFECTS:
	This function can take a long time to execute.

 RESTRICTIONS:
	None.

 EXAMPLE:
	Suppose P = FLTARR(3,3), IX = [.1, .2], and JY = [.6, 2.1] then
	the result of the command:
		Z = BILINEAR(P, IX, JY)
	Z(0,0) will be returned as though it where equal to P(.1,.6) 
	interpolated from the nearest neighbors at P(0,0), P(1,0), P(1,1)
	and P(0,1).

 PROCEDURE:
	Uses bilinear interpolation algorithm to evaluate each element
	in the result  at virtual coordinates contained in IX and JY with 
	the data in P.                                                          

 REVISION HISTORY:
       Nov. 1985  Written by L. Kramer (U. of Maryland/U. Res. Found.)
	Aug. 1990  TJA simple bug fix, contributed by Marion Legg of NASA Ames
	Sep. 1992  DMS, Scrapped the interpolat part and now use INTERPOLATE

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bilinear.pro)


BINOMIAL

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

 PURPOSE: 
	Binomial implements the cumulative binomial distribution.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = BINOMIAL(X, N, P) 

 INPUTS:
	X:	The number of successes.

	N:	The number of trials.

	P:	The success probability.

 OUTPUT:
	Binomial returns the probability of x or more successes in a binomial
	experiment with n trials and success probability p. If n exceeds 25,
	the Gaussian approximation is computed.
 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/binomial.pro)


BIN_DATE

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

 PURPOSE:
	This function converts a standard form ascii date/time string
	to a binary string.

 CATEGORY:
	Date/time functions.

 CALLING SEQUENCE:
	Result = BIN_DATE(Asc_time)

 INPUTS:
	Asc_time: the date/time to convert in standard ascii format.
		  If omitted, use the current date/time.  
	  	  Standard form is a 24 character string:
			DOW MON DD HH:MM:SS YYYY
		  where: DOW = day of week, MON = month, DD=day of month,
			HH:MM:SS = hour/minute/second, YYYY = year.

 OUTPUTS:
	This function returns a 6 element integer array containing:
 	Element 0 = year	e.g. 1992
		1 = month	1-12
		2 = day		1-31
		3 = hour	0-23
		4 = minute	0-59
		5 = second	0-59

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
 	Written by:	DMS /RSI, Jul, 1992.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bin_date.pro)


BLK_CON

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

 PURPOSE:
       This function convolves an input signal with an impulse-response
	sequence.

 CATEGORY:
       Digital Signal Processing

 CALLING SEQUENCE:
       Result = BLK_CON(Filter, Signal, B_length=B_length)

 INPUTS:
       Filter = The impulse-response sequence of length P.
       Signal = The discrete signal samples.

 OUTPUTS:
       The filtered signal with the same number of elements as Signal.

 KEYWORD PARAMETERS:
       B_length = (Block Length) A scalar specifying the length of
                  the subdivided signal segments. If this paramter
                  is not specified a near-optimal value is chosen
                  by the algorithm based upon the length of the
                  impulse-response sequence, P. If P is a value
                  less than 11 or greater than 377, then B_length
                  must be specified.

 OUTPUT PARAMETERS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       1) The block length must be greater than the filter length.
          B_length > P
       2) The block length must be less than the number of signal samples.
          B_length < N_elements(Signal)

 EXAMPLE:
       --- create a filter of length P=32 ---
       FILTER = REPLICATE(1.0,32)  ;Set all pnts to 1.0
       FILTER(2*INDGEN(16)) = 0.5  ;Set even points to 0.5

       --- create a sampled signal with random noise ---
       SIGNAL = SIN((FINDGEN(1000)/35.0)^2.5)
       NOISE  = (RANDOMU(SEED,1000)-.5)/2.
       SIGNAL = SIGNAL + NOISE

       --- convolve the filter and signal using block convolution ---
       RESULT = BLK_CON(FILTER, SIGNAL)

 PROCEDURE:
       Implementation of the 'overlap-save' method in the frequency domain.
       The discrete signal samples are divided into overlapping segments of
       a length specified by the parameter B_length. B_length may be supplied
       by the user as an optional keyword parameter or determined by the
       algorithm to a near-optimal value. Each input segment consists of P-1
       samples from the previous input segment and (B_length-P+1) new signal
       samples, where P is the length of the filter. Each of these segments
       is processed in the frequency domain and then 'reassembled' in the
       time domain. The first and last input segments are handled differently.

 REFERENCE:
       Oppenheim, A.V. and Schafer, R.W.
       DIGITAL SIGNAL PROCESSING
       Prentice-Hall, 1975

 MODIFICATION HISTORY:
           Written by:  ggs@RSI, MAY 1993

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/blk_con.pro)


BMPBTN_ALLOC

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

 $Id: bmpbtn_alloc.pro,v 1.11 1994/06/01 23:08:48 ali Exp $

  WidBmpBtn
   Widget Bitmap Button class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  BMPBTN_Icon
       Return the bitmapped button toolbar icon

UNCTION BMPBTN_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bmpbtn_alloc.pro)


BOX_CURSOR

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

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

 CATEGORY:
	Interactive graphics.

 CALLING SEQUENCE:
	BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]

 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:  If this keyword is set, x0, y0, nx, and ny contain the initial
	parameters for the box.

	FIXED_SIZE:  If this keyword is set, nx and ny contain the initial
	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:
	x0:  X value of lower left corner of box.
	y0:  Y value of lower left corner of box.
	nx:  width of box in pixels.
	ny:  height of box in pixels. 

	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.

 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.
	June, 1993 - Bill Thompson
			prevented the box from having a negative size.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/box_cursor.pro)


BUTTON_ALLOC

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

 $Id: button_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidButton
   Widget Button class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  BUTTON_Icon
       Return the button toolbar icon

UNCTION BUTTON_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/button_alloc.pro)


CALDAT

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

 PURPOSE:
	Return the month, day and year corresponding to a given julian date.
	This is the inverse of the function JULDAY.
 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	CALDAT, Julian, Month, Day, Year
	See also: julday, the inverse of this function.

 INPUTS:
	JULIAN contains the Julian Day Number (which begins at noon) of the 
	specified calendar date.  It should be a long integer.
 OUTPUTS:
	MONTH:	Number of the desired month (1 = January, ..., 12 = December).

	DAY:	Number of day of the month.

	YEAR:	Number of the desired year.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 MODIFICATION HISTORY:
	Translated from "Numerical Recipies in C", by William H. Press,
	Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling.
	Cambridge University Press, 1988 (second printing).

	DMS, July, 1992.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/caldat.pro)


CALENDAR

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

 PURPOSE:
	Display a calandar for a month or an entire year using IDL's
	plotting subsystem. This IDL routine imitates the Unix cal
	command.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	CALENDAR
	CALENDAR, YEAR
	CALENDAR, MONTH, YEAR

 INPUTS:
	If called without arguments, CALENDAR draws a calendar for the
	current month.

	MONTH:  The number of the month for which a calandar is
		desired (1 is January, 2 is February, ..., 12 is December).

	YEAR:   The number of the year for which a calendar should be
		drawn. If YEAR is provided without MONTH, a calendar
		for the entire year is drawn.

 OPTIONAL INPUT PARAMETERS:
	None.

 OUTPUTS:
	The specified calandar is drawn on the current graphics device.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 MODIFICATION HISTORY:
	AB, September, 1988

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/calendar.pro)


CDF_EXISTS

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

 PURPOSE:
	Test for the existence of the CDF library

 CATEGORY:
	File Formats

 CALLING SEQUENCE:
	Result = CDF_EXISTS()

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Returns TRUE (1) if the CDF data format library is
	supported. Returns FALSE(0) if it is not.

 EXAMPLE:
	IF cdf_exists() EQ 0 THEN Fail,"CDF not supported on this machine"

 MODIFICATION HISTORY
	Written by:	Joshua Goldstein,  12/8/92

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cdf_exists.pro)


CHEBYSHEV

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

 PURPOSE:
	Implements forward and reverse Chebyshev polynomial expansion of
	a set of data.

 CATAGORY:
	Mathematics.

 CALLING SEQUENCE:
	Result = CHEBYSHEV(D, N)

 INPUT:
	D:  A vector containing the values at the zeros of Chebyshev
	    polynomial.

	N:  A flag that, if set to -1, returns a set of Chebyshev polynomials.
	    If set to +1, the original data is returned.

 OUTPUT:
	Returns either the set of Chebyshev polynomials or the original
	data depending on the value of N.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Results from this function are subject to roundoff error given
	discontinuous data.

 RESTRICTIONS:                                           
	Unknown.

 PROCEDURE:
	Straightforward implementation of recursion formula. 

 REVISION HISTORY:
	Jan, 1986  Written by Leonard Kramer, U. of Maryland
		   University Research Foundation

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/chebyshev.pro)


CHI_SQR

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

 PURPOSE: 
	CHI_SQR returns the cutoff value v such that

		Probability(X > v) = a

	where X is a random variable from the chi_sqr distribution with 
	v degrees of freedom. 

 CATEGORY:
	Statistics.
 
 CALLING SEQUENCE:
	Result = CHI_SQR(A, DF)

 INPUT:
	A:	probability
	DF:	degrees of freedom

 OUTPUT:
	If a is between 0 and 1, then the cutoff value is returned.
	Otherwise, -1 is returned to indicate an error.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/chi_sqr.pro)


CHI_SQR1

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

 NAME:
	CHI_SQR1

 PURPOSE: 
	CHI_SQR1 returns the probabilty of observing X or something smaller
	from a chi square distribution with DF degrees of freedom.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	PROB = CHI_SQR1(X,DF)

 INPUTS:
	X:	the cut off point
	DF:	the degrees of freedom

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/chi_sqr1.pro)


CIR_3PNT

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

 PURPOSE:
	This procedure returns the radius and center of a circle,
	given 3 points on the circle. This is analogous to finding
	the circumradius and circumcircle of a triangle; the center
	of the circumcircle is the point at which the three perpendicular
	bisectors of the triangle formed by the points meet.

 CATEGORY:
	Analytical geometry.

 CALLING SEQUENCE:
	CIR_3PNT, X, Y, R, X0, Y0

 INPUTS:
	X: A three-element vector containing the X-coordinates of the points.
	Y: A three-element vector containing the Y-coordinates of the points.

 OUTPUTS:
	R: The radius of the circle. The procedure returns 0.0 if the points
	   are co-linear.
	X0, Y0: The coordinates of the center of the circle. The procedure
	        returns 0.0 if the points are co-linear.

 PROCEDURE:
	Derived from Glasser, ed.  Graphics Gems, Volume 1, Page 22.

 EXAMPLE:
	X = [1.0, 2.0, 3.0]
	Y = [1.0, 2.0, 1.0]
	CIR_3PNT, X, Y, R, X0, Y0
	Print, 'The radius is: ', R
	Print, 'The center of the circle is at: ', X0, Y0

 MODIFICATION HISTORY:
 	Written by:	DMS, RSI, Nov, 1992.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cir_3pnt.pro)


COMPLEXROUND

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

 PURPOSE:
        This function rounds a complex array.

 CATEGORY:
        Numerical Analysis.

 CALLING SEQUENCE:
        Result = COMPLEXROUND(Input)

 INPUTS:
        Input: The complex array to be rounded.

 OUTPUTS:
        This function returns a rounded version of the Input array.

 RESTRICTIONS:
        The Input array must be complex.

 PROCEDURE:
        This function rounds the real and imaginary 
        components of the input array.

 EXAMPLE:
 	X = [COMPLEX(1.245, 3.88), COMPLEX(9.1, 0.3345)]
	Z = COMPLEXROUND(X)
	PRINT, Z
	(      1.00000,      4.00000)(      9.00000,      0.00000)

 MODIFICATION HISTORY:
       Written by: GGS, SEPTEMBER, 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/complexround.pro)


COND

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

 PURPOSE:
       This function computes the condition number of an N by N array.

 CATEGORY:
       Complex Linear Algebra.

 CALLING SEQUENCE:
       Result = COND(A)

 INPUTS:
       A:      An N by N real or complex array.

 KEYWORD PARAMETERS:
       DOUBLE: If set to a non-zero value, computations are done in
               double precision arithmetic.
       Note:   Since IDL lacks a double-precision complex data type,
               computations are done internally in double-precision
               and the result is truncated to single-precision complex.

 EXAMPLE:
       Define a complex array (a).
         a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
              [complex(1,-2), complex(2, 2), complex(1, 0)], $
              [complex(1, 1), complex(0, 1), complex(1, 5)]]
       Compute the condition number of the complex array (a) using 
       internal double-precision arithmetic.
         result = cond(a, /double)
         
 PROCEDURE:
       This function returns the condition number of an N x N real or
       complex array (A) by explicitly computing, norm(A)*norm(A_inverse).
       If A is real and A_inverse is invalid (due to the singularity of A 
       or floating-point errors in the nr_invert function), the condition 
       number is returned as a -1. If A is complex and A_inverse is invalid
       (due to the singularity of A), calling COND.PRO results in floating-
       point errors.

 REFERENCE:
       ADVANCED ENGINEERING MATHEMATICS (seventh edition)
       Erwin Kreyszig
       ISBN 0-471-55380-8

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, April 1992
       Modified:    GGS, RSI, February 1994
                    Accepts complex inputs. Added DOUBLE keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cond.pro)


CONGRID

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

 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).

 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.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/congrid.pro)


CONTINGENT

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

 NAME:
	CONTINGENT

 PURPOSE:
	Construct a two-way contingency table from the count data in X and 
	test for independence between two factors represented by the rows 
	and columns of X.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Contingent, X, ChiSqr, Prob, DF
 
 INPUTS: 
	X:	input array of count data. X(i,j) is the number
		of observations at level i and j of the column
		and row factors respectively.

 OUTPUT:
	Contingency table writtem to the screen.

 OPTIONAL OUTPUT PARAMETERS:      
	ChiSqr:	the statistic to test for factor independence.

	Prob:	the probability of ChiSqr or something larger from a chi 
		square distribution.

	DF:	degrees of freedom

 KEYWORDS:
     COLNAMES:	vector of names to label table columns.

     ROWNAMES:	vector of names to label table rows.

    LIST_NAME:	name of output file. default is to the screen.
                          
 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 PROCEDURE:
	Calculation of standard formulas to compute ChiSqr.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/contingent.pro)


COORD2TO3

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

 PURPOSE:
	Return 3D data coordinates given the normalized X and Y screen
	coordinates and one of the three data coordinates.

 CATEGORY:
	Geometry / Graphics.

 CALLING SEQUENCE:
	Result = COORD2TO3(Mx, My, Dim, D0 [, PTI])

 INPUTS:
	Mx, My: The normalized X and Y screen coordinates.

	Dim:  	A parameter used to specify which data coordinate is fixed.
		Use 0 for a fixed X data coordinate, 1 for a fixed Y data 
		coordinate, or 2 for a fixed Z data coordinate.

	D0:	The value of the fixed data coordinate.

 OPTIONAL INPUT PARAMETERS:
	PTI:  	The inverse of !P.T.  If this parameter is not supplied, 
		or set to 0, COORD2TO3 computes the inverse.  If this routine
		is to be used in a loop, the caller should supply PTI for
		highest efficiency.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Returns a 3-element vector containing the 3D data coordinates.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	A valid 3D transform must exist in !P.T or PTI.
	The axis scaling variables, !X.S, !Y.S and !Z.S must be valid.

 PROCEDURE:
	The intersection of the plane determined by data coordinates
	Dim and D0 and the screen coordinate line (Mx, My, 0),
	(Mx, My, 1) is computed.

 EXAMPLE:
	To return the data coordinates of the mouse, fixing the
	data Z value at 10, enter the commands:
		CURSOR, X, Y, /NORM	;Get the normalized mouse coords.
	  	P = COORD2TO3(X, Y, 2, 10.0)

 MODIFICATION HISTORY:
	DMS, 9/91.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/coord2to3.pro)


CORRELATE

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

 PURPOSE:
	Compute the simple correlation coefficient of two arrays.

 CATEGORY:
	G2 - Correlation and regression analysis.

 CALLING SEQUENCE:
	Result = CORRELATE(X, Y)

 INPUTS:
	X, Y:  	Input arrays that may be of any type except string.
		Both arrays must have the same number of points.

 OUTPUTS:
	Returns the simple correlation coefficient of X and Y.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Input arrays must have the same number of data elements.

 PROCEDURE:
	R  = TOTAL(xx*yy)/SQRT(TOTAL(xx^2)*TOTAL(yy^2))

 MODIFICATION HISTORY:
	DMS, RSI, Sept, 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/correlate.pro)


CORREL_MATRIX

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

 PURPOSE: 
	To compute correlation coefficients of pairs of columns of X.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = CORREL_MATRIX(X)

 INPUTS: 
	X:	Matrix of experimental data.  X(i,j) = the value of the ith
		variable in the jth observation.

 OUTPUT:
	CORREL_MATRIX returns a matrix M, where M(i,j) = the simple Pearson
	correlation coefficient between the ith and jth variable. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/correl_matrix.pro)


CRAMER

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

 PURPOSE:
       This function solves an n by n linear system of equations 
       using Cramer's rule.

 CATEGORY:
       Linear Algebra.

 CALLING SEQUENCE:
       Result = CRAMER(A, B)

 INPUTS:
       A:      An N by N array of type: float, or double.

       B:      An N-element vector of type: float, or double.

 KEYWORD PARAMETERS:
       DOUBLE: If set to a non-zero value, computations are done in
               double precision arithmetic.

       ZERO:   Use this keyword to set the value of floating-point
               zero. A floating-point zero on the main diagonal of
               a triangular matrix results in a zero determinant.
               A zero determinant results in a 'Singular matrix'
               error and stops the execution of CRAMER.PRO.
               For single-precision inputs, the default value is 
               1.0e-6. For double-precision inputs, the default value 
               is 1.0e-12.

 EXAMPLE:
       Define an array (a).
         a = [[ 2.0,  1.0,  1.0], $
              [ 4.0, -6.0,  0.0], $
              [-2.0,  7.0,  2.0]]
       And right-side vector (b).
         b = [3.0, 10.0, -5.0]

       Compute the solution of the system, ax = b.
         result = cramer(a, b)

 PROCEDURE:
       CRAMER.PRO uses ratios of column-wise permutations of the array (a)
       to calculate the solution vector (x) of the linear system, ax = b.

 REFERENCE:
       ADVANCED ENGINEERING MATHEMATICS (seventh edition)
       Erwin Kreyszig
       ISBN 0-471-55380-8

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, February 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cramer.pro)


CREATE_VIEW

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

 PURPOSE:
	This procedure sets the various system variables required to
       define a coordinate system and a 3-D view.   This procedure
       builds the system viewing matrix (!P.T) in such a way that the
       correct aspect ratio of the data is maintained even if the
       display window is not square.
       CREATE_VIEW also sets the "Data" to "Normal" coordinate
       conversion factors (!X.S, !Y.S, and !Z.S) so that center of
       the unit cube will be located at the center of the display
       window.

 CATEGORY:
	Viewing.

 CALLING SEQUENCE:
       CREATE_VIEW
	
 INPUTS:
	None.

 KEYWORD PARAMETERS:
       XMIN:       The minimum data value on the X axis.
                   The default is (0.0).
                   Data type : Any scalar numeric value.
       XMAX:       The maximum data value on the X axis.
                   The default is (1.0).
                   Data type : Any scalar numeric value.
       YMIN:       The minimum data value on the Y axis.
                   The default is (0.0).
                   Data type : Any scalar numeric value.
       YMAX:       The maximum data value on the Y axis.
                   Data type : Any scalar numeric value.
                   The default is (1.0).
       ZMIN:       The minimum data value on the Z axis.
                   The default is (0.0).
                   Data type : Any scalar numeric value.
       ZMAX:       The maximum data value on the Z axis.
                   The default is (1.0).
                   Data type : Any scalar numeric value.
       AX:         The orientation (X rotation) of the view.
                   The default is (0.0).
                   Data type : Float.
       AY:         The orientation (Y rotation) of the view.
                   The default is (0.0).
                   Data type : Float.
       AZ:         The orientation (Z rotation) of the view.
                   The default is (0.0).
                   Data type : Float.
       WINX:       The X size, in pixels, of the window that the
                   view is being set up for.
                   The default is (640).
                   Data type : Long.
       WINY:       The Y size, in pixels, of the window that the
                   view is being set up for.
                   The default is (512).
                   Data type : Long.
       ZOOM:       The view zoom factor.   If zoom is a single
                   value then the view will be zoomed equally in
                   all 3 dimensions.   If zoom is a 3 element vector
                   then the view will be scaled zoom(0) in X,
                   zoom(1) in Y, and zoom(2) in Z.
                   The default is (1.0).
                   Data type : Float or Fltarr(3).
       ZFAC:       Use this keyword to expand or contract the view
                   in the Z dimension.
                   The default is (1.0).
                   Data type : Float.
       PERSP:      The perspective projection distance.   A value of
                   (0.0) indicates an isometric projection (NO per-
                   spective).
                   The default is (0.0).
                   Data type : Float.
       RADIANS:    Set this keyword to a non-zero value if the values
                   passed to AX, AY, and AZ are in radians.
                   The default is degrees.
                   Data type : Int.

 SIDE EFFECTS:
	This procedure sets the following IDL system variables :

          !P.T, !P.T3D, !P.Position, !P.Clip, !P.Region
          !X.S, !X.Style, !X.Range, !X.Margin
          !Y.S, !Y.Style, !Y.Range, !Y.Margin
          !Z.S, !Z.Style, !Z.Range, !Z.Margin

 PROCEDURE:
       This procedure sets the 4x4 system viewing matrix (!P.T) by
       calling T3D with the following parameters :

       ; Reset (!P.T) to the identity matrix.
          T3D, /RESET
       ; Translate the center of the unit cube to the origin.
          T3D, TRANSLATE=[(-0.5), (-0.5), (-0.5)]
       ; Zoom the view.
          T3D, SCALE=ZOOM
       ; Scale the view to preserve the correct aspect ratio.
          xrange = xmax - xmin
          yrange = ymax - ymin
          zrange = (zmax - zmin) * zfac
          max_range = xrange > yrange > zrange
          T3D, SCALE=([xrange, yrange, zrange] / max_range)
       ; Rotate the view.
          T3D, ROTATE=[0.0, 0.0, AZ]
          T3D, ROTATE=[0.0, AY, 0.0]
          T3D, ROTATE=[AX, 0.0, 0.0]
       ; Define a perspective projection (if any).
          IF (p_proj) THEN T3D, PERSPECTIVE=PERSP
       ; Compensate for the aspect ratio of the display window.
          T3D, SCALE=[xfac, yfac, 1.0]
       ; Translate the unit cube back to its starting point.
          T3D, TRANSLATE=[(0.5), (0.5), (0.5)]

 EXAMPLE:
       Set up a view to display an iso-surface from volumetric data.

       ; Create some data.
          vol = FLTARR(40, 50, 30)
          vol(3:36, 3:46, 3:26) = RANDOMU(s, 34, 44, 24)
          FOR i=0, 10 DO vol = SMOOTH(vol, 3)

       ; Generate the iso-surface.
          SHADE_VOLUME, vol, 0.2, polygon_list, vertex_list, /LOW

       ; Set up the view.
       ; Note that the subscripts into the Vol array range from
       ; 0 to 39 in X, 0 to 49 in Y, and 0 to 29 in Z.   As such,
       ; the 3-D coordinates of the iso-surface (vertex_list) may
       ; range from 0.0 to 39.0 in X, 0.0 to 49.0 in Y,
       ; and 0.0 to 29.0 in Z.   Set XMIN, YMIN, and ZMIN to
       ; zero (the default), and set XMAX=39, YMAX=49, and ZMAX=29.
          WINDOW, XSIZE=600, YSIZE=400
          CREATE_VIEW, XMAX=39, YMAX=49, ZMAX=29, AX=(-60.0), AZ=(30.0), $
                       WINX=600, WINY=400, ZOOM=(0.7), PERSP=(1.0)

       ; Display the iso surface in the specified view.
          img = POLYSHADE(polygon_list, vertex_list, /DATA, /T3D)
          TVSCL, img

 MODIFICATION HISTORY:
 	Written by:	Daniel Carr. Wed Sep  2 16:40:47 MDT 1992
       Modified the way the view is compensated for the data aspect ratio.
                       Daniel Carr. Tue Dec  8 17:53:54 MST 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/create_view.pro)


CROSSP

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

 PURPOSE:
	Evaluate the vector or cross-product of vectors v1 and v2.

 CATEGORY:
	Vector mathematics.

 CALLING SEQUENCE:
	Result = CROSSP(v1, v2)

 INPUTS:
	v1, v2:  Three-element vectors.

 OUTPUTS:
	Returns a 3-element, floating-point vector.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Vectors must have 3 elements.

 PROCEDURE:
	v1 X v2 = | i  j  k  | = (b1c2 - b2c1)i + (c1a2-c2a1)j + (a1b2-a2b1)k
		  | a1 b1 c1 |
		  | a2 b2 c2 |

 MODIFICATION HISTORY:
	Written, DMS, Aug, 1983;

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/crossp.pro)


CT_LUMINANCE

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

 PURPOSE:
	Calculate the luminance of colors.

 CATEGORY:
	Color tables

 CALLING SEQUENCE:
	L = CT_LUMINANCE(R, G, B)

 INPUTS:
	R = Red color table.  If omitted, use the color values from
		either the COLORS common block, or the current color table.
	G = Green color table, optional parameter.
	B = Blue color table, optional parameter.

 KEYWORD PARAMETERS:
	BRIGHT=var - Stores the index of the brightest color in the current
		colortable into var.
	DARK=var - Stores the index of the darkest color in the current
		colortable into var.
	READ_TABLES = if set and parameters are not specified,
		read directly from color tables, using
		TVLCT, /GET.  Do not use the COLORS common block.

 OUTPUTS:
   This function returns an array containing the luminance values
	of the specified colors.  If the R,G,B parameters are not
	specified, or if R is of integer, byte or long type, the
	result is a longword array.  Otherwise, the result is a 
	floating point array.

 COMMON BLOCKS:
	COLORS:	Contains the current RGB color tables.

 MODIFICATION HISTORY:
	April 1, 1992, AB
		When splitting XPALETTE into widget clusters, this code
		became necessary in multiple places. This routine
		encapsulates it.
	May 15, 1994, DMS
		Process colors from parameters or current color table.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ct_luminance.pro)


CURVEFIT

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

 PURPOSE:
	Non-linear least squares fit to a function of an arbitrary 
	number of parameters.  The function may be any non-linear 
	function where the partial derivatives are known or can be 
	approximated.

 CATEGORY:
	E2 - Curve and Surface Fitting.

 CALLING SEQUENCE:
	Result = CURVEFIT(X, Y, W, A, SIGMAA, FUNCTION_NAME = name)

 INPUTS:
	X:  A row vector of independent variables.

	Y:  A row vector of dependent variable, the same length as x.

	W:  A row vector of weights, the same length as x and y.
		For no weighting,
		w(i) = 1.0.
		For instrumental weighting,
		w(i) = 1.0/y(i), etc.

	A:  A vector, with as many elements as the number of terms, that 
	    contains the initial estimate for each parameter.  If A is double-
	    precision, calculations are performed in double precision, 
	    otherwise they are performed in single precision.

 KEYWORDS:
	FUNCTION_NAME:  The name of the function (actually, a procedure) to 
	fit.  If omitted, "FUNCT" is used. The procedure must be written as
	described under RESTRICTIONS, below.

 OUTPUTS:
	Returns a vector of calculated values.
	A:  A vector of parameters containing fit.

 OPTIONAL OUTPUT PARAMETERS:
	Sigmaa:  A vector of standard deviations for the parameters in A.
	
 COMMON BLOCKS:
	NONE.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	The function to be fit must be defined and called FUNCT,
	unless the FUNCTION_NAME keyword is supplied.  This function,
	(actually written as a procedure) must accept values of
	X (the independent variable), and A (the fitted function's
	parameter values), and return F (the function's value at
	X), and PDER (a 2D array of partial derivatives).
	For an example, see FUNCT in the IDL User's Libaray.
	A call to FUNCT is entered as:
	FUNCT, X, A, F, PDER
 where:
	X = Vector of NPOINT independent variables, input.
	A = Vector of NTERMS function parameters, input.
	F = Vector of NPOINT values of function, y(i) = funct(x(i)), output.
	PDER = Array, (NPOINT, NTERMS), of partial derivatives of funct.
		PDER(I,J) = DErivative of function at ith point with
		respect to jth parameter.  Optional output parameter.
		PDER should not be calculated if the parameter is not
		supplied in call.

 PROCEDURE:
	Copied from "CURFIT", least squares fit to a non-linear
	function, pages 237-239, Bevington, Data Reduction and Error
	Analysis for the Physical Sciences.

	"This method is the Gradient-expansion algorithm which
	combines the best features of the gradient search with
	the method of linearizing the fitting function."

	Iterations are performed until the chi square changes by
	only 0.1% or until 20 iterations have been performed.

	The initial guess of the parameter values should be
	as close to the actual values as possible or the solution
	may not converge.

 EXAMPLE:
	pro gfunct, x, a, f, pder
	  f=a(0)*exp(a(1)*x)+a(2)
	  pder=findgen(10, 3)
	end

	pro fit_curve
	  x=float(indgen(10))
	  y=[12.0, 11.0,10.2,9.4,8.7,8.1,7.5,6.9,6.5,6.1]
	  w=1.0/y
	  a=[10.0,-0.1,2.0]
	  yfit=curvefit(x,y,w,a,sigmaa,function_name='gfunct')
	  print, yfit
	end

 MODIFICATION HISTORY:
	Written, DMS, RSI, September, 1982.
	Does not iterate if the first guess is good.  DMS, Oct, 1990.
	Added CALL_PROCEDURE to make the function's name a parameter.
		(Nov 1990)
	12/14/92 - modified to reflect the changes in the 1991
		   edition of Bevington (eq. II-27) (jiy-suggested by CreaSo)

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/curvefit.pro)


CV_COORD

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

 PURPOSE:
       Converts 2-D and 3-D coordinates between the RECTANGULAR, POLAR,
       CYLINDRICAL, and SPHERICAL coordinate systems.

 CATEGORY:
       Graphics

 CALLING SEQUENCE:
       Coord = CV_COORD()

 KEYWORD PARAMETERS:

       FROM_RECT:
                  A vector of the form [x, y] or [x, y, z], or a (2, n) or
                  (3, n) array containing rectangular coordinates to convert.

       FROM_POLAR:
                  A vector of the form [angle, radius], or a (2, n) array of
                  polar coordinates to convert.

       FROM_CYLIN:
                  A vector of the form [angle, radius, z], or a (3, n) array
                  of cylindrical coordinates to convert.

       FROM_SPHERE:
                  A vector of the form [longitude, latitude, radius], or a
                  (3, n) array of spherical coordinates to convert.

       TO_RECT:   If set, then rectangular coordinates are returned.

       TO_POLAR:  If set, then polar coordinates are returned.

       TO_CYLIN:  If set, then cylindrical coordinates are returned.

       TO_SPHERE: If set, then spherical coordinates are returned.

       DEGREES:   If set, then the input (and output) coordinates are in
                  degrees (where applicable). Otherwise, the angles are
                  in radians.

 OUTPUTS:
       This function returns the converted coordinate(s) based on which of
       the "TO_" keywords is used :

          TO_RECT   : If the input coordinates were polar, then a vector
                      of the form [x, y] or a (2, n) array is returned.
                      Otherwise, a vector of the form [x, y, z], or a
                      (3, n) array is returned.
          TO_POLAR  : A vector of the form [angle, radius], or a (2, n)
                      array is returned.
          TO_CYLIN  : A vector of the form [angle, radius, z], or a (3, n)
                      array is returned.
          TO_SPHERE : A vector of the form [longitude, latitude, radius],
                      or a (3, n) array is returned.

       If the value passed to the "FROM_" keyword is double precision, then
       all calculations are performed in double precision and the returned
       value is double precision. Otherwise, single precision is used.

       If none of the "FROM_" keywords are specified then 0 is returned.
       If none of the "TO_" keywords are specified then the input coordinates
       are returned.

 PROCEDURE:
       When converting from spherical to polar coordinates, the points
       are first projected along the z axis to the x-y plane to get 2-D
       rectangular coordinates. The 2-D rectangular coordinates are
       then converted to polar.

 EXAMPLE:
       ; Convert from spherical to cylindrical coordinates.

       sphere_coord = [[45.0, -60.0, 10.0], [0.0, 0.0, 0.0]]
       rect_coord = CV_COORD(From_Sphere=sphere_coord, /To_Cylin, /Degrees)

       ; Convert from rectangular to polar coordinates.

       rect_coord = [10.0, 10.0]
       polar_coord = CV_COORD(From_Rect=rect_coord, /To_Polar)

 MODIFICATION HISTORY:
       Written by:     Daniel Carr, Thu Mar 31 14:42:58 MST 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cv_coord.pro)


CW_ANIMATE

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

 PURPOSE:
	This widget displays an animated sequence of images using
	X-windows Pixmaps. This is a compound widget, based on the
	XINTERANIMATE procedure, with the following advantages:
		- It can be included in other applications.
		- Multiple copies can be run simultaneously.

	The speed and direction of the display can be adjusted using 
	the widget interface.

 CATEGORY:
	Image display, compound widgets.

 CALLING SEQUENCE:
	To initialize:
		widget = CW_ANIMATE(PARENT, SIZEX, SIZEY, NFRAMES)

	To load a single image:
		CW_ANIMATE_LOAD, WIDGET, IMAGE = IMAGE, FRAME = FRAME_INDEX

	To load a single image that is already displayed in an existing window:

		CW_ANIMATE_LOAD, WIDGET, FRAME = FRAME_INDEX, $
			WINDOW = [WINDOW_NUMBER [, X0, Y0, SX, SY]]

	(This technique is much faster than reading back from the window.)

	To display the animation after all the images have been loaded:

		CW_ANIMATE_RUN, WIDGET [, RATE] 

	To get a copy of the vector of Pixmaps being used by the widget.
	If this routine is called, the widget does not destroy the pixmaps
	when it is destroyed. The user can then provide them to a later
	call to CW_ANIMATE to re-use them while skipping the Pixmap creation
	and rendering step:

		CW_ANIMATE_GETP, widget, PIXMAPS

 INPUTS:
   	CW_ANIMATE:
		PARENT:	 The ID of the parent widget.
		SIZEX:	 The width of the displayed image.
		SIZEY:	 The height of the displayed image.
		NFRAMES: The number of frames in the animation sequence.

  	CW_ANIMATE_LOAD:
		WIDGET:	 The ID of the widget (as created with CW_ANIMATE)
			 into which the image should be loaded.

   	CW_ANIMATE_RUN:
		WIDGET:	 The ID of the widget (as created with CW_ANIMATE)
			 into which the image should be loaded.
		RATE:	 A value between 0 and 100 that represents the
			 speed of the animation as a percentage of the
			 maximum display rate. The fastest animation has
			 a value of 100 and the slowest  has a value of 0.
			 The default animation rate is 100.
               STOP:    If this keyword is set, the animation is stopped.
               NFRAMES: Specifies the number of frames to animate, must
                        <= the number specified in CW_ANIMATE().

 KEYWORD PARAMETERS:
   	CW_ANIMATE:
		PIXMAPS: This keyword provides the new widget with a vector
			 of pre-existing pixmap (off screen window) IDs.
			 This vector is usually obtained from a call to
			 CW_ANIMATE_GETP applied to a previous animation
			 widget.
		UVALUE:  A user supplied value to be stored in the widget's
			 user value field.

   	CW_ANIMATE_LOAD:
		CYCLE:   If set, cycle. Normally, frames are displayed
			 going either forward or backwards. If CYCLE is
			 set, reverse direction after the last frame in
			 either direction is displayed.
		FRAME: 	 The frame number to be loaded. This is a value
			 between 0 and NFRAMES. If not supplied, frame 0
		  	 is loaded.
		IMAGE:   The image to be loaded.
               NO_KILL: If set, make no kill button.
		ORDER:   Set this keyword to display images from the top
			 down instead of the default bottom up. This keyword
			 is only used when loading images with the IMAGE
			 keyword.
		TRACK:   If set, the frame slider tracks the current frame.
			 Default is not to track.
		WINDOW:  When this keyword is specified, an image is copied
			 from an existing window to the animation pixmap.
			 When using X windows, this technique is much faster
			 than reading from the display and then loading with
			 the IMAGE keyword.

			 The value of this parameter is either an IDL window
			 number (in which case the entire window is copied),
			 or a vector containing the window index and the
			 rectangular bounds of the area to be copied. For
			 example:
			 WINDOW = [Window_Number, X0, Y0, Sx, Sy]

      		XOFFSET: The horizontal offset, in pixels from the left of
			 the frame, of the image in the destination window.

      		YOFFSET: The vertical offset, in pixels from the bottom of
			 the frame, of the image in the destination window.

 OUTPUTS:
	No explicit outputs.

 SIDE EFFECTS:
	If the widget is realized before calls to CW_ANIMATE_LOAD, the frames
	are displayed as they are loaded. This provides the user with an
	indication of how things are progressing.

	When the widget is destroyed, it destroys the pixmaps used in the
	animation, unless they were previously obtained via CW_ANIMATE_GETP
       and the KILL_ANYWAY keyword was not set.

	The only event returned by this widget indicates that the user
	has pressed the DONE button. The parent application should use
	this as a signal to kill the animation widget via WIDGET_CONTROL.

 RESTRICTIONS:
	If more than one animation widget is running at a time, they
	will fight for resources and run slower.

 PROCEDURE:
	When initialized, this procedure creates pixmaps containing the
	frames of the animation sequence. Once the images are loaded,
	they are displayed by copying the images from the pixmap or buffer
	to the visible draw widget.

 EXAMPLE:
	Assume the following event handler procedure exists:
		PRO EHANDLER, EV
		  WIDGET_CONTROL, /DESTROY, EV.TOP
		end

	Enter the following commands to open the file ABNORM.DAT (a series
	of images of a human heart) and load the images it contains into
	an array H:

		OPENR, 1, FILEPATH('abnorm.dat', SUBDIR = 'images')
		H = BYTARR(64, 64, 16)
		READU, 1, H
		CLOSE, 1
		H = REBIN(H, 128, 128, 16)

	Create an instance of the animation widget at load the frames:

		base = widget_base()
		animate = CW_ANIMATE(base, 128, 128, 16)
		WIDGET_CONTROL, /REALIZE, base
		for i=0,15 do CW_ANIMATE_LOAD, animate, FRAME=i, IMAGE=H(*,*,I)

	Start the animation:

		CW_ANIMATE_RUN, animate
		XMANAGER, "CW_ANIMATE Demo", base, EVENT_HANDLER = "EHANDLER"

	Pressing the DONE button kills the application.

 MODIFICATION HISTORY:
	AB, June 1992		Heavily based on the XINTERANIMATE procedure.
	SR, September 1992	Fixed a problem when a paused animation's
				frame selection was moved and the resulting
				frame change ended up in another animation.
	SR, November  1992	Fixed a problem when a single paused animation
				would fail when the frame selection slider
				event tried to set do a bad drawing window.
	DMS/AB, March, 1993	Got rid of state caching. Got rid of
				XMANAGER background tasks in favor of new
				"WIDGET_CONTROL,timer=" feature.
	ACY, October 1993	Set RETAIN=2 for draw widget to prevent
				clipping by an overlapping window when
				loading frames.
       DMS, Dec, 1993          Added STOP and NFRAMES keywords to CW_ANIMATE_RUN.
                               Added KILL_ANYWAY keyword to CW_ANIMATE_GETP.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_animate.pro)


CW_ARCBALL

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

 PURPOSE:
	CW_ARCBALL is a compound widget for intuitively specifying
	three-dimensional orientations.

 CATEGORY:
	Widget, 3d graphics

 CALLING SEQUENCE:
	Widget_id = CW_ARCBALL(Parent)

 INPUTS:
       PARENT:	The ID of the parent widget.

 KEYWORD PARAMETERS:
	FRAME:	If set, draws a frame around the widget.
		The default is FRAME=0.
	LABEL:	A string containing the widget's label.
	VALUE:	An initial value for the 3 x 3 rotation matrix. This
		must be a valid rotation matrix (no translation or
		perspective) where: transpose(value) = inverse(value).
		This can be the upper-left corner of !P.T after executing
		the command T3D, /RESET, ROTATE=[x,y,z]. The default
		is the identity matrix.
	UVALUE:	The initial user value for the widget.
	SIZE:	The size of the square drawable area containing the arcball,
		in pixels.  Default size = 192.	
	UPDATE:	If set, the widget will send an event each time
		the mouse button is released after a drag operation.
		Otherwise, an event is only sent when the Update
		button is pressed.
	COLORS:	A 6-element array containing the color indices to be used.
		  Colors(0) = View axis color
		  Colors(1) = object axis color, 
		  Colors(2) = XZ plane +Y side (body top) color, 
		  Colors(3) = YZ plane (fin) color,
		  Colors(4) = XZ plane -Y side (body bottom),
		  Colors(5) = background color.
		Default value = [ 1,7,2,3,7,0], which yields good colors
		with the TEK_COLOR table.
		  (white, yellow, red, green, yellow, black).
	RETAIN: Retain parameter for window, 0 = none, 1 = server's default,
		2 = use backing store.  default = 1.

 OUTPUTS:
	The ID of the widget is returned.

 SIDE EFFECTS:
	Events are generated as described above. The current graphics window
	is changed.

 RESTRICTIONS:
	This widget can generate any rotation about any axis.
	Not all rotations are compatible with the IDL SURFACE
	procedure, which is restricted to rotations that project the
	object Z axis parallel to the view Y axis.

 PROCEDURE:
	This widget is based on "ARCBALL: A User Interface for
	Specifying Three-Dimensional Orientation Using a Mouse", by Ken
	Shoemake, Computer Graphics Laboratory, University of Pennsylvania,
	Philadelphia, PA 19104. "In Arcball, human factors and mathematical
	fundamentals come together exceptionally well."

	The user drags a simulated track-ball with the mouse to interactively
	obtain arbitrary rotations. Sequences of rotations may be cascaded.
	The rotations may be unconstrained (about any axis), constrained to
	the view X, Y, or Z axes, or to the object's X, Y, or Z axis.

	Use the call:
		WIDGET_CONTROL, id, /SET_VALUE
	to draw the arcball after the widget is initially realized.
	Also, the SET_VALUE entry will set the widget's value to the
	given 3x3 rotation matrix and redraw the widget.

	The WIDGET_CONTROL, id, GET_VALUE=v
	call returns the current 3x3 rotation matrix.
	
 EXAMPLE:
	See the procedure ARCBALL_TEST, contained in this file.
	To test CW_ARCBALL:
	.RUN cw_arcball
	ARCBALL_TEST

 MODIFICATION HISTORY:
	DMS, RSI, September, 1993.  Written
	ACY, RSI, January, 1994.  Correct test on initial value.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_arcball.pro)


CW_BGROUP

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

 PURPOSE:
	CW_BGROUP 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_BGROUP 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:
	Compound widgets.

 CALLING SEQUENCE:
		Widget = CW_BGROUP(Parent, Names)

	To get or set the value of a CW_BGROUP, use the GET_VALUE and
	SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP
	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.

 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.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_bgroup.pro)


CW_BSELECTOR

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

 PURPOSE:
	CW_BSELECTOR is a compound widget that appears as a pull-down
	menu whose label shows the widget's current value. When the button
	is pressed, the menu appears and the newly selected value becomes
	the new title of the pull-down menu.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
		widget = CW_BSELECTOR(Parent, Names)

	To get or set the value of a CW_BSELECTOR, use the GET_VALUE and
	SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BSELECTOR
	is the index of the selected item.

 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:
	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.
	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).
	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.
	RETURN_UVALUE:	An array of user values to be associated with
			each button. Selecting the button sets the uvalue
			of the CW_BSELECTOR to the button's uvalue and
			returns the uvalue in the value field of the event
			structure.  If this keyword isn't specified, the
			CW_BSELECTOR's uvalue remains unchanged.
	SET_VALUE:	The initial value of the buttons. This keyword is 
			set to the index of the Names array element desired.
			So if it is desired that the initial value be the 
			second element of the Names array, SET_VALUE would
			be set equal to 1. This is equivalent to the later 
			statement:

			WIDGET_CONTROL, widget, set_value=value

	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 created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures with the following definition:

		event = { ID:0L, TOP:0L, HANDLER:0L, INDEX:0, VALUE:0 }

	The INDEX field is the index (0 based) of the menu choice. 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:
	1 April 1993, DMS,  Adapted from CW_BGROUP.
	22 Dec. 1993, KDB,  Corrected documentation for keyword SET_VALUE.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_bselector.pro)


CW_CLR_INDEX

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

 PURPOSE:
	CW_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:
	Compound 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 = !D.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 cw_clr_index

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_clr_index.pro)


CW_COLORSEL

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

 PURPOSE:
	CW_COLORSEL is a compound widget that displays all the colors
	in the current colormap and allows the user to select the color
	indices via the mouse or with sliders.

 CATEGORY:
	Compund widgets.

 CALLING SEQUENCE:
 	widget = CW_COLORSEL(Parent)

 INPUTS:
	Parent:	 The ID of the parent widget.

 KEYWORD PARAMETERS:
	FRAME:	 If set, a frame is drawn around the widget.
	UVALUE:	 The user value for the widget.
	XOFFSET: The X offset position
	YOFFSET: The Y offset position

 OUTPUTS:
	The ID of the created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures containing a field named
	VALUE, which contains the colormap index selected by the user.

 PROCEDURE:
	The COLORSEL widget displays all the colors in the current
	colormap in a 16x16 (320x320 pixels) grid. To select a color
	index, the user moves the mouse pointer over the desired
	color square and presses any mouse button. Alternatively, the
	color index can be selected by moving one of the three sliders
	provided around the grid.

	WIDGET_CONTROL, SET_VALUE=index can be used to set the current
		color index.

	WIDGET_CONTROL, SET_VALUE=-1 informs the widget to initialize
		itself and redraw. It should be called when any of the
		following happen:
			- The widget needs redrawing.
			- The brightest or darkest color has changed. 

	WIDGET_CONTROL, GET_VALUE=var can be used to retrieve the
		current color index.

 MODIFICATION HISTORY:
	March 30, 1992, AB
		Removed the relevant code from XPALETTE.PRO and modified
		it to create this reusable widget cluster.
	September 4, 1992, SR
		Fixed a bug where the value of the xslider was calculated
		as negative and WIDGET_CONTROL, SET_VALUE failed.
	7 April 1993, AB, Removed state caching.
	October 20, 1993, KDB 
		Changed return value in function CSEL_GET_VALUE
		from state.cur_idx to ret
	23 May 1994, AB
		Added NOTIFY_REALIZE routine to eliminate the need
		to call "WIDGET_CONTROL, SET_VALUE=-1" when the widget
		is realized.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_colorsel.pro)


CW_DEFROI

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

 PURPOSE:
   Widget to define a region of interest within a widget drawable. 
 CATEGORY:
   Regions of interest, graphics.
 CALLING SEQUENCE:
   Result = CW_DEFROI(draw)
 INPUTS:
   Draw = id of drawable to draw the region.
 KEYWORD PARAMETERS:
   IMAGE_SIZE = the size of the underlying array, expressed
       as a two element vector: [columns, rows].  Default =
       drawable size / zoom.
   OFFSET = offset of lower left corner of image within the
       drawable.  Default = [0,0].
   ORDER = if set, return inverted subscripts, as if the array
       were output from top to bottom.
   RESTORE = Set to restore the drawable to its previous appearance
       on exit.  Otherwise, the regions remain on the drawable.
   ZOOM = if the image array was expanded (via REBIN for example)
       specify this two element vector containing the expansion
       factor in X and Y.  Default = [1,1].  Must be integer.
 OUTPUTS:
      Result = subscripts of points within the region[s] defined.
       If no region was defined, a scalar -1 is returned.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       The regions are drawn within the drawable.  Set the RESTORE
       keyword to undo the damage.  
 RESTRICTIONS:
   This is a MODAL widget.  No other widget applications will be
   responsive while this widget is in use.

 PROCEDURE:
   Complicated.
 EXAMPLE:
   To obtain the average of the counts of a region within a drawable:
   Assume A = the array of interest, n columns, m rows, and that
   it is displayed in drawable D, at offset X=20, Y=100, and zoomed
   with a factor of 2:
       TV, REBIN(A, M*2, N*2), 20, 100     ;Display the image
       q = CW_DEFROI(D, ZOOM=[2,2], OFFSET=[20,100], IMAGE_SIZE=[m,n])
       if q(0) ne -1 then print,'Average = ', total(a(q))/n_elements(q)
       
 MODIFICATION HISTORY:
   DMS, RSI, December, 1993.  Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_defroi.pro)


CW_DICE

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

 PURPOSE:
	CW_DICE is a compound widget that implements a single die.
	This widget uses a button with a bitmap label.

	The primary purpose of this compound widget is to serve as
	a full example of a realistic compound widget for the IDL
	User's Guide.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	Widget = CW_DICE(Parent)

 INPUTS:
       Parent:	  The ID of the parent widget.

 KEYWORD PARAMETERS:
	TUMBLE_CNT: The widget simulates the tumbling of a dice by
		changing the bitmap on the dice several times before
		settling down to a final value. The number of "tumbles"
		is specified by the TUMBLE_CNT keyword. The default is 10.
	TUMBLE_PERIOD: The amount of time in seconds between each tumble
		of the dice. The default is .05 seconds.
	UVALUE:	  The user value for the widget.

 OUTPUTS:
       The ID of the created widget is returned.

 COMMON BLOCKS
	CW_DICE_BLK: Used to store dice faces, and the current
		random number generator seed for the CW_DICE class.

 SIDE EFFECTS:
	This widget generates event structures containing an extra
	field named VALUE giving the final value resulting from a dice roll.
	Such events are only sent when the user presses the dice button.

 PROCEDURE:
	The CW_DICE widget consists of a single pushbutton that
	displays its current dice value as a bitmask. If the user presses
	the button, it tumbles for a moment and then the new value is
	displayed and an event is issued.

	The current value of the dice is available via the
	WIDGET_CONTROL,GET_VALUE command.

	The current value can be set by issuing the
	WIDGET_CONTROL, SET_VALUE command. If the requested value is
	outside the range [1,6], then the dice tumbles to a new value
	as if the user had pressed the button, but no event is issued.

 MODIFICATION HISTORY:
	24 October 1993, AB, RSI

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_dice.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.

 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.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_field.pro)


CW_FSLIDER

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

 PURPOSE:
	The standard slider provided by the WIDGET_SLIDER() function is
	integer only. This compound widget provides a floating point
	slider.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	widget = CW_FSLIDER(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.
	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.

 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.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_fslider.pro)


CW_ORIENT

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

 PURPOSE:
	This compound widget provides a means to interactively adjust the
	three dimensional drawing transformation (!P.T). The compound
	widget only returns events when !P.T has been altered.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	widget = CW_ORIENT(Parent)

 INPUTS:
       Parent:	The ID of the parent widget.

 KEYWORD PARAMETERS:
	AX:	The initial rotation in the X direction. If not set, the 
		default is 30 degrees.
	AZ:	The initial rotation in the Z direction. If not set, the 
		default is 30 degrees.
	FRAME:	If set, a frame will be drawn around the widget. The
		default is FRAME=0.
	TITLE:	The title of the widget. (Default is no title.)
	UVALUE:	The user value of the widget.
	XSIZE:	Determines the width of the widget. The default is 100.
	YSIZE:	Determines the height of the widget. The default is 100.

 OUTPUTS:
       The ID of the created widget is returned.

 COMMON BLOCKS:
	CW_OR_PRIVATE: Private to this module.

 SIDE EFFECTS:
	This widget generates event structures each time a modification
	to the orientation is made.  This widget also resets !P.T to 
	reflect the changed orientation.

 MODIFICATION HISTORY:
	August 7, 1992, SMR
       7 April 1993, AB, Removed state caching.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_orient.pro)


CW_PDMENU

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

 PURPOSE:
	CW_PDMENU 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_PDMENU
	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:
	Compound widgets.

 CALLING SEQUENCE:
	widget = CW_PDMENU(Parent, Desc)

 INPUTS:
       Parent:	The ID of the parent widget.
	Desc:	An array of structures, each of which has the following
		definition:

			{ CW_PDMENU_S, flags:0, name:'' }

		The name tag gives the name of button. The flags
		field is a bitmask that controls how the button is
		interpreted:

		    Bit	   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.

 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.
	IDS:		  A named variable into which the button IDs will
			  be stored as a longword vector.
	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_PDMENU_S is defined
		junk = { CW_PDMENU_S, flags:0, name:'' }

		; The description
		desc = [ { CW_PDMENU_S, 1, 'Colors' }, $
			     { CW_PDMENU_S, 0, 'Red' }, $
			     { CW_PDMENU_S, 0, 'Green' }, $
			     { CW_PDMENU_S, 1, 'Blue' }, $
			         { CW_PDMENU_S, 0, 'Light' }, $
			         { CW_PDMENU_S, 0, 'Medium' }, $
			         { CW_PDMENU_S, 0, 'Dark' }, $
			         { CW_PDMENU_S, 0, 'Navy' }, $
			         { CW_PDMENU_S, 2, 'Royal' }, $
			       { CW_PDMENU_S, 0, 'Cyan' }, $
			       { CW_PDMENU_S, 2, 'Magenta' }, $
			 { CW_PDMENU_S, 2, 'Quit' } ]

	The following small program can be used with the above description
	to create the specified menu:


		base = widget_base()
		menu = cw_pdmenu(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

 MODIFICATION HISTORY:
	18 June 1992, AB

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_pdmenu.pro)


CW_RGBSLIDER

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

 PURPOSE:
	CW_RGBSLIDER is a compund widget that provides three sliders for
	adjusting color values. The RGB, CMY, HSV, and HLS color systems
	can all be used. No matter which color system is in use,
	the resulting color is always supplied in RGB, which is the
	base system for IDL.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	Widget = CW_RGBSLIDER(Parent)

 INPUTS:
       Parent:	  The ID of the parent widget.

 KEYWORD PARAMETERS:
	CMY:	  If set, the initial color system used is CMY.
	DRAG:	  Set to zero if events should only be generated when
		  the mouse button is released. If this keyword is set,
		  events will be generated continuously when the sliders
		  are adjusted. Note: On slow systems, /DRAG performance
		  can be inadequate. The default is DRAG=0.
	FRAME:	  If set, a frame will be drawn around the widget. The
		  default is FRAME=0 (no frame drawn).
	HSV:	  If set, the initial color system used is HSV.
	HLS:	  If set, the initial color system used is HLS.
	LENGTH:	  The length of the sliders. The default = 256.
	RGB:	  If set, the initial color system used is RGB.
		  This is the default.
	UVALUE:	  The user value for the widget.
	VERTICAL: If set, the sliders will be oriented vertically.
		  The default is VERTICAL=0 (horizontal sliders).
	COLOR_INDEX: If set, display a small rectangle with the
		  selected color, using the given index.
		  The color is updated as the values are changed.

 OUTPUTS:
       The ID of the created widget is returned.

 SIDE EFFECTS:
	This widget generates event structures containing a three fields
	named 'R', 'G', and 'B' containing the Red, Green, and Blue
	components of the selected color.

 PROCEDURE:
	The CW_RGBSLIDER widget has the following controls:

	Color System Selection: A pulldown menu which allows the user
		to change between the supported color systems.

	Color adjustment sliders: Allow the user to select a new color
		value. 

	By adjusting these controls, the user selects color values which
	are reported via the widget event mechanism.

 MODIFICATION HISTORY:
	April 1, 1992, AB
		Based on the RGB code from XPALETTE.PRO, but extended to
		support color systems other than RGB.
       7 April 1993, AB, Removed state caching.
	10 May 1994, DMS, Added Color_index param to display color.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_rgbslider.pro)


CW_ZOOM

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

 PURPOSE:
	This compound widget displays two images: an original image
	in one window and a portion of the original image in another.
	The user may select the center of the zoom region, the zoom scale,
	the interpolation style, and the method of indicating the zoom center.

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	Widget = CW_ZOOM(Parent)

 INPUTS:
       Parent:	 The ID of the parent widget.

 KEYWORD PARAMETERS:
	FRAME:	 If set, a frame will be drawn around the widget. The
		 default is FRAME=0 (no frame).
	MAX:	 The maximum zoom scale, which must be greater than
		 or equal to 1. The default = 20.
	MIN:	 The minimum zoom scale, which must be greater than
		 or equal to 1. The default = 1.
	RETAIN:	 Controls the setting for backing store for both windows.
		 If backing store is provided, a window which was obscured
		 will be redrawn when it becomes exposed. Set RETAIN=0 for
		 no backing store. Set RETAIN=1 to "request backing store
		 from server" (this is the default). Set RETAIN=2 for IDL
		 to provide backing store.
	SAMPLE:	 Set to zero for bilinear interpolation, or to a non-zero
		 value for nearest neighbor interpolation. Bilinear
		 interpolation gives higher quality results, but requires
		 more time. The default is SAMPLE=0 (bilinear interpolation).
	SCALE:	 The initial integer scale factor to use for the zoomed image.
		 The default is SCALE=4. The scale must be greater than or
		 equal to 1.
	TRACK:	 Set to zero if the zoom window should be updated only when
		 the mouse button is pressed. Set to a non-zero value if the
		 zoom window should be updated continuously as the cursor
		 is moved across the original image. Note: On slow systems,
		 /TRACK performance can be inadequate. The default is TRACK=0.
	UVALUE:	 The user value for the widget.
	XSIZE:	 The width of the window (in pixels) for the original image.
		 The default is 500.
	YSIZE:	 The height of the window (in pixels) for the original image.
		 The default is 500.
	X_SCROLL_SIZE: The width of the visible part of the original image.
		       This may be smaller than the actual width controlled
		       by the XSIZE keyword. The default is 0, for no
		       scroll bar.
	Y_SCROLL_SIZE: The height of the visible part of the original image.
		       This may be smaller than the actual height controlled
		       by the YSIZE keyword. The default is 0, for no
		       scroll bar.
	X_ZSIZE: The width of the window for the zoomed image.
		 The default is 250.
	Y_ZSIZE: The height of the window for the zoomed image.
		 The default is 250.

 OUTPUTS:
       The ID of the created widget is returned.

 SIDE EFFECTS:
	When the "Report Zoom to Parent" button is pressed, this widget
	will generate an event structure containing several data fields.
		x_zsize, y_zsize:	size of the zoomed image
		x0, y0:			lower left corner in original image
		x1, y1:			upper right corner in original image
	This event is a report to the parent that allows retrieval of the
	zoomed image using WIDGET_CONTROL.

 PROCEDURE:
	WIDGET_CONTROL, id, SET_VALUE=value can be used to change the
		original, unzoomed image displayed by the widget.
		The value may not be set until the widget has been
		realized.

	WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current
		zoomed image displayed by the widget.

 MODIFICATION HISTORY:
	June 30, 1992, ACY
       7 April 1993, AB, Removed state caching.
	13 June, 1994, ACY, Save window and set to zoom prior to erase
			    Add byte conversion in set_value

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_zoom.pro)


DEFROI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:			DEFROI
 PURPOSE:	Define an irregular region of interest of an image
		using the image display system and the cursor/mouse.
 CATEGORY:	Image processing.
 CALLING SEQUENCE:
	R = Defroi(Sx, Sy, X0, Y0)
 INPUTS:
	Sx, Sy = Size of image, in pixels.
 Optional Inputs:
	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.
 OUTPUTS:
	Function result = vector of subscripts of pixels inside the region.
	Side effect: The lowest bit in which the write mask is enabled
	is changed.
 OPTIONAL OUTPUTS:
	Xverts, Yverts = Optional output parameters which will contain
		the vertices enclosing the region.
 KEYWORD Parameters:
	NOREGION = Setting NOREGION inhibits the return of the
		pixel subscripts.
	NOFILL = if set, inhibits filling of irregular region on completion.
	RESTORE = if set, original image on display is restored to its
		original state on completion. 
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	Display is changed if RESTORE is not set.
 RESTRICTIONS:
	Only works for interactive, pixel oriented devices with a
		cursor and an exclusive or writing mode.
	A region may have at most 1000 vertices.  If this is not enough
		edit the line setting MAXPNTS.
 PROCEDURE:
	The exclusive or drawing mode is used to allow drawing and
	erasing objects over the original object.

	The operator marks the vertices of the region, either by
		dragging the mouse with the left button depressed or by
		marking vertices of an irregular polygon 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.
	When the operator is finished, the region is filled using 
		the polyfill function, and the polyfillv function is used
		to compute the subscripts within the region.

 MODIFICATION HISTORY:  DMS, March, 1987.
 	Revised for SunView, DMS, Nov, 1987.
       Added additional argument checking, SNG April, 1991
	Modified for devices without write masks: DMS, March, 1992.
		Uses exclusive or mode rather than write masks.
	

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/defroi.pro)


DEMO_MODE

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

 PURPOSE:
	Returns true if IDL is in Demo Mode.

 CALLING SEQUENCE:
	Result = DEMO_MODE()

 OUTPUTS:
	Returns 1 if IDL is in Demo Mode and 0 otherwise.

 SIDE EFFECTS:
	Does a FLUSH, -1.

 PROCEDURE:
	Do a FLUSH, -1 and trap the error message.

 MODIFICATION HISTORY:
	Written by SMR, Research Systems, Inc.	Feb. 1991
	KDB Oct,1993: The error string had an extra ' ' in it and 
		      the function would always return 0. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/demo_mode.pro)


DERIV

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

 PURPOSE:
	Perform numerical differentiation using 3-point, Lagrangian 
	interpolation.

 CATEGORY:
	Numerical analysis.

 CALLING SEQUENCE:
	Dy = Deriv(Y)	 	;Dy(i)/di, point spacing = 1.
	Dy = Deriv(X, Y)	;Dy/Dx, unequal point spacing.

 INPUTS:
	Y:  Variable to be differentiated.
	X:  Variable to differentiate with respect to.  If omitted, unit 
	    spacing for Y (i.e., X(i) = i) is assumed.

 OPTIONAL INPUT PARAMETERS:
	As above.

 OUTPUTS:
	Returns the derivative.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	See Hildebrand, Introduction to Numerical Analysis, Mc Graw
	Hill, 1956.  Page 82.

 MODIFICATION HISTORY:
	Written, DMS, Aug, 1984.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/deriv.pro)


DERIVSIG

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

 PURPOSE:
	This function computes the standard deviation of a derivative
       as found by the DERIV function, using the input variables of
	DERIV and the standard deviations of those input variables.

 CATEGORY:
	Numerical analysis.

 CALLING SEQUENCE:
	sigDy = Derivsig(sigy)		;sigma(Dy(i)/di), point spacing = 1.
	sigDy = Derivsig(X,Y,sigx,sigy) ;sigma(Dy/Dx), unequal point spacing.

 INPUTS:
	Y:	The variable to be differentiated. Omit if X is omitted.
	X:	The Variable to differentiate with respect to. If omitted,
		unit spacing is assumed for Y, i.e. X(i) = i.
       sigy:	The standard deviation of Y. (Vector if used alone in
		call, vector or constant if used with other parameters)
       sigx:	The standard deviation of X (either vector or constant).
		Use "0.0" if the abscissa is exact; omit if X is omitted.

 OPTIONAL INPUT PARAMETERS:
	As above.

 OUTPUTS:
	This function returns the standard deviation of the derivative.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	See Bevington, "Data Analysis and Reduction for the Physical
           Sciences," McGraw-Hill (1969), Chap 4.

 MODIFICATION HISTORY:
       Written by Richard Bonomo at the University of Wisconsin - Madison
       department of Electrical and Computer Engineering, July, 1991.
	"DERIV" written by DMS, Aug, 1984.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/derivsig.pro)


DETERM

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

 PURPOSE:
       This function computes the determinant of an n by n array.

 CATEGORY:
       Linear Algebra.

 CALLING SEQUENCE:
       Result = DETERM(A)

 INPUTS:
       A:      An N by N array of type: float, or double.

 KEYWORD PARAMETERS:
       DOUBLE: If set to a non-zero value, computations are done in
               double precision arithmetic.

       ZERO:   Use this keyword to set the value of floating-point
               zero. A floating-point zero on the main diagonal of
               a triangular matrix results in a zero determinant.
               For single-precision inputs, the default value is 
               1.0e-6. For double-precision inputs, the default value 
               is 1.0e-12.

 EXAMPLE:
       Define an array (a).
         a = [[ 2.0,  1.0,  1.0], $
              [ 4.0, -6.0,  0.0], $
              [-2.0,  7.0,  2.0]]
       Compute the determinant.
         result = determ(a)
       Note:
            See CRAMER.PRO, in the same directory as this file, for
            an application of the determinant function.

 PROCEDURE:
       LU decomposition is used to represent the input array in
       triangular form. The determinant is computed as the product
       of diagonal elements of the triangular form. Row interchanges
       are tracked during the LU decomposition to ensure the correct   
       sign, + or - .

 REFERENCE:
       ADVANCED ENGINEERING MATHEMATICS (seventh edition)
       Erwin Kreyszig
       ISBN 0-471-55380-8

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, February 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/determ.pro)


DIGITAL_FILTER

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

 PURPOSE:
	Compute the coefficients of a non-recursive, digital
	filter.  Highpass, lowpass, bandpass and bandstop
	filters may be constructed with this function.

 CATEGORY:
	Signal processing.

 CALLING SEQUENCE:
	Coeff = DIGITAL_FILTER(Flow, Fhigh, A, Nterms)  ;To get coefficients.

	Followed by:

	Yout  = CONVOL(Yin, Coeff)	;To apply the filter.

 INPUTS:
	Flow:	The lower frequency of the filter as a fraction of the Nyquist
		frequency.

	Fhigh:	The upper frequency of the filter as a fraction of the Nyquist
		frequency.

	A:	The size of Gibbs phenomenon wiggles in -db.  50 is a good 
		choice.

	Nterms:	The number of terms in the filter formula.  The order
		of filter.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		The following conditions are necessary for various types of
		filters:

		No Filtering:	Flow = 0, Fhigh = 1.
		Low Pass:	Flow = 0, 0 < Fhigh < 1.
		High Pass:	0 < Flow < 1, Fhigh =1.
		Band Pass:	0 < Flow < Fhigh < 1.
		Band Stop:	0 < Fhigh < Flow < 1.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

 OPTIONAL INPUT PARAMETERS:
	None.

 OUTPUTS:
	Returns a vector of coefficients with (2*nterms + 1) elements.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	This function returns the coefficients of a non-recursive,
	digital filter for evenly spaced data points.  Frequencies are
	expressed in terms of the Nyquist frequency, 1/2T, where T
	is the time between data samples.

 MODIFICATION HISTORY:
	DMS, April, 1985.
	Adapted from:
	"Digital Filters", Robert Walraven, 
	Proceedings of the Digital Equipment User's Society, Fall, 1984.
	Department of Applied Science, 
	University of California, Davis, CA 95616.
	

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/digital_filter.pro)


DISP_TXT

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

 PURPOSE:
	This procedure displays text strings in the current IDL window.
       The text strings may contain control sequences which define
       what font, color, and position to use when drawing the text.

 CATEGORY:
	Text Display.

 CALLING SEQUENCE:
       DISP_TXT, Strings, Fonts, Yspace

 INPUTS:
       Strings:    A string or string array containing the text to
                   display in the current IDL window.   The string(s)
                   may contain control sequences which specify what
                   font, color, and position to use when drawing the text.
                   Control sequences are enclosed in back quotes.
                   Control sequences consist of one or more commands
                   separated by commas.   Commands start with one of
                   the following upper or lower case characters :

                   F  -  Specify a new font to use
                   C  -  Specify a new color to use
                   J  -  Specify a new justification (alignment)
                   X  -  Specify a new absolute X position (in pixels)
                   Y  -  Specify a new absolute Y position (in pixels)
                   H  -  Shift horizontally a relative amount (in pixels)
                   V  -  Shift vertically a relative amount (in pixels)

                   Here is an example of a text string with an imbedded
                   control sequence to change to font #2, color #255,
                   justification 0.5 (center), and absolute Y position 100 :

                      ABCDEF`F2,C255,J0.5,Y100`GHIJKL

                   The actual fonts to use are specified by the "Fonts"
                   parameter (see below).

                   Care must be taken when specifying any justification
                   other than 0.0 (left justify) or the strings may overlap.
                   A good rule of thumb is if center justification (0.5) or
                   right justification (1.0) is desired, then put the
                   control commands before or after a block of text, but
                   not in the middle of it.

                   One line of text is output for each non-null element
                   in "Strings".   If an element in "Strings" is null
                   or contains only a control seqence, then no new line
                   is output.   To output a blank line, use a space
                   character on a line by itself.
                   Data Type : String or Strarr.

       Fonts:      A string or string array containing the font(s) to
                   use.   When a command of the form "Fn" is encountered
                   while processing the text, the nth element of "Fonts"
                   is passed to the "Device, Font=" command.   Using the
                   above example, when the "F2" command is processed,
                   the font is set by automatically issuing the command :

                      Device, Font=Fonts(2)

                   IF the specified font number is less than zero, or
                   greater than or equal to the number of elements in
                   "Fonts", then Fonts(0) is used.

                   Fonts may be specified using wildcards, and may have
                   an optional field that specifies what style of vector
                   drawn font to use if the specified hardware font does
                   not exist.   The optional field is separated from the
                   actual font string by a "|" character.   (The optional
                   field is always stripped off before passing the string
                   to the "Device, Font=" command.)   An example of a
                   "Fonts" array is as follows :

                      *helvetica-bold*--12*|10!5
                      vector|20!3
                      *helvetica-bold*--24*

                   This example array specifies the following :

                   0. Use 12 point helvetica bold hardware font for font F0.
                      If no matching font exists on the current system
                      then use vector font style #5 (duplex roman), and size
                      the font so that it is 10 pixels high.   For a list of
                      the IDL vector drawn fonts, see chapter 12 in the IDL
                      User's Guide.
                   1. Since there is no such thing as a hardware font called
                      "vector", then use a software (vector drawn) font for
                      font F1.   Draw this font 20 pixels high and use font
                      style #3 (simplex roman).
                   2. Use 24 point helvetica bold hardware font for font F2.
                      If no matching font exists on the current system
                      then use the most recently specified vector drawn font
                      (since there is no optional field specified for this
                      font).
                   
                   On some Unix systems, it is possible to list the available
                   hardware fonts by using the Unix command "xlsfonts".

                   When running under Windows or MacOS, fonts are specified
                   in a slightly different manner.   For example, a Helvetica
                   italic 24-point font could be specified by the font
                   definition :

                      HELVETICA*ITALIC*24

                   For best results, use a scalable font.

                   See "The Windows Device Driver" in the "IDL For Windows"
                   document.

                   Data Type : String or Strarr.

       Yspace:     The spacing, in pixels, between the baseline of each
                   line of text.   IF "Yspace" is negative then the baseline
                   of each line of text will be Yspace pixels ABOVE the
                   previous line.   Otherwise, each line is placed Yspace
                   pixels BELOW the previous line.
                   Data Type : Int or Long.

 KEYWORD PARAMETERS:
       Xstart:     The X location (in pixels) at which to start drawing
                   the text.
                   The default is to start near the left edge of the current
                   window (unless the default justification is Center or
                   Right, in which case the default starting X location is
                   set accordingly).
                   Data Type : Int or Long.
       Ystart:     The Y location (in pixels) at which to start drawing
                   the text.
                   The default is to start near the top edge of the current
                   window.   (Unless "Yspace" is negative, in which case the
                   default is to start near the bottom edge of the current
                   window).
                   Data Type : Int or Long.
       Def_Font:   The font to use when no font has been specified in
                   "Strings".   "Def_Font" is specified just like the fonts
                   in "Fonts" (except that no optional field should be used).
                   If no font is specified in "Strings" and "Def_Font" is
                   not supplied, then the default is to use the default
                   hardware font.   If no hardware font is available then
                   use a vector drawn font as the default.
                   Data Type : String.

       Def_Size:   The default height (in pixels) of the vector drawn font.
                   The default is !D.Y_CH_SIZE.
                   Data Type : Int or Long.

       Def_Style:  The default style (such as !3, !4, etc.) of the vector
                   drawn font.
                   The default is '!3' (simplex roman).
                   Data type : String.

       Def_Color:  The color index to use when no color is specified in
                   "Strings".
                   The default is (!D.N_COLORS - 1L).
                   Data Type : Byte, Int or Long.

       Colors:     Normally, color indices can be specified directly in
                   "Strings".   If "Colors" is specified, however, then
                   "Colors" acts as a translation table to modify the
                   actual color index of the text.   For example, when the
                   following string is drawn :

                      `C13`ABCDEF

                   It will be drawn in color index 13 if "Colors" is NOT
                   specified.   If "Colors" IS specified then the string
                   "ABCDEF" will be drawn in color index Colors(13).

                   If "Colors" is specified, and the color number is
                   less than zero then Colors(0) is used.   IF the color
                   number is greater than or equal to the number of
                   elements in "Colors" then Colors(n-1) is used
                   (where "n" is the number of elements in "Colors).

       W_Erase:    The color index to erase the window with before drawing
                   the text.   If "W_Erase" is less than zero then the window
                   will NOT be erased first.
                   The default is to NOT erase the window first.
                   Data Type : Int or Long.

 RESTRICTIONS:
	An IDL window must exist before calling "DISP_TXT" or an error
       will result.   All text is drawn in Device coordinates and no 3-D
       transformations have any effect.

 EXAMPLE:
       Display a text screen using "DISP_TXT"

       ; Create some strings.
         strings = STRARR(4)
         strings(0) = '0000000000000'
         strings(1) = '`F1,C200`'
         strings(2) = 'ABC`X200,V-100`DEF`F0`GHIJKL`C155`abc'
         strings(3) = '`C255,F1`ABCDEF`F2`GHIJKL'

       ; Specify the fonts.
         fonts = STRARR(3)
         fonts(0) = '*helvetica-bold*--24*|20!5'
         fonts(1) = 'vector|15!6'
         fonts(2) = '8x13|11!3'

       ; Create a window and display the text.
         Window, 0
         DISP_TXT, strings, fonts, 28, Def_Font='12x24'

 MODIFICATION HISTORY:
       Written by:     Daniel Carr. Tue Sep 29 11:52:56 MDT 1992
       Added support for 'windows' and 'MacOS'
                       Daniel Carr. Mon Nov 23 09:44:33 MST 1992
       Modified Yspace for 'windows' and 'MacOS'
                       Daniel Carr. Thu Dec 17 17:02:40 MST 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/disp_txt.pro)


DISSOLVE

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

 PURPOSE:
	A digital "dissolve" effect for images.  Copies the pixels (arranged
	into square tiles) from the image to the display in pseudo-random
	order.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	DISSOLVE, Image

 INPUTS:
	Image:	The image to be displayed.  It is assumed that the image is
		already scaled.  Byte-valued images display most rapidly.

 OPTIONAL INPUT PARAMETERS:
	None.

 KEYWORD PARAMETERS:
	SIZ:	Size of square tile.  The default is 32 x 32 pixels.

	X0, Y0: The X and Y offsets of the lower-left corner of the image on 
		screen.  The defaults are X0 = 0 and Y0 = 0.

	DELAY:	The wait between displaying tiles.  The default is 0.01 secs.

	ORDER:	The Image display order:  	0 = default = bottom up.
						1 = top-down.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The image is written to the screen.

 RESTRICTIONS:
	None, but the effect is dependent upon the speed of the
	machine/display.

 PROCEDURE:
	An integer pseudo-random number generator is used to decide
	which tile to display.  The algorithm is taken from "Graphics Gems",
	Andrew Glassner, ed., Academic Press, 1990, Page 221.

 MODIFICATION HISTORY:
	DMS, Sept, 1990.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/dissolve.pro)


DIST

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

 PURPOSE:
	Create a rectangular array in which each element is proportional
	to its frequency.  This array may be used for a variety
	of purposes, including frequency-domain filtering and
	making pretty pictures.

 CATEGORY:
	Signal Processing.

 CALLING SEQUENCE:
	Result = DIST(N [, M])

 INPUTS:
	N = number of columns in result.
	M = number of rows in result.  If omitted, N is used to return
		a square array.

 OUTPUTS:
	Returns an (N,M) floating array in which:

	R(i,j) = SQRT(F(i)^2 + G(j)^2)   where:
		 F(i) = i  IF 0 <= i <= n/2
		      = n-i  IF i > n/2
		 G(i) = i  IF 0 <= i <= m/2
		      = m-i  IF i > m/2

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.  The computation is done a row at a time.

 MODIFICATION HISTORY:
	Very Old.
 	SMR, March 27, 1991 - Added the NOZERO keyword to increase efficiency.
				(Recomended by Wayne Landsman)
	DMS, July, 1992.  - Added M parameter to make non-square arrays.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/dist.pro)


DL_DOS

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

 PURPOSE:
	Extract the documentation template of one or more procedures (DOS
	version).

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	DL_DOS		;For prompting.
	DL_DOS, Name 	;Extract documentation for procedure Name using
				the current !PATH.

 INPUTS:
	Name:	A string containing the name of the procedure or "*" for all.

 OPTIONAL INPUT PARAMETERS:
	PRINT:	A keyword parameter which, if set to 1, sends the output
		of DL_DOS to PRN:.  If PRINT is a string, it specifies the
		name of a file that will contain the documentation.

   DIRECTORY:	The directory to search.  If omitted, the current directory
		and !PATH are used.

 OUTPUTS:
	No explicit outputs.  Documentation is output using 'more' format 
	unless /PRINT is specified.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Output is produced on terminal or printer.  If the current directory
	is also one of the directories specified in !PATH or DIRECTORY,
	documentation will be output twice for the specified module(s).

 RESTRICTIONS:
	??

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	SNG, Dec, 1990 - adapted from DOC_LIB_UNIX 
	AB, 21 September 1992, renamed from DOC_LIB_DOS to DL_DOS to
		avoid DOS filename limitations.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/dl_dos.pro)


DL_UNIX

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

 PURPOSE:
	Extract the documentation template of one or more IDL modules
	(procedures or functions).

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	DL_UNIX		;For prompting.
	DL_UNIX, Name 	;Extract documentation for procedure Name using
				the current !PATH.

 INPUTS:
	Name:	The string containing the name of the procedure or "*" for all.
	
 KEYWORDS:
	PRINT:	If set, this keyword sends output of DL_UNIX to lpr.  If
		PRINT is a string, it is interpreted as a shell
		command used for output with the documentation from 
		DL_UNIX providing standard input 
		(i.e., PRINT="cat > junk").

   DIRECTORY:	The directory to search.  If omitted, the current directory
		and !PATH are used.

	MULTI:	If set, this flag allows printing of more than one file if the
		requested module exists in more than one directory in the path
		and the current directory.

 OUTPUTS:
	No explicit outputs.  Documentation is piped through "more" unless
	/PRINT is specified.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Output is produced on terminal or printer.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	DMS, Feb, 1988.
	AB, 21 September 1992, renamed from DOC_LIB_UNIX to DL_UNIX to
		avoid DOS filename limitations.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/dl_unix.pro)


DL_VMS

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

 PURPOSE:
	Extract the documentation template of one or more procedures.

 CATEGORY:
	Help, documentation.

 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

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/dl_vms.pro)


DOC_LIBRARY

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

 PURPOSE:
	Extract the documentation template of one or more IDL modules 
	(procedures or functions).  This command provides a standard interface
	to the operating-system specific DL_DOS, DL_UNIX, and
	DL_VMS procedures.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	DOC_LIBRARY		;For prompting.

	DOC_LIBRARY, Name 	;Extract documentation for procedure Name using
				the current !PATH.

 INPUTS:
	Name:	The string containing the name of the procedure.
		Under Unix, Name may be "*" to get information on all routines.

 KEYWORDS:
	PRINT:	If set, this keyword sends the output of DOC_LIBRARY to the 
		default printer.  Under Unix, if PRINT is a string, it is 
		interpreted as a shell command used for output with
		the documentation from DOC_LIBRARY providing standard input
		(i.e. PRINT="cat > junk").

 UNIX KEYWORDS:
   DIRECTORY:	The directory to search.  If omitted, the current directory
		and !PATH are used.

	MULTI:	If set, this flag allows printing of more than one file if the 
		requested module exists in more than one directory in the path
		and the current directory.

 VMS KEYWORDS:
	FILE:	If this keyword is set, the output is left in the file
		"userlib.doc", in the current directory.

	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 sent to the standard output unless /PRINT
	is specified.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Output is produced on terminal or printer.

 RESTRICTIONS:
	The DIRECTORY and MULTI keywords are ignored under VMS. The
	FILE and PATH keywords are ignored under Unix.

 EXAMPLE:
	To obtain documentation for the User's Library function DIST, enter:
		DOC_LIBRARY, 'DIST'

	For a graphical interface to DOC_LIBRARY, see the procedure XDL.

 MODIFICATION HISTORY:
	Written, DMS, Sept, 1982.
	Added library param, Jul 1987.
	Unix version, DMS, Feb, 1988.
	New VMS version, DMS, Dec. 1989
	Wrapper procedure to call the correct version
		under Unix and VMS, AB, Jan 1990
       Added support for DOS, SNG, Dec, 1990

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/doc_library.pro)


DRAW_ALLOC

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

 $Id: draw_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidDraw
   Widget Draw class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  DRAW_Icon
       Return the draw toolbar icon

UNCTION DRAW_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/draw_alloc.pro)


EFONT

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

 PURPOSE:
	This widget provides a vector font editor and display.

 CATEGORY:
	Fonts.

 CALLING SEQUENCE:
	EFONT, Init_font

 INPUTS:
	Init_font: The initial font index, from 3 to 29.  Default = 3.

 KEYWORD PARAMETERS:
	GROUP:     The widget group, if part of a hierarchy.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	efont_com.

 SIDE EFFECTS:
	Reads and modifies a local copy of the file hersh1.chr.

 RESTRICTIONS:
	A basic editor.

 PROCEDURE:
	Call EFONT and press the HELP button for instructions.

 MODIFICATION HISTORY:
	DMS	Nov, 1992.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/efont.pro)


EIGEN_II

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

 PURPOSE:
       This function computes the eigenvectors of an N by N 
       real, nonsymmetric matrix. The result is an array of 
       complex type with a column dimension equal to the 
       number of eigenvalues and a row dimension equal to N.

 CATEGORY:
       Numerical Linear Algebra.

 CALLING SEQUENCE:
       Result = EIGEN_II(A, Eval)

 INPUTS:
           A:  An N by N matrix real, nonsymmetric matrix.
        Eval:  An n-element complex vector of eigenvalues.    

 KEYWORD PARAMETERS:
      Double:  If set to a non-zero value, computations are done in
               double precision arithmetic.
               NOTE: Since IDL lacks a double-precision complex 
                     data type, computations are done internally
                     in double-precision and the result is truncated
                     to single-precision complex.
       Itmax:  The number of iterations performed in the computation
               of each eigenvector. The default value is 4.

 EXAMPLE:
 1) A real, nonsymmetric matrix with real eigenvalues/eigenvectors.
       Define an N by N real, nonsymmetric array.
         a = [[  7.3, 0.2, -3.7], $
              [-11.5, 1.0,  5.5], $
              [ 17.7, 1.8, -9.3]]
       Transpose the array into IDL column (matrix) format.
         at = transpose(a)
       Compute the eigenvalues of a.
         eval = NR_HQR(NR_ELMHES(at))
       Print the eigenvalues.
         print, eval
       Compute the eigenvectors of a.
         evec = EIGEN_II(at, eval)
       Print the eigenvectors.
         print, evec(0,*), evec(1,*), evec(2,*)
       Check the accuracy of each eigenvalue/eigenvector (lamda/x) 
       pair using the mathematical definition of an eigenvector;
       Ax - (lambda)x = 0
         print, (evec(0,*) # a) - (eval(0) * evec(0,*))
         print, (evec(1,*) # a) - (eval(1) * evec(1,*))
         print, (evec(2,*) # a) - (eval(2) * evec(2,*)) 
 2) A real, nonsymmetric matrix with complex eigenvalues/eigenvectors.
       Define an N by N real, nonsymmetric array.
       a = [[ 0.0, 1.0], $
            [-1.0, 0.0]]
       Transpose the array into IDL column (matrix) format.
         at = transpose(a)
       Compute the eigenvalues of a.
         eval = NR_HQR(NR_ELMHES(at))
       Print the eigenvalues.
         print, eval
       Compute the eigenvectors of a.
         evec = EIGEN_II(at, eval, /double)
       Print the eigenvectors.
         print, evec(0,*), evec(1,*)
       Check the accuracy of each eigenvalue/eigenvector (lamda/x)
       pair using the mathematical definition of an eigenvector;
       Ax - (lambda)x = 0
         print, (evec(0,*) # a) - (eval(0) * evec(0,*))
         print, (evec(1,*) # a) - (eval(1) * evec(1,*))

 PROCEDURE:
       EIGEN_II.PRO computes the set of eigenvectors that correspond
       to a given set of eigenvalues using Inverse Subspace Iteration.
       The eigenvectors are computed up to a scale factor and are of
       Euclidean length.
       The functions NR_ELMHES and NR_HQR may be used to find the  
       eigenvalues of an N by N matrix real, nonsymmetric matrix.

 REFERENCE:
       Numerical Recipes, The Art of Scientific Computing (Second Edition)
       Cambridge University Press
       ISBN 0-521-43108-5

 MODIFICATION HISTORY:
           Written by:  GGS, RSI, December 1993

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/eigen_ii.pro)


EQUAL_VARIANCE

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

 PURPOSE: 
	To test treatments, blocks and interactions, as applicable, for 
	variance equality before performing an anova test.
 
 CATEGORY:
	Statisitics.

 CALLING SEQUENCE:
	EQUAL_VARIANCE, X [, FC, DF, P]

 INPUTS:  
	X:	two or three dimensional array of experimental data.

 KEYWORDS: 
	BLOCK:	a flag, if set by user, to test homogeneity of block 
		variances. Default is treatment variances.  Block should 
		only be set when either the keyword TWO_WAY or 
		INTERACTIONS_TWO_WAY is set.

 TINTERACTION:	a flag, if set by the user, to test homogeneity of variance
		for all treatment/block combinations.

 Type of design structure. Options are
      ONE_WAY:	if set,  1-way anova.

 UNEQUAL_ONE_WAY:  if set,  1-way ANOVA with unequal sample sizes.

 TWO_WAY:	if set,  2-way ANOVA.

 INTERACTIONS_TWO_WAY:  if set,  2-way ANOVA with interactions.

 One and only one of the above options may be set.
 Type of test to be used to test variance equality.
 Options are:
              
      HARTLEY:	Hartley's F-Max test. Sample sizes should be equal and data
		nearly normally distributed.

     BARTLETT:	Bartlett's test for nearly normally distributed data and not
		necessarily equal sample sizes.

	BOX:	Box's test. Robust for large data sets, data not necessarily
		normally distributed.
    
	LEVENE:	Levene's test.              

 One and only one test may be selected.

      MISSING:	place holder for missing data or undefined if no data is 
		missing.

     GROUP_NO:	number of groups to use in Box test.

 OUTPUT:     
	FC:	value of statistic computed by each test.  If Bartlett's is 
		selected, FC has chi square distribution.  Otherwise, FC has 
		F distribution.

	DF:	degrees of freedom. 
		Hartley: DF = [max sample size -1, number of treatments],
		Bartlett: DF = number of treatments,
		Box,Levene: DF =[numertor DF,denominator DF]

	P:	probability of FC or something greater for Barlett's, Box's 
		and Levene's Test.  P = -1 for Hartley's.

 PROCEDURE:
	Milliken and Johnson, "Analysis of Messy Data", Van Nostrand, 
	Reinhold, 1984, pp. 18-22.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/equal_variance.pro)


ERRPLOT

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

 PURPOSE:
	Plot error bars over a previously drawn plot.

 CATEGORY:
	J6 - plotting, graphics, one dimensional.

 CALLING SEQUENCE:
	ERRPLOT, Low, High	;X axis = point number.

	ERRPLOT, X, Low, High	;To explicitly specify abscissae.

 INPUTS:
	Low:	A vector of lower estimates, equal to data - error.
	High:	A vector of upper estimates, equal to data + error.

 OPTIONAL INPUT PARAMETERS:
	X:	A vector containing the abscissae.

 KEYWORD Parameters:
	WIDTH:	The width of the error bars.  The default is 1% of plot width.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	An overplot is produced.

 RESTRICTIONS:
	Logarithmic restriction removed.

 PROCEDURE:
	Error bars are drawn for each element.

 EXAMPLES:
	To plot symmetrical error bars where Y = data values and 
	ERR = symmetrical error estimates, enter:

		PLOT, Y			;Plot data
		ERRPLOT, Y-ERR, Y+ERR	;Overplot error bars.

	If error estimates are non-symetrical, enter:

		PLOT,Y
		ERRPLOT, Upper, Lower	;Where Upper & Lower are bounds.

	To plot versus a vector of abscissae:

		PLOT, X, Y		  ;Plot data (X versus Y).
		ERRPLOT, X, Y-ERR, Y+ERR  ;Overplot error estimates.

 MODIFICATION HISTORY:
	DMS, RSI, June, 1983.

	Joe Zawodney, LASP, Univ of Colo., March, 1986. Removed logarithmic
	restriction.

	DMS, March, 1989.  Modified for Unix IDL.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/errplot.pro)


EXPAND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	EXPAND
 PURPOSE:
	Array magnification  (CONGRIDI like except that this really works!)
 CATEGORY:
	Z4 - IMAGE PROCESSING
 CALLING SEQUENCE:
	EXPAND,A,NX,NY,RESULT [,MAXVAL=MAXVAL,FILLVAL=FILLVAL]
 INPUTS:
	A	Array to be magnified
	NX	Desired size of X Dimension
	NY	Desired size of Y Dimension
 Keywords:
	MAXVAL	Largest good value. Elements greater than this are ignored
	FILLVAL	Value to use when elements larger than MAXVAL are encountered.
		Defaults to -1.
 OUTPUTS:
	RESULT	Magnified Floating point image of A array (NX by NY)
 COMMON BLOCKS:
	NONE
 SIDE EFFECTS:
	NONE
 RESTRICTIONS:
	A must be two Dimensional
 PROCEDURE:
	Bilinear interpolation.
	Not really fast if you have to swap memory (eg. NX*NY is a big number).
	OK Postscript users don't forget that postscript pixels are scaleable!
 MODIFICATION HISTORY:
	Aug 15, 1989	J. M. Zawodny, NASA/LaRC, MS 475, Hampton VA, 23665.
	Aug 26, 1992	JMZ, Added maxval and fillval keywords.
	Sep 30, 1992	DMS, RSI, Rewrote to use INTERPOLATE function.
 Please send suggestions and bugreports to zawodny@arbd0.larc.nasa.gov

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/expand.pro)


EXTRAC

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

 PURPOSE:
	The EXTRAC function returns as its result any rectangular sub-matrix
	or portion of the parameter array.  When parts of the specified
	subsection lie outside the bounds of the array, zeros are
	entered into these outlying elements.

	EXTRAC was originally a built-in system procedure in the PDP-11
	version of IDL, and was retained in that form in the original VAX/VMS
	IDL for compatibility.  Most applications of the EXTRAC function
	are more concisely written using subscript ranges (e.g., X(10:15)).  In
	the current release of IDL, EXTRAC has been rewritten as a User Library
	function that provides the same interface as the previous versions.

 CATEGORY:
	Array Manipulation.

 CALLING SEQUENCE:
	Result = EXTRAC(Array, C1, C2, ..., Cn, S1, S2, ..., Sn)

 INPUTS:                 
	Array:	The array from which the subarray will be copied.

	Ci:	The starting subscript in Array for the subarray. There
		should be one Ci for each dimension of Array.

	Si:	The size of each dimension.  The result will have dimensions
		of (S1, S2, ..., Sn). There should be one Si for each
		dimension of Array.

 OUTPUTS:
	This function returns a two-dimensional, floating-point,
	interpolated array.

 RESTRICTIONS:
	In order to make the most typical cases run quickly, little error 
	checking is done on the input.  In particular, the Ci and Si arguments
	must all be scalar integers, and the Si must be non-negative.

	If you know that the subarray will never lie beyond the edges of
	the array, it is more efficient to use array subscript ranges
	to extract the data instead of EXTRAC. 

 PROCEDURE:
	If the subarray lies entirely inside the Array argument, the
	standard array subscript-range mechanism is used to do the work.
	Otherwise, a zeroed array of the correct type and size is
	created, and the overlapping subarray is copied into it.

 EXAMPLES:
	EXAMPLE 1:
	Define a 1000 point vector with each element initialized to
	its subscript.  Extract a 300 pt. vector, starting at A(200) and
	going to A(499).  B(0) will be equal to A(200), B(299) will be
	equal to A(499).  Enter:

	    A = FINDGEN(1000)
	    B = EXTRAC(A, 200, 300)

	EXAMPLE 2:
	Here, the first 49 points extracted (B(0) to B(49)) lie outside
	the bounds of the vector and are set to 0.  B(50) is set to A(0),
	B(51) is set to A(1) which is 1, ... Enter:

	    A = FINDGEN(1000)
	    B = EXTRAC(A, -50, 100)

	EXAMPLE 3:
	The following commands illustrate the use of EXTRAC with multi-
	dimensional arrays.  Enter:

	    A = INTARR(64,64)	;Make a 64X64 matrix to play with

	Take out a 32X32 portion starting at A(20,30) by entering:

	    B = EXTRAC(A, 20, 30, 32, 32)

	A better way to perform the same operation as the previous line is:

	    B = A(20:51, 30:61)

	Extract the 20th column and 32nd row of A:

	    B = EXTRAC(A, 19, 0, 1, 64)	; Extract 20th column of A
	    B = EXTRAC(A, 0, 31, 64, 1)	; Extract 32nd row of A

	Take a 32X32 matrix from A starting at A(40,50).

	    B = EXTRAC(A, 40, 50, 32, 32)

	NOTE: Those points beyond the boundaries of A are set to 0.

 REVISION HISTORY:
	July 18, 1989	Written AB, RSI

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/extrac.pro)


EXTRACT_SLICE

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

 PURPOSE:
	This function returns a 2-D planar slice extracted from
       3-D volumetric data. The slicing plane may be oriented at
       any angle, and may pass through any desired location in the
       volume.

 CATEGORY:
	Volume Rendering.

 CALLING SEQUENCE:
       Slice = EXTRACT_SLICE(Vol, X_size, Y_size, X_center, Y_center, $
                             Z_center, X_rot, Y_rot, Z_rot)

 INPUTS:
       Vol:        The three dimensional volume of data to slice.
                   Data type : Any 3-D array except string or structure.
       X_size:     The size of the returned slice in X (The returned
                   slice will have the dimensions X_size by Y_size).
                   Data type : Long.
       Y_size:     The size of the returned slice in Y. To preserve
                   the correct aspect ratio of the data, Y_size should
                   equal X_size. For optimal results, set X_size and
                   Y_size to be greater than or equal to the largest of
                   the three dimensions of Vol.
                   Data type : Long.
       X_center:   The X coordinate (index) within the volume that the
                   slicing plane passes through. The center of the
                   slicing plane passes through Vol at the coordinate
                   (X_center, Y_Center, Z_center).
                   Data type : Any scalar numeric value (usually Long).
       Y_center:   The Y coordinate (index) within the volume that the
                   slicing plane passes through.
                   Data type : Any scalar numeric value (usually Long).
       Z_center:   The Z coordinate (index) within the volume that the
                   slicing plane passes through.
                   Data type : Any scalar numeric value (usually Long).
       X_rot:      The orientation (X rotation) of the slicing plane.
                   Before transformation, the slicing plane is parallel
                   to the X-Y plane. The slicing plane transformations
                   are performed in the following order :
                      1. Rotate Z_rot degrees about the Z axis.
                      2. Rotate Y_rot degrees about the Y axis.
                      3. Rotate X_rot degrees about the X axis.
                      4. Translate the center of the plane to
                         X_center, Y_center, Z_center.
                   Data type : Float.
       Y_rot:      The orientation (Y rotation) of the slicing plane.
                   Data type : Float.
       Z_rot:      The orientation (Z rotation) of the slicing plane.
                   Data type : Float.
	
 KEYWORD PARAMETERS:
       RADIANS:    Set this keyword to a non-zero value to indicate that
                   X_rot, Y_rot, and Z_rot are in radians. The default
                   is degrees.
                   Data type : Int.
       OUT_VAL:    If OUT_VAL is set, then the portions of the returned
                   slice that lie outside the original volume are set to
                   the value passed to OUT_VAL.
                   Data type : Any scalar numeric value (usually the same
                               type as Vol).
       SAMPLE:     If SAMPLE is set to a non-zero value then nearest
                   neighbor sampling is used to compute the slice.
                   Otherwise, bilinear interpolation is used.
                   A small reduction in execution time will result if
                   SAMPLE mode is set and the OUT_VAL keyword is NOT
                   used.

 OUTPUTS:
       This function returns the planar slice as a two dimensional
       array with the same data type as Vol. The dimensions of the
       returned array are X_size by Y_size.

 EXAMPLE:
       Display an oblique slice through volumetric data.

       ; Create some data.
          vol = RANDOMU(s, 40, 40, 40)
          FOR i=0, 10 DO vol = SMOOTH(vol, 3)
          vol = BYTSCL(vol(3:37, 3:37, 3:37))

       ; Extract and display a slice.
          slice = EXTRACT_SLICE(vol, 40, 40, 17, 17, 17, 30.0, 30.0, 0.0, $
                                OUT_VAL=0B)
          TVSCL, REBIN(slice, 400, 400)

 MODIFICATION HISTORY:
       Written by:     Daniel Carr. Wed Sep  2 14:47:07 MDT 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/extract_slice.pro)


FIELD_ALLOC

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

 $Id: field_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidField
   Widget Field class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  FIELD_Icon
       Return the cw_field toolbar icon

UNCTION FIELD_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/field_alloc.pro)


FILEPATH

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

 PURPOSE:
	Given the name of a file in the IDL distribution,
	FILEPATH returns the fully-qualified path to use in
	opening the file. Operating system dependencies
	are taken into consideration. This routine is used by RSI to
	make the User Library portable.

 CATEGORY:
	File Management.

 CALLING SEQUENCE:
	Result = FILEPATH('filename' [, SUBDIRECTORY = subdir]) 

 INPUTS:
    filename:	The lowercase name of the file to be opened. No device
		or directory information should be included.

 KEYWORDS:
    ROOT_DIR: The name of the directory from which the resulting path
	should be based. If not present, the value of !DIR is used.
	This keyword is ignored if TERMINAL or TMP are specified.

    SUBDIRECTORY:	The name of the subdirectory in which the file
		should be found. If this keyword is omitted, the main 
		directory is used.  This variable can be either a scalar 
		string or a string array with the name of each level of 
		subdirectory depth represented as an element of the array.

		For example, to get a path to the file DETERM in the "userlib"
		subdirectory to the IDL "lib" subdirectory, enter:

		path = FILEPATH("determ", SUBDIRECTORY = ["lib", "userlib"])

    TERMINAL:	Return the filename of the user's terminal.

	  TMP:	The file is a scratch file.  Return a path to the
		proper place for temporary files under the current operating
		system.

 OUTPUTS:
	The fully-qualified file path is returned.  If one of the subdirectory
	keywords is not specified, the file is assumed to exist in the
	main distribution directory.

 COMMON BLOCKS:
	None.

 RESTRICTIONS:
	Don't specify more than one of the keywords in a single call.


 EXAMPLE:
	To get a path to the file DETERM in the "userlib" subdirectory to the 
	IDL "lib" subdirectory, enter:

		path = FILEPATH("determ", SUBDIRECTORY = ["lib", "userlib"])

	The variable "path" contains a string that is the fully-qualified file
	path for the file DETERM.

 MODIFICATION HISTORY:
	December, 1989, AB, RSI (Formalized from original by DMS)
	October, 1990, SG, RSI (added support for MSDOS)
	February, 1991, SMR, RSI (added string array support for multi-level
				  directories)
	21 April 1993, AB, Added ROOT_DIR keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/filepath.pro)


FLICK

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

 PURPOSE:
	Flicker between two output images at a given rate.

 CATEGORY:
	Image display, animation.

 CALLING SEQUENCE:
	FLICK, A, B, Rate

 INPUTS:
	A:	Byte image number 1, scaled from 0 to 255.
	B:	Byte image number 2, scaled from 0 to 255.

 OPTIONAL INPUT PARAMETERS:
	Rate:	The flicker rate.  The default is 1.0 sec/frame

 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.

 MODIFICATION HISTORY:
	DMS, 3/ 88.
	DMS, 4/92, Added X window and MS window optimizations.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/flick.pro)


FLOW3 - DRAW 3D FLOW/VELOCITY FIELD.

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FLOW3 - Draw 3D flow/velocity field.
 PURPOSE:
	Draw lines representing a 3D flow/velocity field.
 CATEGORY:
	Graphics.
 CALLING SEQUENCE:
	FLOW3, vx, vy, vz
 INPUTS:
	Vx, Vy, Vz = 3D arrays containing X, Y, and Z components
		of the field.
 KEYWORD PARAMETERS:
	Sx, Sy, Sz = Optional vectors containing the starting coordinates
	  of the flow lines. If omitted random starting points are chosen.
	Nvecs = Number of random flow lines to draw (Default = 200).
	  Only used if Sx, Sy, Sz are not present.
	Len = Length of each step used to follow flow lines.  Default = 2.0
	  Expressed in units of largest field vector, i.e. the length of
	  the longest step is set to len times the grid spacing.
	Nsteps = number of steps used to follow the flow lines.  Default =
	  largest dimension of vx / 5.
	Blob = 1 to draw a blob at the beginning of each flow line and
	  suppress the arrows.
	Arrowsize = size of arrowheads, default = 0.05
 OUTPUTS:
	None.  Graphics are produced on the currently selected graphics
	device.
 COMMON BLOCKS:
	None.
 RESTRICTIONS:
	Works best with Z buffer output device.
 PROCEDURE:
	The 3D scaling system must be set before calling this procedure.
	For example:  scale3, xr=[0,nx-1], yr=[0,ny-1], zr = [0,nz-1]
	where nx, ny, and nz are the 1st, 2nd, and 3rd dimensions of
	VX, VY, and VZ.
 MODIFICATION HISTORY:
	DMS - RSI, Nov, 1991.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/flow3.pro)


FRIEDMAN

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

 PURPOSE:
	Perform a two-way analysis of variance with k treatments and b 
	blocks to test the hypothesis that all treatments have the same
	distribution versus the alternative that at least two treatment 
	distributions differ in location. No assumptions are needed about 
	the underlying probability distributions.
        
 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	FRIEDMAN, Data [, Rank, F, Prob, Df]

 INPUTS:
	Data:	two dimensional array. Data(i,j) = the observation from the
		ith treatment and jth block.

 KEYWORDS:
	NAMES:	vector of names for the populations to be used in the output.

    LIST_NAME:	name of output file. Default is to the screen.

      NOPRINT:	a flag, if set, to suppress output to the screen or a file.    

 OUTPUT:
	Table written to the screen showing rank sum for each treatment.
	Also, the Friedman test statistic and it is probability assuming a 
	chi-square distribution are written to the screen.

 OPTIONAL OUTPUT PARAMETERS:
	Rank:	1-dim array of rank sums.  Rank(i) = sum of ranks of 
		population i.

	F:	Friedman test statistic.

	Prob:	probability of F, assuming a chi-square distribution.

	DF:	degrees of freedom of chi-square distribution.
		
 RESTRICTIONS:
	No missing data

 COMMON BLOCKS:
	None.

 PROCEDURE:   
	For each block, the observations for the k treatments are ranked. 
	Let Ri = rank sum for ith treatment, RRi = Ri/b and Let R = average 
	of all ranks =(k+1)/2. Let RRi = Ri/ni.  The rank sum analogue to the
	standard sum of squares is:
		SS =b* sum((RRi -R)^2).
	The Friedman statistic F = 12/(k(k+1)) * V and has approximately the
	chi-square distribution if each sample size exceeds 4.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/friedman.pro)


FSLID_ALLOC

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

 $Id: fslid_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidFslider
   Widget Fslider class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  FSLID_Icon
       Return the floating point slider toolbar icon

UNCTION FSLID_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/fslid_alloc.pro)


FUNCT

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

 PURPOSE:
	Evaluate the sum of a Gaussian and a 2nd-order polynomial
	and optionally return the value of its partial derivatives.
	Normally, this function is used by CURVEFIT to fit the
	sum of a line and a varying background to actual data.

 CATEGORY:
	E2 - Curve and surface fitting.

 CALLING SEQUENCE:
	FUNCT, X, A, F [, Pder]

 INPUTS:
	X:	The values of the independent variable.
	A:	The parameters of the equation described in PROCEDURE below.

 OUTPUTS:
	F:	The value of the function at each X(i).

 OPTIONAL OUTPUT PARAMETERS:
	Pder:	An array of the size (N_ELEMENTS(X),6) that contains the
		partial derivatives.  Pder(i,j) represents the derivative
		at the i'th point with respect to j'th parameter.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
	Z = (X-A(1))/A(2)

 MODIFICATION HISTORY:
	WRITTEN, DMS, RSI, SEPT, 1982.
	Modified, DMS, Oct 1990.  Avoids divide by 0 if A(2) is 0.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/funct.pro)


FX_ROOT

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

 PURPOSE:
       This function computes real and complex roots (zeros) of
       a univariate nonlinear function.

 CATEGORY:
       Nonlinear Equations/Root Finding

 CALLING SEQUENCE:
       Result = FX_ROOT(X, Func)

 INPUTS:
       X :      A 3-element initial guess vector of type real or complex.
                Real initial guesses may result in real or complex roots.
                Complex initial guesses will result in complex roots.

       Func:    A scalar string specifying the name of a user-supplied IDL
                function that defines the univariate nonlinear function.
                This function must accept the vector argument X.

 KEYWORD PARAMETERS:
       DOUBLE:  If set to a non-zero value, computations are done in
                double precision arithmetic. 
                Note: Since IDL lacks a double-precision complex data type, 
                this keyword has no effect if the root is of complex type.

       ITMAX:   Set this keyword to specify the maximum number of iterations
                The default is 100.
       
       STOP:    Set this keyword to specify the stopping criterion used to
                judge the accuracy of a computed root, r(k). 
                STOP = 0 implements an absolute error criterion between two
                successively-computed roots, |r(k) - r(k+1)|.
                STOP = 1 implements a functional error criterion at the 
                current root, |Func(r(k))|. The default is 0.

       TOL:     Set this keyword to specify the stopping error tolerance.
                If the STOP keyword is set to 0, the algorithm stops when
                |x(k) - x(k+1)| < TOL.
                If the STOP keyword is set to 1, the algorithm stops when 
                |Func(x(k))| < TOL. The default is 1.0e-4

 EXAMPLE:
       Define an IDL function named FUNC.
         function FUNC, x
           return, exp(sin(x)^2 + cos(x)^2 - 1) - 1 
         end 

       Define a real 3-element initial guess vector.
         x = [0.0, -!pi/2, !pi]

       Compute a root of the function using double-precision arithmetic.
         root = FX_ROOT(x, 'FUNC', /double)

       Check the accuracy of the computed root.
         print, exp(sin(root)^2 + cos(root)^2 - 1) - 1

       Define a complex 3-element initial guess vector.
         x = [complex(-!pi/3, 0), complex(0, !pi), complex(0, -!pi/6)]

       Compute a root of the function.
         root = FX_ROOT(x, 'FUNC')

       Check the accuracy of the computed root.
         print, exp(sin(root)^2 + cos(root)^2 - 1) - 1

 PROCEDURE:
       FX_ROOT implements an optimal Muller's method using complex 
       arithmetic only when necessary.

 REFERENCE:
       Numerical Recipes, The Art of Scientific Computing (Second Edition)
       Cambridge University Press
       ISBN 0-521-43108-5

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, March 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/fx_root.pro)


F_TEST

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

 PURPOSE:
	F_TEST returns the cutoff value v such that:

		Probability(X > v) = a

	where X is a random variable from the F distribution with DFN and DFD
	numerator and denominator degrees of freedom.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
     Result = F_TEST(A, DFN, DFD)

 INPUT:
	A:	probability

	DFN:	numerator degrees of freedom

	DFD:	denominator degrees of freedom

 OUTPUT: 
	If A is between 0 and 1, then the cutoff value is returned. 
	Otherwise, -1 is returned to indicate an error.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/f_test.pro)


F_TEST1

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

 PURPOSE:
	F_test1 returns the probabilty of an observed value greater than X
	from an F distribution with DFN and DFD numerator and denominator 
	degrees of freedom.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
     Result = F_TEST1(X, DFN, DFD)

 INPUT:
	X:	cutoff

	DFN:	numerator degrees of freedom

	DFD:	denominator degrees of freedom

 OUTPUT: 
	The probability of a value greater than X. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/f_test1.pro)


GAMMA_CT

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

 PURPOSE:
	Apply gamma correction to the color table.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	GAMMA, Gamma
	GAMMA, Gamma, /CURRENT

 INPUTS:
	Gamma:	The value of gamma correction.  A value of 1.0 indicates a
		linear ramp, i.e., no gamma correction.  Higher values of 
		gamma give more contrast.  Values less than 1.0 yield lower 
		contrast.

 KEYWORD PARAMETERS:
     CURRENT:	If this keyword is set, apply correction from the current 
		table.  Otherwise, apply from the original color table.  When
		CURRENT is set, the color table input to GAMMA_CT
		is taken from the R_CURR, G_CURR, and B_CURR variables.
		Otherwise, input is from R_ORIG, G_ORIG, and B_ORIG.
		The resulting tables are always saved in the "current" table.

   INTENSITY:	If this keyword is set, correct the individual intensities of 
		each color in the color table.  Otherwise, shift the colors 
		according to the gamma function.

 OUTPUTS:
	No explicit outputs.  The modified color table vectors
	are saved in the COLORS common block, as the variables
	r_curr, g_curr, and b_curr variables.

 COMMON BLOCKS:
	COLORS:	The IDL color table common block.

 SIDE EFFECTS:
	A new color table is loaded, and its contents are placed
	in the "current" variables of the COLORS common block.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.  The gamma correction is implemented
	as x^gamma, where x is the range of color table indices
	scaled from 0 to 1.

 MODIFICATION HISTORY:
	DMS, Oct, 1990. Added ability shift intensities of colors, rather 
			than the mapping of the colors.  DMS, April, 1991.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/gamma_ct.pro)


GAUSS

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

 PURPOSE: 
	Gauss returns the cutoff value v such that

		Probability(X > v) = a,

	where X is a standard gaussian random variable.
 
 CATEGORY:
	Statistics.

 CALLING SEQUENCE: 
	Result = GAUSS(A)

 INPUT:
	A:	The probability for which a cutoff is desired.

 OUTPUT: 
	The cutoff value if a is beween 0 and 1 inclusively. Otherwise, -1.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/gauss.pro)


GAUSSFIT

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

 PURPOSE:
 	Fit the equation y=f(x) where:

 		F(x) = A0*EXP(-z^2/2) + A3 + A4*x + A5*x^2
 			and
		z=(x-A1)/A2

	A0 = height of exp, A1 = center of exp, A2 = sigma (the width).
	A3 = constant term, A4 = linear term, A5 = quadratic term.
 	The parameters A0, A1, A2, A3 are estimated and then CURVEFIT is 
	called.

 CATEGORY:
	?? - fitting

 CALLING SEQUENCE:
	Result = GAUSSFIT(X, Y [, A])

 INPUTS:
	X:	The independent variable.  X must be a vector.
	Y:	The dependent variable.  Y must have the same number of points
		as X.

 OUTPUTS:
	The fitted function is returned.

 OPTIONAL OUTPUT PARAMETERS:
	A:	The coefficients of the fit.  A is a six-element vector as 
		described under PURPOSE.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	The peak or minimum of the Gaussian must be the largest
	or smallest point in the Y vector.

 PROCEDURE:
	If the (MAX-AVG) of Y is larger than (AVG-MIN) then it is assumed
	that the line is an emission line, otherwise it is assumed there
	is an absorbtion line.  The estimated center is the MAX or MIN
	element.  The height is (MAX-AVG) or (AVG-MIN) respectively.
	The width is found by searching out from the extrema until
	a point is found less than the 1/e value.

 MODIFICATION HISTORY:
	DMS, RSI, Dec, 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/gaussfit.pro)


GOODFIT

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

 PURPOSE:
	Test that a set of data has a given distibution.  User can select
	built-in distribution through the keyword DISTR or supply own 
	expected values.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	GOODFIT, Freq, [A, B, ChiSqr, Prob, DF, DISTR=D]

 INPUTS: 
     Freq:	Vector of value or range frequencies.
          
 OPTIONAL INPUTS:
     A:	Vector of observed values or left endpoints for interval data.
		Should have same length as F.  A must be present if user
		selects built-in distributions.                

     B:	Vector of right hand endpoints.
                            

 OPTIONAL OUTPUT PARAMETERS:
	ChiSqr:	The chi square statistic to test for the goodness of fit of
		the data to the distribution.

	Prob:	The probability of ChiSqr or somethinG larger from a chi 
		square distribution.
  
	DF:	Degrees of freedom. User must specify chi
		square degrees of freedom for user supplied
		distribution. Compute DF to be s-1-t,
		where s = N_Elements(A) and t is the number
		of parameters that must be estimated to
		derive expected frequencies.

 KEYWORDS: 
	Distr:	the type of distribution for which the data is to be tested.
		If Distr = "G", then GOODFIT tests for a Gaussian distribution.
		To supply distribution, set Distr to the vector of expected
		frequencies, say, EF.  EF(i) = the frequency expected for the
		observation with observed frequency Freq(i).

 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECT:
	None.

 PROCEDURE:
	Compute expected frequencies EXP(i).
	Chi_Sqr = SUM((Freq(i)-ExpV(i))^2/ExpV(i)^2)
	has the chi sqr distribution.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/goodfit.pro)


GS_ITER

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

 PURPOSE:
       This function solves an n by n linear system of equations
       using Gauss-Seidel iteration.

 CATEGORY:
       Linear Algebra.

 CALLING SEQUENCE:
       Result = GS_ITER(A, B)

 INPUTS:
       A:      An N by N array of type: int, float, or double.

       B:      An N-element vector of type: int, float, or double.

 KEYWORD PARAMETERS:
       CHECK:    An integer value of 0 or 1 that denies or requests
                 checking A for a diagonally dominant form.
                 CHECK = 0 (the default) results in no checking.
                 CHECK = 1  Checks A and reports if it does not
                            meet the required condition. This is
                            just a warning. The algorithm will
                            proceed on the chance it may converge.

       LAMBDA:   A scalar value in the range: [0.0, 2.0]
                 This value determines the amount of 'RELAXATION'.
                 Relaxation is a weighting technique that is used
                 to enhance convergence.
                 1) LAMBDA = 1.0 (the default) no weighting.
                 2) A value in the range  0.0 <= LAMBDA < 1.0  improves
                    convergence in oscillatory and non-convergent systems.
                 3) A value in the range  1.0 < LAMBDA <= 2.0  improves
                    convergence in systems known to converge.

       MAX_ITER: The maximum number of iterations allowable for the
                 algorithm to converge to the solution. The default 
                 is 30 iterations.
         
       X_0:      An N-element vector that provides the algorithm's 
                 starting point. The default is [1.0, 1.0, ... , 1.0].       

       TOL:      The relative error tolerance between current and past
                 iterates calculated as:  ABS( (current-past)/current )
                 The default is 1.0e-4.

 SIDE EFFECTS:
       Upon output A and B are divided by the diagonal elements of A.
       Integer inputs are converted to floats.

 RESTRICTIONS:
       The equations must be entered in a DIAGONALLY DOMINANT form
       to guarantee convergence.
       A system is diagonally dominant if it satisfies the condition:
                   abs(A(row,row)) > SUM(abs(A(row,col)))
       where SUM runs col=1,N excluding col = row and A is in row major.
       This restriction on A is known as a sufficient condition. That is,
       it is sometimes possible for the algorithm to converge without the
       condition being satisfied. But, convergence is guaranteed if the
       condition is satisfied.

 EXAMPLE:
       Define an array (a) in a non-diagonally dominant form.
         a = [[ 1.0,  7.0, -4.0], $
              [ 4.0, -4.0,  9.0], $
              [12.0, -1.0,  3.0]]
       And right-side vector (b).
         b = [12.0, 2.0, -9.0]
       Compute the solution of the system, ax = b.
         result = gs_iter(a, b)
       Note: This example fails to converge, because A is not in
             diagonally dominant form.

       Reorder the array given above into diagonally dominant form.
         a = [[12.0, -1.0,  3.0], $
              [ 1.0,  7.0, -4.0], $
              [ 4.0, -4.0,  9.0]]
       Make corresponding changes in the ordering of b.
         b = [-9.0, 12.0, 2.0]
       Compute the solution of the system, ax = b.
         result = gs_iter(a, b)

 PROCEDURE:
       GS_ITER.PRO implements the Gauss-Seidel iterative method with
       over- and under- relaxation to enhance convergence.
     
 REFERENCE:
       ADVANCED ENGINEERING MATHEMATICS (seventh edition)
       Erwin Kreyszig
       ISBN 0-471-55380-8

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, April 1993
       Modified:    GGS, RSI, February 1994
                    1) Format keyword is no longer supported. The matrix
                       should be supplied in a row major format. 
                    2) The input/output parameter X has been removed. The 
                       algorithm's initial starting point is an n-element
                       vector of 1s. The keyword X_0 has been added to 
                       override the default.
                    3) GS_ITER is now called as a function, x = gs_iter( ). 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/gs_iter.pro)


HANNING

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

 PURPOSE:
	Window function for Fourier Transform filtering.  May be used
		for both the Hanning and Hamming windows.

 CATEGORY:
	Signal, image processing.

 CALLING SEQUENCE:
	Result = HANNING(N1) ;For 1 dimension.

	Result = HANNING(N1, N2) ;For 2 dimensions.

 INPUTS:
	N1:	The number of columns of the result.

	N2:	The number of rows of the result.

 Keyword Parameters:
	Alpha = width parameter of generalized Hamming window.  Alpha
		must be in the range of 0.5 to 1.0.  If Alpha = 0.5,
		the default, the function is called the "Hanning" window.
		If Alpha = 0.54, the result is called the "Hamming" window.

 OUTPUTS:
	Result(i) = 1/2 [1 - COS(2 PI i / (N-1)]

	For two dimensions, the result is the same except that "i" is replaced
	with "i*j", where i and j are the row and column subscripts.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	DMS, May, 1987.
	DMS, Jan, 1994. Added generalized width parameter.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hanning.pro)


HDF_EXISTS

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

 PURPOSE:
	Test for the existence of the HDF library

 CATEGORY:
	File Formats

 CALLING SEQUENCE:
	Result = HDF_EXISTS()

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Returns TRUE (1) if the HDF data format library is
	supported. Returns FALSE(0) if it is not.

 EXAMPLE:
	IF hdf_exists() EQ 0 THEN Fail,"HDF not supported on this machine"

 MODIFICATION HISTORY
	Written by:	Joshua Goldstein,  12/21/92

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hdf_exists.pro)


HILBERT

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

 PURPOSE:
	Return a series that has all periodic terms shifted by 90 degrees. 

 CATEGORY:
	G2 - Correlation and regression analysis
	A1 - Real arithmetic, number theory.

 CALLING SEQUENCE:
	Result = HILBERT(X [, D])

 INPUT:
	X:	A floating- or complex-valued vector containing any number 
		of elements.

 OPTIONAL INPUT:
	D:	A flag for rotation direction.  Set D to +1 for a 
		positive rotation.  Set D to -1 for a negative rotation.
		If D is not provided, a positive rotation results.

 OUTPUTS:
	Returns the Hilbert transform of the data vector, X.  The output is 
	a complex-valued vector with the same size as the input vector.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	HILBERT uses FFT() so this procedure exhibits the same side 
	effects with respect to input arguments as that function.

 PROCEDURE:
	A Hilbert transform is a series	that has had all periodic components 
	phase-shifted by 90 degrees.  It has the interesting property that the 
	correlation between a series and its own Hilbert transform is 
	mathematically zero.

	The method consists of generating the fast Fourier transform using 
	the FFT() function and shifting the first half of the transform 
	products by +90 degrees and the second half by -90 degrees.  The 
	constant elements in the transform are not changed.

	Angle shifting is accomplished by multiplying or dividing by the 
	complex number, I=(0.0000, 1.0000).  The shifted vector is then
	submitted to FFT() for transformation back to the "time" domain and the
	output is divided by the number elements in the vector to correct for
	multiplication effect peculiar to the FFT algorithm.  

 REVISION HISTORY:
	JUNE, 1985,	Written, Leonard Kramer, IPST (U. of Maryland) on site
			contractor to NASA(Goddard Sp. Flgt. Cntr.)

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hilbert.pro)


HIST_2D

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

 PURPOSE:
	Return the density function (histogram) of two variables.

 CATEGORY:
	Image processing, statistics, probability.

 CALLING SEQUENCE:
	Result = hist_2d(V1, V2)
 INPUTS:
	V1 and V2 = arrays containing the variables.  They must be
		of byte, integer, or longword type, and contain
		no negative elements.

 OUTPUTS:
	The two dimensional density function of the two variables,
	a longword array of dimensions (MAX(v1)+1, MAX(v2)+1).  Result(i,j)
	is equal to the number of sumultaneous occurences of V1 = i,
	and V2 = j, at the same element.
	
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	Data must be in byte, integer, or longword form.  To use with
	floating point data, scale into the range of integers.

 PROCEDURE:
	Creates a combines array from the two variables, equal to the
	linear subscript in the resulting 2D histogram, then applies
	the standard histogram function.

	The following pseudo-code shows what the result contains,
	not how it is computed:
		r = LONARR(MAX(v1)+1, MAX(v2)+1)  ;Result
		FOR i=0, N_ELEMENTS(v1)-1 DO $
		  r(v1(i), v2(i)) = r(v1(i), v2(i)) +1

 EXAMPLE:
	Return the 2D histogram of two byte images:
		R = HIST_2D(image1, image2)
	Return the 2D histogram made from two floating point images
	with range of -1 to +1, and with 100 bins:
		R = HIST_2D(long((f1+1) * 50), long((f2+1) * 50))

 MODIFICATION HISTORY:
 	Written by:
	DMS, Sept, 1992		Written

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hist_2d.pro)


HIST_EQUAL

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

 PURPOSE:
	Return a histogram-equalized image or vector.

 CATEGORY:
	Z1 - Image processing, spatially invariant.

 CALLING SEQUENCE:
	Result = HIST_EQUAL(A [, MINV = minv] [, MAXV = maxv])

 INPUTS:
	A:	The array to be histogram-equalized.

 KEYWORD PARAMETERS:
	MINV:	The minimum value to consider.  If this keyword is omitted,
		zero is used.  Input elements less than or equal to MINV are
		output as zero.  MINV should be greater than or equal to 0.

	MAXV:	The maximum value to consider.  If this keyword is omitted,
		the maximum element is used.  Input elements greater than or
		equal to MAXV are output as 255.

     BINSIZE:	Size of bin to use.  If this keyword is omitted, the value 1
		is used.  This parameter is ignored for byte type data.

	TOP:	The maximum value to scale the output array. If this keyword 
		is omitted, 255 is used.

 OUTPUTS:
	A histogram-equalized byte array is returned.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	The output array is always of byte type and is scaled from 0 to TOP. 
	Floating-point arrays should not have small ranges, (e.g., less than
	around 255) unless a binsize is specified.

 PROCEDURE:
	The HISTOGRAM function is used to obtain the density distribution of
	the input array.  The histogram is integrated to obtain the 
	cumulative density-propability function and finally the lookup 
	function is used to transform to the output image.

 EXAMPLE:
	Create a sample image using the IDL DIST function and display it by
	entering:

		IMAGE = DIST(100)
		TV, DIST
	
	Create a histogram-equalized version of the byte array, IMAGE, and
	display the new version.  Use a minumum input value of 10, a maximum 
	input value of 200, and limit the top value of the output array to 
	220.  Enter:

		NEW = HIST_EQUAL(IMAGE, MINV = 10, MAXV = 200, TOP = 220)
		TV, NEW 

 MODIFICATION HISTORY:
	August, 1982. Written by DMS, RSI.
	Feb, 1988, Revised for Sun, DMS.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hist_equal.pro)


HLS

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

 PURPOSE:
	Make a color table based on the HLS (Hue, Lightness, Saturation) 
	color system.

 CATEGORY:
	Z4 - Image processing, color table manipulation

 CALLING SEQUENCE:
	HLS, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr]

 INPUTS:
	Litlo:	Starting lightness, from 0 to 100%.

	Lithi:	Ending lightness, from 0 to 100%.

	Satlo:	Starting saturation, from 0 to 100%.

	Sathi:	Ending stauration, from 0 to 100%.

	Hue:	Starting Hue, from 0 to 360 degrees.  Red = 0 degs,
		green = 120, blue = 240.

 	Loops:	The number of loops through the color spiral.  This 
		parameter does not have to be an integer.  A negative value
		causes the loops to traverse the spiral in the opposite 
		direction.

 OUTPUTS:
	No required outputs.

 OPTIONAL OUTPUT PARAMETERS:
	Colr:	A (256,3) integer array containing the R, G, and B values
		that were loaded into the color tables.
		Red = colr(*,0), green = colr(*,1), blue = colr(*,2).

 COMMON BLOCKS:
	COLORS:	Contains the red, green, and blue vectors on exit.

 SIDE EFFECTS:
	The color tables are loaded.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Adapted from program on page 619, Fundamentals of Interactive
	Computer Graphics, Foley and Van Dam.

	Using the input parameters, a spiral through the double-
	ended HLS cone is traced.  Points along the cone
	are converted from HLS to RGB.

 MODIFICATION HISTORY:
	Written, DMS, Jan, 1983.
	Changed common block, dms, 4/1987.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hls.pro)


HSV

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

 PURPOSE:
	Make a color table based on the HSV (Hue, Saturation, and Value) 
	color system.

 CATEGORY:
	Z4 - Image processing, color table manipulation

 CALLING SEQUENCE:
	HLS, Vlo, Vhi, Satlo, Sathi, Hue, Loops [, Colr]

 INPUTS:
	Vlo:	Starting value, from 0 to 100%.

	Vhi:	Ending value, from 0 to 100%.

	Satlo:	Starting saturation, from 0 to 100%.

	Sathi:	Ending saturation, from 0 to 100%.

	Hue:	Starting Hue, from 0 to 360 degrees.  Red = 0 degs,
		green = 120, blue = 240.

 	Loops:	The number of loops through the color spiral.  This
		parameter does not have to be an integer.  A negative value
		causes the loops to traverse the spiral in the opposite
		direction.

 OUTPUTS:
	No required outputs.

 OPTIONAL OUTPUT PARAMETERS:
	Colr:	A (256,3) integer array containing the R, G, and B values
		that were loaded into the color tables.
		Red = colr(*, 0), green = colr(*, 1), blue = colr(*, 2).

 COMMON BLOCKS:
	COLORS:	Contains the red, green and blue color vectors on exit.

 SIDE EFFECTS:
	The color tables are loaded.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Adapted from a program on page 616, Fundamentals of Interactive
	Computer Graphics, Foley and Van Dam.

	Using the input parameters, a spiral through the single-ended HSV 
	cone is traced.  Points along the cone are converted from HLS to RGB.

 MODIFICATION HISTORY:
	Written, DMS, Jan, 1983.
	Added common block COLORS, DMS, Dec, 1983 and Apr, 1987.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/hsv.pro)


H_EQ_CT

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

 PURPOSE:
	Histogram-equalize the color tables for an image or a region
	of the display.

 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	H_EQ_CT, Image	;To histogram equalize from an image.
	H_EQ_CT		;To histogram equalize from a region

 INPUTS:
	Image:	Image whose histogram is to be used in determining
		the new color tables.  If this value is omitted, the user 
		is prompted to mark the diagonal corners of a region of the 
		display.

		Image MUST be a byte image, scaled the same way as
		the image loaded to the display.

 OUTPUTS:
	No explicit outputs.  The result is applied to the current color
	tables.

 COMMON BLOCKS:
	COLORS:	The IDL color table common block.

 SIDE EFFECTS:
	The current color table is modified.

 RESTRICTIONS:
	If a parameter is supplied, it is assumed to be an image that
	was just displayed.

 PROCEDURE:
	Either the image parameter or the region of the display marked by
	the user is used to obtain a pixel-distribution histogram.  The
	cumulative integral is taken and scaled.  This function is applied
	to the current color tables.

 MODIFICATION HISTORY:
	DMS, March, 1988, written.
	DMS, May, 1990, added BOX_CURSOR.
	AB, 21 September 1992,renamed from HIST_EQUAL_CT to H_EQ_CT to
		avoid DOS filename limitations. HIST_EQUAL_CT is still
		available as a wrapper to this routine under operating
		systems that can handle longer file names.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/h_eq_ct.pro)


H_EQ_INT

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

 PURPOSE:
	Interactively histogram-equalize the color tables of an image
	or a region of the display.  By moving the cursor across
	the screen, the amount of histogram equalization is varied.

 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	H_EQ_INT, Image		;To histogram equalize from an image.
	H_EQ_INT		;To histogram equalize from a region.

 INPUTS:
	Image:	The image whose histogram is to be used in determining
		the new color tables.  If this value is omitted, the user 
		is prompted to mark the diagonal corners of a region of the 
		display.

		Image MUST be a byte image, scaled the same way as
		the image loaded to the display.

 OUTPUTS:
	No explicit outputs.  The result is applied to the current color
	tables.

 COMMON BLOCKS:
	COLORS:	The IDL color table common block.

 SIDE EFFECTS:
	The current color table is modified.

 RESTRICTIONS:
	If a parameter is supplied, it is assumed to be an image that
	was just displayed.

 PROCEDURE:
	Either the image parameter or the region of the display marked by
	the user is used to obtain a pixel-distribution histogram.  The
	cumulative integral is taken and scaled.  This function is applied
	to the current color tables.

	A window is created and the histogram equalization function is 
	plotted.

	A linear ramp is overplotted.  Move the cursor from left
	to right to vary the amount of histogram equalization applied to the 
	color tables from 0 to 100%.  Press the right mouse button to exit.

 MODIFICATION HISTORY:
	DMS, November, 1989, written.
	AB, 21 September 1992,renamed from HIST_EQUAL_INT to H_EQ_INT to
		avoid DOS filename limitations. HIST_EQUAL_INT is still
		available as a wrapper to this routine under operating
		systems that can handle longer file names.
	JWG, 14 December 1992,routine did not restore font.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/h_eq_int.pro)


IMAGE_CONT

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

 PURPOSE:
	Overlay an image and a contour plot.

 CATEGORY:
	General graphics.

 CALLING SEQUENCE:
	IMAGE_CONT, 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).

	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.

	INTERP:	If this keyword is set, bilinear interpolation is used if 
		the image is resized.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The currently selected display is affected.

 RESTRICTIONS:
	None.

 PROCEDURE:
	If the device has scalable pixels, then the image is written over
	the plot window.

 MODIFICATION HISTORY:
	DMS, May, 1988.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/image_cont.pro)


INTERPOL

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

 PURPOSE:
	Linearly interpolate vectors with a regular or irregular grid.

 CATEGORY:
	E1 - Interpolation

 CALLING SEQUENCE:
	Result = INTERPOL(V, N) 	;For regular grids.

	Result = INTERPOL(V, X, U)	;For irregular grids.

 INPUTS:
	V:	The input vector can be any type except string.

	For regular grids:
	N:	The number of points in the result when both input and
		output grids are regular.  The output grid absicissa values
		equal FLOAT(i)/N_ELEMENTS(V), for i = 0, n-1.

	Irregular grids:
	X:	The absicissae values for V.  This vecotr must have same # of
		elements as V.  The values MUST be monotonically ascending 
		or descending.

	U:	The absicissae values for the result.  The result will have 
		the same number of elements as U.  U does not need to be 
		monotonic.
	
 OPTIONAL INPUT PARAMETERS:
	None.

 OUTPUTS:
	INTERPOL returns a floating-point vector of N points determined
	by linearly interpolating the input vector.

	If the input vector is double or complex, the result is double 
	or complex.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Result(i) = V(x) + (x - FIX(x)) * (V(x+1) - V(x))

	where 	x = i*(m-1)/(N-1) for regular grids.
		m = # of elements in V, i=0 to N-1.

	For irregular grids, x = U(i).
		m = number of points of input vector.

 MODIFICATION HISTORY:
	Written, DMS, October, 1982.
	Modified, Rob at NCAR, February, 1991.  Made larger arrays possible 
		and correct by using long indexes into the array instead of
		integers.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/interpol.pro)


INT_2D

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

 PURPOSE:
       This function computes the double integral of a bivariate
       function F(x,y) with limits of integration from A to B 
       for x and from P(x) to Q(x) for y.

 CATEGORY:
       Numerical Analysis.

 CALLING SEQUENCE:
       Result = INT_2D(Fxy, AB_Limits, PQ_Limits, Pts)

 INPUTS:
       Fxy:  A scalar string specifying the name of a user-supplied 
             IDL function that defines the bivariate function to be 
             integrated. The function must accept x & y and return  
             a scalar result.
       AB_Limits:  A two-element vector containing the lower, A, and
                   upper, B,  limits of integration for x.
       PQ_Limits:  A scalar string specifying the name of a user-
                   supplied IDL function that defines the lower, P(x), 
                   and upper, Q(x), limits of integration for y. The 
                   function must accept x and return a two-element 
                   vector result. 
       Pts:  The number of transformation points used in the 
             computation. Possible values are: 6, 10, 20, or 48.

 EXAMPLE:
       Compute the double integral of the bivariate function 
       F(x, y) = exp(-x^2 -y^2) over the circular region: 
       A = -4, B = 4, Px = -sqrt(16 - x^2), Qx = sqrt(16 - x^2).
	The result should be !PI.
       
       function Fxy, x, y
         return, exp(-x^2. -y^2.)
       end

       function PQ_Limits, x
         return, [-sqrt(16. - x^2), sqrt(16. - x^2)]
       end

       AB_Limits = [-4.0, 4.0]
		     Integrate with 10 point formula:
       Print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 10)
	Print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 20) ;20 pts
	Print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48) ;48 pts
       
       INT_2D with 10 transformation points yields:    3.1208432
       INT_2D with 20 transformation points yields:    3.1415922
       INT_2D with 48 transformation points yields:    3.1415923
       The exact solution (7 decimal accuracy) yields: 3.1415923

 PROCEDURE:
       INT_2D.PRO computes the double integral of a bivariate function
       using iterated Gaussian Quadrature. The algorithm's transformation
       data is provided in tabulated form with 15 decimal accuracy.

 REFERENCE:
       Handbook of Mathematical Functions 
       U.S. Department of Commerce 
       Applied Mathematics Series 55

 MODIFICATION HISTORY:
           Written by:  GGS, RSI, January 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/int_2d.pro)


INT_3D

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

 PURPOSE:
       This function computes the triple integral of a trivariate
       function F(x,y,z) with limits of integration from A to B
       for X, from P(x) to Q(x) for Y and from U(x,y) to V(x,y) 
       for Z.

 CATEGORY:
       Numerical Analysis.

 CALLING SEQUENCE:
       Result = INT_3D(Fxyz, AB_Limits, PQ_Limits, UV_Limits, Pts)

 INPUTS:
       Fxyz:  A scalar string specifying the name of a user-supplied
              IDL function that defines the trivariate function to be
              integrated. The function must accept x, y & z and return
              a scalar result.
       AB_Limits:  A two-element vector containing the lower, A, and
                   upper, B,  limits of integration for x.
       PQ_Limits:  A scalar string specifying the name of a user-
                   supplied IDL function that defines the lower, P(x),
                   and upper, Q(x), limits of integration for y. The
                   function must accept x and return a two-element
                   vector result.
       UV_Limits:  A scalar string specifying the name of a user-
                   supplied IDL function that defines the lower, U(x,y),
                   and upper, V(x,y), limits of integration for z. The
                   function must accept x & y and return a two-element
                   vector result.
        Pts:  The number of transformation points used in the
              computation. Possible values are: 6, 10, 20, or 48.

 EXAMPLE:
       Compute the triple integral of the trivariate function
       F(x,y,z) = z * (x^2 + y^2 + z^2)^1.5 over the region:
       A = -2, B = 2, Px = -sqrt(4 - x^2), Qx = sqrt(4 - x^2),
       Uxy = 0, Vxy = sqrt(4 - x^2 - y^2).

       function Fxyz, x, y, z
         return, z * (x^2 + y^2 + z^2)^1.5
       end

       function PQ_Limits, x
         return, [-sqrt(4. - x^2), sqrt(4. - x^2)]
       end

       function UV_Limits, x, y
         return, [0.0, sqrt(4. - x^2 - y^2)]
       end

       AB_Limits = [-2.0, 2.0]
       print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 10)
       print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 20)
       print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 48)

       INT_3D with 10 transformation points yields:    57.4442475
       INT_3D with 20 transformation points yields:    57.4462014
       INT_3D with 48 transformation points yields:    57.4462648
       The exact solution (7 decimal accuracy) yields: 57.4462673

 PROCEDURE:
       INT_3D.PRO computes the triple integral of a trivariate function
       using iterated Gaussian Quadrature. The algorithm's transformation
       data is provided in tabulated form with 15 decimal accuracy.

 REFERENCE:
       Handbook of Mathematical Functions
       U.S. Department of Commerce
       Applied Mathematics Series 55

 MODIFICATION HISTORY:
           Written by:  GGS, RSI, January 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/int_3d.pro)


INT_TABULATED

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

 PURPOSE:
       This function integrates a tabulated set of data { x(i) , f(i) },
       on the closed interval [min(X) , max(X)].

 CATEGORY:
       Numerical Analysis.

 CALLING SEQUENCE:
       Result = INT_TABULATED(X, F)

 INPUTS:
       X:  The tabulated X-value data. This data may be irregularly
           gridded and in random order. If the data is randomly ordered
	    you must set the SORT keyword to a nonzero value.
       F:  The tabulated F-value data. Upon input to the function
           X(i) and F(i) must have corresponding indices for all
	    values of i. If X is reordered, F is also reordered.

       X and F must be of floating point or double precision type.

 KEYWORD PARAMETERS:
       SORT:   A zero or non-zero scalar value.
               SORT = 0 (the default) The tabulated x-value data is
                        already in ascending order.
               SORT = 1 The tabulated x-value data is in random order
                        and requires sorting into ascending order. Both
			 input parameters X and F are returned sorted.
       DOUBLE: If set to a non-zero value, computations are done in
               double precision arithmetic.

 OUTPUTS:
       This fuction returns the integral of F computed from the tabulated
	data in the closed interval [min(X) , max(X)].

 RESTRICTIONS:
       Data that is highly oscillatory requires a sufficient number
       of samples for an accurate integral approximation.

 PROCEDURE:
       INT_TABULATED.PRO constructs a regularly gridded x-axis with a
	number of segments as an integer multiple of four. Segments
	are processed in groups of four using a 5-point Newton-Cotes
	integration formula.
       For 'sufficiently sampled' data, this algorithm is highly accurate.

 EXAMPLES:
       Example 1:
       Define 11 x-values on the closed interval [0.0 , 0.8].
       x = [0.0, .12, .22, .32, .36, .40, .44, .54, .64, .70, .80]

       Define 11 f-values corresponding to x(i).
       f = [0.200000, 1.30973, 1.30524, 1.74339, 2.07490, 2.45600, $
            2.84299, 3.50730, 3.18194, 2.36302, 0.231964]

       Call INT_TABULATED.PRO
       result = INT_TABULATED(x, f)

       In this example, the f-values are generated from a known function.
       f = .2 + 25*x - 200*x^2 + 675*x^3 - 900*x^4 + 400*x^5

       The Multiple Application Trapazoid Method yields;  result = 1.5648
       The Multiple Application Simpson's Method yields;  result = 1.6036
				INT_TABULATED.PRO yields;  result = 1.6232
         The Exact Solution (4 decimal accuracy) yields;  result = 1.6405

	Example 2: 
       Create 30 random points in the closed interval [-2 , 1].
       x = randomu(seed, 30) * 3. - 2.

       Explicitly define the interval's endpoints.
       x(0) = -2.  &  x(29) = 1.

       Generate f(i) corresponding to x(i) from a given function.
       f = sin(2*x) * exp(cos(2*x))

       Call INT_TABULATED.PRO with the SORT keyword.
       result = INT_TABULATED(x, f, /sort)

       In this example, the f-values are generated from the function.
       f = sin(2*x) * exp(cos(2*x))

       The result of this example will vary because the x(i) are random.
       Executing this example three times gave the following results:
		               INT_TABULATED.PRO yields;  result = -0.0702
		               INT_TABULATED.PRO yields;  result = -0.0731
		               INT_TABULATED.PRO yields;  result = -0.0698
        The Exact Solution (4 decimal accuracy) yields;  result = -0.0697

 MODIFICATION HISTORY:
           Written by:  GGS, RSI, September 1993
           Modified:    GGS, RSI, November  1993
                        Use Numerical Recipes cubic spline interpolation 
                        function NR_SPLINE/NR_SPLINT. Execution time is 
                        greatly reduced. Added DOUBLE keyword. The 'sigma' 
                        keyword is no longer supported.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/int_tabulated.pro)


JOIN

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

 PURPOSE:
	To partition the cases represented by the rows in DataArray into
	nested clusters. 

 CATEGORY:
	Statistics.

 CALLING SEQUENCE: 
	JOIN, DataArray, pos, Imin, Sim

 INPUTS: 
    DataArray:	a (C,R) dimensioned array where R is the
		number of cases to be partitioned and C
		is the number of variables.

 KEYWORDS
     CASENAME:	one dimensional array of R case names.

	NORM:	Flag to signal whether to normalize the
		variable values in Data. Values normalized only if Norm=1. 

      MISSING:	Missing data value. If undefined, assume no missing data

     DISTANCE:	Rule for computing case distances.
		Options are:
		1. "%": Distance = percent of variable values that disagree
				   between two cases. 
		2. "EUCLID":	This is the default.
		3. "COR":	Distance between i and    
                               j = 1-rij, where rij= the correlation 
				between i and j.
		4. "OWN":  DataArray= a symmetric a
			   distance array supplied by the user.  This array
			   should be a 1-dim array of the elements in the
			   distance array that are below the main diagonal.

	AMAL:	Rule for computing cluster distances. Options are:
		1. "MIN": distance = distance between closest members.
		2. "MAX": distance = distance between farthest members.
		3.  "MEAN" : distance = average of distances between members.
                              
      NOPRINT:	A flag, if set, to suppress output to the screen.             

	WIDTH:	User supplied tree width in characters.  The default is 60.

 OUTPUT:
	The tree of hierarchical clusters is printed to the screen.  
     
 OPTIONAL OUTPUT PARAMETERS: 
	Pos:	One-dimensional array of cases in the in the tree of 
		hierarchical clusters. Pos(i) = position of case i in tree.

	Imin:	One-dimensional array specifying nesting of clusters. 
		Imin(i) = smallest cluster properly containing cluster or
		case i.
              
	Sim:	One-dimensional array of minimum distances.
		Sim(i) = the distance between the two clusters joined to
		form cluster i. 
                         
 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 PROCEDURE:
	Adapted from algorithm in Clustering Algorithms by
	Hartigan, Wiley Series in Probablity and Mathematical
	Statistics, Chapt.4. Function  kmeans1 implements a
	function that given a partition P returns a
	partition P' in the same neighborhood with reduced
	in group error. Function is called repeatedly until 
	it finds a fixed point or local minimum. Kmeans1
	recomputes cluster means after each reassignment.
	Procedure Kmeans successively finds partitions
	with the starting partition for K the final partition
	for K-1 with the case farthest from its cluster mean
	split off to form a new cluster.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/join.pro)


JULDAY

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

 PURPOSE:
	Calculate the Julian Day Number for a given month, day, and year.
	This is the inverse of the library function CALDAT.
	See also caldat, the inverse of this function.
 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	Result = JULDAY(Month, Day, Year)

 INPUTS:
	MONTH:	Number of the desired month (1 = January, ..., 12 = December).

	DAY:	Number of day of the month.

	YEAR:	Number of the desired year.

 OPTIONAL INPUT PARAMETERS:
	None.

 OUTPUTS:
	JULDAY returns the Julian Day Number (which begins at noon) of the 
	specified calendar date.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 MODIFICATION HISTORY:
	Translated from "Numerical Recipies in C", by William H. Press,
	Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling.
	Cambridge University Press, 1988 (second printing).

	AB, September, 1988

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/julday.pro)


KMEANS

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

 NAME:
	KMEANS

 PURPOSE:
	To split the cases in Data into n (default=2) groups that have 
	minimum in  group variation relative to between group variation.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE: 
	KMEANS, Data, Cluster, VarName, CaseName

 INPUTS: 
       Data =  a (C,R) dimensioned array where R is
		the number of cases to be partitioned and C is the number 
		of variables.

 KEYWORDS:
	Number = the number of clusters in final
                  partition. The default is 2
	Iter =   the number of iterations used to assign
                  cases to clusters. The default is 50.
	Norm =   flag, if set, to signal whether to
                  normalize the variable values in Data.
                  Values normalized only if Norm=1. 

	Missing = missing data value. If undefined,
                   assume no missing data

	List_Name= name of output file. Default is to
                    the screen.
	ClustMeans=array of cluster means. If defined on
                    entry, CM(i,j) = mean of ith variable
                     in j th cluster on exit
	ClustSTD = array of cluster standard deviations.
                    If defined on entry, CS(i,j) =
                     standard deviation of ith variable
                    in jth cluster on exit
	SSBetween = array of sum of squares  between
                    clusters. If defined on entry,
                    SSB(i)= sum of squares for ith
                    variable.
	SSWithin = array of sum of squares within clusters.
                   SSW is the  analogue for SSB
	VarName= one dimensional array of C variable names
	CaseName= one dimensional array of R case names

 OUTPUT:
	Summary statistics for each variable for each cluster, overall
	analysis of variance for each variable.

 OPTIONAL OUTPUT PARAMETERS: 
	Cluster	a one dimensional array. Cluster(i) = the cluster containing
	case i in the final partition

 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 PROCEDURE:
	Adapted from algorithm in Clustering Algorithms by Hartigan, 
	Wiley Series in Probablity and Mathematical Statistics, Chapt.4.
	Function kmeans1 implements a function that given a partition P
	returns a partition P' in the same neighborhood with reduced in group
	error.

	Function is called repeatedly until it finds a fixed point or local
	minimum. Kmeans1 recomputes cluster means after each reassignment.
           
	Procedure Kmeans successively finds partitions with the starting 
	partition for K the final partition for K-1 with the case farthest
	from its cluster mean split off to form a new cluster.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/kmeans.pro)


KRIG_2D

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	KRIG_2D 
 
 PURPOSE: 
	This function interpolates a regularly or irregularly gridded
	set of points Z = F(X,Y) using kriging.

 CATEGORY: 
	Interpolation, Surface Fitting 

 CALLING SEQUENCE: 
	Result = KRIG2D(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: 
   Model Parameters:
	EXPONENTIAL: if set (with parameters [A, C0, C1]), use an exponential
		     semivariogram model.
	SPHERICAL:   if set (with parameters [A, C0, C1]), use a spherical
		     semivariogram model.

   Both models use the following parameters:
	A:	  the range. At distances beyond A, the semivariogram 
		  or covariance remains essentialy constant. 
		  See the definition of the functions below. 
	C0:	  the "nugget," which provides a discontinuity at the
		  origin. 
	C1:	  the covariance value for a zero distance, and the variance
		  of the random sample Z variable. If only a two element
		  vector is supplied, C1 is set to the sample variance.
		  (C0 + C1) = the "sill," which is the variogram value for
		  very large distances.

  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. 
 
 OUTPUTS: 
	This function returns a two dimensional floating point array
	containing the interpolated surface, sampled at the grid points.

 RESTRICTIONS:
	The accuracy of this function is 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
	10			676			1.1
	20			676			1.5
	40			676			2.6
	80			676			7.8
	10			1024			1.6
	10			4096			5.9
	10			16384			23

 PROCEDURE: 
	Ordinary kriging is used to fit the surface described by the
	data points X,Y, and Z. See: Isaaks and Srivastava,
	"An Introduction to Applied Geostatistics," Oxford University
	Press, 1989, Chapter 12.

	The parameters of the data model, the range, nugget, and
	sill, are highly dependent upon the degree and type of spatial
	variation of your data, and should be determined statistically.
	Experimentation, or preferrably rigorus analysis, is required.

	For N data points, a system of N+1 simultaneous
	equations are solved for the coefficients of the 
	surface. For any interpolation point, the interpolated value 
	is: 
          F(x,y) = Sum( w(i) * C(x(i),y(i), x, y)

	Formulas used to model the variogram functions:
		d(i,j) = distance from point i to point j.
		V = variance of samples.
		C(i,j) = Covariance of sample i with sample j.
               C(x0,y0,x1,y1) = Covariance of point (x0,y0) with (x1,y1).

       Exponential covar: C(d) = C1 * EXP(-3*d/A)   if d ne 0.
                               = C1 + C0          if d eq 0.

       Spherical covar:   C(d) = (1.0 - 1.5 * d/a + 0.5 * (d/a)^3)
                               = C1 + C0           if d eq 0.
                               = 0                 if d > a.

 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: 
	  e = [ 0.25, 0.0]	;Range and nugget are 0.25, and 0.
				;(These numbers are dependent upon
				;your data model.)
	  r = krig2d(z, x, y, EXPON = e)	;Get the surface. 

 	Or: get a surface over the unit square, with spacing of 0.05: 
	  r = krig2d(z, x, y, EXPON=e, 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 = krig2d(z, x, y, EXPON=e, NX=10, NY=10) 
 
 Example 2: Regularly gridded cases 
	  s = [ 10., 0.2]			;Range and sill, data dependent.
	  z = randomu(seed, 5, 6)		;Make some random data

	interpolate to a 26 x 26 grid: 
	  CONTOUR, krig2d(z, /REGULAR, SPHERICAL = s)
 
 MODIFICATION HISTORY: 
	DMS, RSI, March, 1993. Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/krig2d.pro)


KRUSKAL_WALLIS

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

 PURPOSE:
	To perform a one-way analysis of variance on k treatments to test
	the hypothesis that all treatments have the same distribution 
	versus the alternative that at least two treatments differ in 
	location.  No assumptions are needed about the underlying probability
	distributions.
        
 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	KRUSKAL_WALLIS, Data [,Rank, H, Prob, df, Pop    $
         names=names, List_Name=Ln, Missing=M , NoPrint =NP]

 INPUTS:
	Data:	Two-dimensional array. Data(i,j) =the jth   $
		observation from the ith treatment;

 KEYWORDS:  
	NAMES:	vector of names for the treatments to be used in the output.

    LIST_NAME:	Name of output file.  Default is to the screen.

      MISSING:	value used as a place holder for missing data.  Pairwise
		handling of missing data.

      NOPRINT:	flag, if set, to suppress ouput to the screen or a file.

 OUTPUT:
	Table written to the screen showing rank sum for each treatment.
	Also, the kruskal_wallis test statistic and it is probability 
	assuming a chi-square distribution are written to the screen.

 OPTIONAL OUTPUT PARAMETERS:
	Rank:	1-dim array of rank sums.
		Rank(i) = sum of ranks of treatment i

	H:	kruskal_wallis test statistic.

	Prob:	probability of H assuming a chi-square distribution.

	DF:	degrees of freedom of chi-square distribution.

	POP:	1-dim array of treatment sizes

 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 PROCEDURE:   
	The samples from the k treatments are pooled and their members are
	ranked. Let Ri = rank sum for ith treatment and let ni = the sample
	size. Let R = the average of all ranks =(n+1)/2 where n = sum(ni).
	Let RRi = Ri/ni. The rank sum analogue to the standard sum of squares
	is:
		SS = sum(ni(RRi -R))^2.
	The Kruskal-Wallis statistic H = 12/(n(n+1)) * V and has approximately
	the chi-square distribution if each sample size exceeds 4.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/kruskal_wallis.pro)


LABEL_ALLOC

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

 $Id: label_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidLabel
   Widget Label class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  LABEL_Icon
       Return the label toolbar icon

UNCTION LABEL_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/label_alloc.pro)


LABEL_DATE

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

 PURPOSE:
	This function labels axes with dates.

 CATEGORY:
	Plotting.

 CALLING SEQUENCE:
	To set up:
		dummy = LABEL_DATE(DATE_FORMAT='string')
	To use:
		PLOT, x, y, XTICKFORMAT='LABEL_DATE'

 INPUTS:
	No explicit user defined inputs. When called from the plotting
	routines, the input parameters are (Axis, Index, Value)

 KEYWORD PARAMETERS:
	DATE_FORMAT: a format string which may contain the following:
		       %M for month (3 character abbr)
		       %N for month (2 digit abbr)
		       %D for day of month,
		       %Y for 4 digit year.
		       %Z for last two digits of year.
		       %% is %.
		     Other characters are passed directly thru.
		     For example, '%M %D, %Y' prints DEC 11, 1993
		       '%M %2Y' yields DEC 93
		       '%D-%M' yields 11-DEC
		       '%D/%N/%Y' yields 11/12/1993
		       '%M!C%Y' yields DEC on the top line, 1993 on
		       the bottom (!C is the new line graphic command).

	MONTHS:      The names of the months, a twelve element string array.
		     If omitted, use Jan, Feb, ..., Dec.

 OUTPUTS:
	The date string to be plotted.

 COMMON BLOCKS:
	LABEL_DATE_COM.

 RESTRICTIONS:
	Only one date axis may be simultaneously active.

 PROCEDURE:
	Straightforward.

 EXAMPLE:
	For example, to plot from Jan 1, 1993, to July 12, 1994:
	  Start_date = julday(1, 1, 1993)
	  End_date = julday(7, 12, 1994)
	  Dummy = LABEL_DATE(DATE_FORMAT='%N/%D')  ;Simple mm/dd
	  x = findgen(end_date+1 - start_date) + start_date ;Time axis
	  PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1
	  (Plot with X axis style set to exact.)
	
 MODIFICATION HISTORY:
	DMS, RSI.	April, 1993.	Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/label_date.pro)


LEEFILT

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

 PURPOSE:
	Performs the Lee filter algorithm on an image array using a 
	box of size 2N+1.  This function can also be used on vectors.

 CATEGORY:
	E3 Smoothing (image).

 CALLING SEQUENCE:
	Result = LEEFILT(A [, N, Sig])

 INPUTS:
	A:	The input image array or one-dimensional vector.

 OPTIONAL INPUT PARAMETERS:
	N:	The size of the filter box is 2N+1.  The default value is 5.

	Sig:	Estimate of the standard deviation.  The default is 5.
		If Sig is negative the procedure requests a value to be 
		entered, and displays the resulting image.  This cycle 
		continues until a zero value of Sig is entered.

 OUTPUTS:
	The filtered image or vector is returned.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Displays the filtered image in an IDL window using TVSCL if Sig
	was negative.

 RESTRICTIONS:
	None.

 PROCEDURE:
	The LEE (Computer Graphics 197?) technique smooths additive
	image noise by generating statistics in a local neighborhood
	and comparing them to the expected values.

 MODIFICATION HISTORY:
	Written, 24-Nov-1982, by R. A. Howard, Naval Research Lab,
				 Washington, DC 20375

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/leefilt.pro)


LISTREP

[Previous Routine] [Next Routine] [List of Routines]
 $Id: listrep.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.


pro ListRep,X,RowNum,Rows,here
 ListRep repairs a matrix that has had data thrown away in Listwise

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/listrep.pro)


LISTWISE

[Previous Routine] [Next Routine] [List of Routines]
 $Id: listwise.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.


Function ListWise,Data,MV,RowNum, Rows,here

;ListWise returns an array identical to Data modulo the rows containing
; the missing data value, MV. Data must be a 2D array. Here is a list of
; excluded rows. Rows is an array of excluded rows.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/listwise.pro)


LIST_ALLOC

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

 $Id: list_alloc.pro,v 1.6 1994/06/01 23:08:48 ali Exp $

  WidList
   Widget List class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  LIST_Icon
       Return the list toolbar icon

UNCTION LIST_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/list_alloc.pro)


LJLCT

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

 PURPOSE:
	Load standard color tables for LJ-250/252 printer.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	LJLCT

 OUTPUTS:
	No explicit outputs.

 SIDE EFFECTS:
	The color tables are modified if the current device is 'LJ'.

 LIMITATIONS:
	The default color maps used are for the 90dpi color palette.
	There are only 8 colors colors availible at 180 dpi.

 PROCEDURE:
	If the current device is 'LJ', !D.N_COLORS is used to determine
	how many bit planes are in use (1 to 4). The standard
	color map for that number of planes is loaded. These maps are 
	described in Chapter 7 of the "LJ250/LJ252 Companion Color
	Printer Programmer Reference Manual", Table 7-5.  That manual gives
	the values scaled from 1 to 100, LJLCT scales them from 0 to 255.

 MODIFICATION HISTORY:
	AB, 29 July 1990.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ljlct.pro)


LL_ARC_DISTANCE

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

 PURPOSE:
 	This function returns the longitude and latitude [lon, lat] of
	a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az),
	from a specified location Lon_lat0.

 CATEGORY:
	Mapping, geography.

 CALLING SEQUENCE:
	Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az)

 INPUTS:
    	Lon_lat0: A 2-element vector containing the longitude and latitude
		  of the starting point. Values are assumed to be in radians
		  unless the keyword DEGREES is set.
    	Arc_Dist: The arc distance from Lon_lat0. The value must be between
		  -!PI and +!PI. To express distances in arc units, divide
		  by the radius of the globe expressed in the original units.
		  For example, if the radius of the earth is 6371 km, divide
		  the distance in km by 6371 to obtain the arc distance.    
    	Az:	  The azimuth from Lon_lat0. The value is assumed to be in
		  radians unless the keyword DEGREES is set.

 KEYWORD PARAMETERS:
    	DEGREES:  Set this keyword to express all measurements and
		  results in degrees.

 OUTPUTS:
	This function returns a two-element vector containing the
	longitude and latitude of the resulting point. Values are
	in radians unless the keyword DEGREES is set.

 PROCEDURE:
	Formula from Map Projections - a working manual.  USGS paper
	1395.  Equations (5-5) and (5-6).

 EXAMPLE:
	Lon_lat0 = [1.0, 2.0]		; Initial point specified in radians	
	Arc_Dist = 2.0			; Arc distance in radians
	Az = 1.0			; Azimuth in radians
	Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az)
	PRINT, Result
     	  2.91415    -0.622234

 MODIFICATION HISTORY:
	DMS, Aug, 1992.  Written.
       DJC, Jun, 1994.  Added test for zero arc distance.
                        Renamed "dist" variable to "arc_dist" for
                        compatibility with IDL "Dist" function.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ll_arc_distance.pro)


LOADCT

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

 PURPOSE:
	Load predefined color tables.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	LOADCT [, Table]

 OPTIONAL INPUTS:
	Table:	The number of the pre-defined color table to load, from 0 
		to 15.  If this value is omitted, a menu of the available 
		tables is printed and the user is prompted to enter a table 
		number.

 KEYWORD PARAMETERS:
	FILE:	If this keyword is set, the file by the given name is used
		instead of the file colors1.tbl in the IDL directory.  This
		allows multiple IDL users to have their own color table file.
		The specified file must exist.
	GET_NAMES: If this keyword is present AND DEFINED, the names
		of the color tables are returned as a string array.
		No changes are made to the color table.
	NCOLORS = number of colors to use.  Use color indices from 0
		to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1.
		Default = !D.TABLE_SIZE = all available colors.
	SILENT:	If this keyword is set, the Color Table message is suppressed.
	BOTTOM = first color index to use. Use color indices from BOTTOM to
		BOTTOM+NCOLORS-1.  Default = 0.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	COLORS:	The IDL color common block.

 SIDE EFFECTS:
	The color tables of the currently-selected device are modified.

 RESTRICTIONS:
	Works from the file: $IDL_DIR/colors1.tbl or the file specified
	with the FILE keyword.

 PROCEDURE:
	The file "colors1.tbl" or the user-supplied file is read.  If
       the currently selected device doesn't have 256 colors, the color
	data is interpolated from 256 colors to the number of colors
	available.

	The colors loaded into the display are saved in the common
	block COLORS, as both the current and original color vectors.

	Interpolation:  If the current device has less than 256 colors,
	the color table data is interpolated to cover the number of
	colors in the device.

 MODIFICATION HISTORY:
	Old.  For a widgetized version of this routine, see XLOADCT in the IDL
		widget library.
	DMS, 7/92, Added new color table format providing for more than
		16 tables.  Now uses file colors1.tbl.  Old LOADCT procedure
		is now OLD_LOADCT.
	ACY, 9/92, Make a pixmap if no windows exist for X windows to
		determine properly the number of available colors.
		Add FILE keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/loadct.pro)


LU_COMPLEX

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

 PURPOSE:
       1) This function solves an N by N complex linear system 
          using LU decomposition. The result is an n-element 
          complex vector.
       2) This function computes the generalized inverse of 
          an N by N complex array. The result is an N by N
          complex array.
          
 CATEGORY:
       Complex Linear Algebra.

 CALLING SEQUENCE:
       Result = LU_COMPLEX(A, B)

 INPUTS:
       A:	An N by N complex array.
       B:	1) An n-element right-side vector (real or complex),
                  if this function is used to calculate the solution
                  of a linear system.
               2) A scalar, if this function is used to calculate the
                  generalized inverse of A.

 KEYWORD PARAMETERS:
       DOUBLE:	If set to a non-zero value, computations are done in
               double precision arithmetic.
       Note:   Since IDL lacks a double-precision complex data type,
               computations are done internally in double-precision
               and the result is truncated to single-precision complex.
 EXAMPLE:
       1) Define a complex array (a) and right-side vector (b).
            a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
                 [complex(1,-2), complex(2, 2), complex(1, 0)], $
                 [complex(1, 1), complex(0, 1), complex(1, 5)]]
            b =  [complex(1, 1), complex(3,-2), complex(1,-2)]

          Solve the complex linear system (az = b) for z.
            z = LU_COMPLEX(a, b)

        2) Compute the inverse of the complex array (a) by supplying
           a scalar for b; in this example a -1 is used.
            inv = LU_COMPLEX(a, -1)

 PROCEDURE:
       LU_COMPLEX.PRO solves the complex linear system az = b
       if b is an n-element vector.
       LU_COMPLEX.PRO computes the generalized inverse of a if
       b is a scalar value.
       
 REFERENCE:
       Numerical Recipes, The Art of Scientific Computing (Second Edition)
       Cambridge University Press
       ISBN 0-521-43108-5

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, October 1993
       Modified:    GGS, RSI, February 1994
                    Transposing the array prior to calling LU_COMPLEX
                    is no longer necessary. LU_COMPLEX is now able to 
                    compute the generalized inverse of an n by n complex
                    array.  

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/lu_complex.pro)


MAKETREE

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

 PURPOSE:
	MakeTree constructs a tree representation of the nested clusters
	created by the join procedure. 

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	MAKETREE, Pos, Imin, Sim [, Unit]

 INPUT:
	Pos(i):	The position of the ith case as a leaf in the tree to be 
		constructed.

      Imin(i):	The smallest cluster to strictly contain the case or object i.

      Sim (i):	A measure of similarity among the objects in cluster i.

 OPTIONAL INPUT PARAMETERS:
	Unit:	The file unit for output.  Default is to the screen.

 KEYWORDS:
	WIDTH:	User-supplied tree width in characters.  The default is 60.
		MAKETREE tries to fit the tree into the specified width.

     CASENAME:	User-supplied vector of case names to be used in the output.
         

 PROCEDURE:
	We scan the cases in the order they appear in the tree.
	A list V is maintained of strictly increasing clusters to be
	used to determine which cluster should appear in the gap 
	between case i and case i+1.  Each cluster in V contains at
	least one case that has been scanned. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/maketree.pro)


MANN_WHITNEY

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

 PURPOSE:
	To test the null hypothesis that two populations have the same
	distribution -i.e. F(x) = G(x) against the alternative that their
	distributions differ in location, i.e F(x) = G(x+a).  MANN_WHITNEY 
	is a rank test that does not assume equal population sizes.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	MANN_WHITNEY, Pop [, U0, U1, N1, N2, Z, Prob, MISSING = M]

 INPUTS:
	Pop:	Array dimensioned (2,Maxsize).  Pop(i,j) = jth observation
		from ith population, i = 0, 1.
  
 KEYWORDS: 
      MISSING:	Value used as a place holder for missing data.  Pairwise
		handling of missing data.

 OPTIONAL OUTPUT PARAMETERS:
	U0:	MANN_WHITNEY statistic for Population 0.
	U1:	MANN_WHITNEY statistic for Population 1.     
	N1:	Size of sample from Pop(0,*)
	N2:	Size of sample from Pop(1,*)
	Z:	Test statistic,almost normal, to be used
		when sample sizes exceed 10. Otherwise, Z=0.
	Prob:	Probablity of Z or something more extreme.
		Undefined for small sample sizes.

 RESTRICTIONS: 
	All populations have the same sample size.

 COMMON BLOCKS:
	None.

PROCEDURE:  
	The Mann_Whitney statistics Ua may be computed by ordering all 
	observations according to their magnitude and counting the number
	of observations in the first sample that precede each observation
	in the second. Ub may be computed likewise. Very large or very small
	values of UA or UB indicate seperation in the data and suggest 
	rejection of the null hypothesis. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/mann_whitney.pro)


MAN_PROC

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

 PURPOSE:
	Provide online documentation for IDL topics.  If the current
	graphics device supports widgets, a graphical user interface
	is used.  Otherwise, a more basic version that is a cross
	between the Unix man pages and VMS online help is used.  The
	help is organized in a two-level hierarchy.  Level 1 is the
	global subject, and Level 2 supplies help on subjects within
	each global subject.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	MAN_PROC [, Request]

 INPUTS:
     Request:	A scalar string containing the item for which help is desired.
		This string can contain one or two (whitespace separated) 
		words.  The first word is taken as the global topic and the 
		second as the topic within the scope of the first.  The user
		is prompted for missing words.

 OUTPUTS:
	The widget version uses a text widget to display the help
	text.  The basic version sends help text to the standard output.

 COMMON BLOCKS:
	None.

 RESTRICTIONS:
	The help text is derived from the LaTeX files used to produce
	the reference manual.  However, it is not possible to produce
	exactly the same output as found in the manual due to the limitations
	of text-oriented terminals.  Therefore, the text used is considerably
	abbreviated.  Always check the manual if the online help is
	insufficient. 

 MODIFICATION HISTORY:
	4 January 1991, AB	Renamed the old MAN_PROC to MP_BASIC and added
		 		MP_WIDGETS to handle the widget interface.
	3 September 1992, AB	Switched from the IDLwidgets version
				(MP_WIDGETS) to the builtin help. This allows
				help and the IDL> prompt to work simultaneously
	17 May 1993, AB		Reverted to using MP_WIDGETS for the Sun 3
				because it is stuck at OpenWindows 2.0 and
				recent changes to online help will not be
				ported to that platform.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/man_proc.pro)


MAP_IMAGE

[Previous Routine] [Next Routine] [List of Routines]
NAME:
     map_image
PURPOSE:
       This function returns the Image_Orig image warped to fit
       the map specified by the system variable !Map. Image_Orig
       must be centered at 0.
Category:
        Mapping
Calling Sequence:
        result = map_image(Image_Orig [, xstart, ystart [, xsize, ysize]])
INPUT:
      Image_Orig--- A two-dimensional array representing geographical
               image to be overlayed on map.  It has Nx columns,
		and Ny rows.
KEYWORDS:
	LATMIN --- the latitude corresponding to the first row of Image_Orig.
		The default value is -90.  Latitude and Longitude values
		refer to the CENTER of each cell.
	LATMAX --- the latitude corresponding to last row of Image_Orig. The
		default is  90 - (180. / Ny).
	LONMIN --- the longitude corresponding to the first column of
		Image_Orig. The default value is -180.
	LONMAX --- the longitude corresponding to the last column
		of Image_Orig. The default is  180. - (360./Nx).
		For images crossing the international dateline, lonmax
		will be less than lonmin.
		If the longitude of the last column is equal to 
		(lonmin - (360. /Nx)) MODULO 360.
		it is assumed that the image covers all longitudes.
	BILINEAR --- A flag, if set, to request bilinear interpolation. The
		default is nearest neighbor.
	COMPRESS --- Interpolation compression flag.  Setting this to
		a higher number saves time --- lower numbers produce
		more accurate results.  Setting this to 1
		solves the inverse map transformation for every
		pixel of the output image.  Default = 4 for output devices
		with fixed pixel sizes.
	WHOLE_MAP = Set to defeat the code that determines the extent
		of the image on the map.  Some projections are so
		tricky (especially the satellite) that it is difficult
		to find where the image goes on the map.  Setting this
		keyword computes the entire map, at the cost of more
		time.  For images which cover the entire map, setting
		this keyword produces no penalty.
	SCALE = pixel / graphics scale factor for devices with scalable
		pixels (e.g. PostScript).  Default = 0.02 pixels/graphic_coord.
		This yields an approximate output image size of 350 x 250.
		Make this number larger for more resolution (and larger
		PostScript files, and images), or smaller for faster
		and smaller, less accurate images.
	MISSING = value to set areas outside the valid map coordinates.
		If omitted, areas outside the map are set to 255 (white) if
		the current graphics device is PostScript, or 0 otherwise.
	MAX_VALUE = values in Image_Orig greater than or equal to MAX_VALUE
		are considered missing.  Pixels in the output image
		that depend upon missing pixels will be set to MISSING.
 Optional Output Parameters:
	xstart --- the  x coordinate where the left edge of the image
		should be placed on the screen.
	ystart --- the y coordinate where th bottom edge of the image
		should be placed on the screen.
	xsize ---  returns the width of the resulting image expressed in
		graphic coordinate units.  If current graphics device has
		scalable pixels,  the value of XSIZE and YSIZE should
		be passed to the TV procedure.
	ysize ---  returns the pixel height of the resulting image, if the
		current graphics device has scalable pixels. 

Output:
      The warped image is returned.

 Procedure:  An image space algorithm is used, so the time required
	is roughly proportional to the size of the final image.

MODIFICATION HISTORY:
       CAB, Feb, 1992. Map_image has been changed to handle images
       	crossing the international dateline in a more convenient way.
       	Specifically, it no longer requires that the keyword LONMIN be
       	greater than or equal to -180 or the keyword LONMAX be
		less than or equal to 180.
	DMS, Aug, 1992.  Completly rewritten.  Uses different algorithms.
	DMS, Dec, 1992.  Coordinates were off by part of a pixel bin.
		Also, round when not doing bi-linear interpolation.
	DMS, Sep, 1993.  Added MAX_VALUE keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/map_image.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_set, p0lat, p0lon, rot, proj = proj,            $
              	     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, 	      $
		     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 finished,
			  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 boundary.
	  con_color	= color of continents.
         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.
	  Horizon	= if set, draw the horizon (limb) around the map.
	  Isotropic	= if set, map will be made isotropic and 
			  X and Y will have a 1:1 aspect ratio.
         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 < Lonmax.
			   For maps that cross the international dateline,
			   specify west longitudes as angles between
			   180 and 360.
			  If an eight element vector: [ lat0, lon0, 
			    lat1, lon1, lat2, lon2, lat3, lon3] specify
			    four points on the map which give, respectively,
			    the location of a point on the left edge, 
			    top edge, right edge, and bottom edge of
			    the map extent.
         lonalign     = the aligment of the text baseline for
                        longitude labels. A value of 0.0 left justifies
                        the label, 1.0 right justifies it and
                         0.5 centers it. Default value is .5.
        Londel         = if set, spacing of meridians drawn on grid.
                         Y axis, and the screen border
        LonLab       =  if set, latitude at which to place longitude
                         labels. Default is longitude of center.
        Mlinethick     = thickness of continental boundaries. Default is 1.
        Mlinestyle     = linestyle of continental boundaries. Default is
                         0 = normal.
        Noborder       = if set, no border is drawn around the map.
        Noerase        = flag to signal that map_set should not erase the
                         current plot window. Default is to erase.
 
	Position	= Optional POSITION keyword for PLOT to specify the
			  location of the map in the drawing area. See manual.
	Sat_p		= an three element array of additional parameters
			  required by the satellite projection.  The parameters
			  are:  [ P, omega, gamma], where:  P = distance of
			  viewpoint from center of globe, in units of the 
			  globe's radius (P may be negative).
			  Gamma = rotation of 
			  projection plane clockwise from north.
			  Omega = downward tilt of the 
			  viewing plane in degrees.  The
			  projection plane is first rotated gamma degrees 
			  clockwise from north, and then tilted down
			  omega degrees.  If both gamma and omega are zero,
			  a Vertical Perspective projection results.
	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
	zvalue		= This keyword goes with T3D and specifies
			  the height of the mapping plane.
	whole_map	= in some cases where the limit is small, the gridlines
			  will not cover the whole map.  This keyword can be
			  specified to eliminate that problem.

 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
	DMS, 3-93	Extended axes by a fudge factor, improved labelling.
	JIY, 4-93	Added ZVALUE keyword to work with T3D.
			Added NO_GRID keyword to MAP_GRID for displaying
			labels only.
			Added WHOLE_MAP keyword to make the gridlines cover
			the entire map area when the limit is small
			COLOR now works with map border and labels.
   	KDB, 10-93	Fixed bug that would cause divide by zero errors
			when P0lat was small and Rot equal to 0.0.
       KDB,  5-94	Removed FONT=0 from plot calls. All vector fonts
			can now be used. Font selection now depends on 
			the value of !p.font
	DMS, 6-94	Added HORIZON and ISOTROPIC keywords.  Cleaned
			up a lot of logic.  Limits for maps of the entire
			globe are done more cleanly and a lot quicker.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/map_set.pro)


MESH_OBJ

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

 PURPOSE:
       MESH_OBJ generates a polygon mesh (vertex list and polygon list) that
       represent the desired primitive object. The available primitive
       objects are: triangulated surface, rectangular surface, polar surface,
       cylindrical surface, spherical surface, surface of extrusion, surface
       of revolution, and ruled surface.

 CATEGORY:
       Graphics.

 CALLING SEQUENCE:
       MESH_OBJ, Type, Vertex_List, Polygon_List, Array1, Array2

 INPUTS:

       Type:   An integer which specifies what type of object to create.

                  TYPE CODE:      SURFACE TYPE:
                  ----------      -------------

                  0               TRIANGULATED
                  1               RECTANGULAR
                  2               POLAR
                  3               CYLINDRICAL
                  4               SPHERICAL
                  5               EXTRUSION
                  6               REVOLUTION
                  7               RULED

                  ELSE            none

       Vertex_List:
               On input, Vertex_List may be undefined. On output, it contains
               the mesh vertices. Vertex_List and Polygon_List have the same
               format as the lists returned by the SHADE_VOLUME procedure.

       Polygon_List:
               On input, Polygon_List may be undefined. On output, it contains
               the mesh indexes.

       Array1:
               An array whose use depends on the type of object being created.

                  SURFACE TYPE:   Array1 type
                  -------------   --------------------------------------------

                  TRIANGULATED    A (3, n) array containing random [x, y, z]
                                  points to build a triangulated surface from.
                                  The resulting polygon mesh will have n
                                  vertices. When shading a triangulated mesh,
                                  the shading array should have (n) elements.

                  RECTANGULAR     A two dimensional (n, m) array containing
                                  z values. The resulting polygon mesh will
                                  have n*m vertices.
                                  When shading a rectangular mesh, the shading
                                  array should have (n, m) elements.

                  POLAR           A two dimensional (n, m) array containing
                                  z values. The resulting polygon mesh will
                                  have n*m vertices. The n dimension of the
                                  array is mapped to the polar angle, and the
                                  m dimension is mapped to the polar radius.
                                  When shading a polar mesh, the shading array
                                  should have (n, m) elements.

                  CYLINDRICAL     A two dimensional (n, m) array containing
                                  radius values. The resulting polygon mesh
                                  will have n*m vertices. The n dimension of
                                  the array is mapped to the polar angle,
                                  and the m dimension is mapped to the Z axis.
                                  When shading a cylindrical mesh, the shading
                                  array should have (n, m) elements.

                  SPHERICAL       A two dimensional (n, m) array containing
                                  radius values. The resulting polygon mesh
                                  will have n*m vertices. The n dimension of
                                  the array is mapped to the longitude (0.0 to
                                  360.0 degrees), and the m dimension is
                                  mapped to the latitude (-90.0 to +90.0
                                  degrees).
                                  When shading a spherical mesh, the shading
                                  array should have (n, m) elements.

                  EXTRUSION       A (3, n) array of connected 3-D points which
                                  define the shape to extrude. The resulting
                                  polygon mesh will have n*(steps+1) vertices
                                  (where steps is the number of "segments" in
                                  the extrusion). (See the P1 keyword).
                                  If the order of the elements in Array1 is
                                  reversed, then the polygon facing is
                                  reversed.
                                  When shading an extrusion mesh, the shading
                                  array should have (n, steps+1) elements.

                  REVOLUTION      A (3, n) array of connected 3-D points which
                                  define the shape to revolve. The resulting
                                  polygon mesh will have n*((steps>3)+1)
                                  vertices (where steps is the number of
                                  "steps" in the revolution). (See the P1
                                  keyword). If the order of the elements in
                                  Array1 is reversed, then the polygon facing
                                  is reversed.
                                  When shading a revolution mesh, the shading
                                  array should have (n, (steps>3)+1) elements.

                  RULED           A (3, n) array of connected 3-D points which
                                  define the shape of the first ruled vector.
                                  The optional (3, m) Array2 parameter defines
                                  the shape of the second ruled vector. The
                                  resulting polygon mesh will have
                                  (n>m)*(steps+1) vertices (where steps is the
                                  number of intermediate "steps"). (See the P1
                                  keyword).
                                  When shading a ruled mesh, the shading
                                  array should have (n>m, steps+1) elements.

 OPTIONAL INPUTS:

       Array2:
               If the object type is 7 (Ruled Surface) then Array2 is a (3, m)
               array containing the 3-D points which define the second ruled
               vector. If Array2 has fewer elements than Array1 then Array2 is
               processed with CONGRID to give it the same number of elements
               as Array1. If Array1 has fewer elements than Array2 then Array1
               is processed with CONGRID to give it the same number of
               elements as Array2.
               Array2 MUST be supplied if the object type is 7. Otherwise,
               Array2 is ignored.

 KEYWORD PARAMETERS:

       P1 - P5:
               The meaning of the keywords P1 through P5 vary depending upon
               the object type.

                  SURFACE TYPE:   Keywords
                  -------------   --------------------------------------------

                  TRIANGULATED    P1, P2, P3, P4, and P5 are ignored.

                  RECTANGULAR     If Array1 is an (n, m) array, and if P1 has
                                  n elements, then the values contained in
                                  P1 are the X coordinates for each column of
                                  vertices. Otherwise, FINDGEN(n) is used for
                                  the X coordinates. If P2 has m elements,
                                  then the values contained in P2 are the Y
                                  coordinates for each row of vertices.
                                  Otherwise, FINDGEN(m) is used for the Y
                                  coordinates. The polygon facing is reversed
                                  if the order of either P1 or P2 (but not
                                  both) is reversed.
                                  P3, P4, and P5 are ignored.

                  POLAR           P1 specifies the polar angle of the first
                                  column of Array1 (the default is 0). P2
                                  specifies the polar angle of the last column
                                  of Array1 (the default is 2*PI). If P2 is
                                  less than P1 then the polygon facing is
                                  reversed. P3 specifies the radius of the
                                  first row of Array1 (the default is 0). P4
                                  specifies the radius of the last row of
                                  Array1 (the default is m-1). If P4 is less
                                  than P3 then the polygon facing is reversed.
                                  P5 is ignored.

                  CYLINDRICAL     P1 specifies the polar angle of the first
                                  column of Array1 (the default is 0). P2
                                  specifies the polar angle of the last column
                                  of Array1 (the default is 2*PI). If P2 is
                                  less than P1 then the polygon facing is
                                  reversed. P3 specifies the Z coordinate of
                                  the first row of Array1 (the default is 0).
                                  P4 specifies the Z coordinate of the last
                                  row of Array1 (the default is m-1). If P4 is
                                  less than P3 then the polygon facing is
                                  reversed. P5 is ignored.

                  SPHERICAL       P1 specifies the longitude of the first
                                  column of Array1 (the default is 0). P2
                                  specifies the longitude of the last column
                                  of Array1 (the default is 2*PI). IF P2 is
                                  less than P1 then the polygon facing is
                                  reversed. P3 specifies the latitude of the
                                  first row of Array1 (the default is -PI/2).
                                  P4 specifies the latitude of the last row of
                                  Array1 (the default is +PI/2). If P4 is less
                                  than P3 then the polygon facing is reversed.
                                  P5 is ignored.

                  EXTRUSION       P1 specifies the number of steps in the
                                  extrusion (the default is 1). P2 is a three
                                  element vector specifying the direction
                                  (and length) of the extrusion (the default
                                  is [0, 0, 1]). P3, P4, and P5 are ignored.

                  REVOLUTION      P1 specifies the number of "facets" in the
                                  revolution (the default is 3). If P1 is less
                                  than 3 then 3 is used. P2 is a three element
                                  vector specifying a point that the rotation
                                  vector passes through (the default is
                                  [0, 0, 0]). P3 is a three element vector
                                  specifying the direction of the rotation
                                  vector (the default is [0, 0, 1]). P4
                                  specifies the starting angle for the
                                  revolution (the default is 0). P5 specifies
                                  the ending angle for the revolution (the
                                  default is 2*PI). If P5 is less than P4 then
                                  the polygon facing is reversed.

                  RULED           P1 specifies the number of "steps" in the
                                  ruling (the default is 1).
                                  P2, P3, P4, and P5 are ignored.

       DEGREES:   If set, then the input parameters are in degrees
                  (where applicable). Otherwise, the angles are in
                  radians.

 EXAMPLE:

       ; Create a 48x64 cylinder with a constant radius of 0.25.
       MESH_OBJ, 3, Vertex_List, Polygon_List, Replicate(0.25, 48, 64), $
          P4=0.5

       ; Transform the vertices.
       T3d, /Reset
       T3d, Rotate=[0.0, 30.0, 0.0]
       T3d, Rotate=[0.0, 0.0, 40.0]
       T3d, Translate=[0.25, 0.25, 0.25]
       Vertex_List = Vert_T3d(Vertex_List)

       ; Create the window and view.
       Window, 0, Xsize=512, Ysize=512
       Create_View, Winx=512, Winy=512

       ; Render the mesh.
       Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0
       Tvscl, Polyshade(Vertex_List, Polygon_List, /Normal)


       ; Create a cone (surface of revolution).
       MESH_OBJ, 6, Vertex_List, Polygon_List, $
          [[0.75, 0.0, 0.25], [0.5, 0.0, 0.75]], P1=16, P2=[0.5, 0.0, 0.0]

       ; Create the window and view.
       Window, 0, Xsize=512, Ysize=512
       Create_View, Winx=512, Winy=512, Ax=30.0, Ay=(140.0), Zoom=0.5

       ; Render the mesh.
       Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0
       Tvscl, Polyshade(Vertex_List, Polygon_List, /Data, /T3d)

 MODIFICATION HISTORY:
       Written by:     Daniel Carr, Thu Mar 31 19:16:43 MST 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/mesh_obj.pro)


MIN_CURVE_SURF

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

 PURPOSE:
	This function Interpolates a regularly- or irregularly-gridded
	set of points with either a minimum curvature surface or
	a thin-plate-spline surface.

 CATEGORY:
	Mathematical functions, Interpolation, Surface Fitting

 CALLING SEQUENCE:
	Result = MIN_CURVE_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:
	TPS:	If set, use the thin-plate-spline method, otherwise
		use the minimum curvature surface method.
  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. 
	XOUT:	  If present, XOUT must be 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:	  If present, YOUT must be a vector containing the output
		  grid Y values. If this parameter is supplied, GS, BOUNDS,
		  and NY are ignored for the Y output grid. Use this
		  parameter to specify irregular spaced output grids.
	XPOUT:	  If present, the arrays XPOUT and YPOUT contain the X and Y
	YPOUT:	  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:
	This function returns a two-dimensional floating point array
 	containing the interpolated surface, sampled at the grid points.

 RESTRICTIONS:
	The accuracy of this function is 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^k),
	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.  k = 1 for minimum curvature surface,
	and 2 for Thin Plate Splines.  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))

	The results obtained the thin plate spline (TPS) or the minimum
	curvature surface (MCS) methods are very similar.  The only 
	difference is in the basis functions: TPS uses d^2*alog(d^2),
	and MCS uses d^2*alog(d), where d is the distance from 
	point (x(i),y(i)).

 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 = 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)

 Example 2: Regularly gridded cases
	Make some random data
	  z = randomu(seed, 5, 6)

	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, XPOUT and YPOUT.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/min_curve_surf.pro)


MK_LIBRARY_HELP

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

 PURPOSE:
	Given a directory or a VMS text library containing IDL user library 
	procedures, this procedure generates a file in the IDL help format
	that contains the documentation for those routines that contain
	a DOC_LIBRARY style documentation template.  The output file is
	compatible with the IDL "?" command.

	A common problem encountered with the DOC_LIBRARY user library
	procedure is that the user needs to know what topic to ask for
	help on before anything is possible.  The XDL widget library
	procedure is one solution to this "chicken and egg" problem.
	The MK_LIBRARY_HELP procedure offers another solution.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	MK_LIBRARY_HELP, Source, Outfile

 INPUTS:
      SOURCE:	The directory or VMS text library containing the
		.pro files for which help is desired.  If SOURCE is
		a VMS text library, it must include the ".TLB" file
		extension, as this is what MK_LIBRARY_HELP uses to
		tell the difference.

     OUTFILE:	The name of the output file which will be generated.
		If you place this file in the help subdirectory of the
		IDL distribution, and if it has a ".help" extension, then
		the IDL ? command will find the file and offer it as one
		of the availible help categories. Note that it uses the
		name of the file as the name of the topic.

 KEYWORDS:
     TITLE:	If present, a string which supplies the name that
		should appear on the topic button for this file
		in the online help. This title is only used on
		systems that allow very short file names (i.e. MS DOS),
		so it won't always have a visible effect. However,
		it should be used for the broadest compatibility. If
		a title is not specified, IDL on short name systems
		will use a trucated copy of the file name.
     VERBOSE:	Normally, MK_LIBRARY_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.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A help file with the name given by the OUTFILE argument is
	created.

 RESTRICTIONS:
	If you put the resulting file into the "help" subdirectory of
	the IDL distribution, it will be overwritten when you install a
	new release of IDL.  To avoid this problem, keep a backup copy of 
	your created help files in another directory and move them into 
	the new distribution.

	Since this routine copies the documentation block from the
	functions and procedures, subsequent changes will not be
	reflected in the help file unless you run MK_LIBRARY_HELP
	again.

	The following rules must be followed in formating the .pro
	files which are searched.
		(a) The first line of the documentation block contains
		    only the characters ";+", starting in column 1.
		(b) The last line of the documentation block contains
		    only the characters ";-", starting in column 1.
		(c) Every other line in the documentation block contains
		    a ";" in column 1.

	No reformatting of the documentation is done.

 MODIFICATION HISTORY:
	17 April, 1991, Written by AB, RSI.
	1 December 1992, Reorganized internally. No functionality change.
	31 December 1992, Added the TITLE keyword as part of the effort
		towards releasing the Microsoft Windows version of IDL.
	20 January 1993,  Corrected for VMS, W. Landsman HSTX
	17 March 1993, Corrected for MSDOS and VMS, AB.
	13 January 1994, Added the VERSION attribute and modified format to
		accomodate extended identifier names (the old format was
		limited to 15 characters.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/mk_library_help.pro)


MODIFYCT

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

 PURPOSE:
	Update the distribution color table file "colors.tbl1" or the
	user-supplied file with a new table.

 CATEGORY:
	Z4 - Image processing, color table manipulation.

 CALLING SEQUENCE:
	MODIFYCT, Itab, Name, R, G, B

 INPUTS:
	Itab:	The table to be updated, numbered from 0 to 255.  If the
		table entry is greater than the next available location
		in the table, then the entry will be added to the table
		in the available location rather than the index specified
		by Itab.  On return, Itab will contain the index for the
		location that was modified or extended.  The table 
		can be loaded with the IDL command:  LOADCT, Itab.

	Name:	A string up to 32 characters long that contains the name for 
		the new color table.

	R:	A 256-element vector that contains the values for the red
		color gun.

	G:	A 256-element vector that contains the values for the green
		color gun.

	B:	A 256-element vector that contains the values for the blue
		color gun.

 KEYWORD PARAMETERS:
	FILE:	If this keyword is set, the file by the given name is used
		instead of the file colors1.tbl in the IDL directory.  This
		allows multiple IDL users to have their own color table file.
		The file specified must be a copy of the colors1.tbl file.
		The file must exist.

 OUTPUTS:
	Itab:	The index of the entry which was updated, 0 to 255.  This
		may be different from the input value of Itab if the
		input value was greater than the next available location
		in the table.  If this was the case the entry was added to
		the table in the next available location instead of leaving
		a gap in the table.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The distribution file "colors.tbl1" or the user-supplied file is
	modified with the new table.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	Aug, 1982, DMS, Written.
	Unix version, 1987, DMS.
	ACY, 9/92, Update for new color table structure, Add FILE keyword.
		   Allow extending table.
	

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/modifyct.pro)


MP_BASIC

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

 PURPOSE:
	Provide online documentation for IDL topics. The style
	is a cross between Unix man pages and VMS online help.  The
	help is organized in a two level hierarchy --- Level 1 is the
	global subject, and Level 2 supplies help on subjects within
	each global subject.  If !D.WINDOW is not -1, (window system in use)
	the mouse is used to prompt for subjects, otherwise, the normal tty
	interface is used.

	THIS ROUTINE IS TO BE CALLED ONLY BY MAN_PROC.  Users can obtain
	online help by using the "?" command.

 CATEGORY:
	Help, documentation.

 CALLING SEQUENCE:
	MP_BASIC [, Request]

 INPUTS:
     REQUEST:	A scalar string containing the item on which help is desired.
		This string can contain 1 or 2 (whitespace separated) words.
		The first word is taken as the global topic and the second
		as the topic within the scope of the first.  The procedure
		prompts for missing words.

 OUTPUTS:
	Help text is sent to the standard output.

 COMMON BLOCKS:
	None.

 RESTRICTIONS:
	The help text is derived from the LaTeX files used to produce
	the reference manual.  However, it is not possible to produce
	exactly the same output as found in the manual due to limitations
	of text oriented terminals.  The text used is therefore considerably
	abbreviated.  Always check the manual if the online help is
	insufficient. 

 MODIFICATION HISTORY:
	3 November 1988, AB

	January, 1989, AB
	Added ambiguity resolution, ability to handle multiple levels,
	and support for mouse.

       SNG, December, 1990	Added support for MS-DOS.

	3 January 1991, AB
	Renamed from MAN_PROC to make room for the widget version.
	
       Bobby Candey, Atlantic Research         30 January 1991
       Added looping in VMS version to extract multiple "]" from filenames

       31 December 1992, AB    Modified to ignore the optional %TITLE
                               line at the top of the file. There's no
                               reason to handle it, since this routine is
                               obsolete. The builtin online help system
                               *does* handle it.

	11 February 1993, SMR	Added support for the Mac Version
	21 April 1993, AB, Added ability to use new !HELP_PATH system
		variable to locate help files.
	13 January 1994, AB	Added ability to understand new version
				2 help files with extended identifier names.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/mp_basic.pro)


MP_WIDGETS

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

 PURPOSE:
	Provide a graphical user interface to the online documentation.
	The topic is selected by pressing a button at the top.
	Subtopics a displayed in a scrolling list on the left side.  Pressing
	a mouse button while pointing at a subtopic causes the information
	on that topic to be displayed in the large text region on the right.

	It is expected that this routine will only be called by MAN_PROC.

 CATEGORY:
	Help, documentation, widgets.

 CALLING SEQUENCE:
	MP_WIDGETS [, Request]

 INPUTS:
     Request:	A scalar string containing the item on which help is desired.
		This string can contain 1 or two (whitespace separated) words.
		The first word is taken as the global topic and the second
		as the topic within the scope of the first.

 OUTPUTS:
	None.  A widget interface is used to allow reading the help text.

 COMMON BLOCKS:
	MPW_COM: This common block is private to MP_WIDGETS, and
		 should not be referenced by other modules.

 RESTRICTIONS:
	The basic version of the help facility (MP_BASIC) can accept
	ambiguous requests, and if a request maches more than a single
	subtopic, they are all shown.  This version can also accept
	ambiguous requests, but only the first subtopic matched is shown.
	This feature is not as important as it was in MP_BASIC because the 
	widget interface allows multiple subjects to be viewed easily.

	This routine uses a COMMON block to keep its internal state, so only 
	one copy of this routine can run at a time.

 MODIFICATION HISTORY:
	AB, August, 1990
	28 December 1990	Rewritten to take advantages in changes to 
				the widget facility, to use XMANAGER, and to 
				accept the REQUEST argument.
	31 December 1992	Modified to ignore the optional %TITLE
				line at the top of the file. There's no
				reason to handle it, since this routine is
				obsolete. The builtin online help system
				*does* handle it.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/mp_widgets.pro)


MULTI

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

 PURPOSE:
	Expand the current color table to wrap around N times.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	MULTI, N

 INPUTS:
	N:	The number of times the color table will wrap.  This 
		parameter does not need not be an integer.

 OUTPUTS:
	No explicit outputs, color tables are loaded.

 COMMON BLOCKS:
	COLORS, the IDL color table common block, contains current color 
	tables, loaded by LOADCT, ADJCT, HLS, HSV, etc.

 SIDE EFFECTS:
	Color tables are loaded.

 RESTRICTIONS:
	One of the above procedures must have been called.

 PROCEDURE:
	Tables are expanded by a factor of n.

 EXAMPLE:
	Display an image, load color table 1, and make that color table
	"wrap around" 3 times.  Enter:
		TVSCL, DIST(256)	;A simple image.
		LOADCT, 1		;Load color table 1.
		MULTI, 3		;See how the new color table affects
					;the image.
 
 MODIFICATION HISTORY:
	DMS, May, 1984.
	Changed common, DMS, 4/87.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/multi.pro)


MULTICOMPARE

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

 PURPOSE:
	Multicompare gives the user access to a variety of procedures for 
	making many inferences from a single experimental data set. These
	procedures are designed to guard against experimentwise errors 
	resulting from the increased probabilty of at least one inferential
	error when many inferences are made. 

 CATEGORY: 
	Statistics.

 CALLING SEQUENCE:
	MULTICOMPARE, X, Contrast, A, St

 INPUTS: 
	X:	2 or 3-dimensional array of experimental data values.

     Contrast:	An array, dimensioned (CL,C), where:
		CL = the number of treatments
		   = the number of columns of X
		and 
		C = the number of contrasts or inferences to be tested.
		Contrast, B(i,j) = the coefficient of the mean of the ith 
		treatment in the jth contrast.

	A:	Experimentwise significance level desired. 
 
 OUTPUT:
	St:	An array, dimensioned (2,C), where C is the number
		of contrasts to test. ST(0,j) = the absolute value
		of the test statistic. ST(1,j) = the lower
		limit of the rejection region - i.e.,
		if ST(0,j) > ST(1,j) reject the null hypothesis for
		the jth contrast at the a*100% significance level.

 KEYWORD PARAMETERS:
	Type of design structure. Options are:
      ONE_WAY:	If set,  1-way anova.

 UNEQUAL_ONE_WAY:  If set,  1-way ANOVA with unequal sample sizes.

      TWO_WAY:	If set,  2-way ANOVA.

 INTERACTIONS_TWO_WAY:	If set, 2-way ANOVA with interactions.
	One and only one of the above options may be set.

	Options for multicomparison testing:

	LSD:	Fisher's LSD procedure. LSD is a post-hoc test of any
		contrasts of the treatment means.  It should only be used if
		the F-test for equal means rejects the null hypothesis at
		the A*100% significance level. LSD has an experimentwise
		error rate approximately equal to 5%.

   BONFERRONI:	Bonferroni's method. This method should be selected
		instead of LSD if the F-test is not significant.
                                      
        
      SCHEFFE:	Scheffe's procedure.  Use Sheffe's procedure to make any
		number of unplanned comparisons - that is, to data snoop.
		Experimentwise error rate is A*100%.              

	TUKEY:	Tukey`s procedure. Tukey's procedure is often more sensitive
		than Sheffe's but in the general case it requires equal sample
		sizes. Pairwise testing of means is allowed with unequal 
		sample sizes, but if the disparity is too great, Sheffe's 
		method is more sensitive.  The experimentwise error rate, A,
		must be between 0 and 0.1.

	BLOCK:	a flag which ,if set, signals that comparisons
		should be done on block means instead of treatment means.
		Alternatively, input transpose(X) for the experimental data
		array.

      MISSING:	Placeholding value for missing data.  If not set, then assume
		no missing data.

 TINTERACTION:	A flag, if set, to signal that contrasts are for interaction
		effects. The user should not set both keywords BLOCK and
		TINTERACTION.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/multicompare.pro)


NCDF_EXISTS

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

 PURPOSE:
	Test for the existence of the NetCDF library

 CATEGORY:
	File Formats

 CALLING SEQUENCE:
	Result = NCDF_EXISTS()

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Returns TRUE (1) if the NetCDF data format library is supported
	Returns FALSE(0) if it is not.

 COMMON BLOCKS:
	NCDFTEST

 EXAMPLE:
	IF ncdf_exists() EQ 0 THEN Fail,"Library not supported on this machine"

 MODIFICATION HISTORY
	Written by:	Joshua Goldstein,  12/8/92

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ncdf_exists.pro)


NORM

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

 PURPOSE:
       1) This function computes the Euclidean norm of a vector.
          OR
       2) This function computes the Infinity norm of an array.

 CATEGORY:
       Complex Linear Algebra.

 CALLING SEQUENCE:
       Result = NORM(A)

 INPUTS:
       A:      An N-element real or complex vector.
               An M by N real or complex array.

 KEYWORD PARAMETERS:
       DOUBLE: If set to a non-zero value, computations are done in
               double precision arithmetic.
       Note:   Since IDL lacks a double-precision complex data type,
               this keyword has no effect if A is of complex type. 

 EXAMPLE:
       1) Define an N-element complex vector (a).
            a = [complex(1, 0), complex(2,-2), complex(-3,1)]
          Compute the Euclidean norm of (a).
            result = norm(a)

       2) Define an M by N complex array (a). 
            a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
                 [complex(1,-2), complex(2, 2), complex(1, 0)]]
          Compute the Infinity norm of the complex array (a).
            result = norm(a)

 PROCEDURE:
       NORM.PRO computes the Euclidean norm of an N-element vector.
       NORM.PRO computes the Infinity norm of an M by N array

 REFERENCE:
       ADVANCED ENGINEERING MATHEMATICS (seventh edition)
       Erwin Kreyszig
       ISBN 0-471-55380-8

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, April 1992
       Modified:    GGS, RSI, February 1994
                    Computes the Euclidean norm of an N-element vector.
                    Accepts complex inputs. Added DOUBLE keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/norm.pro)


OPLOTERR

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

 PURPOSE:
	Overplot data points with accompanying error bars.

 CATEGORY:
	Plotting, 2-dimensional.

 CALLING SEQUENCE:
	OPLOTERR, [ X ,]  Y , Err  [, Psym ]

 INPUTS:
	Y:	The array of Y values.

	Err:	The array of error bar values.

 OPTIONAL INPUT PARAMETERS:
	X:	An optional array of X values.  The procedure checks whether 
		or not the third parameter passed is a vector to decide if X 
		was passed.
		
		If X is not passed, then INDGEN(Y) is assumed for the X values.

	PSYM:	The plotting symbol to use (default = +7).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Arrays cannot be of type string.  There must be enough points to
	plot.

 PROCEDURE:
	A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR
	is written to the output device over any plot already there.

 MODIFICATION HISTORY:
	William Thompson	Applied Research Corporation
	July, 1986		8201 Corporate Drive
				Landover, MD  20785

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/oploterr.pro)


PAIRWISE

[Previous Routine] [Next Routine] [List of Routines]
 $Id: pairwise.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.


Pro Pairwise,X,Missing,YR,YC, NotGood1, good
;On return,  YR(i) = the number of entries in the ith row of the two
; dimensional array X that are unequal to Missing. YC= analoque of YR
; for rows. Also, all occurences of Missinig in X will be changed to 0.
; Pairwise is intended to handle missing data.

  

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pairwise.pro)


PARTIAL_COR

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

 PURPOSE:
	Compute the partial correlation coefficient between
	X and Y after both have been adjusted for the variables in C.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE: 
	Result = PARTIAL_COR(X,Y,C)

 INPUTS:
	X:	column vector of R independent data values.
	Y:	column vector of R dependent data values.

	C:	two dimensional array with each column containing data
		values corresponding to an independent variable.  Each column
		has length R.

 OUTPUT:
	The partial correlation coefficient.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/partial_cor.pro)


PARTIAL_COR2

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

 PURPOSE:
	Compute the partial correlation coefficient between X and Y after
	both have been adjusted for the variables in C

 CATEGORY:
	Statistics.

 CALLING SEQUENCE: 
	Result = PARTIAL_COR(X,Y,C)

 INPUTS:
	X:	Column vector of R independent data values.

	Y:	Column vector of R dependent data values.
  
	C:	Two-dimensional array with each column
		containing data values corresponding to
		an independent variable. Each column has
		length R.

 OUTPUT:
       The partial correlation coefficient.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/partial2_cor.pro)


PDMENU_ALLOC

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

 $Id: pdmenu_alloc.pro,v 1.8 1994/06/01 23:08:48 ali Exp $

  WidPdmenu
   Widget Pull Down Menu class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  PDMENU_Icon
       Return the pulldown menu toolbar icon

UNCTION PDMENU_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pdmenu_alloc.pro)


PD_BISECTION

[Previous Routine] [Next Routine] [List of Routines]
 $Id: pd_bisection.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.



unction pd_bisection, a, funct, U, L, del
 pd_bisections uses a simple bisection technique on probabilty
 distribution funct to find the cutoff point x so that the probabilty of
 an observation from the given distribution less than x is a(0). U and L are
 respectively upper and lower limits for x. a(1) and a(2) are df`s if
 appropriate. Funct is a string.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pd_bisection.pro)


PHASER

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

 PURPOSE:
	Issue the SET_PLOT and DEVICE commands appropriate for the Tektronix
	Phaser IIpxi color PostScript laser printer.

 CATEGORY:
	Device drivers.

 CALLING SEQUENCE:
	PHASER [, /LETTER] [, /LEGAL] [, /LANDSCAPE] [, /PORTRAIT]

 INPUTS:
	None.

 KEYWORD PARAMETERS:
      LETTER:	If this keyword is set, output is produced for letter-sized 
		paper.  This setting is the default.

       LEGAL:	If this keyword is set, output is produced for legal-sized
		papter.  /LEGAL should be used for overhead transparencies as 
		well, since these are legal size before the borders are 
		removed.

   LANDSCAPE:	If this keyword is set, output is produced in landscape 
		orientation, i.e. with the X axis along the long edge of the 
		page.  This setting is the default.

    PORTRAIT:	If this keyword is set, output is produced in portrait 
		orientation, i.e. wih the X axis  along the short edge of the 
		paper.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The plotting device is set to PostScript, 8 bits/pixel, color and with
	sizes, offsets and orientations appropriate to the keywords used.

 RESTRICTIONS:
	Because of the paper handling mechanism in the Phaser printer it is
	unable to print over the entire page.  The actual print dimensions
	are 8.0" x 8.5" for /LETTER and 8.0" x 10.5" for /LEGAL.

 PROCEDURE:
	The SET_PLOT, 'PS' command is issued. 
	Then PHASER issues a command like:

	DEVICE, BITS=8, /COLOR, XSIZE=SHORT_SIDE, YSIZE=LONG_SIDE, $
		XOFFSET = SMALL_OFFSET, YOFFSET = BIG_OFFSET, $
		/INCH, /PORTRAIT, [/LANDSCAPE or /PORTRAIT]

	The values of SHORT_SIDE, LONG_SIDE, SMALL_OFFSET, BIG_OFFSET are
	calculated for the paper size (/LETTER or /LEGAL) and orientation
	(/LANDSCAPE or /PORTRAIT).

 MODIFICATION HISTORY:
	Created 22-OCT-1991 by Mark Rivers.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/phaser.pro)


PICKFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       PICKFILE 
 
 PURPOSE: 
       This function allows the user to interactively pick a file.  A file 
       selection tool with a graphical user interface is created.  Files 
       can be selected from the current directory or other directories. 
 
 CATEGORY: 
       Widgets. 
 
 CALLING SEQUENCE: 
       Result = PICKFILE() 
 
 KEYWORD PARAMETERS: 
 
       FILE:   A string value for setting the initial value of the 
               selection. Useful if there is a default file 
 
       GET_PATH: Set to a named variable. Returns the path at the 
               time of selection. 
 
       GROUP:  The widget ID of the widget that calls PICKFILE.  When this 
               ID is specified, a death of the caller results in the death of 
               the PICKFILE widget application. 
 
       READ:   Set this keyword to make the title of the PICKFILE window  
               "Select File to Read". 
 
       WRITE:  Set this keyword to make the title of the PICKFILE window  
               "Select File to Write". 
 
       PATH:   The initial path to select files from.  If this keyword is  
               not set, the current directory is used. 
 
       FILTER: A string value for filtering the files in the file list.  This 
               keyword is used to reduce the number of files to choose from. 
               The user can modify the filter unless the FIX_FILTER keyword 
               is set.  Example filter values might be "*.pro" or "*.dat". 
 
       FIX_FILTER: When this keyword is set, only files that satisfy the 
               filter can be selected.  The user has no ability to modify 
               the filter and the filter is not shown. 
 
       TITLE:  A scalar string to be used for the window title.  If it is 
               not specified, the default title is "Select File" 
 
       NOCONFIRM: Return immediately upon selection of a file.  The default 
               behavior is to display the selection and then return the 
               file when the user uses the "ok" button. 
 
       MUST_EXIST: When set, only files that actually exist can be selected. 
 
 OUTPUTS: 
       PICKFILE returns a string that contains the name of the file selected. 
       If no file is selected, PICKFILE returns a null string. 
 
 COMMON BLOCKS: 
       PICKER: COMMON block that maintains state for the widget. 
 
 SIDE EFFECTS: 
       This function initiates the XMANAGER if it is not already running. 
 
 RESTRICTIONS: 
       This routine is known to work on Suns (OPEN LOOK), MIPS, RS/6000,  
       DEC Ultrix, HP/700, VAX/VMS and SGI machines. 
 
       Only one instance of the PICKFILE widget can be running at one time. 
 
       PICKFILE does not recognize symbolic links to other files in UNIX. 
 
 PROCEDURE: 
       Create and register the widget and then exit, returning the filename 
       that was picked. 
 
 EXAMPLE: 
       Create a PICKFILE widget that lets users select only files with  
       the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title  
       and store the name of the selected file in the variable F.  Enter: 
 
               F = PICKFILE(/READ, FILTER = '*.pro *.dat') 
 
 MODIFICATION HISTORY: 
       Written by:     Steve Richards, April, 1991 
       July, 1991      Added a FILTER keyword to allow users 
                       to select files with a given extension or  
                       extensions. 
       August, 1991    Fixed bugs caused by differences between 
                       spawned ls commands on different machines. 
       September, 1991 Made Myfindfile so only one pass was 
                       necessary to find files and directories. 
       3/92 - ACY      Corrected initialization of dirsave, change spawn 
                       command to "ls -lL" and added case for links 
                       add NOCONFIRM keyword for auto exiting on selection 
       8/92 - SMR      Rewrote pickfile as a compound widget. 
       10/92 - SMR     Fixed a bug where extremely large file namess didn't 
                       show up properly in the file list or as return 
                       values. 
       12/92 - JWG     Add better machine dependency code 
       1/93 - JWG      Added FILE, GET_PATH keywords. 
       1/93 - TAC      Added Windows Common dialog pickfile code 
       2/93 - SMR      Fixed the documentation example for multiple extensions
       1/94 - KDB      If directory had no execute permission on Unix  
                       platforms, CD fails and causes error. Added check 
                       for this. Increased spawn speed by using /sh for unix. 
                       Added -a switch to ls so that all files can be found  
                       on unix machines. 
       2/94 - KDB	Values passed to CD cannot end in a '\' on DOS 
			platforms. Program would crash if the PATH keyword
			was supplied a value that ended with a "\". Added
		        a check for this.
	3/94 - BMH	Deleted the reference here to OS_PICKFILE for the
			Unix platforms and created an IDL routine to 
			to call the Mac and Windows specific OS_PICKFILE 
			routines.  This solved the saving and restoring on
	 		different platforms problem.
	4/94 - KDB      The vms call to lib$findfile in valid_dir was
		        commented out. This caused errors when path was
			changed by user. Uncommented. In Valid_Dir, with
			vms the type of directory specification was not
		        checked (directory can be a path or a filename):
			Fixed this. In dirlist section of event handler,
		        a "[-]" would get trimmed to "" and cause error:
			Fixed.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pickfile.pro)


PLOTERR

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

 PURPOSE:
	Plot data points with accompanying error bars.
	(See also OPLOTERR.)	

 CATEGORY:
	Plotting, two-dimensional.

 CALLING SEQUENCE:
	PLOTERR, [ X ,]  Y , Err [, PSYM = Psym] [, TYPE = Type]

 INPUTS:
	X:	The array of abcissae.

	Y:	The array of Y values.

	Err:	The array of error-bar values.

 OPTIONAL KEYWORD PARAMETERS:
	PSYM:	The plotting symbol to use.  The default is +7.

	ITYPE:	The type of plot to be produced.  The possible types are:
			ITYPE = 0 :	X Linear - Y Linear (default)
			ITYPE = 1 :	X Linear - Y Log
			ITYPE = 2 :	X Log    - Y Linear
			ITYPE = 3 :	X Log    - Y Log

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Arrays cannot be of type string.  There must be enough points to
	plot.

 PROCEDURE:
	A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR
	is written to the output device.

 MODIFICATION HISTORY:
	William Thompson	Applied Research Corporation
	July, 1986		8201 Corporate Drive
				Landover, MD  20785

	DMS, April, 1989	Modified for Unix.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ploterr.pro)


PLOT_3DBOX

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

 PURPOSE:
	This procedure plots data in a 3-dimensional box, with options
	to have the data displayed on the walls surrounding the plot area.

 CATEGORY:
	Plotting, Three-dimensional

 CALLING SEQUENCE:
	Plot_3dbox, X, Y, Z
 
 INPUTS:
	X:	A one dimensional array that contains the X coordinats

	Y:	A one dimensional array that contains the Y coordinates

	Z:	A one dimensional array that contains the Z coordinates

 OPTIONAL INPUTS:
	None.
	
 KEYWORD PARAMETERS:
	COLOR:		The color for the Grid and Lines or the Color
		 	for the box walls when the keyword SOLID_WALLS
			is set.

	BACKGROUND:	The background color of the plot or the color
			of the Grid and Plot data when the SOLID_WALLS
			keyword is set.

	XY_PLANE:	Setting this keyword will cause the X and Y values
			of the data to be plotted on the Z=0 axis plane.

	XZ_PLANE:	Setting this keyword will cause the X and Z values
			of the data to be plotted on the Y=Ymax axis plane.

	YZ_PLANE:	Setting this keyword will cause the Y and Z values
			of the data to be plotted on the X=Xmax axis plane.

	SOLID_WALLS:	Setting this keyword causes the axis "walls" of 
			the plot box to be filled with the value of COLOR.

	PSYM:		The plotting symbol that the data is draw with.

	GRIDSTYLE:	Set this keyword to the linestyle that will be 
			used in drawing the gridlines.

	TITLE:		Set this keyword to the Main plot title
	
	XTITLE:		Set this keyword to the X axis title.

	YTITLE:		Set this keyword to the Y axis title.

	ZTITLE:		Set this keyword to the Z axis title.

 	SUBTITLE:	Set this keyword to the Sub-Title 

	LINESTYLE:	The linestyle used to plot the data.

	XYSTYLE:	The linesytle used to draw the plot in the XY plane.
			If this keyword is not set, the value of LINESTYLE
			is used.

	XZSTYLE:	The linesytle used to draw the plot in the XZ plane.
			If this keyword is not set, the value of LINESTYLE
			is used.

	YZSTYLE:	The linesytle used to draw the plot in the YZ plane.
			If this keyword is not set, the value of LINESTYLE
			is used.

	Surface         All other keywords available to SURFACE are also
	Keywords:	used by this procedure.

 OUTPUTS:
	None.

 OPTIONAL OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Plotting on the current device is performed.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.  Unrecognized keywords are passed to the SURFACE
	procedure.  

 EXAMPLE:
       Create some data that can be passed to Plot_3dbox

       x = Replicate(5., 10)
       x1 = cos(findgen(36)*10.*!dtor)*2.+5.     
       x=[x,x1,x]     
       y = findgen(56)     
       z = Replicate(5., 10)
       z1 =sin(findgen(36)*10.*!dtor)*2.+5.     
       z=[z,z1,z]     

     ; Plot this data in a "plot box" 

       Plot_3dbox, X, Y, Z, /XY_PLANE, /YZ_PLANE, /XZ_PLANE, $
                 /SOLID_WALLS, GRIDSTYLE=1, XYSTYLE=3, XZSTYLE=4, $
                 YZSTYLE=5, AZ=40, TITLE="Example Plot Box",      $
                 Xtitle="X Coodinate", Ytitle="Y Coodinate",      $
                 Ztitle="Z Coodinate", SubTitle="Sub Title",      $
                 /YSTYLE, ZRANGE=[0,10], XRANGE=[0,10],Charsize=1.6

     ; Then to plot symbols on the locations of the above plot

       plots, X, Y, Z, /T3D, PSYM=4, COLOR=!p.background

 MODIFICATION HISTORY:
       6/94   KDB, RSI   - Initial Coding and Testing

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/plot_3dbox.pro)


PLOT_FIELD

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

 PURPOSE:
	This procedure plots a 2-dimensional field.

 CATEGORY:
	Plotting, two-dimensional.

 CALLING SEQUENCE:
	PLOT_FIELD, U, V

 INPUTS:
	U:	The 2-dimensional array giving the field vector at each
		point in the U(X) direction.

	V:	The 2-dimensional array giving the field vector at each
		point in the V(Y) direction.

 KEYWORD PARAMETERS:
	N:	The number of arrows to draw. The default is 200.

	LENGTH:	The length of the longest field vector expressed as a fraction
		of the plotting area. The default is 0.1.

	ASPECT:	The aspect ratio of the plot (i.e., the ratio of the X size 
		to Y size). The default is 1.0.

	TITLE:	The title of plot. The default is "Velocity Field".

 OUTPUTS:
	No explicit outputs.

 SIDE EFFECTS:
	A new plot is drawn to the current output device.

 PROCEDURE:
	N random points are picked, and from each point a path is traced
	along the field. The length of the path is proportional to "LENGTH" 
	and the field vector magnitude.

 EXAMPLE:
	X = FINDGEN(20, 20)		; Create array X
	Y = FINDGEN(20, 20)*3		; Create array Y
	PLOT_FIELD, X, Y		; Create plot
	
 MODIFICATION HISTORY:
	Jan., 1988	Neal Hurlburt, University of Colorado.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/plot_field.pro)


PNT_LINE

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

 PURPOSE:
	This function returns the perpendicular distance between the
	point P0 and the line between points L0 and L1.

 CATEGORY:
	Geometry.

 CALLING SEQUENCE:
	Result = PNT_LINE(P0, L0, L1 [, Pl])

 INPUTS:
	P0: The location of the point. P0 may have 2 to N elements,
    	    for N dimensions.
	L0: One end-point of the line. L0 must have same number of
	    elements as P0.
	L1: The other end-point of the line. L1 must have the same
	    number of elements as LO.

 KEYWORD PARAMETERS:
	INTERVAL: If set, and if the point on the line between L0
		  and L1 that is closest to PO is not within the
		  interval (L0, L1), causes the function to return
		  the distance from P0 to the closer of the two
		  endpoints L0 and L1.

 OUTPUTS:
	This function returns the distance from point P0 to the line
	between L0 and L1, unless the closest point on the line is
	not in the interval (L0, L1) and the keyword INTERVAL is set.
	In this case, the function returns the distance between P0
	and the closer of the two end-points.

 OPTIONAL OUTPUTS:
	Pl: The point on the line between L0 and L1 that is closest to P0.
	    Pl is not necessarily in the interval (L0, L1).

 RESTRICTIONS:
	This function is limited by the machine accuracy of single
	precision floating point.

 PROCEDURE:
	Solve equations of perpendicular, etc.

 EXAMPLE:
	To print the distance between the point (2,3) and the line
	from (-3,3) to (5,12), and also the location of the point on
	the line closest to (2,3), enter the following command:

	  PRINT, PNT_LINE([2,3], [-3,3], [5,12], Pl), Pl

 MODIFICATION HISTORY:
 	DMS, RSI, Jan, 1993.	Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pnt_line.pro)


POLAR_SURFACE

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

 PURPOSE:
	This function interpolates a surface from polar coordinates
	(R, Theta, Z) to rectangular coordinates (X, Y, Z).

 CATEGORY:
	Gridding.

 CALLING SEQUENCE:
	Result = POLAR_SURFACE(Z, R, Theta)

 INPUTS:
	Z:	 An array containing the surface value at each point.
		 If the data are regularly gridded (GRID=1) in R and 
		 Theta, Z is a two dimensional array, where Z(i,j) has a
		 radius of R(i) and an azimuth of Theta(j).  If GRID is
		 not set, R(i) and Theta(i) contain the radius and azimuth
		 of each Z(i).
	R:	 The radius. If GRID is set, Z(i,j) has a radius of R(i).
		 If GRID is not set, R must have the same number of elements
		 as Z, and contains the radius of each point.
	Theta:   The azimuth, in radians. If GRID is set, Z(i,j) has an
		 azimuth of Theta(j). If GRID is not set, Theta must
		 have the same number of elements as Z, and contains
		 the azimuth of each point.

 KEYWORD PARAMETERS:
	GRID:    Set GRID to indicate that Z is regularly gridded in R
		 and Theta.
	SPACING: A two element vector containing the desired grid spacing
		 of the resulting array in X and Y.  If omitted, the grid
		 will be approximately 51 by 51.
	BOUNDS:  A four element vector, [X0, Y0, X1, Y1], containing the
		 limits of the XY grid of the resulting array.  If omitted,
		 the extent of input data sets the limits of the grid.
	QUINTIC: If set, the function uses quintic interpolation, which is
		 slower but smoother than the default linear interpolation.
	MISSING: A value to use for areas within the grid but not within
		 the convex hull of the data points. The default is 0.0.

 OUTPUTS:
	This function returns a two-dimensional array of the same type as Z.

 PROCEDURE:
	First, each data point is transformed to (X, Y, Z). Then
	the TRIANGULATE and TRIGRID procedures are used to interpolate
	the surface over the rectangular grid.

 EXAMPLE:
	r = findgen(50) / 50.		  		;Radius
	theta = findgen(50) * (2 * !pi / 50.) 		;Theta
	z = r # sin(theta)		;Make a function (tilted circle)
	SURFACE, POLAR_SURFACE(z, r, theta, /GRID) 	 ;Show it

 MODIFICATION HISTORY:
	DMS 	Sept, 1992	Written

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/polar_surface.pro)


POLY

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

 PURPOSE:
	Evaluate a polynomial function of a variable.

 CATEGORY:
	C1 - Operations on polynomials.

 CALLING SEQUENCE:
	Result = POLY(X,C)

 INPUTS:
	X:	The variable.  This value can be a scalar, vector or array.

	C:	The vector of polynomial coefficients.  The degree of 
		of the polynomial is N_ELEMENTS(C) - 1.

 OUTPUTS:
	POLY returns a result equal to:
		 C(0) + c(1) * X + c(2)*x^2 + ...

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Straightforward.

 MODIFICATION HISTORY:
	DMS, Written, January, 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/poly.pro)


POLYFITW

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

 PURPOSE:
	Perform a least-square polynomial fit with optional error estimates.

 CATEGORY:
	Curve fitting.

 CALLING SEQUENCE:
	Result = POLYFITW(X, Y, W, NDegree [, Yfit, Yband, Sigma, A])

 INPUTS:
	    X:	The independent variable vector.

	    Y:	The dependent variable vector.  This vector should be the same 
		length as X.

	    W:	The vector of weights.  This vector should be same length as 
		X and Y.

     NDegree:	The degree of polynomial to fit.

 OUTPUTS:
	POLYFITW returns a vector of coefficients of length NDegree+1.

 OPTIONAL OUTPUT PARAMETERS:
	 Yfit:	The vector of calculated Y's.  Has an error of + or - Yband.

	Yband:	Error estimate for each point = 1 sigma.

	Sigma:	The standard deviation in Y units.

	    A:	Correlation matrix of the coefficients.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 MODIFICATION HISTORY:
	Written by: 	George Lawrence, LASP, University of Colorado,
			December, 1981.

	Adapted to VAX IDL by: David Stern, Jan, 1982.

	Weights added, April, 1987,  G. Lawrence

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/polyfitw.pro)


POLYWARP

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

 PURPOSE:
	Perform polynomial spatial warping.

	Using least squares estimation, determine the coefficients Kx(i,j) 
	and Ky(i,j) of the polynomial functions:
		Xi = sum over i and j of:  Kx(i,j) * Xo^j * Yo^i
		Yi = sum over i and j of:  Ky(i,j) * Xo^j * Yo^i

	Kx and Ky can be used as inputs P and Q to the built-in function
	POLY_2D.
	
 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	POLYWARP, Xi, Yi, Xo, Yo, Degree, Kx, Ky

 INPUTS:
	Xi, Yi:	The vectors of x,y coordinates to be fit as a function 
		of Xo and Yo.

	Xo, Yo:	The vectors of x,y independent coordinates.  These vectors 
		must have the same number of elements as Xi and Yi.

	Degree:	The degree of the fit.  The number of coordinate pairs must be
		greater than or equal to (Degree+1)^2.

 OUTPUTS:
	Kx:	The array of coefficients for Xi as a function of (xo,yo).  
		This parameter is returned as a (Degree+1) by (Degree+1) 
		element array.

	Ky:	The array of coefficients for yi.  This parameter is returned
		as a (Degree+1) by (Degree+1) element array.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	See:	Computer Image Processing and Recognition, Ernest L. Hall,
		Academic Press, 1979, Pages 186-188.

	Xi and Yi are expressed as polynomials of Xo, Yo:
		Xi = Kx(i,j) * Xo^j * Yo^i   Summed for i,j = 0 to degree.
	And
		Yi = Ky(i,j) * Xo^j * Yo^i.

	This coordinate transformation may be then used to
	map from Xo, Yo coordinates into Xi, Yi coordinates.

 EXAMPLE:
	The following example shows how to display an image and warp it
	using the POLYWARP and POLY_2D routines.

	Create and display the original image by entering:

		A = BYTSCL(SIN(DIST(250)))
		TVSCL, A

	Now set up the Xi's and Yi's.  Enter:

		XI = [24, 35, 102, 92]
		YI = [81, 24, 25, 92]

	Enter the Xo's and Yo's:

		XO = [61, 62, 143, 133]
		YO = [89, 34, 38, 105]

	Run POLYWARP to obtain a Kx and Ky:

		POLYWARP, XI, YI, XO, YO, 1, KX, KY

	Create a warped image based on Kx and Ky with POLY_2D:

		B = POLY_2D(A, KX, KY)

	Display the new image:

		TV, B

 MODIFICATION HISTORY:
	DMS, RSI, Dec, 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/polywarp.pro)


POLY_AREA

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

 PURPOSE:
	Return the area of a polygon given the coordinates
	of its vertices.

 CATEGORY:
	Analytical Geometry

 CALLING SEQUENCE:
	Result = POLY_AREA(X, Y)

 INPUTS:
	It is assumed that the polygon has N vertices with N sides
	and the edges connect the vertices in the order:

	[(x1,y1), (x2,y2), ..., (xn,yn), (x1,y1)].

	i.e. the last vertex is	connected to the first vertex.

	X:	An N-element vector of X coordinate locations for the vertices.

	Y:	An N-element vector of Y coordinate locations for the vertices.

 OUTPUTS:
	POLY_AREA returns the area of the polygon.  This value is always 
	positive.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	The area is computed as:
		Area = 	1/2 * [ x1y2 + x2y3 + x3y4 +...+x(n-1)yn + xny1 
			- y1x2 - y2x3 -...-y(n-1)xn - ynx1)

 MODIFICATION HISTORY:
	DMS, July, 1984.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/poly_area.pro)


POLY_FIT

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

 PURPOSE:
	Perform a least-square polynomial fit with optional error estimates.

	This routine uses matrix inversion.  A newer version of this routine,
	SVDFIT, uses Singular Value Decomposition.  The SVD technique is more
	flexible, but slower.

	Another version of this routine, POLYFITW, performs a weighted
	least square fit.

 CATEGORY:
	Curve fitting.

 CALLING SEQUENCE:
	Result = POLY_FIT(X, Y, NDegree [,Yfit, Yband, Sigma, A] )

 INPUTS:
	X:	The independent variable vector.

	Y:	The dependent variable vector, should be same length as x.

     NDegree:	The degree of the polynomial to fit.

 OUTPUTS:
	POLY_FIT returns a vector of coefficients with a length of NDegree+1.

 OPTIONAL OUTPUT PARAMETERS:
	Yfit:	The vector of calculated Y's.  These values have an error 
		of + or - Yband.

	Yband:	Error estimate for each point = 1 sigma

	Sigma:	The standard deviation in Y units.

	A:	Correlation matrix of the coefficients.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 MODIFICATION HISTORY:
	Written by: George Lawrence, LASP, University of Colorado,
		December, 1981.

	Adapted to VAX IDL by: David Stern, Jan, 1982.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/poly_fit.pro)


POPD

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

 PURPOSE:
	Change the current working directory to the directory
	saved on the top of the directory stack maintained
	by the PUSHD and POPD User Library procedures. This top entry
	is then removed.

 CALLING SEQUENCE:
	POPD

 SIDE EFFECTS:
	The top entry of the directory stack is removed.

 RESTRICTIONS:
	Popping a directory from an empty stack causes a warning
	message to be printed.  The current directory is not changed
	in this case.

 COMMON BLOCKS:
	DIR_STACK:  Contains the stack.

 MODIFICATION HISTORY:
	17, July, 1989, Written by AB, RSI.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/popd.pro)


PRINTD

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

 PURPOSE:
	Display the contents of the directory stack maintained by the
	PUSHD and POPD User Library procedures.

 CALLING SEQUENCE:
	PRINTD

 OUTPUTS:
	PRINTD lists the contents of the directory stack on the default
	output device.

 COMMON BLOCKS:
	DIR_STACK:  Contains the stack.

 MODIFICATION HISTORY:
	17, July, 1989, Written by AB, RSI.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/printd.pro)


PROFILE

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

 PURPOSE:
	Extract a profile from an image.

 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	Result = PROFILE(Image, XX, YY)

 INPUTS:
	Image:	The data array representing the image.  This array can be
		of any type except complex.

 KEYWORD PARAMETERS:
      XSTART:	The starting X location of the lower-left corner of Image.
		If this keyword is not specified, 0 is assumed.

      YSTART:	The starting Y location of the lower-left corner of Image.
		If this keyword is not specified, 0 is assumed.

     NONMARK:	Set this keyword to inhibit marking the image with the 
		profile line.

 OUTPUTS:
	PROFILE returns a floating-point vector containing the values of
	the image along the profile line marked by the user.

 OPTIONAL OUTPUTS:
	XX:	After picking the end points, XX contains the X coordinates
		of the points along the selected profile.

	YY:	After picking the end points, YY contains the Y coordinates
		of the points along the selected profile.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Cursor on image display is enabled.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Allow the operator to mark two points on the
	image display with the joystick.  Extract and
	return the points along the line.  Optionally
	return the X and Y values of each extracted point.

 EXAMPLE:
	Display an image, select a profile and plot that profile in a new
	window.  Create and display an image by entering:

		A = BYTSCL(DIST(256))
		TV, A

	Extract a profile from the image.  Enter the following command and
	mark two points on the image with the mouse:

		R = PROFILE(A)

	Create a new plotting window and plot the profile by entering:

		WINDOW, /FREE
		PLOT, R

	An interactive version of this routine is available with the User
	Library procedure PROFILES.

 MODIFICATION HISTORY:
	Written, DMS, November, 1982.
	Modified for Sun, march, 1988.
	December 1991, KRC  Made PROFILES return XX and YY.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/profile.pro)


PROFILES

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

 PURPOSE:
	Interactively draw row or column profiles of an image in a separate
	window.

 CATEGORY:
	Image analysis.

 CALLING SEQUENCE:
	PROFILES, Image [, SX = sx, SY = sy]

 INPUTS:
	Image:	The variable that represents the image displayed in current 
		window.  This data need not be scaled into bytes.
		The profile graphs are made from this array.

 KEYWORD PARAMETERS:
	SX:	Starting X position of the image in the window.  If this 
		keyword is omitted, 0 is assumed.

	SY:	Starting Y position of the image in the window.  If this
		keyword is omitted, 0 is assumed.

	WSIZE:	The size of the PROFILES window as a fraction or multiple 
		of 640 by 512.

	ORDER:	Set this keyword param to 1 for images written top down or
		0 for bottom up.  Default is the current value of !ORDER.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A new window is created and used for the profiles.  When done,
	the new window is deleted.

 RESTRICTIONS:
	None.

 PROCEDURE:
	A new window is created and the mouse location in the original
	window is used to plot profiles in the new window.  Pressing the
	left mouse button toggles between row and column profiles.
	The right mouse button exits.

 EXAMPLE:
	Create and display an image and use the PROFILES routine on it.
	Create and display the image by entering:

		A = BYTSCL(DIST(256))
		TV, A

	Run the PROFILES routine by entering:

		PROFILES, A

	The PROFILES window should appear.  Move the cursor over the original
	image to see the profile at the cursor position.  Press the left mouse
	button to toggle between row and column profiles.  Press the right
	mouse button (with the cursor over the original image) to exit the
	routine.

 MODIFICATION HISTORY:
	DMS, Nov, 1988.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/profiles.pro)


PROJECT_VOL

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

 PURPOSE:
       This function returns a two dimensional image that is the
       projection of a 3-D volume of data onto a plane (similar to an
       X-ray). The returned image is a translucent rendering of the
       volume (the highest data values within the volume show up as the
       brightest regions in the returned image). Depth queing and
       opacity may be used to affect the image. The volume is
       projected using a 4x4 matrix, so any type of projection may
       be used including perspective. Typically the system viewing
       matrix (!P.T) is used as the 4x4 matrix.

 CATEGORY:
	Volume Rendering.

 CALLING SEQUENCE:
       Return = PROJECT_VOL(Vol, X_sample, Y_sample, Z_sample)

 INPUTS:
       Vol:        The three dimensional volume of data to project.
                   Data type : Any 3-D array except string or structure.
       X_sample:   The number of rays to project along the X dimension
                   of the image. (The returned image will have the
                   dimensions X_sample by Y_sample).
                   Data type : Long.
       Y_sample:   The number of rays to project along the Y dimension
                   of the image. To preserve the correct aspect ratio
                   of the data, Y_sample should equal X_sample.
                   Data type : Long.
       Z_sample:   The number of samples to take along each ray.
                   Higher values for X_sample, Y_sample, and Z_sample
                   increase the image resolution as well as execution time.
                   Data type : Long.

 KEYWORD PARAMETERS:
       DEPTH_Q:    Set this keyword to indicate that the image should be
                   created using depth queing. The depth queing should
                   be a single floating point value (between 0.0 and 1.0).
                   This value specifies the brightness of the farthest
                   regions of the volume relative to the closest regions
                   of the volume. A value of 0.0 will cause the back
                   side of the volume to be completely blacked out,
                   while a value of 1.0 indicates that the back side
                   will show up just as bright as the front side.
                   The default is 1.0 (indicating no depth queing).
                   Data type : Float.
       OPAQUE:     A 3-D array with the same size and dimensions as Vol.
                   This array specifies the opacity of each cell in the
                   volume. Opaque values of 0 allow all light to
                   pass through. Opaque values are cumulative.
                   For example, if a ray eminates from a data value of 50,
                   and then passes through 10 opaque cells (each with a
                   data value of 0 and an opacity value of 5) then that
                   ray would be completely blocked out (the cell with the
                   data value of 50 would be invisible on the returned
                   image).
                   The default is no opacity.
                   Data type : Any 3-D array except string or structure
                               (usually the same type as Vol).
       TRANS:      A 4x4 floating point array to use as the
                   transformation matrix when projecting the volume.
                   The default is to use the system viewing matrix (!P.T).
                   Data type : Fltarr(4, 4).

 OUTPUTS:
       This function returns the projected volume as a two dimensional
       array with the same data type as Vol. The dimensions of the
       returned array are X_sample by Y_sample.

 EXAMPLE:
       Use "T3D" to set up a viewing projection and render a volume of
       data using "PROJECT_VOL" :

       ; Create some data.
          vol = RANDOMU(s, 40, 40, 40)
          FOR i=0, 10 DO vol = SMOOTH(vol, 3)
          vol = BYTSCL(vol(3:37, 3:37, 3:37))
          opaque = RANDOMU(s, 40, 40, 40)
          FOR i=0, 10 DO opaque = SMOOTH(opaque, 3)
          opaque = BYTSCL(opaque(3:37, 3:37, 3:37), TOP=25B)

       ; Set up the view.
          T3D, /RESET
          T3D, TRANSLATE=[-0.5, -0.5, -0.5]
          T3D, SCALE=[0.7, 0.7, 0.7]
          T3D, ROTATE=[30, -30, 60]
          T3D, TRANSLATE=[0.5, 0.5, 0.5]

       ; Generate and display the image.
          img = PROJECT_VOL(vol, 64, 64, 64, DEPTH_Q=0.7, $
                OPAQUE=opaque, TRANS=(!P.T))
          TVSCL, img

 MODIFICATION HISTORY:
 	Written by:	Daniel Carr. Tue Sep  1 17:52:06 MDT 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/project_vol.pro)


PSAFM

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

 PURPOSE:
	Given an Abobe Font metric file, this procedure generates an AFM
	file in the format that IDL likes. This new file differs from the
	original in the following ways:

		[] Information not used by IDL is removed.
		[] AFM files with the AdobeStandardEncoding are
		   supplemented with an ISOLatin1Encoding.

 CATEGORY:
	Misc., PostScript, Fonts

 CALLING SEQUENCE:
	PSAFM, input_filename, output_filename

 INPUTS:
	Input_Filename:	 Name of existing AFM file from Adobe.
	Output_FIlename: Name of new AFM file to be created.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Generates an output file.

 MODIFICATION HISTORY:
	8 January 1993, Written by AB, RSI.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/psafm.pro)


PSEUDO

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

 PURPOSE:
	Generate a pseudo-color table based on the LHB,
	(lightness, hue, and brightness) system and load it.

 CATEGORY:
	Z4 - Image processing, color table manipulation.

 CALLING SEQUENCE:
	PSEUDO, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr]

 INPUTS:
	Litlo:	Starting lightness, from 0 to 100%.

	Lithi:	Ending lightness, from 0 to 100%.

	Satlo:	Starting saturation, from 0 to 100%.

	Sathi:	Ending saturation, from 0 to 100%.

	Hue:	Starting hue, in degrees, from 0 to 360.

	Loops:	The number of loops of hue to make in the color helix.
		This value can range from 0 to around 3 to 5 and it need
		not be an integer.

 OUTPUTS:
	No required outputs.

 OPTIONAL OUTPUT PARAMETERS:
	Colr:	A (256,3) integer array containing the red, green, and 
		blue color values that were loaded into the color lookup 
		tables.  Red = COLR(*,0), Green = COLR(*,1), Blue = COLR(*,1).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Color tables are loaded.

 RESTRICTIONS:
	None.

 PROCEDURE:
	This procedure generates a pseudo-color table and loads the red,
	green, and blue LUTS with the table.  The pseudo-color mapping 
	used is generated by first translating from the LHB (lightness, 
	hue, and brightness) coordinate system to the LAB coordinate 
	system, finding N colors spread out along a helix that spans
	this LAB space (supposedly a near maximal entropy mapping for 
	the eye, given a particular N) and remapping back into the RGB
	space (red, green, and blue color space).  Thus, given N desired 
	colors, the output will be N discrete values loaded into the
	red LUTs, N discrete values loaded into the blue LUTs, and N
	discrete values loaded into the green LUTs. 
   
 MODIFICATION HISTORY:
	Adapted from the IIS primitive DPSEU. DMS, Nov, 1982.
	Changed common, DMS, Apr, 1987.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pseudo.pro)


PS_SHOW_FONTS

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

 PURPOSE:
	This procedure displays all the PostScript fonts that IDL knows
	about, with both the StandardAdobe and ISOLatin1 encodings. Each
	display takes a separate page, and each character in each font
	is shown with its character index.

 CATEGORY:
	Misc., PostScript, Fonts.

 CALLING SEQUENCE:
	PS_SHOW_FONTS

 INPUTS:
	None.

 KEYWORDS:
	NOLATIN: If set, do NOT output ISOLatin1 encodings.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A PostScript file is produced, one page per font/mapping combination.

 RESTRICTIONS:
	The output file contains almost 70 pages of output. A PostScript
	previewer is recommended rather than sending it to a printer.

 MODIFICATION HISTORY:
	12 January 1993, AB, RSI.
	12 October 1993, Rob Montgomery, NCAR - added 'nolatin' keyword.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/ps_show_fonts.pro)


PURPOSE:

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

 PURPOSE:

 CATEGORY:
	Compound widgets.

 CALLING SEQUENCE:
	widget = CW_TMPL(parent)

 INPUTS:
       PARENT - The ID of the parent widget.

 KEYWORD PARAMETERS:
	UVALUE - Supplies the user value for the widget.

 OUTPUTS:
       The ID of the created widget is returned.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:

 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:

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_tmpl.pro)


PUSHD

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

 PURPOSE:
	Push a directory onto the top of the directory stack maintained
	by the PUSHD and POPD User Library procedures.

 CALLING SEQUENCE:
	PUSHD, Dir

 INPUTS:
	Dir:	The directory to change to. The current directory will
		be pushed to the top of the directory stack.

 SIDE EFFECTS:
	The current directory is pushed onto the directory stack.
	It will be the next directory used by POPD.

 COMMON BLOCKS:
	DIR_STACK:  Contains the stack.

 MODIFICATION HISTORY:
	17, July, 1989, Written by AB, RSI.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/pushd.pro)


RDPIX

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

 PURPOSE:
	Interactively display the X position, Y position, and pixel value 
	of the cursor.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	RDPIX, Image [, X0, Y0]

 INPUTS:
	Image:	The array that represents the image being displayed.  This 
		array may be of any type.  Rather reading pixel values from 
		the display, they are taken from this parameter, avoiding 
		scaling difficulties.

 OPTIONAL INPUT PARAMETERS:
	X0, Y0:	The location of the lower-left corner of the image area on
		screen.  If these parameters are not supplied, they are
		assumed to be zero.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The X, Y, and value of the pixel under the cursor are continuously 
	displayed.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Instructions are printed and the pixel values are printed as the 
	cursor is moved over the image.

	Press the left or center mouse button to create a new line of output,
	saving the previous line.

	Press the right mouse button to exit the procedure.

 MODIFICATION HISTORY:
	DMS, Dec, 1987.
	Rob Montgomery (rob@hao.ucar.edu), 9/21/92;
		Correct indices for case of !order = 1

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/rdpix.pro)


READ_BMP

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

 PURPOSE:
 	This function reads a Microsoft Windows Version 3 device
	independent bitmap file (.BMP).

 CATEGORY:
   	Input/Output

 CALLING SEQUENCE:
   	Result = READ_BMP(File [, R, G, B [, IHDR]])

 INPUTS:
 	File: The full path name of the bitmap file to read.

 OUTPUTS:
	This function returns a byte array containing the image
	from the bitmap file. In the case of 4-bit or 8-bit images,
	the dimensions of the resulting array are (biWidth, biHeight);
	for 24-bit images the dimensions are (3, biWidth, biHeight).
	Dimensions are taken from the BITMAPINFOHEADER of the file.
	NOTE: for 24 bit images, color interleaving is blue, green, red;
	i.e. result(0,i,j) = blue, result(1,i,j) = green, etc.

 OPTIONAL OUTPUTS:
   	R, G, B:  Color tables from the file. There 16 elements each for
		  4 bit images, 256 elements each for 8 bit images. Not
		  defined or used for 24 bit images.
  	Ihdr:	  A structure containing BITMAPINFOHEADER from file.
		  Tag names are as defined in the MS Windows Programmer's
		  Reference Manual, Chapter 7.

 SIDE EFFECTS:
   	IO is performed.

 RESTRICTIONS:
   	DOES NOT HANDLE: 1 bit deep images, or compressed images.
   	Is not fast for 4 bit images. Works best on images where the
   	number of bytes in each scan-line is evenly divisible by 4.

 PROCEDURE:
   	Straightforward. Will work on both big endian and little endian
	machines.

 EXAMPLE:
   	TV, READ_BMP('c:\windows\party.bmp', r, g, b) 	;Read & display image
   	TVLCT, r, g, b              			;Load it's colors

 MODIFICATION HISTORY:
   DMS, RSI.   March 1993.   	Original version.
   DMS, RSI.   May, 1993.	Now works on all machines...

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_bmp.pro)


READ_GIF

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

 PURPOSE:
	Read the contents of a GIF format image file and return the image
	and color table vectors (if present) in the form of IDL variables.

 CATEGORY:
	Input/Output.

 CALLING SEQUENCE:
	READ_GIF, File, Image [, R, G, B]

 INPUTS:
	File:	Scalar string giving the name of the rasterfile to read

 OUTPUTS:
	Image:	The 2D byte array to contain the image.


 OPTIONAL OUTPUT PARAMETERS:
     R, G, B:	The variables to contain the Red, Green, and Blue color vectors
		if the rasterfile containes colormaps.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	This routine only reads in the first image in a file (the format
	allows many). Local colormaps are not supported.
	Only 8 bit images are supported.

 EXAMPLE:
	To open and read the GIF image file named "foo.gif" in the current
	directory, store the image in the variable IMAGE1, and store the color
	vectors in the variables R, G, and B, enter:

		READ_GIF, "foo.gif", IMAGE1, R, G, B

	To load the new color table and display the image, enter:

		TVLCT, R, G, B
		TV, IMAGE1
 
 MODIFICATION HISTORY:
	Written June 1992, JWG

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_gif.pro)


READ_INTERFILE

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

 PURPOSE:
	Simplistic Interfile (v3.3) reader. Can only read a series
	of images containing byte,int,long,float or double data where
	all images have the same height and with.  Result is returned
	in a 3-D array.

 CATEGORY:
	Input/Output.

 CALLING SEQUENCE:
	READ_INTERFILE, File, Data

 INPUTS:
	File:	Scalar string containing the name of the Interfile
		to read.  Note: if the Interfile has a header file and
		a data file, this should be the name of the header
		file (also called the administrative file).
	
 OUTPUTS:
	Data: A 3-D array of data as read from the file.  Assumed to be
	a series of 2-D images.

 RESTRICTIONS:
	This is a simplistic reader.  It does not get additional
	keyword information above and beyond what is needed to read
	in the image data.  If any problems occur reading the file,
	READ_INTERFILE prints a message and stops.

	If the data is stored in on a bigendian machine and read on
	a littleendian machine (or vice versa) the order of bytes in
	each pixel element may be reversed, requiring a call to
	BYTEORDER

 PROCEDURE:
	Generates keyword table and initializes it on the fly.
	Read in administrative data.
	Read in binary data.
	Clean up keyword processing information.

 EXAMPLE:
	READ_INTERFILE, '0_11.hdr', X

 MODIFICATION HISTORY:
 	Written by:	J. Goldstein, Oct 1993

	12/22/93 JWG,TH		Bug fixes. Added byte swapping for short data

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_interfile.pro)


READ_PICT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		READ_PICT
 PURPOSE: 	Reads limited types of image files written in the PICT
		Version 2 Format.  This format is used by the Apple 
		Macintosh Computers.
 CATEGORY:	
 CALLING SEQUENCE:
	READ_PICT, FILE, IMAGE		;Reads PICT file into IMAGE
	READ_PICT, FILE, IMAGE, R, G, B	;Reads Image and loads color vectors
 INPUTS:
       FILE = Scalar string giving the name of the PICT file to read.
       IMAGE = 2D matrix to be input.  
 OPTIONAL INPUT PARAMETERS:
       R, G, B = The Red, Green, and Blue color vectors to be read
               with IMAGE.  If not specified, the color table associated
		with the picture is ignored.
 OUTPUTS:
	IMAGE - the image that is read in from the file.
	R, G, B - the color vectors from the PICT file.
 SIDE EFFECTS:
	A file is opened, UnPackData is called, I/O is performed
 RESTRICTIONS:
	Only creates Version 2 PICT files.  Not intended to read all PICT
	files.  Known to work with IDL PICT files written with write_pict
	routine in IDL.
 PROCEDURE:
	Read in the header, size, and the following quickdraw opcodes.

 MODIFICATION HISTORY:
	Written 19 November 1990, Steve Richards.
		19 November 1992, Steve Richards, Fixed a problem where
			the color vectors returned were integer and not
			bytes.
		Jul 1994,  DMS, RSI.  Added code for both big and little
			endian byte ordering.  Previous version would not
			work on little endian machines.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_pict.pro)


READ_SPR

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

 PURPOSE:
       This function reads a row-indexed sparse matrix from a specified
	file and returns it as the result.    Row-indexed sparse matrices
	are created by using the Numerical Recipes routine NR_SPRSIN.

 CATEGORY:
      	Sparse Matrix File I/O	

 CALLING SEQUENCE:
       result = READ_SPR('Filename')

 INPUTS:
	Filename:  Name of file containing a row-indexed sparse matrix
                  
 KEYWORD PARAMETERS;
	NONE

 OUTPUTS:
	result:  Row-indexed sparse matrix


 MODIFICATION HISTORY:
       Written by:     BMH, 1/94.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_spr.pro)


READ_SRF

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

 PURPOSE:
	Read the contents of a Sun rasterfile and return the image and
	color table vectors (if present) in the form of IDL variables.

 CATEGORY:
	Input/Output.

 CALLING SEQUENCE:
	READ_SRF, File, Image [, R, G, B]

 INPUTS:
	File:	Scalar string giving the name of the rasterfile to read

 OUTPUTS:
	Image:	The 2D byte array to contain the image.


 OPTIONAL OUTPUT PARAMETERS:
     R, G, B:	The variables to contain the Red, Green, and Blue color vectors
		if the rasterfile containes colormaps.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	This routine only handles 1, 8, 24, and 32-bit rasterfiles of type
	RT_OLD and RT_STANDARD.  See the file /usr/include/rasterfile.h
	for the structure of Sun rasterfiles.

 EXAMPLE:
	To open and read the Sun rasterfile named "sun.srf" in the current
	directory, store the image in the variable IMAGE1, and store the color
	vectors in the variables R, G, and B, enter:

		READ_SRF, "sun.srf", IMAGE1, R, G, B

	To load the new color table and display the image, enter:

		TVLCT, R, G, B
		TV, IMAGE1
 
 MODIFICATION HISTORY:
	Written fall 1897, AB
	3/1/90, Added 24 bit images, DMS.
	7/8/90, Added 32 bit images, DMS.
	1/22/92, the colors within 24 bit images were not ordered
		correctly, DMS.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_srf.pro)


READ_WAVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	READ_WAVE
 PURPOSE:
	READ a .wave or .bwave file created by the Advanced Data Visualizer
	into an series of IDL variables.
 CALLING SEQUENCE:
	READ_WAVE, FILE, VARIABLES, NAMES, DIMENSIONS
 INPUTS:
	FILE = Scalar string giving the name of the Wavefront file to write.
 KEYWORD PARAMETERS:
	MESHNAMES = The name of the mesh used in the Wavefront file
		for each variable.
 OUTPUTS:
	VARIABLES = Upon return, this variable contains a block of the 
		variables contained in the wavefront file.  Since each
		variable in a wavefront file can have more than one field
		(for instance, a vector variable has 3 fields), the fields
		of each variable make up the major index into the variable 
		block.  For instance, if a Wavefront file had one scalar 
		variable and one vector variable, the scalar would be
		extracted as follows:

			vector_scalar = variables(0,*,*,*)

		and the vector variable would be extracted as follows:

			vector_variable = variables(1:3,*,*,*)

		To find the dimensions of the returned variable, see the
		description below regarding DIMENSIONS

	NAMES = Upon return, this variable contains the string names of each
		variable contained in the file.
	DIMENSIONS = Upon return, this variable is a long array that describes
		how many fields in the large returned variable block each
		variable occupies.  In the above example of one scalar variable
		followed by a vector variable, the dimension variable would 
		be:
			DIMENSIONS = [1,3]
		So the first field of the returned variable block would be
		the scalar variable and the following 3 fields would comprise
		the vector variable.
 RESTRICTIONS:
	This routine only preserved the structure of the variables if they
	are regularly grided variables.  
 MODIFICATION HISTORY:
	Written July 16, 1991, by Steve Richards.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_wave.pro)


READ_X11_BITMAP

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

 PURPOSE:
	Read bitmaps stored in the X11 format.

	The X Windows bitmap(1) program produces a C header file
	containing the definition of a bitmap produced by that program.
	This procedure reads such a file and creates an IDL byte array
	containing the bitmap.

	This procedure is used primarily to read bitmaps to be used as
	IDL widget button labels.

 CATEGORY:
	Bitmaps, X Windows, widgets.

 CALLING SEQUENCE:
	READ_X11_BITMAP, File, Bitmap [, X, Y]

 INPUTS:
	File: The name of the file containing the bitmap.

 KEYWORD PARAMETERS:

	EXPAND_TO_BYTES: return a 2-D array which has one bit per byte
		(0 for a 0 bit), (255 for a 1 bit) instead. (See example)

 OUTPUTS:
	Bitmap: The variable in which to store the bitmap.  This variable
		is returned as a byte array.

 OPTIONAL OUTPUT PARAMETERS:
	X:	The width of the bitmap is returned in this variable.

	Y:	The height of the bitmap is returned in this variable.

 COMMON BLOCKS:
	None.

 EXAMPLE:
	To open and read the X11 bitmap file named "my.x11" in the current 
	directory, store the bitmap in the variable BITMAP1, and the width
	and height in the variables X and Y, enter:

		READ_X11_BITMAP, "my.x11", BITMAP1, X, Y

	To display the new bitmap, enter:

		READ_X11_BITMAP, "my.x11", Image, /EXPAND_TO_BYTES
		TV, Image, /ORDER

 MODIFICATION HISTORY:
	10 January 1991, AB
	1 Apr, 1992, CF fixed bug with bitmaps larger than 32k bytes.
	24 March 1993, JWG fixed EXPAND_TO_BYTES option

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_x11_bitmap.pro)


READ_XWD

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

 PURPOSE:
	Read the contents of files created by the XWD (X Windows Dump)
	command and return the image and color table vectors in the form of
	IDL variables.

 CATEGORY:
	Input/Output.

 CALL:
	Result = READ_XWD(File_Name [, R, G, B])

 INPUTS:
   File_Name:	Scalar string giving the name of the xwd file to read

 OUTPUTS:
	READ_XWD returns a 2D byte array containing the image.  If the file
	cannot be open or read, the return value is zero.

 OPTIONAL OUTPUT PARAMETERS:
     R, G, B:	The variables to contain the Red, Green, and Blue color
		vectors if the XWD file contains color tables.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	I/O is performed.

 RESTRICTIONS:
	This function is intended to be used only on files containing
	8-bit pixmaps.  It is not intended to be used with all XWD files.
	No guarantees are made that all XWD files will work with this routine.
	This routine will not work with XWD files with version less than 6.

 PROCEDURE:
	The header is read into a structure and the bytes are reversed
	if necessary.  Then the colormap and image portions of the
	file are read into their respective variables.

 EXAMPLE:
	To open and read the X Windows Dump file named "my.xwd" in the current
	directory, store the image in the variable IMAGE1, and store the color 
	vectors in the variables, R, G, and B, enter:

		IMAGE1 = READ_XWD("my.xwd", R, G, B)

	To load the new color table and display the image, enter:

		TVLCT, R, G, B
		TV, IMAGE1


 MODIFICATION HISTORY:
	September, 1990 DMS and SMR, Research Systems, Inc.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/read_xwd.pro)


RECON3

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

 PURPOSE:
	This function can reconstruct a 3-dimensional data array from
       two or more images (or projections) of an object.   For example, if
       you placed a dark object in front of a white background and then
       photographed it three times (each time rotating the object a
       known amount) then these three images could be used with RECON3
       to approximate a 3-D volumetric representation of the object.
       RECON3 also works with translucent projections of an object.
       RECON3 returns a 3-D byte array.

 CATEGORY:
	Volume Reconstruction

 CALLING SEQUENCE:
       vol = RECON3(Images, Obj_Rot, Obj_Pos, Focal, Dist, $
                    Vol_Pos, Img_Ref, Img_Mag, Vol_Size)

 INPUTS:
       Images:   The images to use to reconstruct the volume.   Execution
                 time increases linearly with more images.
                 Data Type: 8-bit (byte) array with dimensions (x, y, n)
                 where x is the horizontal image dimension, y is the vertical
                 image dimension, and n is the number of images.

       Obj_Rot:  The the amount the object is rotated to make it appear as
                 it does in each image.   The object is first rotated
                 about the X axis, then about the Y axis, and finally
                 about the Z axis (with the object's reference point at the
                 origin.
                 Data Type: (3, n) Float array where Obj_Rot(0, *) is the X
                 rotation for each image, Obj_Rot(1, *) is the Y rotation, 
                 and Obj_Rot(2, *) is the Z rotation.
                 
       Obj_Pos:  The position of the the object's reference point RELATIVE to
                 the camera lens.   The camera lens is located at the
                 coordinate origin and points in the negative Z direction
                 (the view up vector points in the positive Y direction).
                 Obj_Pos should be expressed in this coordinate system.
                 The values for Obj_Pos, Focal, Dist, and Vol_Pos should all
                 be expressed in the same units (mm, cm, m, in, ft, etc.).
                 Data Type: (3, n) Float array where Obj_Pos(0, *) is the X
                 position for each image, Obj_Pos(1, *) is the Y position, 
                 and Obj_Pos(2, *) is the Z position.   All the values in
                 Obj_Pos(2, *) should be less than zero.

       Focal:    The focal length of the lens for each image.   Focal may be
                 set to zero to indicate a parallel image projection
                 (infinite focal length).
                 Data Type: Float array with n elements.

       Dist:     The distance from the camera lens to the image plane (film)
                 for each image.   Dist should be greater than Focal.
                 Data Type: Float array with n elements.

       Vol_Pos:  The two opposite corners of a cube that surrounds the object.
                 Vol_Pos should be expressed in the object's coordinate system
                 RELATIVE to the object's reference point.
                 Data Type: (3, 2) Float array where Vol_Pos(*, 0) specifies
                 one corner and Vol_Pos(*, 1) specifies the opposite corner.

       Img_Ref:  The pixel location at which the object's reference point
                 appears in each of the images.
                 Data Type: (2, n) Int or Float array where Img_Ref(0, *) is
                 the X coordinate for each image and Img_Ref(1, *) is the Y
                 coordinate.

       Img_Mag:  The magnification factor for each image.   This number is
                 actually the length (in pixels) that a test object would
                 appear in an image if it were N units long and N units
                 distant from the camera lens.
                 Data Type: (2, n) Int or float array where Img_Mag(0, *) is
                 the X dimension (in pixels) of a test object for each image,
                 and Img_Mag(1, *) is the Y dimension.   All elements in
                 Img_Mag should be greater than or equal to 1.

       Vol_Size: The size of the volume to return.   The returned volume will
                 be a 3-D byte array with dimensions equal to Vol_Size.
                 Execution time (and resolution) increases exponentially with
                 larger values for Vol_Size.
                 Data Type: Int array with 3 elements where Vol_Size(0)
                 specifies the X dimension of the volume, Vol_Size(1) specifies
                 the Y dimension, and Vol_Size(2) specifies the Z dimension.

 KEYWORD PARAMETERS:
       MISSING:  The value for cells in the 3-D volume that do not map to
                 any of the supplied images.   The Missing value is passed
                 to the IDL "INTERPOLATE" function.
                 Data Type: Byte.
                 Default : 0B

       MODE:     If Mode is less than zero then each cell in the 3-D volume
                 is the MINIMUM of the corresponding pixels in the images.
                 If Mode is greater than zero then each cell in the 3-D volume
                 is the MAXIMUM of the corresponding pixels in the images.
                 If Mode is equal to zero then each cell in the 3-D volume
                 is the AVERAGE of the corresponding pixels in the images.
                 Mode should usually be (-1) when the images contain a bright
                 object in front of a dark background.   Mode should usually
                 be (+1) when the images contain a dark object in front of a
                 light background.   AVERAGE mode requires more memory since
                 the volume array must temporarily be kept as an INT array
                 instead of a BYTE array.
                 Data Type: Int
                 Default : 0 (average cells)

 OUTPUTS:
	RECON3 returns a 3-D byte array containing the reconstructed object.

       If the images contain low (dark) values where the object is and high
       (bright) values where the object isn't, then Mode should be set to (+1).
       If the above is true then the returned volume will have low values
       where the object is, and high values where the object isn't.

       If the images contain high (bright) values where the object is and low
       (dark) values where the object isn't, then Mode should be set to (-1).
       If the above is true then the returned volume will have high values
       where the object is, and low values where the object isn't.

 RESTRICTIONS:
       In general, the object must be CONVEX for a good reconstruction to be
       possible.   Concave regions are not easily reconstructed.
       An empty coffee cup, for example, would be reconstructed as if it
       were full.

	The images should show strong light/dark contrast between the object
       and the background.

       The more images the better.   Images from many different angles will
       improve the quality of the reconstruction.   It is also important to
       supply images that are parallel and perpendicular to any axes of
       symmetry.   Using the coffee cup as an example, at least one image
       should be looking through the opening in the handle.

       Telephoto images are also better for reconstruction purposes than
       wide angle images.

 PROCEDURE:
	A 4x4 transformation matrix is created for each image based upon the
       parameters Obj_Rot, Obj_Pos, Focal, Dist, and Img_Ref.   Each cell in
       the volume is assigned a 3-D coordinate based upon the parameters
       Vol_Pos and Vol_Size.   These coordinates are multiplied by the
       transformation matricies to produce x,y image coordinates.   Each cell
       in the volume is assigned a value that is the AVERAGE, MINIMUM, or
       MAXIMUM of the image values at the x,y position (depending on Mode).

 EXAMPLE:
 ------------------------------------------------------------------------------
       ; Assumptions for this example :
       ; The object's major axis is parallel to the Z axis.
       ; The object's reference point is at its center.
       ; The camera lens is pointed directly at this reference point.
       ; The reference point is 5000 mm in front of the camera lens.
       ; The focal length of the camera lens is 200 mm.

       ; If the camera is focused on the reference point, then the
       ; distance from the lens to the camera's image plane must be
       ;    dist = (d * f) / (d - f) =
       ;    (5000 * 200) / (5000 - 200) = (1000000 / 4800) = 208.333 mm

       ; The object is roughly 600 mm wide and 600 mm high.
       ; The reference point appears in the exact center of each image.

       ;  If the object is 600 mm high and 5000 mm distant from the camera
       ;  lens, then the object image height must be
       ;     hi = (h * f) / (d - f)  =
       ;     (600 * 200) / (5000 - 200) = (120000 / 4800) = 25.0 mm
       ;  The object image appears 200 pixels high so the final magnification
       ;  factor is
       ;     img_mag = (200 / 25) = 8.0
 

       imgy = 256
       frames = 3
 
       images = Bytarr(imgx, imgy, frames, /Nozero)
       obj_rot = Fltarr(3, frames)
       obj_pos = Fltarr(3, frames)
       focal = Fltarr(frames)
       dist = Fltarr(frames)
       vol_pos = Fltarr(3, 2)
       img_ref = Fltarr(2, frames)
       img_mag = Fltarr(2, frames)
 
       vol_size = [40, 40, 40]
 
       ; The object is 5000 mm directly in front of the camera.
       obj_pos(0, *) =     0.0
       obj_pos(1, *) =     0.0
       obj_pos(2, *) = -5000.0
 
       ; The focal length of the lens is constant for all the images.
       focal(*) = 200.0
 
       ; The distance from the lens to the image plane is also constant.
       dist(*) = 208.333
 
       ; The cube surrounding the object is 600 mm X 600 mm.
       vol_pos(*, 0) = [-300.0, -300.0, -300.0]
       vol_pos(*, 1) = [ 300.0,  300.0,  300.0]
 
       ; The image reference point appears at the center of all the images.
       img_ref(0, *) = imgx / 2
       img_ref(1, *) = imgy / 2
 
       ; The image magnification factor is constant for all images.
       ; (The images haven't been cropped or resized).
       img_mag(*, *) = 8.0
 
       ; Only the object rotation changes from one image to the next.
       ; Note that the object is rotated about the X axis first, then Y,
       ; and then Z.
 
       ; Create some fake images for this example.
       images(30:160, 20:230, 0) = 255
       images(110:180, 160:180, 0) = 180
       obj_rot(*, 0) = [-90.0, 0.0, 0.0]
 
       images(70:140, 100:130, 1) = 255
       obj_rot(*, 1) = [-70.0, 75.0, 0.0]
 
       images(10:140, 70:170, 2) = 255
       images(80:90, 170:240, 2) = 150
       obj_rot(*, 1) = [-130.0, 215.0, 0.0]
 
       ; Reconstruct the volume.
       vol = RECON3(images, obj_rot, obj_pos, focal, dist, vol_pos, img_ref, $
                    img_mag, vol_size, Missing=255B, Mode=(-1))
 ------------------------------------------------------------------------------

 MODIFICATION HISTORY:
 	Written by:	Daniel Carr	Thu Feb  4 02:54:29 MST 1993
	KDB - 23 Dec., 1993 - Variable dist had a conflicted with Userlib
			      function DIST and could cause compile erros.
			      Renamed variable dist to distance.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/recon3.pro)


REDUCE_COLORS

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

 PURPOSE:
	This procedure reduces the number of colors used in an image
	by eliminating pixel values without members.

 CATEGORY:
	Image display.

 CALLING SEQUENCE:
	REDUCE_COLORS, Image, Values

 INPUTS:
	Image:  The original image array. Note that the input array is
		replaced by its color-reduced equivalent.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Image:  The color-reduced image array.
	Values: A vector of non-zero pixel values. If Image contains
		pixel values from 0 to M, Values will be an M+1 element
		vector containing the mapping from the old values to
		the new. Values(I) contains the new color index of old
		pixel index I.

 SIDE EFFECTS:
	Input array is overwritten.

 PROCEDURE:
	The pixel distribution histogram is obtained and the WHERE
	function is used to find bins with non-zero values. Next,
	a lookup table is made where table(old_pixel_value) contains
	new_pixel_value, and then applied to the image.
		
 EXAMPLE:
	To reduce the number of colors and display an image with the
	original color tables R, G, B:
	  REDUCE_COLORS, Image, V
	  TVLCT, R(V), G(V), B(V)

 MODIFICATION HISTORY:
	DMS,	RSI, Oct, 1992.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/reduce_colors.pro)


REGRESS

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

 PURPOSE:
	Perform a multiple linear regression fit.

	REGRESS fits the function:
		Y(i) = A0 + A(0)*X(0,i) + A(1)*X(1,i) + ... + 
                      A(Nterms-1)*X(Nterms-1,i)

 CATEGORY:
       G2 - Correlation and regression analysis.

 CALLING SEQUENCE:
	Result = REGRESS(X, Y, W, Yfit, A0, Sigma, Ftest, R, Rmul, Chisq)

 INPUTS:
       X:	The array of independent variable data.  X must 
		be dimensioned as an array of Nterms by Npoints, where 
		there are Nterms coefficients (independent variables) to be 
		found and Npoints of samples.

       Y:	The vector of dependent variable points.  Y must have Npoints 
		elements.

	W:	The vector of weights for each equation.  W must be a vector
		of Npoints elements.  For instrumental weighting, 
		W(i) = 1/standard_deviation(Y(i))^2.  For statistical 
		weighting, w(i) = 1./Y(i).  For no weighting, set w(i)=1,
		and also set the RELATIVE_WEIGHT keyword.

 OUTPUTS:
	REGRESS returns a column vector of coefficients that has Nterms 
	elements.

 OPTIONAL OUTPUT PARAMETERS:
	Yfit:	Vector of calculated values of Y with Npoints elements.

	A0:	Constant term.

	Sigma:	Vector of standard deviations for coefficients.

	Ftest:	The value of F for test of fit.

	Rmul:	The multiple linear correlation coefficient.

	R:	Vector of linear correlation coefficients.

	Rmul:   The multiple linear correlation coefficient.

	Chisq:	Reduced, weighted chi squared.

 KEYWORDS:
 RELATIVE_WEIGHT:  If this keyword is set, the input weights
		(W vector) are assumed to be relative values, and not based
		on known uncertainties in the Y vector.  Set this keyword in 
		the case of no weighting, W(*) = 1.

 PROCEDURE:
	Adapted from the program REGRES, Page 172, 
	Bevington, Data Reduction and Error Analysis for the 
	Physical Sciences, 1969.

 MODIFICATION HISTORY:
	Written, DMS, RSI, September, 1982.
	Added RELATIVE_WEIGHT keyword    W. Landsman   August 1991
       Fixed bug in invert  Bobby Candey 1991 April 22

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/regress.pro)


REGRESS1

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

 PURPOSE:
	Multiple linear regression fit.
	Fit the function:
	Y(i) = A0 + A(0)*X(0,i) + A(1)*X(1,i) + ... + 
		A(Nterms-1)*X(Nterms-1,i)

 CATEGORY:
	G2 - Correlation and regression analysis.

 CALLING SEQUENCE:
	Result = REGRESS(X, Y, W, YFIT, A0, SIGMA, FTEST, R, RMUL, CHISQ)

 INPUTS:
	X:	array of independent variable data.  X must 
		be dimensioned (Nterms, Npoints) where there are Nterms 
		coefficients to be found (independent variables) and 
		Npoints of samples.

	Y:	vector of dependent variable points, must have Npoints 
		elements.

       W:	vector of weights for each equation, must be a Npoints 
		elements vector.  For instrumental weighting 
		w(i) = 1/standard_deviation(Y(i)), for statistical 
		weighting w(i) = 1./Y(i).   For no weighting set w(i)=1,
		and also set the RELATIVE_WEIGHT keyword.

 OUTPUTS:
	Function result = coefficients = vector of 
	Nterms elements.  Returned as a column vector.

 OPTIONAL OUTPUT PARAMETERS:
	Yfit:	array of calculated values of Y, Npoints elements.

	A0:	Constant term.

	Sigma:	Vector of standard deviations for coefficients.

	Ftest:	value of F for test of fit.

	Rmul:	multiple linear correlation coefficient.

	R:	Vector of linear correlation coefficient.

	Chisq:	Reduced weighted chi squared.

 KEYWORDS:
RELATIVE_WEIGHT: if this keyword is non-zero, the input weights
		(W vector) are assumed to be relative values, and not based
		on known uncertainties in the Y vector.    This is the case for
		no weighting W(*) = 1.

 PROCEDURE:
	Adapted from the program REGRES, Page 172, Bevington, Data Reduction
	and Error Analysis for the Physical Sciences, 1969.

 MODIFICATION HISTORY:
	Written, DMS, RSI, September, 1982.
	Added RELATIVE_WEIGHT keyword, W. Landsman, August 1991

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/regress1.pro)


REGRESSION

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

 PURPOSE:
	To augment and display the output of the library function Regress.
	Additional output includes an anova table to test the hypothesis
	that all coefficients are zero.A regression table is printed to the
	screen or user specified file displaying the Coefficients, their
	standard deviations, and  the T statistic to test for each coefficient
	the hypothesis that it is zero.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
   REGRESSION, X, Y, W,A0, COEFF, Resid, YFit, sigma, FTest, R, RMul, ChiSqr

 INPUTS:
	X:	Array of independent variable data.  X must be dimensioned
		(NTerms, NPoints) where there are Nterms coefficients to be
		found and NPoints of sample data.  Y = column vector of NPoints
		dependent variable values.

 OPTIONAL INPUTS:
	W:	vector of weights for each equation.  For instrumental 
		weighing, set w(i) = 1/Variance(Y(i)), for statistical 
		weighting, w(i) = 1./Y(i) 

 KEYWORDS:
     VARNAMES:	A vector of names for the independent variables to be used
		in the output.
                        
      NOPRINT:	A flag to suppress printing out regression statistics.
		The default is to print.
       
    LIST_NAME:	Name of output file.  Default is to the screen.

      MISSING:	Missing data value.  If undefined, assume no missing data.
		Listwise handling of missing data.

 OUTPUTS:
	Anova table and regression summary written to the screen or to user
	specified file.

 OPTIONAL OUTPUT PARAMETERS:
	A0:	Constant term.

	Coeff:	Vector of coefficients. Coeff has NTerm elements.

	Resid:	Vector of residuals - i.e. Y - YFit.

 	Yfit:	Array of calculated values of Y, Npoints 

	Sigma:	Vector of standard deviations for coefficients.

	Ftest:	Value of F for test of fit.

	Rmul:	Multiple linear correlation coefficient.

	R:	Vector of linear correlation coefficient.

	ChiSqr:	Reduced weighted chi square for fit.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE: 
	See documentation for REGRESS in the User's Library.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/regression.pro)


REVERSE

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

 PURPOSE:
	Reverse the order of rows or columns in an array or vector.

 CATEGORY:
	Array manipulation.

 CALLING SEQUENCE:
	Result = REVERSE(Array [, Subscript_Index])

 INPUTS:
	Array:	The array or vector containing the original data.

 OPTIONAL INPUT PARAMETERS:
 Subscript_Index:  If this parameter is omitted or 1, the first subscript is
		reversed (i.e., rows are reversed).  Set this parameter to
		2 to reverse columns.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	REVERSE returns a copy of the original array that is reversed about 
	one of its dimensions.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Only works for 1-, 2-, or 3-dimensional arrays.

 PROCEDURE:
	Uses the ROTATE function.

 MODIFICATION HISTORY:
	Old.
	Apr, 1991, DMS,	Added 3D reversing.
       Sept, 1992 Mark L. Rivers, added simple return for scaler argument

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/reverse.pro)


ROT

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

 PURPOSE:
	Rotate, magnify or demagnify, and/or translate an image.

 CATEGORY:
	Z3 - Image processing, geometric transforms.

 CALLING SEQUENCE:
	Result = ROT(A, Angle, [Mag, X0, Y0], MISSING = missing,
		INTERP = Interp, CUBIC = Cubic)

 INPUTS:
	A:	The image array to be rotated.  This array may be of any type,
		but it must have two dimensions.

	ANGLE:	Angle of rotation in degrees CLOCKWISE. (Why?,
		because of an error in the old ROT.)

 OPTIONAL INPUT PARAMETERS:
	MAG:	Magnification/demagnification factor.  A value of 1.0 = no
		change, > 1 is magnification and < 1 is demagnification.

	X0:	X subscript for the center of rotation.  If omitted, X0 equals
		the number of columns in the image divided by 2.

	Y0:	Y subscript for the center of rotation.  If omitted, y0 equals
		the number of rows in the image divided by 2.

 KEYWORDS:
	INTERP:	Set this keyword for bilinear interpolation.  If this keyword
		is set to 0 or omitted, nearest neighbor sampling is used.
		Note that setting this keyword is the same as using the 
		ROT_INT User Library function.  This change (and others) 
		essentially makes ROT_INT obsolete.

	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.

      MISSING:	The data value to substitute for pixels in the output image 
		that map outside the input image.

      PIVOT: Setting this keyword causes the image to pivot around the point
		X0, Y0, so that this point maps into the same point in the
		output image.  If this keyword is set to 0 or omitted, then the
		point X0, Y0 in the input image is mapped into the center of
		the output image.

 OUTPUTS:
	ROT returns a rotated, magnified, and translated version of the
	input image.  Note that the dimensions of the output image are
	always the same as those of the input image.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	The POLY_2D function is used to translate, scale, and
	rotate the original image.

 EXAMPLE:
	Create and display an image.  Then display a rotated and magnified
	version.  Create and display the image by entering:

		A = BYTSCL(DIST(256))
		TV, A

	Rotate the image 33 degrees and magnify it 1.5 times.  Use bilinear
	interpolation to make the image look nice.  Enter:

		B = ROT(A, 33, 1.5, /INTERP)
		TV, B
	
 MODIFICATION HISTORY:
	June, 1982. 	Written by DMS, RSI.

	Feb, 1986. 	Modified by Mike Snyder, ES&T Labs, 3M Company.
	 		Adjusted things so that rotation is exactly on the 
			designated center.

	October, 1986.  Modified by DMS to use the POLY_2D function.

	Aug, 1988.	Added INTERP keyword.
       Dec, 1992.      Added PIVOT keyword, William Thompson, NASA/GSFC.
	Nov, 1993.	Added CUBIC keyword, DMS/RSI.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/rot.pro)


RSI_GAMMAI

[Previous Routine] [Next Routine] [List of Routines]
 $Id: rsi_gammai.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.

 modification: 09/21/92 - changed the number of iterations in
			   g_series (jiy)


ro g_series,result,x,a
evaluates incomplete gamma function with series representation.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/rsi_gammai.pro)


RSTRPOS

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

 PURPOSE:
	This function finds the last occurrence of a substring within
	an object string. If the substring is found in the expression,
	RSTRPOS returns the character position of the match, otherwise
	it returns -1.

 CATEGORY:
	String processing.

 CALLING SEQUENCE:
        Result = RSTRPOS(Expr, SubStr [, Pos])

 INPUTS:
       Expr:	The expression string in which to search for the substring.
	SubStr: The substring to search for.

 OPTIONAL INPUTS:
	Pos:	The character position before which the search is bugun.
	      	If Pos is omitted, the search begins at the last character
	      	of Expr.

 OUTPUTS:
        Returns the position of the substring, or -1 if the
	 substring was not found within Expr.

 SIDE EFFECTS:
        Unlike STRPOS, Expr and SubStr must be strings.

 EXAMPLE:
	Expr = 'Holy smokes, Batman!'	; define the expression.
	Where = RSTRPOS(Exp, 'smokes')	; find position.
	Print, Where			; print position.
		5			; substring begins at position 5
					; (the sixth character).

 MODIFICATION HISTORY:
        JWG, January, 1993

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/rstrpos.pro)


RUNS_TEST

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

 PURPOSE:
	To test for nonrandomness in a sequence of 0 and 1's by
	counting the number of runs and computing its probabilty.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	RUNS_TEST, Sequence1, RunNo, Prob, BinNo, Z, LIST_NAME = Ln

 INPUTS:
    Sequence1:	The vector of 0's and 1's.
           
 OPTIONAL OUTPUT PARAMETERS:
	RunNo:	Total number of rums.
                            
	Prob:	probabilty of total number of runs, if number of 0's and 
		number of 1's both exceeds 10.Otherwise, undefined and -1 is
		returned in Prob.

	BinNo:	[ number of 0's, number of 1's]

	Z:	Approximately normal test statistic computed when number \
		of 0' and number of 1's both exceed 10.
                                                           
 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 PROCEDURE:
	If either the number of 0's or the number of 1's does not exceed 10,
	then the probability must be looked up in a table. Otherwise, it is
	estimated with the normal distribution. Any nonbinary values are 
	removed from the sequence.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/runs_test.pro)


SCALE3

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

 PURPOSE:
	Set up transformation and scaling for basic 3D viewing.

	This procedure is similar to SURFR and SCALE3D, except that the
	data ranges must be specified and the scaling does not vary with 
	rotation.

 CATEGORY:
	Graphics, 3D.

 CALLING SEQUENCE:
	SCALE3, XRANGE = xr, YRANGE = yr, ZRANGE = zr [, AX = ax] [, AZ = az]

 INPUTS:
	No plain parameters.

 KEYWORD PARAMETERS:
	XRANGE:	Two-element vector containing the minimum and maximum X values.
		If omitted, the X-axis scaling remains unchanged.

	YRANGE:	Two-element vector containing the minimum and maximum Y values.
		If omitted, the Y-axis scaling remains unchanged.

	ZRANGE:	Two-element vector containing the minimum and maximum Z values.
		If omitted, the Z-axis scaling remains unchanged.

	AX:	Angle of rotation about the X axis.  The default is 30 degrees.

	AZ:	Angle of rotation about the Z axis.  The default is 30 degrees.

 OUTPUTS:
	No explicit outputs.  Results are stored in the system variables 
	!P.T, !X.S, !Y.S, and !Z.S.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The 4 by 4 matrix !P.T (the 3D-transformation system variable), 
	receives the homogeneous transformation matrix generated by this 
	procedure.

	The axis scaling variables, !X.S, !Y.S, and !Z.S are set
	from the data ranges.

 RESTRICTIONS:
	Axonometric projections only.

 PROCEDURE:
 	Set the axis scaling variables from the supplied ranges, then:

 	1) Translate the unit cube so that the center (.5,.5,.5) is moved
	   to the origin.

 	2) Scale by 1/SQRT(3) so that the corners do not protrude.

 	3) Rotate -90 degrees about the X axis to make the +Z
	   axis of the data the +Y axis of the display.  The +Y data axis
	   extends from the front of the display to the rear.

 	4) Rotate about the Y axis AZ degrees.  This rotates the
	   result counterclockwise as seen from above the page.

 	5) Then it rotates about the X axis AX degrees, tilting the data
	   towards the viewer.

 	6) Translate back to the (0,1) cube.

 	This procedure may be easily modified to affect different rotations
	transformations.

 EXAMPLE:
	Set up a 3D transformation where the data range is 0 to 20 for each
	of the 3 axes and the viewing area is rotated 20 degrees about the
	X axis and 55 degrees about the Z axis.  Enter:

	SCALE3, XRANGE=[0, 20], YRANGE=[0, 20], ZRANGE=[0, 20], AX=20, AZ=55 

 MODIFICATION HISTORY:
	DMS, June, 1991.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/scale3.pro)


SCALE3D

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

 PURPOSE:
	Scale the 3D unit cube (a cube with the length of each side equal
	to 1) into the viewing area.

 CATEGORY:
	Graphics, 3D.

 CALLING SEQUENCE:
	SCALE3D

 INPUTS:
	No explicit inputs.  !P.T is an implicit input.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	No explicit outputs.  !P.T is an implicit output.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	!P.T is modified.

 RESTRICTIONS:
	Doesn't work for all forms of perspective transformations.

 PROCEDURE:
	Eight, 3D data points are created at the vertices of the 3D
	unit cube.  They are transformed by !P.T.  The system
	is translated to bring the minimum (x,y,z) point to the origin, 
	and then scaled to make each coordinates maximum value equal to 1.

 MODIFICATION HISTORY:
	DMS, May, 1988.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/scale3d.pro)


SEARCH2D

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

 PURPOSE:
	This function finds "objects" or regions of similar data
       values within a 2-D array of data. Given a starting location
       and a range of values to search for, SEARCH2D will find all
       the cells within the array that are within the specified range
       of values, and have some path of connectivity through these cells
       to the starting location. In addition to searching for cells
       within a global range of data values, SEARCH2D can also search
       for adjacent cells whose values deviate from their neighbors within
       specified tolerances. See the procedure "SEARCH3D" for the
       three dimensional case.

       This function returns a list of the array subscripts that define
       the selected object or region.

 CATEGORY:
       Data subsetting.
	Image manipulation.

 CALLING SEQUENCE:
       Region = SEARCH2D(Array, Xpos, Ypos, Min_val, Max_val)

 INPUTS:
       Array:      The 2-D array of data to search.
                   Data type : Any 2-D array except string or structure.
       Xpos:       The X coordinate (first subscript into the 2-D Array)
                   of the starting cell for the search.
                   Data type : Long.
       Ypos:       The Y coordinate (second subscript into the 2-D Array)
                   of the starting cell for the search.
                   Data type : Long.
       Min_val:    The minimum data value to search for. All cells that
                   are connected to the starting cell, and have a value
                   greater than or equal to Min_val and less that or equal
                   to Max_val, will be considered part of the "object".
       Max_val:    The maximum data value to search for.

 KEYWORD PARAMETERS:
       DECREASE:   If the DECREASE or INCREASE keywords are specified,
                   then SEARCH2D creates an internal copy of Array.
                   This internal copy is then processed to enhance the
                   object edges by using an algorithm similar to the
                   "SOBEL" edge enhancement process. Any adjacent
                   cells will be found if their corresponding data value
                   in the edge enhanced array is greater than DECREASE and
                   less than INCREASE. In any case, the adjacent cells
                   will NEVER be selected if their data value is not
                   between Min_val and Max_val.
                   The default is 0.0 if INCREASE is specified.
                   Otherwise, the default is no edge checking.
                   Data type : Int or Float (usually less than zero).
       INCREASE:   The maximum value in the edge enhanced array for
                   a cell to be considered part of the selected object.
                   Some savings in execution time and memory usage result
                   when DECREASE and INCREASE are omitted.
                   See DECREASE above.
                   The default is 0.0 if DECREASE is specified.
                   Otherwise, the default is no edge checking.
                   Data type : Int or Float (usually greater than zero).
       LPF_BAND:   This keyword indicates what (if any) Low Pass Filtering
                   is performed on the edge enhanced array before the
                   search begins. If LPF_BAND is set to 3 or higher
                   then the edge enhanced array will be smoothed using
                   LPF_BAND as the width of the smoothing window.
                   If LPF_BAND is less than 3 then no smoothing is
                   performed. This keyword only has effect when the
                   DECREASE or INCREASE keywords are supplied.
                   See DECREASE above.
                   The default is zero (no smoothing).
                   Data type : Int.
       DIAGONAL:   Normally, cells are considered adjacent only when
                   squares surrounding the cells share a common edge.
                   If a non-zero value is passed to DIAGONAL then
                   SEARCH2D will also locate cells meeting the search
                   criteria whose surrounding squares share a common
                   corner. Specifying diagonal search mode requires
                   more memory and execution time.
                   The default is no diagonal searching.
                   Data type : int

 OUTPUTS:
       This function returns a list of the indices into the 2-D array
       that are part of the located object or region. This list is
       returned as a LONARR(n) where n is the number of cells found.

       If the returned array of indices is called Region, and the
       size of the 2-D array of data is size_x by size_y, then the
       actual X and Y indices can be obtained by using the following
       algorithm :

          index_y = Region / size_x
          index_x = Region - (index_y * size_x)

       The object within the 2-D Array could then be subscripted as :

          Array(Region)
       OR
          Array(index_x, index_y)

 EXAMPLE:
       Find all the indices corresponding to an object contained in a
       2-D array of data.

       ; Create some data.
          img = FLTARR(512, 512)
          img(3:503, 9:488) = 0.7
          img(37:455, 18:438) = 0.5
          img(144:388, 90:400) = 0.7
          img(200:301, 1:255) = 1.0
          img(155:193, 333:387) = 0.3

       ; Display the image.
          TVSCL, img

       ; Search for an object starting at (175, 300) whose data values
       ; are between (0.6) and (0.8).
          Region = SEARCH2D(img, 175, 300, 0.6, 0.8, /DIAGONAL)
 
       ; Scale the background cells into the range 0 to 127.
          img = BYTSCL(img, TOP=127B)

       ; Highlight the object region by setting it to 255.
          img(Region) = 255B
 
       ; Display the array with the highlighted object in it.
          TVSCL, img

 MODIFICATION HISTORY:
       Written by:     Daniel Carr. Thu Sep  3 15:36:17 MDT 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/search2d.pro)


SEARCH3D

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

 PURPOSE:
	This function finds "objects" or regions of similar data
       values within a 3-D array of data. Given a starting location
       and a range of values to search for, SEARCH3D will find all
       the cells within the volume that are within the specified range
       of values, and have some path of connectivity through these cells
       to the starting location. In addition to searching for cells
       within a global range of data values, SEARCH3D can also search
       for adjacent cells whose values deviate from their neighbors within
       specified tolerances. See the procedure "SEARCH2D" for the
       two dimensional case.

       This function returns a list of the array subscripts that define
       the selected object or region.

 CATEGORY:
       Data subsetting.
	Volume manipulation.

 CALLING SEQUENCE:
       Region = SEARCH3D(Array, Xpos, Ypos, Zpos, Min_val, Max_val)

 INPUTS:
       Array:      The 3-D volume of data to search.
                   Data type : Any 3-D array except string or structure.
       Xpos:       The X coordinate (first subscript into the 3-D Array)
                   of the starting cell for the search.
                   Data type : Long.
       Ypos:       The Y coordinate (second subscript into the 3-D Array)
                   of the starting cell for the search.
                   Data type : Long.
       Zpos:       The Z coordinate (third subscript into the 3-D Array)
                   of the starting cell for the search.
                   Data type : Long.
       Min_val:    The minimum data value to search for. All cells that
                   are connected to the starting cell, and have a value
                   greater than or equal to Min_val and less that or equal
                   to Max_val, will be considered part of the "object".
       Max_val:    The maximum data value to search for.

 KEYWORD PARAMETERS:
       DECREASE:   If the DECREASE or INCREASE keywords are specified,
                   then SEARCH3D creates an internal copy of Array.
                   This internal copy is then processed to enhance the
                   object edges by using an algorithm similar to the
                   "SOBEL" edge enhancement process (in 3-D). Any
                   adjacent cells will be found if their corresponding
                   data value in the edge enhanced array is greater
                   than DECREASE and less than INCREASE. In any case,
                   the adjacent cells will NEVER be selected if their
                   data value is not between Min_val and Max_val.
                   The default is 0.0 if INCREASE is specified.
                   Otherwise, the default is no edge checking.
                   Data type : Int or Float (usually less than zero).
       INCREASE:   The maximum value in the edge enhanced array for
                   a cell to be considered part of the selected object.
                   Some savings in execution time and memory usage result
                   when DECREASE and INCREASE are omitted.
                   See DECREASE above.
                   The default is 0.0 if DECREASE is specified.
                   Otherwise, the default is no edge checking.
                   Data type : Int or Float (usually greater than zero).
       LPF_BAND:   This keyword indicates what (if any) Low Pass Filtering
                   is performed on the edge enhanced array before the
                   search begins. If LPF_BAND is set to 3 or higher
                   then the edge enhanced array will be smoothed using
                   LPF_BAND as the width of the smoothing window.
                   If LPF_BAND is less than 3 then no smoothing is
                   performed. This keyword only has effect when the
                   DECREASE or INCREASE keywords are supplied.
                   See DECREASE above.
                   The default is zero (no smoothing).
                   Data type : Int.
       DIAGONAL:   Normally, cells are considered adjacent only when
                   cubes surrounding the cells share a common face.
                   If a non-zero value is passed to DIAGONAL then
                   SEARCH3D will also locate cells meeting the search
                   criteria whose surrounding cubes share a common
                   edge or corner. Specifying diagonal search mode
                   requires more memory and execution time.
                   The default is no diagonal searching.
                   Data type : int

 OUTPUTS:
       This function returns a list of the indices into the 3-D array
       that are part of the located object or region. This list is
       returned as a LONARR(n) where n is the number of cells found.

       If the returned array of indices is called Region, and the
       size of the 3-D volume of data is size_x by size_y by size_z,
       then the actual X, Y, and Z indices can be obtained by using
       the following algorithm :

          index_z = Region / (size_x * size_y)
          index_y = (Region - (index_z * size_x * size_y)) / size_x
          index_x = (Region - (index_z * size_x * size_y)) - (index_y * size_x)

       The object within the 3-D Array could then be subscripted as :

          Array(Region)
       OR
          Array(index_x, index_y, index_z)

 EXAMPLE:
       Find all the indices corresponding to an object contained in a
       3-D volume of data.

       ; Create some data.
          vol = RANDOMU(s, 40, 40, 40)
          vol(3:13, 1:15, 17:33) = 1.3
          vol(15:25, 5:25, 15:25) = 0.2
          vol(5:30,17:38,7:28) = 1.3
          vol(9:23, 16:27, 7:33) = 1.5

       ; Search for an object starting at (6, 22, 16) whose data values
       ; are between (1.2) and (1.4)..
          Region = SEARCH3D(vol, 6, 22, 16, 1.2, 1.4, /DIAGONAL)
 
       ; Scale the background cells into the range 0 to 127.
          vol = BYTSCL(vol, TOP=127B)

       ; Highlight the object region by setting it to 255.
          vol(Region) = 255B
 
       ; Set up a 3-D view.
          T3D, /RESET
          T3D, TRANSLATE=[-0.5,-0.5, -0.5]
          T3D, ROTATE=[30.0, -60.0, 30.0]
          T3D, TRANSLATE=[0.5, 0.5, 0.5]
 
       ; Display the volume with the highlighted object in it.
          TVSCL, REBIN(PROJECT_VOL(vol, 64, 64, 40), 512, 512)

 MODIFICATION HISTORY:
       Written by:     Daniel Carr. Thu Sep  3 17:36:04 MDT 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/search3d.pro)


SETUP_KEYS

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

 PURPOSE:
	Set up function keys for use with IDL.

	Under Unix, the number of function keys, their names, and the
	escape sequences they send to the host computer vary
	enough between various keyboards that IDL cannot be
	written to understand all keyboards.  Therefore, it provides
	a very general routine named DEFINE_KEY that allows the
	user to specify the names and escape sequences of function keys.

	SETUP_KEYS uses DEFINE_KEY (called via modular procedures) to
	enter the keys for known keyboards (Sun3, DEC VT200, HP, 
	Mips, PSTERM, SGI).

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	SETUP_KEYS

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	NOTE:  If no keyword is specified, SETUP_KEYS uses !VERSION to
	determine the type of machine running IDL. It assumes that the
	keyboard involved is of the same type (usually this is correct).

    EIGHTBIT:	When establishing VT200 function key definitions,
		use the 8-bit versions of the escape codes instead
		of the default 7-bit.

	SUN:	Establish function key definitions for a Sun3 keyboard.

	VT200:	Establish function key definitions for a DEC VT200 keyboard.

	HP9000:	Establish function key definitions for an HP 9000 series
		300 keyboard.  Although the HP 9000 series 300 supports both
		xterm and hpterm windows, IDL supports only user-definable
		key definitions in xterm windows - hpterm windows use
		non-standard escape sequences which IDL does not attempt
		to handle.

	MIPS:	Establish function key definitions for a Mips RS series
		keyboard.

	PSTERM:	Establish function key definitions for PSTERMS such as those
		found on the Sun Sparc Station.

	SGI:	Establish function key definitions for SGI keyboards.

  APP_KEYPAD:	Will define escape sequences for the group of keys
		in the numeric keypad, enabling these keys to be programmed
		within IDL.

  NUM_KEYPAD:	Will disable programmability of the numeric keypad.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The definitions for the function keys are entered.  The new keys
	can be viewed using the command HELP, /KEYS.

	For the HP keyboard, the upper right-hand group of four keys (at the
	same height as the function keys) are called "BLANK1" through
	"BLANK4", since they have no written labels.  Keys defined to have
	labels beginning with a capital "K" belong to the numeric keypad
	group.  For example, "K9" refers to keypad key "9".

	Although the HP 9000 series 300 can create both xterm and hpterm
	windows, IDL supports only user-definable key definitions in xterm
	windows - hpterm windows use non-standard escape sequences which
	IDL does not attempt to handle.

 MODIFICATION HISTORY:
	AB, 26 April 1989
	TJA, July 1990.	Added key definitions for HP 9000 series 300, as
			well as Mips RS series; also rearranged code into 
			separate files.

	SMR, April, 1991.  Added key definitions for SGI and PSTERM

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/setup_keys.pro)


SFIT

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

 PURPOSE:
	This function determines a polynomial fit to a surface.

 CATEGORY:
	Curve and surface fitting.

 CALLING SEQUENCE:
	Result = SFIT(Data, Degree)

 INPUTS:
 	Data:	The two-dimensional array of data to fit. The sizes of
		the dimensions may be unequal.

	Degree:	The maximum degree of fit (in one dimension).

 OUTPUT:
	This function returns a fitted array.

 OUTPUT KEYWORDS:
	Kx:	The array of coefficients for a polynomial function
		of x and y to fit data.
		This parameter is returned as a (Degree+1) by (Degree+1) 
		element array.

 PROCEDURE:
 	Fit a 2D array Z as a polynomial function of x and y.
 	The function fitted is:
  	    F(x,y) = Sum over i and j of kx(j,i) * x^i * y^j
 	where kx is returned as a keyword.

 MODIFICATION HISTORY:
	July, 1993, DMS		Initial creation

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/sfit.pro)


SHADE_SURF_IRR

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

 PURPOSE:
	Make a shaded surface representation of an irregulary gridded
	elevation dataset.

	The data must be representable as an array of quadrilaterals.  This 
	routine should be used when the (X, Y, Z) arrays are too irregular to 
	be drawn by SHADE_SURF, but are still semi-regular.

 CATEGORY:
	Graphics, surface plotting.

 CALLING SEQUENCE:
	SHADE_SURF_IRR, Z, X, Y

 INPUTS:
	Z:	A 2D array of elevations.  This array must be dimensioned 
		as (NX, NY).

	X:	A 2D array containing the X location of each Z value.  This
		array must be dimensioned as (NX, NY).

	Y:	A 2D array containing the Y location of each Z value.  This
		array must be dimensioned as (NX, NY).

 KEYWORD PARAMETERS:
	AX:	The angle of rotation about the X axis.  The default is 30
		degrees.  This parameter is passed to SURFR.

	AZ:	The angle of rotation about the Z axis.  The default is 30
		degrees.  This parameter is passed to SURFR.

	IMAGE:	Set this keyword to an array that will contain the resulting
		shaded surface image.  The variable is returned as a byte 
		array of the same size as the currently selected graphics 
		device.

	PLIST:	Set this keyword to an array that will contain the polygon
		list on return.  This feature is useful when you want to make a
		number of images from the same set of vertices and polygons.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The currently selected display is modified.

 RESTRICTIONS:
	The grid described by X and Y must consist of quadrilaterals,
	must be semi-regular, and must be in "CLOCKWISE" order:
	i.e., each cell must be defined by the vertices:

		v(i,j), v(i+1,j),v(i+1,j+1), and v(i,j+1).

	Clockwise ordering:

		x(i,j) <= x(i+1, j) ... for all j
	and	y(i,j) <= y(i, j+1) ... for all i.

	WARNING:  This restriction is not checked.

 PROCEDURE:
	First, SURFR is called to establish the 3D to 2D transformation.
	Then the vertex and polygon data structures required by the
	POLYSHADE function are built and passed that function.  POLYSHADE
	returns the shaded image which is then displayed by TV.

	This simple procedure can be modified to use and/or accept
	additional keywords.

 MODIFICATION HISTORY:
	Oct, 1989, DMS.	
	DMS, 	Modified to use SURFR instead of SURFACE. and to return the
		polygon list.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/shade_surf_irr.pro)


SHOW3

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

 PURPOSE:
	Show a 2D array three ways in a display that combines SURFACE, 
	CONTOUR, and an image (color/gray scale pixels).

 CATEGORY:
	Display, graphics.

 CALLING SEQUENCE:
	SHOW3, Image [, INTERP = Interp, SSCALE = Sscale]

 INPUTS:
	Image:	The 2-dimensional array to display.

 KEYWORD PARAMETERS:
	INTERP:	Set this keyword to use bilinear interpolation on the pixel 
		display.  This technique is slightly slower, but for small 
		images, it makes a better display.

	SSCALE:	Reduction scale for surface. The default is 1.  If this
		keyword is set to a value other than 1, the array size 
		is reduced by this factor for the surface display.  That is, 
		the number of points used to draw the wire-mesh surface is
		reduced.  If the array dimensions are not an integral multiple
		of SSCALE, the image is reduced to the next smaller multiple.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A new plot is generated.

 RESTRICTIONS:
	The display gets too "busy" when displaying larger (say 50 by 50),
	images, especially if they are noisy.  It can be helpful to use
	the SSCALE keyword or the SMOOTH and/or REBIN functions to smooth the 
	surface plot.

	You might want to modify the calls to CONTOUR and SURFACE slightly
	to customize the display to your tastes, i.e., with different colors,
	skirts, linestyles, contour levels, etc.

 PROCEDURE:
	First, do a SURFACE with no data to establish the 3D to 2D scaling.
	Then convert the coordinates of the corner pixels of the array to
	2D.  Use POLYWARP to get the warping polynomial to warp the
	2D image into the area underneath the SURFACE plot.  Output the image,
	output the surface (with data) and then output the contour plot at
	the top (z=1).

 MODIFICATION HISTORY:
	DMS. Jan, 1988.
	Added fudges for PostScript, April, 1988.
	Fixed bug where contour plot was occasionally clipped. Dec, 1990.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/show3.pro)


SHOWFONT

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

 PURPOSE:
	This procedure displays a vector-drawn font on the current
	graphics device.

 CATEGORY:
	Fonts.

 CALLING SEQUENCE:
	SHOWFONT, Font, Name

 INPUTS:
	Font:	 The index number of the font (may range from 3 to 29).
	Name:	 Title text to appear at top of display.

 KEYWORD PARAMETERS:
	ENCAPSULATED:	If this keyword is set, and if the current graphics
			device is "PS", makes encapsulated PostScript output.

 OUTPUTS:
	No explicit outputs.

 SIDE EFFECTS:
	A display is made.

 RESTRICTIONS:
	Not very flexible.

 PROCEDURE:
	Straightforward.

 EXAMPLE:
	To create a display of Font 3 for PostScript:
		SET_PLOT, 'PS'
		SHOWFONT, 3, "Simplex Roman"

 MODIFICATION HISTORY:
 	Written by:
	DMS, Nov, 1992

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/showfont.pro)


SIGMA

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

 PURPOSE:
	Calculate the standard deviation value of an array, or calculate the 
	standard deviation over one dimension of an array as a function of all
	the other dimensions.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = SIGMA(Array)

	Result = SIGMA(Array, N_Par)

	Result = SIGMA(Array, N_Par, Dimension)

 INPUTS:
	Array:	The input array of any type except string.

 OPTIONAL INPUT PARAMETERS:
	N_Par:	The number of parameters.  The default value is zero.  The 
		number of degrees of freedom is N_ELEMENTS(Array) - N_Par.  
		The value of sigma varies as one over the square root of the 
		number of degrees of freedom.

   Dimension:	The dimension to do standard deviation over.

 OUTPUTS:
	SIGMA returns the standard deviation value of the array when called 
	with one parameter. 

	If DIMENSION is passed, then the result is an array with all the
	dimensions of the input array except for the dimension specified,
	each element of which is the standard deviation of the corresponding
	vector in the input array.

	For example, if A is an array with dimensions of (3,4,5), then the
	command:

		B = SIGMA(A,N,1) 

	is equivalent to

		B = FLTARR(3,5)
		FOR J = 0,4 DO BEGIN
			FOR I = 0,2 DO BEGIN
			B(I,J) = SIGMA(A(I,*,J), N)
			ENDFOR
		ENDFOR

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	The dimension specified must be valid for the array passed, 
	otherwise the input array is returned as the output array.

 PROCEDURE:
	When DIMENSION is passed, then the function SUM is used.

 MODIFICATION HISTORY:
	William Thompson	Applied Research Corporation
	July, 1986		8201 Corporate Drive
				Landover, MD  20785
	DMS, May, 1993		Removed AVG fcn, use new features of TOTAL.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/sigma.pro)


SIGN_TEST

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

 PURPOSE:
	To test the null hypothesis that two populations have the same 
	distribution -i.e. F(x) = G(x) against the alternative that their 
	distributions differ in location- i.e F(x) = G(x+a).Sign_test 
	pairwise tests the populations in Data.
  
 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	SIGN_TEST, Data, [Diff,Prob,Names=Names]

 INPUTS:
	Data:	Two-dimensional array. Data(i,j) = the jth observation from
		the ith population.

 KEYWORDS:  
	NAMES:	Vector of user supplied names for the populations to be 
		used in the output.

    LIST_NAME:	Name of output file. Default is to the screen.

      MISSING:	Value used as a place holder for missing data.  Pairwise 
		handling of missing data.
           
      NOPRINT:	Flag, if set, to suppress output to the screen.

 OUTPUT:
	Table written to the screen showing for each pair of populations 
	the number of positive differences in observations.  Also, table of 
 	probabilties for each population pair giving the two-tailed 
	significance of the results in the first table.

OPTIONAL OUTPUT PARAMETERS: 
	Diff:	Two-dimensional array of positive differences.
		Diff(i,j) = number of observations in population
		i greater than the corresponding observation in population j.

	Prob:	Two-dimensional array. Prob(i,j) = probability of 
		Diff(i,j) or something more extreme.
                          
RESTRICTIONS:
      All populations have the same sample size.

COMMON BLOCKS: 
     None.

PROCEDURE:
	For each pair of populations, the diffence between corresponding
	observations is computed and a count is made of the positive and
	negative differences.  The probability of the count is computed
	under the assumption that the distributions are the same - i.e.
	the probability of a negative difference = the probability of a 
	positive difference = .5.  For sample size > 25, the binomial 
	distribution is approximated with a normal distribution for computing
	Prob.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/sign_test.pro)


SIMPREGRESS

[Previous Routine] [Next Routine] [List of Routines]
 $Id: simpregress.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.


unction simpregress,X,Y,W,YFit,A0,sigma,FTest,R,RMul,Chisqr

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/simpregress.pro)


SKEY_DEC

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

 PURPOSE:
	Under Unix, the number of function keys, their names, and the
	escape sequences they send to the host computer vary
	enough between various keyboards that IDL cannot be
	written to understand all keyboards. Therefore, it provides
	a very general routine named DEFINE_KEY that allows the
	user to specify the names and escape sequences. This
	routine uses DEFINE_KEY to enter the keys for a DEC
	VT200-style keyboard.

	Note: SKEY_DEC is primarily designed to be called by
	SETUP_KEYS, which attempts to automatically detect the correct
	keyboard type in use, and define the keys accordingly.
	Nonetheless, SKEY_DEC can be called as a standalone
	routine.

	This procedure is for Unix systems - NOT VMS.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	SKEY_DEC

 INPUTS:
	None.

 KEYWORD PARAMETERS:
    EIGHTBIT:	When establishing VT200 function key definitions,
		use the 8-bit versions of the escape codes instead
		of the default 7-bit.

  APP_KEYPAD:	Defines escape sequences for the group of keys
		in the numeric keypad, enabling these keys to be programmed
		within IDL.

  NUM_KEYPAD:	Disables programmability of the numeric keypad.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The definitions for the function keys have been entered, and
	can be viewed using the command HELP, /KEYS .

 MODIFICATION HISTORY:
	AB, 26 April 1989
	TJA, July 1990, setup_keys_dec created by the "breakup" of setup_keys
		into separate files.  Also, keywords added to enable and
		disable programmability of the numeric keypad.
	AB, 21 September 1992,renamed from SETUP_KEYS_DEC to SKEY_DEC to
		avoid DOS filename limitations.
	AB, 16 June 1993, The IDL scanner used to treat octal string escapes
		in a manner similar to the C language, but this ability was
		removed to make the MS DOS port possible (conflicts with
		file path specifications). Removed all uses of that here.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/skey_dec.pro)


SKEY_HP

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

 PURPOSE:
	Under Unix, the number of function keys, their names, and the
	escape sequences they send to the host computer vary
	enough between various keyboards that IDL cannot be
	written to understand all keyboards. Therefore, it provides
	a very general routine named DEFINE_KEY that allows the
	user to specify the names and escape sequences. This
	routine uses DEFINE_KEY to enter the keys for the HP 9000
	series 300 keyboard.

	Note: SKEY_HP is primarily designed to be called by
	SETUP_KEYS, which attempts to automatically detect the correct
	keyboard type in use, and define the keys accordingly.
	Nonetheless, SKEY_HP can be called as a standalone
	routine.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	SKEY_HP

 INPUTS:
	None.

 KEYWORD PARAMETERS:
  APP_KEYPAD:	Defines escape sequences for the group of keys
		in the numeric keypad, enabling these keys to be programmed
		within IDL.

  NUM_KEYPAD:	Disables programmability of the numeric keypad.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The definitions for the function keys have been entered, and
	can be viewed using HELP,/KEYS .

	The upper right-hand group of four keys (at the same height as
	the function keys) are called "BLANK1" through "BLANK4", since
	they have no written labels.  Keys defined to have labels beginning
	with a capital "K" belong to the numeric keypad group.  For example,
	"K9" refers to keypad key "9".

	Although the HP 9000 series 300 can create both xterm and hpterm
	windows, IDL supports only user-definable key definitions in xterm
	windows - hpterm windows use non-standard escape sequences which
	IDL does not attempt to handle.

 MODIFICATION HISTORY:
	TJA & AB, July 1990, setup_keys_hp created, and call to setup_keys_hp
		placed in procedure setup_keys
	AB, 21 September 1992,renamed from SETUP_KEYS_HP to SKEY_HP to
		avoid DOS filename limitations.
	AB, 16 June 1993, The IDL scanner used to treat octal string escapes
		in a manner similar to the C language, but this ability was
		removed to make the MS DOS port possible (conflicts with
		file path specifications). Removed all uses of that here.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/skey_hp.pro)


SKEY_MIPS

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

 PURPOSE:
	Under Unix, the number of function keys, their names, and the
	escape sequences they send to the host computer vary
	enough between various keyboards that IDL cannot be
	written to understand all keyboards. Therefore, it provides
	a very general routine named DEFINE_KEY that allows the
	user to specify the names and escape sequences. This
	routine uses DEFINE_KEY to enter the keys for the MIPS RS
	series keyboard.

	Note: SKEY_MIPS is primarily designed to be called by
	SETUP_KEYS, which attempts to automatically detect the correct
	keyboard type in use, and define the keys accordingly.
	Nonetheless, SKEY_MIPS can be called as a standalone
	routine.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	SKEY_MIPS

 INPUTS:
	None.

 KEYWORD PARAMETERS:
  APP_KEYPAD:	Defines escape sequences for the group of keys
		in the numeric keypad, enabling these keys to be programmed
		within IDL.

  NUM_KEYPAD:	Disables programmability of the numeric keypad.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The definitions for the function keys have been entered, and
	can be viewed using HELP,/KEYS .

	The , , and  keys are not defined,
	as they do not generate standard escape sequences.  The same is
	true for , , and  in the grouping of six keys above
	the arrow keys; however, the other three in the group ARE defined.
	Keys defined to have labels beginning with a capital "K" belong
	to the numeric keypad group.  For example, "K9" refers to keypad
	key "9".  The  key is the only one within the keypad
	which is not defined.

 MODIFICATION HISTORY:
	TJA , July 1990.  SETUP_KEYS_MIPS created, and call to SETUP_KEYS_MIPS
			  placed in procedure SETUP_KEYS.
	AB, 21 September 1992,renamed from SETUP_KEYS_MIPS to SKEY_MIPS to
		avoid DOS filename limitations.
	AB, 16 June 1993, The IDL scanner used to treat octal string escapes
		in a manner similar to the C language, but this ability was
		removed to make the MS DOS port possible (conflicts with
		file path specifications). Removed all uses of that here.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/skey_mips.pro)


SKEY_SGI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		SKEY_SGI
 PURPOSE:	Under Unix, the number of function keys, their names, and the
		escape sequences they send to the host computer vary
		enough between various keyboards that IDL cannot be
		written to understand all keyboards. Therefore, it provides
		a very general routine named DEFINE_KEY that allows the
		user to specify the names and escape sequences. This
		routine uses DEFINE_KEY to enter the keys for a Sun keyboard.

		Note: SKEY_SGI is primarily designed to be called by
		SETUP_KEYS, which attempts to automatically detect the correct
		keyboard type in use, and define the keys accordingly.
		Nonetheless, SKEY_SGI may be called as a standalone
		routine.

 CATEGORY:	Misc.
 CALLING SEQUENCE:
	SKEY_SGI
 INPUTS:
	None.
 KEYWORD PARAMETERS:
	None.
 OUTPUTS:
	None.
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:

	The definitions for the function keys have been entered, and
	can be viewed using HELP,/KEYS .
 MODIFICATION HISTORY:
	AB, 26 April 1989
	TJA, July 1990, setup_keys_sun created by the "breakup" of setup_keys
		into separate files.
	SMR, April 1991, setup_keys_sgi created by modifying setup_keys_sun
	AB, 21 September 1992,renamed from SETUP_KEYS_SGI to SKEY_SGI to
		avoid DOS filename limitations.
	AB, 16 June 1993, The IDL scanner used to treat octal string escapes
		in a manner similar to the C language, but this ability was
		removed to make the MS DOS port possible (conflicts with
		file path specifications). Removed all uses of that here.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/skey_sgi.pro)


SKEY_SUN

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

 PURPOSE:
	Under Unix, the number of function keys, their names, and the
	escape sequences they send to the host computer vary
	enough between various keyboards that IDL cannot be
	written to understand all keyboards. Therefore, it provides
	a very general routine named DEFINE_KEY that allows the
	user to specify the names and escape sequences. This
	routine uses DEFINE_KEY to enter the keys for a Sun keyboard.

	Note: SKEY_SUN is primarily designed to be called by
	SETUP_KEYS, which attempts to automatically detect the correct
	keyboard type in use, and define the keys accordingly.
	Nonetheless, SKEY_SUN can be called as a standalone
	routine.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	SKEY_SUN

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The definitions for the function keys have been entered, and
	can be viewed using the command HELP, /KEYS .

 MODIFICATION HISTORY:
	AB, 26 April 1989
	TJA, July 1990, SETUP_KEYS_SUN created by the "breakup" of SETUP_KEYS
			into separate files.
	AB, 21 September 1992,renamed from SETUP_KEYS_SUN to SKEY_SUN to
		avoid DOS filename limitations.
	AB, 16 June 1993, The IDL scanner used to treat octal string escapes
		in a manner similar to the C language, but this ability was
		removed to make the MS DOS port possible (conflicts with
		file path specifications). Removed all uses of that here.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/skey_sun.pro)


SLICER

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

 PURPOSE:
	Widget based application to show 3D volume slices and isosurfaces.

 CATEGORY:
	Volume display / rendering.

 CALLING SEQUENCE:
	COMMON VOLUME_DATA, A
	A = your_volume_data
	SLICER

 INPUTS:
	Variable A in VOLUME_DATA common contains volume data.  See EXAMPLE
	section below.

 KEYWORD PARAMETERS:
     COMMANDS:	An optional string array of commands to execute
		before entering the interactive mode.  Commands are
		in the form of a keyword optionally followed one or more 
		numeric, blank-separated parameters.  For example:
			"COMMAND P1 P2 P3 ... Pn"
		Keywords and parameters are:
		UNDO:	Undo previous operation.
		ORI X_Axis Y_Axis Z_axis X_Rev Y_Rev Z_Rev X_Rot Z_Rot Asp
			This command sets the orientation for the SLICER 
			display.  X_Axis, Y_Axis, and Z_Axis should be 0 for 
			data x, 1 for data y, and 2 for data z.  
			X_Rev, Y_Rev, and Z_Rev should be 0 for normal, 1 for 
			reversed.  Asp is the Z axis aspect ratio w/ respect 
			to X, Y.  X_Rot and Z_Rot are the rotations of the 
			X and Z axes in degrees (30 is the default).
			For example, to interchange the X and Z axes and
			reverse the Y use the string:
				ORI 2 1 0 0 1 0 30 30
		TRANS On_Off Threshold:  Use this command to turn transparency 
			on or off and set the transparency threshold value.
			1 means on, 0 means off.  Threshold is expressed in 
			percent of data range (0 = min data value, 100 = max 
			data value).
		SLICE Axis Value Interp 0:  Draw an orthogonal slice along
			the given axis (0=x, 1=y, 2=z) at Value.  Set Interp
			equal to 1 for interpolation, 0 for nearest neighbor.
			Expose = 1 to remove, 0 for normal slice.
		SLICE Azimuth, Elev, Interp, Expose, 1, x0, y0, z0:  Draw
			an oblique slice.  The oblique plane crosses the
			XY plane at angle Azimuth, with an elevation of Elev.
			It passes thru the point (x0, y0, z0).
		COLOR Table_Index Low High Shading:  Set the color tables.
			Table_Index is the pre-defined color table number (see
			LOADCT), or -1 to retain the present table.  Low, High
			and Shading are expressed in percent.
		ISO Threshold Hi_Lo:  Draw an iso-surface.  Threshold is the 
			isosurface threshold value.  Hi_Lo should be set to 1
			to view the low side, 0 for the high side.
		ERASE:	Erase the display.
		CUBE Mode Cut_Ovr Interp X0 Y0 Z0 X1 Y1 Z1:  Draw cube 
			(mode = 1) or cut-out (mode = 0).
			Cut_Ovr should be set to  1 for cut-over, 0 for 
			cut-thru.  Interp should be 1 for interpolation, 0 
			for nearest neighbor.  (X0,Y0,Z0) is the lower corner 
			of the cube.  (X1,Y1,Z1) is the upper corner. 
			(X0 < X1, etc.)
		WAIT Secs:  Wait the designated time (in seconds).

     CMD_FILE:	A string that contains the name of a file containing SLICER
		commands to execute as described above.

	DETACHED: if set, put the drawable in a separate window. (Good
		for large windows.)
	GROUP:	The base ID of the widget that calls SLICER.  When this 
		keyword is specified, the death of the caller results in the
		death of the SLICER.

	RANGE:	A two-element array containing minimum and maximum data
		values of interest.  If this keyword is omitted, the data is 
		scanned for the minimum and maximum.

    RESOLUTION: a two element vector giving the width and height of
		the drawing window.  Default = 55% by 44% of screen width.
 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	COMMON VOLUME_DATA, A   ;Used to pass in the volume data.
	COMMON SLICER_COMMON   ;Used internally.
	COMMON SLICER_COMMON1  ;Used internally.

 SIDE EFFECTS:
	On exit, the Z-buffer contains the most recent image generated by
	SLICER.  The image may be redisplayed on a different device by 
	reading the Z-buffer contents, plus the current color table.
	Widgets are created on the X window display.

 RESTRICTIONS:
	Widgets are required.
	The volume data must fit in memory.

 PROCEDURE:
	The slicer program has the following modes:
	Slices:         Displays orthogonal slices thru the data volume.
	Block:          Displaces the surfaces of a selected block inside
	                the volume. 
	Cutout:         Cuts blocks from previously drawn objects.
	Isosurface:     Draws an isosurface contour.
	Probe:          Displays the position and value of objects
	                using the mouse.
	Colors:         Manipulates the color tables and contrast.
	Rotations:      Sets the orientation of the display.

 EXAMPLE:
	Data is transferred to the SLICER via the VOLUME_DATA common block
	instead of as an argument.  This technique is used because volume
	datasets can be very large and hence, the duplication that occurs when
	passing values as arguments is a waste of memory.  Suppose that you 
	want to read some data from the file "head.dat" into IDL for use
	in the SLICER.  Before you read the data, establish the VOLUME_DATA
	common block with the command:

		COMMON VOLUME_DATA, VOL

	The VOLUME_DATA common block has just one variable in it.  The variable
	can have any name.  Here, we're using the name "VOL".  Now read the
	data from the file into VOL.  For example:

		OPENR, 1, "head.dat"
		VOL = FLTARR(20, 30, 42)
		READU, 1, VOL
		CLOSE, 1

	Now you can run the SLICER widget application by entering:

		SLICER

	The data stored in VOL is the data being worked on by the SLICER.

	To obtain the image in the slicer window after slicer is finished:
	(Use the image with the current color tables).

	SET_PLOT, 'Z'   ;Use the Z buffer graphics device
	a = TVRD()	;Read the image

 MODIFICATION HISTORY:
	DMS - RSI, Oct, 1991.
	DMS - RSI, Mar, 1992.  Added Journaling and expose mode.
				Fixed bug with 24 bit color.
	DMS - RSI, Jan, 1993.  Added oblique slices.
       DJC - RSI, Jun, 1994.  Fixed oblique slice initialization and
                              atan(0,0) problem (on HP).

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/slicer.pro)


SLIDER_ALLOC

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

 $Id: slider_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidSlider
   Widget Slider class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  SLIDER_Icon
       Return the slider toolbar icon

UNCTION SLIDER_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/slider_alloc.pro)


SLIDE_IMAGE

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

 PURPOSE:
	Create a scrolling graphics window for examining large images.
	By default, 2 draw widgets are used.  The left draw widget shows
	a reduced version of the complete image, while the draw widget on
	the right displays the actual image with scrollbars that allow sliding
	the visible window.

 CALLING SEQUENCE:
	SLIDE_IMAGE [, Image]

 INPUTS:
	Image:	The 2-dimensional image array to be displayed.  If this 
		argument is not specified, no image is displayed. The 
		FULL_WINDOW and SCROLL_WINDOW keywords can be used to obtain 
		the window numbers of the 2 draw widgets so they can be drawn
		into at a later time.

 KEYWORDS:
      CONGRID:	Normally, the image is processed with the CONGRID
		procedure before it is written to the fully visible
		window on the left. Specifying CONGIRD=0 will force
		the image to be drawn as is.

  FULL_WINDOW:	A named variable in which to store the IDL window number of \
		the non-sliding window.  This window number can be used with 
		the WSET procedure to draw to the scrolling window at a later
		point.

	GROUP:	The widget ID of the widget that calls SLIDE_IMAGE.  If this
		keyword is specified, the death of the caller results in the
		death of SLIDE_IMAGE.

	ORDER:	This keyword is passed directly to the TV procedure
		to control the order in which the images are drawn. Usually,
		images are drawn from the bottom up.  Set this keyword to a
		non-zero value to draw images from the top down.

     REGISTER:	Set this keyword to create a "Done" button for SLIDE_IMAGE
		and register the widgets with the XMANAGER procedure.

		The basic widgets used in this procedure do not generate
		widget events, so it is not necessary to process events
		in an event loop.  The default is therefore to simply create
		the widgets and return.  Hence, when register is not set, 
		SLIDE_IMAGE can be displayed and the user can still type 
		commands at the "IDL>" prompt that use the widgets.

	RETAIN:	This keyword is passed directly to the WIDGET_DRAW
		function, and controls the type of backing store
		used for the draw windows.  If not present, a value of
		2 is used to make IDL handle backing store.

 SLIDE_WINDOW:	A named variable in which to store the IDL window number of 
		the sliding window.  This window number can be used with the 
		WSET procedure to draw to the scrolling window at a later 
		time.

	TITLE:	The title to be used for the SLIDE_IMAGE widget.  If this
		keyword is not specified, "Slide Image" is used.

	TOP_ID:	A named variable in which to store the top widget ID of the 
		SLIDE_IMAGE hierarchy.  This ID can be used to kill the 
		hierarchy as shown below:

			SLIDE_IMAGE, BASE_ID=base, ...
			.
			.
			.
			WIDGET_CONTROL, /DESTROY, base

	XSIZE:	The maximum width of the image that can be displayed by
		the scrolling window.  This keyword should not be confused 
		with the visible size of the image, controlled by the XVISIBLE
		keyword.  If XSIZE is not specified, the width of Image is 
		used.  If Image is not specified, 256 is used.

     XVISIBLE:	The width of the viewport on the scrolling window.  If this 
		keyword is not specified, 256 is used.

	YSIZE:	The maximum height of the image that can be displayed by
		the scrolling window.  This keyword should not be confused 
		with the visible size of the image, controlled by the YVISIBLE
		keyword.  If YSIZE is not present the height of Image is used.
		If Image is not specified, 256 is used.

     YVISIBLE:	The height of the viewport on the scrolling window. If
		this keyword is not present, 256 is used.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	Widgets for displaying a very large image are created.
	The user typically uses the window manager to destroy
	the window, although the TOP_ID keyword can also be used to
	obtain the widget ID to use in destroying it via WIDGET_CONTROL.

 RESTRICTIONS:
	Scrolling windows don't work correctly if backing store is not 
	provided.  They work best with window-system-provided backing store
	(RETAIN=1), but are also usable with IDL provided backing store 
	(RETAIN=2).

	Various machines place different restrictions on the size of the
	actual image that can be handled.

 MODIFICATION HISTORY:
	7 August, 1991, Written by AB, RSI.
	10 March, 1993, ACY, Change default RETAIN=2

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/slide_image.pro)


SPEARMAN

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

 PURPOSE:
	To compute the correlation matrix where Spearman's correlation 
	coefficient is computed between pairs of ranked variables. No 
	assumptions are made about the probabilty distribution of the 
	variable values.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	SPEARMAN, Data, CorMatrix

 INPUTS:
	Data:	Two-dimensional array. Data(i,j) = the jth value of the ith
		variable.

 KEYWORDS:
	NAMES:	Vector of user supplied names for the variables to be used in
		the output.

    LIST_NAME:	Name of output file.  Default is to the screen.

      MISSING:	Value used as a place holder for missing data.  Pairwise 
		handling of missing data.

     NOPRINT:	A flag, if set, to suppress output to the screen.
           
 OUTPUT:
       Correlation matrix written to the screen

 OPTIONAL OUTPUT PARAMETERS:
    CORMATRIX:	Two-dimensional correlation array.  CorMatrix(i,j) = spearman
		correlation coeffiecient computed for variables i and j.
                          
 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 PROCEDURE:
	Variables are pairwised ranked with ties averaged.  Correlation 
	coefficient is computed using the rankings.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/spearman.pro)


SPH_4PNT

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

 PURPOSE:
       Given four 3-dimensional points, this procedure returns the
       center and radius necessary to define the unique sphere passing
       through those points.

 CATEGORY:
       Analytic Geometry.

 CALLING SEQUENCE:
       SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R

 INPUTS:
       X: A 4-element vector containing the X coordinates of the points.
       Y: A 4-element vector containing the Y coordinates of the points.
       Z: A 4-element vector containing the Z coordinates of the points.

	Note: X, Y, and Z should be floating-point or double-precision
	      vectors.

 OUTPUTS:
       Xc: The sphere's center x-coordinate. 
       Yc: The sphere's center y-coordinate.
       Zc: The sphere's center z-coordinate.
       R:  The sphere's radius.

 RESTRICTIONS:
       Points may not coincide.

 EXAMPLE:
       Find the center and radius of the unique sphere passing through
       the points: (1, 1, 0), (2, 1, 2), (1, 0, 3), (1, 0, 1)
       
       Define the floating-point vectors containing the x, y and z 
       coordinates of the points. 
         X = [1, 2, 1, 1] + 0.0
	  Y = [1, 1, 0, 0] + 0.0
	  Z = [0, 2, 3, 1] + 0.0

       Compute the sphere's center and radius.
         SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R

       Print the results.
         PRINT, Xc, Yc, Zc, R

 MODIFICATION HISTORY:
       Written by:  GGS, RSI, Jan 1993
       Modified:    GGS, RSI, March 1994
                    Rewrote documentation header.
                    Uses the new Numerical Recipes NR_LUDCMP/NR_LUBKSB.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/sph_4pnt.pro)


SPLINE

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

 PURPOSE:
	This function performs cubic spline interpolation.

 CATEGORY:
	Interpolation - E1.

 CALLING SEQUENCE:
	Result = SPLINE(X, Y, T [, Sigma])

 INPUTS:
	X:	The abcissa vector. Values MUST be monotonically increasing.

	Y:	The vector of ordinate values corresponding to X.

	T:	The vector of abcissae values for which the ordinate is 
		desired. The values of T MUST be monotonically increasing.

 OPTIONAL INPUT PARAMETERS:
	Sigma:	The amount of "tension" that is applied to the curve. The 
		default value is 1.0. If sigma is close to 0, (e.g., .01),
		then effectively there is a cubic spline fit. If sigma
		is large, (e.g., greater than 10), then the fit will be like
		a polynomial interpolation.

 OUTPUTS:
	SPLINE returns a vector of interpolated ordinates.
	Result(i) = value of the function at T(i).

 RESTRICTIONS:
	Abcissa values must be monotonically increasing.

 EXAMPLE:
	The commands below show a typical use of SPLINE:

		X = [2.,3.,4.]  	;X values of original function
		Y = (X-3)^2     	;Make a quadratic
		T = FINDGEN(20)/10.+2 	;Values for interpolated points.
					;twenty values from 2 to 3.9.
		Z = SPLINE(X,Y,T) 	;Do the interpolation.



 MODIFICATION HISTORY:
	Author:	Walter W. Jones, Naval Research Laboratory, Sept 26, 1976.
	Reviewer: Sidney Prahl, Texas Instruments.
	Adapted for IDL: DMS, Research Systems, March, 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/spline.pro)


SPLINE_P

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

 PURPOSE:
	This procedure performs parameteric cubic spline interpolation.

 CATEGORY:
	Interpolation - E1.

 CALLING SEQUENCE:
	SPLINE_P, X, Y, Xr, Yr

 INPUTS:
	X:	  The abcissa vector (should be floating or double).
	Y:	  The vector of ordinate values corresponding to X.
	Neither X or Y need be monotonic.

 KEYWORD PARAMETERS:
	INTERVAL: The interval in XY space between interpolants. If
		  omitted, approximately 8 interpolants per XY segment
		  will result.
	TAN0:	  The tangent to the spline curve at X(0), Y(0). If omitted,
		  the tangent is calculated to make the curvature of the
		  result zero at the beginning. This is a two element vector,
		  containing the X and Y components of the tangent.
	TAN1:	  The tangent to the spline curve at X(N-1), Y(N-1). If omitted,
		  the tangent is calculated to make the curvature of the
		  result zero at the end. This is a two element vector,
		  containing the X and Y components of the tangent.

 OUTPUTS:
	XR:	  The abcissa values of the interpolated function. This
		  may NOT be the same variable as either X or Y.
	YR:	  The ordinate values of the interpolated function. This
		  may NOT be the same variable as either X or Y.

 RESTRICTIONS:
	X and Y should be floating or double.

 PROCEDURE:
	Cubic spline interpolation with relaxed or clamped end conditions
	as used in the Numerical Recipes.

	This routine is both more general and faster than the
	user's library function SPLINE. One call to SPLINE_P is equivalent
	to two calls to SPLINE, as both the X and Y are interpolated with
	splines. It is suited for interpolating between randomly 
	placed points, and the abcissae	values need not be monotonic.
	In addition, the end conditions may be optionally specified via
	tangents.

 EXAMPLE:
	The commands below show a typical use of SPLINE_P:
	  X = [0.,1,0,-1,0]	  ;Abcissae for square with a vertical diagonal
	  Y = [0.,1,2,1,0]	  ;Ordinates
	  SPLINE_P, X, Y, XR, YR  ;Interpolate with relaxed end conditions
	  PLOT, XR, YR		  ;Show it

 	As above, but with setting both the beginning and end tangents:
 	  SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0]

 	This yields approximately 32 interpolants.

 	As above, but with setting the interval to 0.05, making more
	interpolants, closer together:
 	  SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0], INTERVAL=0.05

 	This yields 116 interpolants and looks close to a circle.

 MODIFICATION HISTORY:
	DMS, RSI.	August, 1993.	Written.
	DMS, RSI.	Jan, 1994.  Modified to use NR_ spline routines.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/spline_p.pro)


STDEV

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

 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-1)))

 MODIFICATION HISTORY:
	DMS, RSI, Sept. 1983.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/stdev.pro)


STEPWISE

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

 PURPOSE:
	To select the locally best set of independent variables to be used
	in a regression analysis to predict Y.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	STEPWISE, X, Y [,InEQ, Alpha, Alphar]

 INPUT:
	X:	A 2-dimensional array of observed variable values. 
		X(i,j) = the value of the ith variable in the jth observation.

	Y:	A column vector of observed dependent variable values. 
		X and Y must have the same number of rows.

 OPTIONAL INPUTS:
	InEq:	Vector of indices of equations to be forced into the equation.

	Alpha:	Significance level for including a variable.  The default 
		is 0.05.

	Alphar:	Significance level for removing a variable from the 
		regression equation. The default is equal to Alpha.

 KEYWORDS:   
     VARNAMES:	A vector of names for the independent variables to be used in
		the output.
         
	REPORT:	A flag to print out regression statistics as each a variable 
		enters or leaves the equation.

    LIST_NAME:	A string that contains the name of output file.  Default is 
		to the screen.

      MISSING:	Value of missing data.  If this keyword is not set, assume no
		missing data.  Listwise handling of missing data.    

 OUTPUT:
	Regression statistics for the final equation.

 OPTIONAL OUTPUT PARAMETERS:
	InEq:	Vector of indices of variables in final equation.

 RESTRICTIONS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None. 
 
 PROCEDURE:                     
	Adapted from an algorithm from Statistical Analysis, a Computer
	Oriented Approach, by A.A. Afifi and S.P. Azen.  The procedure 
	successively picks the best predictor of the dependent variable Y 
	given the variables already entered (via a statistic based on the
	partial correlation coefficient).  Variables may be removed from the
	equation if their significance falls below a given level. 

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/stepwise.pro)


STRETCH

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

 PURPOSE:
	Stretch the image display color tables so the full range 
	runs from one color index to another.

 CATEGORY:
	Image processing, point operations.

 CALLING SEQUENCE:
	STRETCH, Low, High [, /CHOP]

 INPUTS:
	Low:	The lowest pixel value to use.  If this parameter is omitted,
		0 is assumed.  Appropriate values range from 0 to the number 
		of available colors-1.

	High:	The highest pixel value to use.  If this parameter is omitted,
		the number of colors-1 is assumed.  Appropriate values range 
		from 0 to the number of available colors-1.

 OPTIONAL INPUTS:
	Gamma:	Gamma correction factor.  If this value is omitted, 1.0 is 
		assumed.  Gamma correction works by raising the color indices
		to the Gamma power, assuming they are scaled into the range 
		0 to 1.

 KEYWORD PARAMETERS:
	CHOP:	If this keyword is set, color values above the upper threshold
		are set to color index 0.  Normally, values above the upper 
		threshold are set to the maximum color index.

 OUTPUTS:
	No explicit outputs.

 COMMON BLOCKS:
	COLORS:	The common block that contains R, G, and B color
		tables loaded by LOADCT, HSV, HLS and others.

 SIDE EFFECTS:
	Image display color tables are loaded.

 RESTRICTIONS:
	Common block COLORS must be loaded before calling STRETCH.

 PROCEDURE:
	New R, G, and B vectors are created by linearly interpolating
	the vectors in the common block from Low to High.  Vectors in the 
	common block are not changed.

	If NO parameters are supplied, the original color tables are
	restored.

 EXAMPLE:
	Load the STD GAMMA-II color table by entering:

		LOADCT, 5

	Create and display and image by entering:

		TVSCL, DIST(300)

	Now adjust the color table with STRETCH.  Make the entire color table
	fit in the range 0 to 70 by entering:

		STRETCH, 0, 70

	Notice that pixel values above 70 are now colored white.  Restore the
	original color table by entering:

		STRETCH

 MODIFICATION HISTORY:
	DMS, RSI, Dec, 1983.
	DMS, April, 1987.	Changed common.
	DMS, October, 1987.	For unix.
	DMS, RSI, Nov., 1990.	Added GAMMA parameter.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/stretch.pro)


STR_SEP

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

 PURPOSE:
    This routine cuts a string into pieces which are separated by the 
    separator string.
 CATEGORY:
    String processing.
 CALLING SEQUENCE:
    arr = STR_SEP(string, separator)

 INPUTS:
    str - The string to be separated.
    sep - The separator.

 KEYWORDS:
    None.

 OUTPUT: 
    An array of strings as function value.

 COMMON BLOCKS:
    None

 SIDE EFFECTS:
    No known side effects.

 RESTRICTIONS:
    None.

 EXAMPLE:
    array = STR_SEP ("ulib.usca.test", ".")

 MODIFICATION HISTORY:
	July 1992, AH,	CreaSo		Created.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/str_sep.pro)


STUDENT1_T

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

 PURPOSE: 
	STUDENT1_T returns the probability that an observed value from the
	Student's t distribution with DF degrees of freedom is less than |X|.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = STUDENT1_T(X, DF)

 INPUTS:
	X:	Cutoff.

	DF:	Degrees of freedom.

 OUTPUT:
       The probability of |X| or something smaller.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/student1_t.pro)


STUDENT_T

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

 PURPOSE:
	STUDENT_T returns the cutoff value v such that

		Probability(X > v) = a1

	where X is a random variable from the Student t's distribution with
	DF degrees of freedom.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = STUDENT_T(A, DF)

 INPUT:
	A1:	The probability for which a cutoff is desired.
	DF:	The degrees of freedom

 OUTPUT: 
	The cutoff value if a is beween 0 and 1 inclusively. Otherwise, -1.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/student_t.pro)


STUDRANGE

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

 PURPOSE:
	Approximate the quantile P for a studentized range distribution 
	with V degrees of freedom and R samples. P must be between .9 and .90.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	Result = STUDENT_RANGE(P, V, R)

 INPUT:
	P:	The probability. .9 <= P <= .99.

	V:	Degrees of freedom. V >=1.

	R:	The number of samples. R > 1.

 OUTPUT:
	The cutoff point of the student_range for probability P, degrees 
	of freedom V and sample size R.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/studrange.pro)


SURFR

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

 PURPOSE:
	Set up 3D transformations.

	This procedure duplicates the rotation, translation, and scaling 
	features of the SURFACE routine.

 CATEGORY:
	Graphics, 3D.

 CALLING SEQUENCE:
	SURFR [, AX = ax]  [, AZ = az]

 INPUTS:
	No plain parameters.

 KEYWORD PARAMETERS:
	AX:	Angle of rotation about the X axis.  The default is 30 degrees.

	AZ:	Angle of rotation about the Z axis.  The default is 30 degrees.

 OUTPUTS:
	No explicit outputs.  Results are stored in !P.T.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	The 4 by 4 matrix, !P.T, the 3D transformation system variable, 
	receives the homogeneous transformation matrix generated by this 
	procedure.

 RESTRICTIONS:
	Axonometric projections only.

 PROCEDURE:
	1. Translate the unit cube so that the center (.5,.5,.5) is moved
	   to the origin.

	2. Rotate -90 degrees about the X axis to make the +Z
	   axis of the data the +Y axis of the display.  The +Y data axis
	   extends from the front of the display to the rear.

	3. Rotate about the Y axis AZ degrees.  This rotation is 
	   counterclockwise as seen from above the page.

	4. Rotate about the X axis AX degrees, tilting the data
	   toward the viewer.

	5. Translate back to the origin and scale the data so
	   that the data are still contained within the unit cube after
	   transformation.  This step uses the user procedure SCALE3D.

 MODIFICATION HISTORY:
	DMS, may, 1988.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/surfr.pro)


SVDFIT

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

 PURPOSE:
	Perform a general least squares fit with optional error estimates.

	This version uses SVD.  A user-supplied function or a built-in
	polynomial is fit to the data.

 CATEGORY:
	Curve fitting.

 CALLING SEQUENCE:
	Result = SVDFIT(X, Y, M)

 INPUTS:
	X:	A vector representing the independent variable.

	Y:	Dependent variable vector.  This vector should be same length 
		as X.

	M:	The number of coefficients in the fitting function.  For 
		polynomials, M is equal to the degree of the polynomial + 1.

 OPTIONAL INPUTS:
	Weight:	A vector of weights for Y(i).  This vector should be the same
		length as X and Y.

		If this parameter is ommitted, 1 is assumed.  The error for 
		each term is weighted by Weight(i) when computing the fit.  
		Frequently, Weight(i) = 1./Sigma(i) where Sigma is the 
		measurement error or standard deviation of Y(i).

	Funct:	A string that contains the name of an optional user-supplied 
		basis function with M coefficients. If omitted, polynomials
		are used.

		The function is called:
			R = FUNCT(X,M)
		where X is an N element vector, and the function value is an 
		(N, M) array of the N inputs, evaluated with the M basis 
		functions.  M is analogous to the degree of the polynomial +1 
		if the basis function is polynomials.  For example, see the 
		function COSINES, in the IDL User Library, which returns a 
		basis function of:
			R(i,j) = cos(j*x(i)).
		For more examples, see Numerical Recipes, page 519.

		The basis function for polynomials, is R(i,j) = x(i)^j.
		
 OUTPUTS:
	SVDFIT returns a vector of M coefficients.

 OPTIONAL OUTPUT PARAMETERS:
	NOTE:  In order for an optional keyword output parameter
	to be returned, it must be defined before calling SVDFIT.
	The value or structure doesn't matter.  For example:

		YF = 1				;Define output variable yf.
		C = SVDFIT(X, Y, M, YFIT = YF) 	;Do SVD, fitted Y vector is now
						;returned in variable YF.

	YFIT:	Vector of calculated Y's.

	CHISQ:	Sum of squared errors multiplied by weights if weights
		are specified.

	COVAR:	Covariance matrix of the coefficients.

    VARIANCE:	Sigma squared in estimate of each coeff(M).

    SINGULAR:	The number of singular values returned.  This value should
		be 0.  If not, the basis functions do not accurately
		characterize the data.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 MODIFICATION HISTORY:
	Adapted from SVDFIT, from the book Numerical Recipes, Press,
	et. al., Page 518.
	minor error corrected April, 1992 (J.Murthy)

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/svdfit.pro)


SWAP_ENDIAN

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

 PURPOSE:
	This fucntion reverses the byte ordering of arbitrary scalars,
	arrays or structures. It may be used, for example, to make little
	endian numbers big, or big endian numbers little.

 CATEGORY:
	Utility.

 CALLING SEQUENCE:
	Result = SWAP_ENDIAN(A)

 INPUTS:
	A:	The scalar, array, or structure to be swapped.

 OUTPUTS:
	Result:	The same type and structure as the input, with the
		pertinent bytes reversed.

 PROCEDURE:
	Swap arrays and scalars directly using BYTEORDER.
	Swap structures recursively.

 EXAMPLE:
	A = SWAP_ENDIAN(A)  ;Reverses the "endianness" of A

 MODIFICATION HISTORY:
	DMS, RSI, May, 1993.	Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/swap_endian.pro)


T3D

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

 PURPOSE:
	Implement three-dimensional transforms.

	This routine accumulates one or more sequences of translation,
	scaling, rotation, perspective, and oblique transformations
	and stores the result in !P.T, the 3D transformation system variable.
	All the IDL graphic routines use this (4,4) matrix for output.

 CATEGORY:
	Graphics.

 CALLING SEQUENCE:
	T3D [, /RESET, TRANSLATE = T, SCALE = S, ROTATE = R, ... ]

 INPUTS:
	No non-keyword inputs.

 KEYWORDS:
	All inputs to T3D are in the form of keywords.  Any, all, or none of 
	the following keywords can be present in a call to T3D.  The order of 
	the input parameters does not matter.

	The transformation specified by each keyword is performed in the
	order of their descriptions below (e.g., if both TRANSLATE and
	SCALE are specified, the translation is done first):

	RESET:	Set this keyword to reset the transformation to the default 
		identity matrix.

    TRANSLATE:	A three-element vector of the translations in the X, Y, and Z 
		directions.

	SCALE:	A three-element vector of scale factors for the X, Y, and Z 
		axes.

       ROTATE:	A three-element vector of the rotations, in DEGREES, 
		about the X, Y, and Z axes.  Rotations are performed in the
		order of X, Y, and then Z.

  PERSPECTIVE:	Perspective transformation.  This parameter is a scalar (p) 
		that indicates the Z distance of the center of the projection.
		Objects are projected into the XY plane at Z=0, and the "eye" 
		is at point (0,0,p).

      OBLIQUE:	A two-element vector of oblique projection parameters.
		Points are projected onto the XY plane at Z=0 as follows:
			x' = x + z(d COS(a)), and y' = y + z(d SIN(a)).
		where OBLIQUE(0) = d, and OBLIQUE(1) = a.

	XYEXCH:	Exchange the X and Y axes.

	XZEXCH:	Exchange the X and Z axes.

	YZEXCH:	Exchange the Y and Z axes.

 OUTPUTS:
	The 4 by 4 transformation matrix !P.T is updated with the
	resulting transformation.  !P.T3D is NOT set, so for the 
	transformations to have effect you must set !P.T3D = 1 (or set
	the T3D keyword in subsequent calls to graphics routines).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	!P.T is changed.

 RESTRICTIONS:
	This routine implements general rotations about the three axes.
	The routines SURFACE and SHADE_SURF may only be used in conjunction 
	with T3D rotations that project the Z axis in 3 dimensions to
	a line parallel to the Y axis in 2 dimensions.

 PROCEDURE:
	This program follows that of Foley & Van Dam, "Fundamentals of
	Interactive Computer Graphics", Chapter 8, "Viewing in Three
	Dimensions".

	The matrix notation is reversed from the normal IDL sense,
	i.e., here, the first subscript is the column, the second is the row,
	in order to conform with the above reference.

	A right-handed system is used.  Positive rotations are COUNTER-
	CLOCKWISE when looking from a positive axis to the origin.

 EXAMPLES:
	To reset the transformation, rotate 30 degs about the X axis
	and do perspective transformation with the center of the projection
	at Z = -1, X=0, and Y=0, enter:

		T3D, /RESET, ROT = [ 30,0,0], PERS = 1.

	Transformations may be cascaded, for example:

		T3D, /RESET, TRANS = [-.5,-.5,0], ROT = [0,0,45]
		T3D, TRANS = [.5,.5,0]

	The first command resets, translates the point (.5,.5,0) to the 
	center of the viewport, then rotates 45 degrees counterclockwise 
	about the Z axis.  The second call to T3D moves the origin back to 
	the center of the viewport.

 MODIFICATION HISTORY:
	DMS, Nov, 1987.

	DMS, June 1990.	Fixed bug that didn't scale or translate
			matrices with perspective properly.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/t3d.pro)


TESTCONTRAST

[Previous Routine] [Next Routine] [List of Routines]
 $Id: testcontrast.pro,v 1.1 1993/04/02 18:54:39 idl Exp $

  Copyright (c) 1991-1993, Research Systems Inc.  All rights
  reserved. Unauthorized reproduction prohibited.


unction testcontrast, A, unit
testcontrast tests that the array A consists
of contrasts-- ie the sum of each row is zero.
input: 
     A = two-dimensional array
output:
    return 1 if A consists of contrasts and
           0, if rows dont sum to 0
           -1, if 0 contrast or wrong dimensions

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/testcontrast.pro)


TEXT_ALLOC

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

 $Id: text_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidText
   Widget Text class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  TEXT_Icon
       Return the text toolbar icon

UNCTION TEXT_Icon

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/text_alloc.pro)


THREED

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

 PURPOSE:
	Plot a 2D array as a pseudo 3D plot.

 CATEGORY:
	J7 Plotting, graphics, multi-dimensional.

 CALLING SEQUENCE:
	THREED, A [, Sp]

 INPUTS:
	A:	The two-dimensional array to plot.

 OPTIONAL INPUT PARAMETERS:
	Sp:	Spacing between plot lines.  If sp is omitted, the spacing 
		is set to: 
			(MAX(A)-MIN(A))/ROWS
		If Sp is negative, hidden lines are not removed.

 KEYWORDS:
	TITLE:	The main plot title.

	XTITLE:	The X axis title.

	YTITLE:	The Y axis title.

 OUTPUTS:
	None.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A plot is produced on the currently selected graphics device.

 RESTRICTIONS:
	Orientation of data is fixed.
	Use the built-in procedure SURFACE for a more comprehensive surface 
	plotting routine.

 PROCEDURE:
	Straightforward.
	A vector is maintained of the previous maximum plotted Y.
	The PLOT and OPLOT procedures are used.

 MODIFICATION HISTORY:
	VERSION 1.2, CREATED BY D. LINDLER, AUGUST 5,1980
	VERSION 1.3, CREATED BY I. DEAN AHMAD, JANUARY 28, 1981
	MODIFIED FOR VAX, DMS, SEPT, 1982.
	Modified for Unix, DMS, 2/15/88.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/threed.pro)


TIFF_DUMP

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

 PURPOSE:
	Dump the Image File Directories of a TIFF File.  This procedure is
	used mainly for debugging.

 CATEGORY:
	Input/output.

 CALLING SEQUENCE:
	TIFF_DUMP, Filename

 INPUTS:
    Filename:	string containing the name of file to read.
		The default extension is ".TIF".

 OUTPUTS:
	All output is to the terminal.  Each TIFF Image File Directory
	entry is printed.

 COMMON BLOCKS:
	TIFF_COM.  Only for internal use.

 SIDE EFFECTS:
	A file is read.

 RESTRICTIONS:
	Not all of the tags have names encoded.
	In particular, Facsimile, Document Storage and Retrieval,
	and most no-longer recommended fields are not encoded.

 PROCEDURE:
	The TIFF file Header and the IFD (Image File Directory) are read
	and listed.

 MODIFICATION HISTORY:
	DMS, Apr, 1991.  Extracted from TIFF_READ.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/tiff_dump.pro)


TIFF_READ

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

 PURPOSE:
	Read 8-bit or 24-bit images in TIFF format.

 CATEGORY:
	Input/output.

 CALLING SEQUENCE:
   Result = TIFF_READ(Filename [,R, G, B], ORDER = order, PLANARCONFIG = pc)

 INPUTS:
    Filename:	A string containing the name of file to read.
		The default extension is ".TIF".

 OUTPUTS:
	TIFF_READ returns a byte array containing the image data.  The 
	dimensions of the result are the same as defined in the TIFF 
	file: (Columns, Rows).

	For TIFF images that are RGB interleaved by pixel, the output 
	dimensions are (3, Cols, Rows).

	For TIFF images that are RGB interleaved by image, on output
	Planarconfig is set to 2, and the result is the integer value
	zero.   In this case, three separate images are returned in
	the R, G, and B output parameters.

 OPTIONAL OUTPUTS:
     R, G, B:	Variables to hold the Red, Green, and Blue color vectors
		extracted from TIFF Class P, Palette Color images.
	For TIFF images that are RGB interleaved by image (Planarconfig
	returned as 2) the R, G, and B variables each hold an image
	with the dimensions (Columns, Rows).

 KEYWORDS:
	The following keywords are used for output parameters only:

	ORDER:	The order parameter from the TIFF File.  This parameter is
		returned as 0 for images written bottom to top, and 1 for
		images written top to bottom.  If the Orientation parameter 
		does not appear in the TIFF file, an order of 1 is returned.

 PLANARCONFIG:	This parameter is returned as 1 for TIFF files that are
		GrayScale, Palette, or RGB color interleaved by pixel.  
		This parameter is returned as 2 for RGB color TIFF files 
		interleaved by image.

 COMMON BLOCKS:
	TIFF_COM.  Only for internal use.

 SIDE EFFECTS:
	A file is read.

 RESTRICTIONS:
	Handles TIFF classes G, P, and R.  One image per file.

 EXAMPLE:
	Read the file "my.tiff" in the current directory into the variable
	IMAGE, and save the color tables in the variables, R, G, and B by
	entering:

		IMAGE = TIFF_READ("my.tiff", R, G, B)

	To view the image, load the new color table and display the image by
	entering:

		TVLCT, R, G, B
		TV, IMAGE 


 MODIFICATION HISTORY:
	DMS, Written for VMS in 1985.
	DMS, April, 1991.  Rewrote and added class R and P images.
	DMS, Jan, 1992.  Fixed bug for images without a RowsPerStrip field.
       DJC, Nov, 1993.  Fixed doc header.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/tiff_read.pro)


TIFF_WRITE

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

 PURPOSE:
	Write 8-bit or 24-bit images in TIFF format.

 CATEGORY:
	Input/output.

 CALLING SEQUENCE:
	TIFF_WRITE, Filename, Array [, Orientation], $
		    [RED = R, GREEN = G, BLUE = B, PLANARCONFIG = pc, $
		    XRESOL = xresol, YRESOL = yresol]

 INPUTS:
     Filename:	A string containing the name of file to create. 

	Array:	The image data to be written.  If not already a byte array,
		it is made a byte array.  Array may be either an
		(n, m) array for Grayscale or Palette classes, or
		a (3, n, m) array for RGB full color, interleaved
		by image.  If the PLANARCONFIG keyword (see below) is set
		to 2 then the Array parameter is ignored (and may be
		omitted). See PROCEDURE below for more information on
		TIFF classes. 

 OPTIONAL INPUT PARAMETERS:
 Orientation:	This parameter should be 0 if the image is stored from bottom 
		to top (the default).  For images stored from top to bottom, 
		this parameter should be 1.  

		WARNING:  Not all TIFF readers are capable of reversing the 
		scan line order.  If in doubt, first convert the image
		to top to bottom order (use the IDL REVERSE() function), and 
		set Orientation to 1.

 OPTIONAL KEYWORD PARAMETERS:
 RED, GREEN, BLUE:
		The color table vectors, scaled from 0 to 255 in the case of 
		a Class P, Palette color image.  If, PlanarConfig is 2, these 
		parameters must contain the 3 color component image parameters.

 PLANARCONFIG:	Set this parameter to 2 if writing an RGB image that is 
		contained in three separate images (color planes), specified
		in the RED, GREEN, and BLUE parameters.  Otherwise, omit
		this parameter (or set it to 1).

	XRESOL:	The horizontal resolution, in pixels per inch.  The default
		is 100.
 
	YRESOL:	The vertical resolution, in pixels per inch.  The default
		is 100.

 OUTPUTS:
	No explicit inputs.

 COMMON BLOCKS:
	TIFF_COM.  Only for internal use.

 SIDE EFFECTS:
	A file is created and written.

 RESTRICTIONS:
	This procedure writes images in a single strip, or 3 strips when 
	PLANARCONFIG is set to 2.  This procedure may cause readers with 
	memory limitations problems.

 PROCEDURE/EXAMPLES:
	Four types of TIFF files can be written:

	TIFF Class G, Grayscale.  Array contains the 8-bit image array.
	A value of 0 is black, 255 is white.  The Red, Green, and Blue
	keywords are omitted.  Example:
		TIFF_WRITE, 'a.tiff', Array

	TIFF Class P, Palette Color.  Array contains the 8-bit image array.  
	The keyword parameters RED, GREEN, and BLUE contain the color tables, 
	which can have up to 256 elements, scaled from 0 to 255.  Example:
		TIFF_WRITE, 'a.tiff', Array, RED = r, GREEN = g, BLUE = b

	TIFF Class R, RGB Full Color, color interleaved by pixel.
	Array contains the byte data, and is dimensioned (3, cols, rows).
	Example:
		TIFF_WRITE, 'a.tiff', Array

	TIFF Class R, RGB Full Color, color interleaved by image.
	Input is three separate images, provided in the keyword
	parameters RED, GREEN, and BLUE.  The input parameter "Array"
	is ignored.  The keyword PLANARCONFIG must be set to 2 in this case.
	Example:
		TIFF_WRITE, 'a.tiff', RED = r, GREEN = g, BLUE = b, PLAN = 2

 MODIFICATION HISTORY:
	DMS, Written for VMS in 1985.

	DMS, April, 1991.  Rewrote and added class R and P images.
	DJC, Nov, 1993.  Fixed doc header.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/tiff_write.pro)


TIME_TEST

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

 PURPOSE:
	General purpose IDL benchmark program that performs
	approximately 20 common operations and prints the time
	required.

 CATEGORY:
	Miscellaneous.

 CALLING SEQUENCE:
	TIME_TEST [, Filename]

 OPTIONAL INPUTS:
    Filename:	The string containing the name of output file for the 
		results of the time test.

 OUTPUTS:
	No explicit outputs.  Results of the test are printed to the screen 
	or to a file.

 OPTIONAL OUTPUT PARAMETERS:
	None.

 COMMON BLOCKS:
	TIMER_COMMON

 SIDE EFFECTS:
	Many operations are performed.  Files are written, etc.

 RESTRICTIONS:
	Could be more complete, and could segregate integer, floating
	point and file system IO times into separate figures.

 PROCEDURE:
	Straightforward.
	See also the procedure GRAPHICS_TEST, in this file, which
	times a few of the common graphics operations.

	We make no claim that these times are a fair or accurate
	measure of computer performance.  In particular, different
	versions of IDL were used.

	Graphics performance varies greatly, depending largely on the
	window system, or lack of thereof.
	
	Typical times obtained to date include:
 	 (where	Comp.     = computational tests
 		Graphics  = graphics tests
		Geo. Avg. = geometric average)

 Machine / OS / Memory            Comp.   Geo. Avg.   Graphics Geo. Avg.

 MicroVAX II, VMS 5.1, 16MB        637     14.4        39.9    6.57
 MicroVAX II, Ultrix 3.0, 16MB     616     13.9        58.1    8.27
 Sun 3/110, SunOS 4.0, 12MB        391      8.19       32.0    7.81
 Sun 3/80, 12MB, 24 bit color      282      6.03       89.3   21.7
 PC 386 25MHz, 80387, MSDOS, 4MB   276      6.9        29.5    5.94
 Mips R2030, RISC/os 4.1, 8MB      246      3.67       14.6    2.62
 VAXStation 3100, VMS 5.1, 16MB    235      5.13       24.3    3.71
 HP 9000, Model 375, ?? ??         163      4.14       20.8    3.37
 DecStation 3100, UWS 2.1, 16MB    150      4.00       17.6    3.23
 486 33mhz Clone, MS Windows, 8MB   70      1.81       12.9    3.00
 Sun 4/65, SunOS 4.1, 16MB          66      1.81        7.0    1.64
 Silicon Graphics 4D/25, ??         51      1.38       19.4    2.44
 Sun 4/50 IPX, 16MB		     40	     1.03	 7.7	0.80
 IBM 6000 Model 325 24MB            40      0.87        5.8    1.21
 HP 9000 / 720 48 MB                20      0.52        5.0    0.70
 SGI Indigo XS4000, 32MB	     20      0.46	 2.1    0.44
 SGI Indigo2, 150Mhz, 32MB	     16	     0.32        2.4    0.51
 DEC Alpha 3000/500, 224MB	     13      0.30        2.3    0.43


 MODIFICATION HISTORY:
	DMS, 1986.

	DMS, Revised July 1990,  Increased the size of arrays and the number
		of repetitions to make most of the tests take longer.
		This is to eliminate the effect of clock granularity
		and to acknowledge that machines are becoming faster.
		Many of the tests were made longer by a factor of 10.
		

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/time_test.pro)


TPLT_ALLOC

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

 $Id: tplt_alloc.pro,v 1.5 1994/06/01 23:08:48 ali Exp $

  WidTemplate
   Sample Class definition file

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  TPLT_Icon

UNCTION TPLT_Icon
 ;  One should either return 0 (indicates no toolbar icon)
 ;  or a BYTARR(4,32) which will be added to the toolbar.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/tplt_alloc.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 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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/tri_surf.pro)


UNIQ

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

 PURPOSE:
	Return the subscripts of the unique elements in an array.

	Note that repeated elements must be adjacent in order to be
	found.  This routine is intended to be used with the SORT
	function.  See the discussion of the IDX argument below.

	This command is inspired by the Unix uniq(1) command.

 CATEGORY:
	Array manipulation.

 CALLING SEQUENCE:
	UNIQ(Array [, Idx])

 INPUTS:
	Array:	The array to be scanned.  The type and number of dimensions
		of the array are not important.  The array must be sorted
		into monotonic order unless the optional parameter Idx is 
		supplied.

 OPTIONAL INPUT PARAMETERS:
	IDX:	This optional parameter is an array of indices into Array
		that order the elements into monotonic order.
		That is, the expression:

			Array(Idx)

		yields an array in which the elements of Array are
		rearranged into monotonic order.  If the array is not
		already in monotonic order, use the command:

			UNIQ(Array, SORT(Array))

		The expression below finds the unique elements of an unsorted
		array:

			Array(UNIQ(Array, SORT(Array)))

 OUTPUTS:
	An array of indicies into ARRAY is returned.  The expression:

		ARRAY(UNIQ(ARRAY))

	will be a copy of the sorted Array with duplicate adjacent
	elements removed.

 COMMON BLOCKS:
	None.

 MODIFICATION HISTORY:
	29 July 1992, ACY - Corrected for case of all elements the same.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/uniq.pro)


VEL

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

 PURPOSE:
	Draw a velocity (flow) field with arrows following the field 
	proportional in length to the field strength.  Arrows are composed 
	of a number of small segments that follow the streamlines.

 CATEGORY:
	Graphics, two-dimensional.

 CALLING SEQUENCE:
	VEL, U, V

 INPUTS:
	U:	The X component at each point of the vector field.  This 
		parameter must be a 2D array.

	V:	The Y component at each point of the vector field.  This 
		parameter must have the same dimensions as U.

 KEYWORD PARAMETERS:
	NVECS:	The number of vectors (arrows) to draw.  If this keyword is
		omitted, 200 vectors are drawn.

	XMAX:	X axis size as a fraction of Y axis size.  The default is 1.0.
		This argument is ignored when !p.multi is set.

	LENGTH:	The length of each arrow line segment expressed as a fraction 
		of the longest vector divided by the number of steps.  The 
		default is 0.1.

	NSTEPS:	The number of shoots or line segments for each arrow.  The
		default is 10.

	TITLE:	A string containing the title for the plot.
	
 OUTPUTS:
	No explicit outputs.  A velocity field graph is drawn on the current
	graphics device.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	A plot is drawn on the current graphics device.

 RESTRICTIONS:
	none

 PROCEDURE:
	NVECS random points within the (u,v) arrays are selected.
	For each "shot" the field (as bilinearly interpolated) at each
	point is followed using a vector of LENGTH length, tracing
	a line with NSTEPS segments.  An arrow head is drawn at the end.

 MODIFICATION HISTORY:
	12/2/92	- modified to handle !p.multi (jiy-RSI)
	Neal Hurlburt, April, 1988.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/vel.pro)


VELOVECT

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

 PURPOSE:
	Produce a two-dimensional velocity field plot.

	A directed arrow is drawn at each point showing the direction and 
	magnitude of the field.
               
 CATEGORY:
	Plotting, two-dimensional.

 CALLING SEQUENCE:
	VELOVECT, 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 first dimension of U and V.

 KEYWORD INPUT PARAMETERS:
      MISSING:	Missing data value.  Vectors with a LENGTH greater
		than MISSING are ignored.

	LENGTH:	Length factor.  The default of 1.0 makes the longest (U,V)
		vector the length of a cell.

	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.

	COLOR:	The color index used for the plot.

	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.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/velovect.pro)


VERT_T3D

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

 PURPOSE:
       This function tranforms 3-D points by a 4x4 transformation matrix.
       The 3-D points are typically an array of polygon vertices that were
       generated by SHADE_VOLUME or MESH_OBJ.

 CATEGORY:
       Graphics.

 CALLING SEQUENCE:
       result = VERT_T3D(vertex_list)

 INPUTS:
       Vertex_List:
               A vector of the form [x, y, z], or a (3, n) array of 3-D
               coordinates to transform.

 KEYWORD PARAMETERS:

       Matrix:
               The 4x4 transformation matrix to use. The default is to use
               the system viewing matrix (!P.T). (See the "T3D" procedure). 

       No_Copy:
               Normally, a COPY of Vertex_List is transformed and the
               original vertex_list is preserved. If No_Copy is set, however,
               then the original Vertex_List will be undefined AFTER the call
               to VERT_T3D. Using the No_Copy mode will require less memory.

       No_Divide:
               Normally, when a [x, y, z, 1] vector is transformed by a 4x4
               matrix, the final homogeneous coordinates are obtained by
               dividing the x, y, and z components of the result vector by
               the fourth element in the result vector. Setting the No_Divide
               keyword will prevent VERT_T3D from performing this division.
               In some cases (usually when a perspective transformation is
               involved) the fourth element in the result vector can be very
               close to (or equal to) zero.

       Save_Divide:
               Set this keyword to a named variable to receive the fourth
               element of the transformed vector(s). If Vertex_List is a
               vector then Save_Divide is a scalar. If Vertex_List is a
               (3, n) array then Save_Divide is an array of n elements.
               This keyword only has effect when the No_Divide keyword is set.

 OUTPUTS:
       This function returns the transformed coordinate(s). The returned
       array has the same size and dimensions as Vertex_List.

 PROCEDURE:
       Before performing the transformation, the (3, n) Vertex_List is padded
       to produce a (4, n) array with 1's in the last column. After the
       transformation, the first three columns of the array are divided by
       the fourth column (unless the No_Divide keyword is set). The fourth
       column is then stripped off (or saved in the Save_Divide keyword)
       before returning.

 EXAMPLE:
       Transform four points representing a square in the x-y plane by first
       translating +2.0 in the positive X direction, and then rotating 60.0
       degrees about the Y axis.

               points = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], $
                         [1.0, 1.0, 0.0], [0.0, 1.0, 0.0]]
               T3d, /Reset
               T3d, Translate=[2.0, 0.0, 0.0]
               T3d, Rotate=[0.0, 60.0, 0.0]
               points = VERT_T3D(points)

 MODIFICATION HISTORY:
       Written by:     Daniel Carr, Thu Mar 31 15:58:07 MST 1994

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/vert_t3d.pro)


VORONOI

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

 PURPOSE:
	This procedure computes the Voronoi polygon of a point within
	an irregular grid of points, given the Delaunay triangulation.
	The Voronoi polygon of a point contains the region closer to
	that point than to any other point.

 CATEGORY:
	Gridding.

 CALLING SEQUENCE:
	VORONOI, X, Y, I0, C, Xp, Yp

 INPUTS:
	X:	An array containing the X locations of the points.
	Y:	An array containing the Y locations of the points.
	I0:	Indices of the points.
	C:	A connectivity list from the Delaunay triangulation.
		This list is produced with the CONNECTIVITY keyword
		of the TRIANGULATE procedure.

 OUTPUTS:
	Xp, Yp:	The vertices of voroni polygon.

 RESTRICTIONS:
	The polygons only cover the convex hull of the set of points.

 PROCEDURE:
	For interior points, the polygon is constructed by connecting
	the midpoints of the lines connecting the point with its Delaunay
	neighbors. Polygons are traversed in a counterclockwise direction.

	For exterior points, the set described by the midpoints of the
	connecting lines, plus the circumcenters of the two triangles
	that connect the point to the two adjacent exterior points.

 EXAMPLE:
	To draw the voroni polygons of each point of an irregular 
	grid:
	  x = randomu(seed, n)			 ;Random grid of N points
	  y = randomu(seed, n)
	  triangulate, x, y, tr, CONN=c			  ;Triangulate it
	  for i=0, n-1 do begin
		voronoi, x, y, i, c, xp, yp		  ;Get the ith polygon
		polyfill, xp, yp, color = (i mod 10) + 2  ;Draw it
		endfor

 MODIFICATION HISTORY:
	DMS, RSI.	Dec, 1992. Original version.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/voronoi.pro)


WARP_TRI

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

 PURPOSE:
	This function warps images using control (tie) points.

 CATEGORY:
	Image processing, geometric transformation.

 CALLING SEQUENCE:
	Result = WARP_TRI(Xo, Yo, Xi, Yi, Im_in)

 INPUTS:
	Xo, Yo:	     Vectors containing the locations of the tie points
		     in the output image.
	Xi, Yi:	     Vectors containing the location of the tie points
		     in the input image (Im_in). Xi, Yi must be the same
		     length as Xo, Y0.
	Im_in:	     The image to be warped. May be any type of data.

 KEYWORD PARAMETERS:
	OUTPUT_SIZE: A 2-element vector containing the size of the
		     output image. If omitted, the output image is the
		     same size as Im_in.
	QUINTIC:     Set this keyword to use smooth quintic interpolation.
		     Quintic interpolation is slower but the
		     derivatives are continuous across triangles,
		     giving a more pleasing result than the default
		     linear interpolation. 
	EXTRAPOLATE: Set to true to extrapolate outside the convex
		     hull of the tie points. Setting this keyword implies
		     the use of QUINTIC interpolation.

 OUTPUTS:
	This function returns an image array with the specified
	geometric correction applied. Points at locations (Xi, Yi)
	are shifted to (Xo, Yo).

 PROCEDURE:
	The irregular grid defined by (Xo, Yo) is triangulated
	using TRIANGULATE. Then the surfaces defined by (Xo, Yo, Xi)
	and (Xo, Yo, Yi) are interpolated using TRIGRID to get
	the locations in the input image of each pixel in the output
	image. Finally, INTERPOLATE is called to obtain the result.
	Linear interpolation is used by default.  Smooth quintic
	interpolation is used if the QUINTIC keyword is set.

 MODIFICATION HISTORY:
	DMS, Jan, 1992.
	DMS, Jul, 1992, added quintic interpolation.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/warp_tri.pro)


WF_DRAW

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

 PURPOSE:
	This procedure draws weather fronts of various types with
	spline smoothing.

 CATEGORY:
	Meterology.

 CALLING SEQUENCE:
	WF_DRAW, X, Y

 INPUTS:
  	X, Y:        Vectors of abcissae and ordinates defining the
		     front to be drawn.

 KEYWORD PARAMETERS:
  	COLD:	     A cold front. The default is a plain line with
		     no annotations.
  	WARM:	     A warm front.
  	OCCLUDED:    An occluded front.
  	STATIONARY:  A stationary front.
  	CONVERGENCE: A convergence line.
  	FRONT_TYPE:  Index of type of front to draw, COLD=1, WARM=2, etc.
		     Not required if plain line is desired or if an
		     explicit front type keyword is specified.
  	THICK:	     Line thickness. The default = 1.0.
  	INTERVAL:    The spline interpolation interval, in normalized
		     units. The default = 0.01. Larger values give coarser
		     approximations to curves, smaller values make more
		     interpolted points.
  	COLOR:       The color to use. The default = !P.COLOR.
  	DEVICE:      If set, X and Y are in device coordinates.
  	DATA:        If set, X and Y are in data coordinates.
  	NORM:	     If set, X and Y are in normalized coordinates.
		     This is the default.
  	PSYM:	     If set, draw a marker (index = PSYM) on each actual
		     (X, Y) data point.
  	SYM_LEN:     The length and spacing factor for front symbols,
		     in normalized units. The default = 0.15.
  	SYM_HT:      The height of front symbols, in normalized units.
		     The default = 0.02.

 OUTPUTS:
	No explicit outputs.

 SIDE EFFECTS:
	Draws objects on current graphics device.

 PROCEDURE:
	Uses parametric spline interpolation to smooth the lines.
	POLYFILL is used to make the annotations on the front lines.

 EXAMPLE:
	Draw a front given 3 points:
	  WF_DRAW, [40, 20, 40], [30, 40, 25], /DATA, /COLD

 MODIFICATION HISTORY:
	DMS, RSI.   August, 1993.  Written.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/wf_draw.pro)


WIDALLOC

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

 $Id: widalloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $

  WidAlloc
   Widget Editor allocation related routines.

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  Destroy
   Generic function to cause an object to delete itself from memory.
   This is assumed to be recursive (objects containing other objects
   should destroy their children as well).

RO Destroy, Ptr

   ;   An invalid pointer is considered to be already destroyed
   ;   Not much we could do anyway.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widalloc.pro)


WIDBUILD

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

 $Id: widbuild.pro,v 1.9 1994/06/01 23:08:48 ali Exp $

  WidBuild
   Widget Editor common routines related to building dialog boxes. Mostly.

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  MakeBaseObj
       Create a base object of the given type.  All use the same structure
   but are different object types (MAIN, DEP, BASE)

RO MakeBaseObj, Parent, Obj, Type

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widbuild.pro)


WIDDEP

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

 $Id: widdep.pro,v 1.11 1994/06/01 23:08:48 ali Exp $

  WidDep
   Dependent Dep object class definition.

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  DEP_Alloc
       Allocate a dependent base object (if Ptr is NULL or just invalid)
   There are 3 base object classes (MAIN,DEP, and BASE) so they call
   a common routine to allocate base objects.

RO DEP_Alloc, Parent, Ptr

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widdep.pro)


WIDED

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

 PURPOSE:
       An IDL dialog Editor.  Lets one graphically produce a widget
       hierarchy.

 CATEGORY:
       Widgets.

 CALLING SEQUENCE:
       WIDED [, File ]

 OPTIONAL INPUTS:
       File:   Widget builder will read this file.  File should
               be a widget file (.WID)

 KEYWORD PARAMETERS:
       None.

 COMMON BLOCKS:

       FMagic_Comm     -- Store global variable, NoCheck.
       TestDraw_Comm   -- Saves a seed number used in random plot generation
       WidDirty_Comm   -- Save Yes/No/Cancel information in Dirty
       WidEd_Comm      -- Global variables used through the Widget Builder
                       Definition of this common block in in wided.com
       XPrintf_Comm    -- Save I/O state to allow multiple I/O operations
                       to write a single line.  FORMAT=(..., $) doesn't
                       work on VMS and this needs to work *EVERYWHERE*

 SIDE EFFECTS:
       Builds widget trees.  Writes IDL Code.  Probably more side
       effects than you can shake a stick at.

 RESTRICTIONS:
       You must have IDL 3.5 or later.  This is a graphical program
       so widgets must be available.

 PROCEDURE:
       Add, delete, cut, copy and paste widgets to your hearts delight.
       Save the results if you want to.

 EXAMPLE:
       Please see the "Using the IDL Widget Builder" document.

 MODIFICATION HISTORY:
       Written by:     Joshua Goldstein,       Spring '93

       Fall '93        Complete rewrite using widget UVALUEs instead
                       of uniform structures to store hierarchy. Added
                       bitmapped buttons, pull down menus, embedded
                       comments in .PRO files to save user mods.
                       Made adding user classes even easier (add 1 line
                       to widdef.dat).  Still need to write class library.
                       Added comments to wided.  Hope they help.

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/wided.pro)


WIDEDIT

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

 $Id: widedit.pro,v 1.8 1994/06/01 23:08:48 ali Exp $

  WidEdit
   Cut/Paste/Copy/Edit dialog routines.
   These are the other 'Top Level' dialogs and as main, have many
   externally visible hooks (c.f. wided.com)

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  UpdateCut
   Update the given dialog box (cut, copy or edit) to reflect a
   change in the current widget tree.

   General notes:

   If we are looking at some portion of the widget tree and any portion
   of that tree has been removed, give up and look at the top level.

   If the widget tree is empty (widget tree consists of MAIN alone)
   then close the dialog (nothing to cut copy or edit)

RO UpdateCut, Id, Removed

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widedit.pro)


WIDFILE

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

 $Id: widfile.pro,v 1.14 1994/06/01 23:08:48 ali Exp $

  WidFile
   Widget File class library

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93





  Currpath
   Return the current path. If there is no current path, chose
   a reasonable default path. (I use the current directory)

UNCTION CurrPath

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widfile.pro)


WIDMAIN

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

 $Id: widmain.pro,v 1.11 1994/06/01 23:08:48 ali Exp $

  WidMain
   Main object class definition.

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93




  UpdateMainDlg
       Set controls in top level base to reflect current settings
       in the MAIN widget object

RO UpdateMainDlg

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widmain.pro)


WIDUTIL

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

 $Id: widutil.pro,v 1.8 1994/06/01 23:08:48 ali Exp $

  WidUtil
   Miscellaneous Utility functions and procedures

 Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
   Unauthorized reproduction prohibited.

 MODIFICATION HISTORY
       Written by:     Joshua Goldstein,       12/93






  Event handler loop for Error dialog box

RO ErrorEvent, Event

   ; The only event possible is a 'Done' so we don't bother
   ; to check, just bring the dialog down

(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/widutil.pro)


WILCOXON

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

 PURPOSE:
	Test the null hypothesis that two populations have the same 
	distribution -i.e. F(x) = G(x) against the alternative that their 
	distributions differ in location- i.e F(x) = G(x+a).
	Wilcox pairwise tests the populations in Data.  It is preferable 
	to the sign_test for non-binary data, since it uses the ranking of
	data differences and not just the sign.

 CATEGORY:
	Statistics.

 CALLING SEQUENCE:
	WILCOXON, Data

 INPUTS:
	Data:	Two-dimensional array. Data(i,j) = the jth observation from 
		the ith population.

 KEYWORDS:  
	NAMES:	Vector of user supplied names for the populations to be 
		used in the output.

    LIST_NAME:	Name of output file.  The default is to the screen.

      MISSING:	Value used as a place holder for missing data.
		Pairwise handling of missing data.

	TAIL:	If set, tail specifies the type of test.  If Tail = 1 then a 
		one-tailed test is performed.  Likewise, Tail = 2 specifies 
		a two-tailed test.  The default is the two-tailed test.

      NOPRINT:	A flag, if set, to suppress output to the screen or a file.
           
 OUTPUT:
	Table written to the screen showing for each pair of populations the
	total of the rankings.  Also, table of probabilities for each 
	population pair giving the significance of the results in the first
	table. These probabilities are based on normal approximations.  For
	small sample sizes (less than 26), consult a table for the Wilcox 
	Test in any general text on statistics.

 OPTIONAL OUTPUT PARAMETERS:
	Rank:	Two-dimensional array of ranking sums.
		Rank(i,j) = sum of ranks of population i where observations
		in i are ranked with those in population j.

	Prob:	Two-dimensional array. Prob(i,j) = probability of Rank(i,j) 
		or something more extreme. -1 is returned for small 
		(less than 26) populations.
                          
 RESTRICTIONS: 
	All populations have the same sample size.

 COMMON BLOCKS:
	None.

 PROCEDURE:
	For each pair of populations,  differences be