Extended IDL Help

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

     ? mk_html_help

at the IDL command line prompt.

Last modified: Fri Feb 2 17:45:00 2001.


List of Routines


Routine Descriptions

ARRAY_MATCH

[Next Routine] [List of Routines]
 Project     :	SOHO - CDS

 Name        :	ARRAY_MATCH()

 Purpose     : Detect if a vector matches any row or column of a 2D array

 Explanation : Search through a 2D array to see if any row (or column, if
               keyword COLUMN is set) of it is identical to (or matches) 
               a given vector.

               This routine is called by XCDS to check if the current
               study has been selected previously.

 Use         : Result = array_match(A, B [,/column])
               IF (array_match(a,b [,/column])) THEN ...

 Inputs      : A -- a 2D array with n x m elements
               B -- a vector with n elements (or m elements if keyword COLUMN
                    is to be set)
 Opt. Inputs : None.

 Outputs     : Result -- 1 if vector B matches either row (or column when
                         COLUMN is set) of array A; 0 otherwise

 Opt. Outputs: None.

 Keywords    : COLUMN -- If set, comparison is made through column of A

 Calls       : None.

 Common      : None.

 Restrictions: Number of elements of vector B must be equal to the column
               number (or row number, if the keyword COLUMN is set) of
               array A

 Side effects: None.

 Category    : Utilities, array manipulation

 Prev. Hist. : None.

 Written     :	Liyun Wang, GSFC/ARC, August 23, 1994

 Modified    : Liyun Wang, GSFC/ARC, August 24, 1994
                  Fixed a bug that only checks for a maximum of two rows
               Liyun Wang, GSFC/ARC, August 30, 1994
                  Added keyword COLUMN to allow comparison of one vector with
                  each column of a 2D array.

 Version     : Version 1.0, August 30, 1994

(See .//array_match.pro)


AVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS

 Name        : 
	AVERAGE()
 Purpose     : 
	Averages an array over one or all of its dimensions.
 Explanation : 
	Calculates the average value of an array, or calculates the average
	value over one dimension of an array as a function of all the other
	dimensions.
 Use         : 
	Result = AVERAGE( ARRAY )
	Result = AVERAGE( ARRAY, DIMENSION )
 Inputs      : 
	ARRAY	  = Input array.  May be any type except string or structure.
 Opt. Inputs : 
	DIMENSION = Optional dimension to do average over.  Valid inputs are 1
		    through the total number of dimensions of ARRAY.
 Outputs     : 
	The average 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 average 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 = AVERAGE(A,2) is equivalent to

			B = FLTARR(3,5)
			FOR J = 0,4 DO BEGIN
				FOR I = 0,2 DO BEGIN
					B(I,J) = TOTAL( A(I,*,J) ) / 4.
				ENDFOR
			ENDFOR

 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	The dimension specified must be valid for the array passed.
 Side effects: 
	None.
 Category    : 
	Utilities, Arrays.
 Prev. Hist. : 
	Taken from an earlier routine by W. Thompson called AVG, but the
	definition of the DIMENSION parameter is different to be consistent
	with current usage in IDL.
 Written     : 
	William Thompson, GSFC, 9 April 1993.
 Modified    : 
	Version 1, William Thompson, GSFC, 9 April 1993.
 Version     : 
	Version 1, 9 April 1993.

(See .//average.pro)


BOOST_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS

 Name        : 
	BOOST_ARRAY
 Purpose     : 
	Append array onto an array of arrays.
 Explanation : 
	Add array APPEND to array DESTINATION, allowing the dimensions of
	DESTINATION to adjust to accomodate it.  If both input arrays have the
	same number of dimensions, then the output array will have one
	additional dimension.  Otherwise, the last dimension of DESTINATION
	will be incremented by one.
 Use         : 
	BOOST_ARRAY, DESTINATION, APPEND
 Inputs      : 
	DESTINATION	= Array to be expanded.
	APPEND		= Array to append to DESTINATION.
 Opt. Inputs : 
	None.
 Outputs     : 
	DESTINATION	= Expanded output array.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : 
	None
 Common      : 
	None.
 Restrictions: 
	DESTINATION and APPEND have to be either both of type string or both of
	numerical types.

	APPEND cannot have more dimensions than DESTINATION.

 Side effects: 
	None.
 Category    : 
	Utilities, Arrays.
 Prev. Hist. : 
	Written Aug'88 (DMZ, ARC)
	Modified Sep'89 to handle byte arrays (DMZ)
	Modifed to version 2, Paul Hick (ARC), Feb 1991
	Removed restriction to 2D arrays, William Thompson (ARC), Feb 1992.
 Written     : 
	Dominic M. Zarro, GSFC/SMM, August 1988.
 Modified    : 
	Version 1, William Thompson, GSFC, 12 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 12 April 1993.

(See .//boost_array.pro)


BSORT

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SOHO - CDS

 Name        :	
	BSORT
 Purpose     :	
	Sorts data into ascending order.
 Explanation :	
	Function to sort data into ascending order, like a simple bubble sort.
	original subscript order is maintained when values are equal (FIFO).
	(This differs from the IDL SORT routine alone, which may rearrange 
	order for equal values)

 Use         :	
	result = bsort( array, [ asort, /INFO, /REVERSE ] )

 Inputs      :	
	Array - array to be sorted

 Opt. Inputs :	None.

 Outputs     :	
	result - sort subscripts are returned as function value

 Opt. Outputs:	
	Asort - sorted array

 Keywords    :	
       /REVERSE - if this keyword is set, and non-zero, then data is sorted
                 in descending order instead of ascending order.
	/INFO = optional keyword to cause brief message about # equal values.

 Calls       :	None.

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utilities, Array

 Prev. Hist. :	
	written by F. Varosi Oct.90:
	uses WHERE to find equal clumps, instead of looping with IF ( EQ ).
	compatible with string arrays, test for degenerate array 
	20-MAY-1991	JKF/ACC via T AKE- return indexes if the array to 
			be sorted has all equal values.
	Aug - 91  Added  REVERSE keyword   W. Landsman      

 Written     :	F. Varosi, GSFC, October 1990

 Modified    :	Version 1, William Thompson, GSFC, 29 March 1994
			Incorporated into CDS library
		Version 2, William Thompson, GSFC, 3 August 1994
			Incorporated change by W. Landsman to always return
			type LONG.

 Version     :	Version 2, 3 August 1994

(See .//bsort.pro)


CONCAT2D

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CONCAT2D()
               
 Purpose     : Concatenate two or more 2-d arrays.
               
 Explanation : Concatenate two or more 2-d arrays to produce one output array.
               eg if a  = intarr(20,25)
                     b  = intarr(20,2)
                     c  = intarr(20,27)  then 

                 x = concat3d(a,b,c) will return an array of dimensions (20,54) 
               
 Use         :  IDL>  x = concat2d(a,b [,c,d,e]  (max of 5 input arrays)
    
 Inputs      :  a,b,c...   input 2-d arrays, the first dimensions of which must
                           be the same size.
               
 Opt. Inputs : None
               
 Outputs     : Function returns the concatenation.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: First dimensions of input arrays must be the same.
               
 Side effects: None
               
 Category    : Util, array
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 13-May-94
               
 Modified    : 

 Version     : Version 1,  13-May-94 

(See .//concat2d.pro)


CONCAT3D

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CONCAT3D()
               
 Purpose     : Concatenate two or more 3-d arrays.
               
 Explanation : Concatenate two or more 3-d arrays to produce one output array.
               eg if a  = intarr(20,25,10)
                     b  = intarr(20,25,12)
                     c  = intarr(20,25,5)  then 

                 x = concat3d(a,b,c) will return an array of dimensions (20,25,27) 
               
 Use         :  IDL>  x = concat3d(a,b [,c,d,e]  (max of 5 input arrays)
    
 Inputs      :  a,b,c...   input 3-d arrays, the first 2 dimensions of which must
                           have the same size.
               
 Opt. Inputs : None
               
 Outputs     : Function returns the concatenation.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: First 2 dimensions of input arrays must be the same.
               
 Side effects: None
               
 Category    : Util, array
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 13-May-94
               
 Modified    : 

 Version     : Version 1,  13-May-94 

(See .//concat3d.pro)


MATCH

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SOHO - CDS

 Name        :	
	MATCH
 Purpose     :	
	Routine to match values in two vectors.
 Explanation :	
	Routine to match values in two vectors.
 Use         :	
	match, a, b, suba, subb

	EXAMPLE: If a = [3,5,7,9,11]   & b = [5,6,7,8,9,10]
	then 
		IDL> match, a, b, suba, subb, COUNT = count

	will give suba = [1,2,3], subb = [0,2,4],  COUNT = 3
	and       suba(a) = subb(b) = [5,7,9]

 Inputs      :	
	a,b - two vectors to match elements

 Opt. Inputs :	None.

 Outputs     :	
	suba - subscripts of elements in vector a with a match
		in vector b
	subb - subscripts of the positions of the elements in
		vector b with matchs in vector a.

	suba and subb are ordered such that a(suba) equals b(subb)

 Opt. Outputs:	None.

 Keywords    :	
	COUNT - set to the number of matches, integer scalar

 Calls       :	None.

 Common      :	None.

 Restrictions:	
	a and b should not have duplicate values within them.
	You can use rem_dup function to remove duplicate values
	in a vector

 Side effects:	
	!ERR is set to the number of matches, can be used instead of COUNT

 Category    :	Utilities, Array

 Prev. Hist. :	
	D. Lindler  Mar. 1986.
	Fixed "indgen" call for very large arrays   W. Landsman  Sep 1991
	Added COUNT keyword    W. Landsman   Sep. 1992

 Written     :	D. Lindler, GSFC/HRS, March 1986

 Modified    :	Version 1, William Thompson, GSFC, 29 March 1994
			Incorporated into CDS library

 Version     :	Version 1, 29 March 1994

(See .//match.pro)


PRODUCT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS

 Name        : 
	PRODUCT()
 Purpose     : 
	Calculates the product of all the elements of an array.
 Explanation : 
	Calculates the product of all the elements of an array--the
	multiplicative equivalent of total.
 Use         : 
	Result = PRODUCT(ARRAY)
 Inputs      : 
	ARRAY	= Array of elements to multiply together.  For instance, ARRAY
		  could contain the dimensions of another array--then
		  PRODUCT(ARRAY) would be the total number of elements of that
		  other array.
 Opt. Inputs : 
	None.
 Outputs     : 
	The result of the function is the total product of all the elements of
	ARRAY.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	ARRAY must be a numerical type.
 Side effects: 
	The result will always be of at least floating point type.
 Category    : 
	Utilities, Arrays.
 Prev. Hist. : 
	William Thompson, Feb. 1992.
 Written     : 
	William Thompson, GSFC, February 1992.
 Modified    : 
	Version 1, William Thompson, GSFC, 12 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 12 April 1993.

(See .//product.pro)


REARRANGE

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SOHO - CDS

 Name        :	
	REARRANGE()
 Purpose     :	
	Rearranges the dimensions in an array (ala TRANSPOSE).
 Explanation :	
	Rearranges the dimensions in an array.  The concept is similar to
	TRANSPOSE or ROTATE, but generalized to N dimensions.
 Use         :	
	Result = REARRANGE(ARRAY,DIMENSIONS)

	EXAMPLE:  If ARRAY has the dimensions NI x NJ x NK, then

			RESULT = REARRANGE(ARRAY, [3,1,2])

		  will have the dimensions NK x NI x NJ.

 Inputs      :	
	ARRAY		= Input array to be rearranged.
	DIMENSIONS	= Array containing the order of the original dimensions
			  once they are rearranged.  Each dimension is
			  specified by a number from 1 to N.  If any dimension
			  is negative, then the order of the elements is
			  reversed in that dimension.
 Opt. Inputs :	
	None.
 Outputs     :	
	The result of the function is ARRAY with the dimensions rearranged into
	the order specified by DIMENSIONS.
 Opt. Outputs:	
	None.
 Keywords    :	
	None.
 Env. Vars.  :
	CDS_EXTERNAL = Points to a sharable object file containing associated C
		       software callable by CALL_EXTERNAL.  If this environment
		       variable exists, then the routine uses CALL_EXTERNAL to
		       perform the rearrangement.  Otherwise the rearrangement
		       is performed within IDL, which is slower.
 Calls       :	
	None.
 Common      :	
	None.
 Restrictions:	
	DIMENSIONS cannot contain the same dimensions more than once each.
	Each dimension must be accounted for.

	This routine is not very fast for large arrays, unless CDS_EXTERNAL is
       defined so that CALL_EXTERNAL is used.
 Side effects:	
	None.
 Category    :	
	Utilities, Arrays.
 Prev. Hist. :	
	William Thompson, February 1993.
	William Thompson, 30 June 1993, modified to allow dimensions to be
		reversed.
 Written     :	
	William Thompson, GSFC, February 1993.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 24 August 1994.
		Combined pure IDL and CALL_EXTERNAL versions into one routine.
		Ported CALL_EXTERNAL software to OSF.
	Version 3, William Thompson, GSFC, 27 December 1994
		Fixed bug where trailing dimensions with one element were lost.
 Version     :	
	Version 3, 27 December 1994

(See .//rearrange.pro)


STORE_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS

 Name        : 
	STORE_ARRAY
 Purpose     : 
	Insert array into an array of arrays.
 Explanation : 
	Inserts array INSERT into array DESTINATION, allowing the dimensions of
	DESTINATION to adjust to accommodate it.
 Use         : 
	STORE_ARRAY, DESTINATION, INSERT, INDEX
 Inputs      : 
	DESTINATION	= Array to be expanded.
	INSERT		= Array to insert into DESTINATION.
	INDEX		= Index of the final dimension of DESTINATION to insert
			  INSERT into.
 Opt. Inputs : 
	None.
 Outputs     : 
	DESTINATION	= Expanded output array.  If both input arrays have the
			  same number of dimensions, then the DESTINATION will
			  be replaced with INSERT.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	DESTINATION and INSERT have to be either both of type string or both of
	numerical types.

	INSERT must not have more dimensions than DESTINATION.

 Side effects: 
	None.
 Category    : 
	Utilities, Arrays.
 Prev. Hist. : 
	William Thompson, Feb. 1992, from BOOST_ARRAY by D. Zarro and P. Hick.
 Written     : 
	William Thompson, GSFC, February 1992.
 Modified    : 
	Version 1, William Thompson, GSFC, 12 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 12 April 1993.

(See .//store_array.pro)


SUM_COL

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : SUM_COL()
               
 Purpose     : Sums along the columns of a matrix.
               
 Explanation : Sums along the columns of a matrix.
               
 Use         : col = sum_col(array)
    
 Inputs      : array  -  the array to be column-summed
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, arrays
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 4-Jan-94
               
 Modified    : 

 Version     : Version 1, 4-Jan-94

(See .//sum_col.pro)


SUM_ROW

[Previous Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : SUM_ROW()
               
 Purpose     : Sums along the rows of a matrix.
               
 Explanation : Sums along the rows of a matrix.
               
 Use         : row = sum_row(array)
    
 Inputs      : array  -  the array to be row-summed
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, arrays
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 4-Jan-94
               
 Modified    : 

 Version     : Version 1, 4-Jan-94

(See .//sum_row.pro)