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:44:42 2001.


List of Routines


Routine Descriptions

BIN2DEC

[Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BIN2DEC
               
 Purpose     : Convert binary representation to decimal integer.
               
 Explanation : The binary representation of a decimal number is converted
               to a decimal integer and can be displayed or returned or 
               both or neither.
               
 Use         : IDL> bin2dec, binary [, decimal, /quiet]
    
 Inputs      : binary - the binary representation to convert. It can either
                        be a string of zeros and ones or an array with each
                        element a zero or one.
                        eg bin2dec,'01010101'    or
                           bin2dec,['1','0','1','0','1','0','1','0']    or
                           bin2dec,[1,0,1,0,1,0,1,0]
                        The MSB is assumed to come first

 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: decimal - the decimal integer equivalent of the input.
               
 Keywords    : quiet - unless given the decimal number is printed to the
                       terminal

 Calls       : None
               
 Restrictions: Input must be a string or an array of integers or strings.
               
 Side effects: None
               
 Category    : Utils, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-93
               
 Modified    : 

 Version     : Version 1, 7-Oct-93

(See .//bin2dec.pro)


BIN2HEX

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BIN2HEX
               
 Purpose     : Convert binary representation to hexadecimal.
               
 Explanation : The binary representation of a decimal number is converted
               to hexadecimal and can be displayed or returned or 
               both or neither.
               
 Use         : IDL> bin2hex, binary [, hex, nchar=nchar, /quiet, /upper]
    
 Inputs      : binary - the binary representation to convert. It can either
                        be a string of zeros and ones or an array with each
                        element a zero or one.
                        eg bin2hex,'01010101'    or
                           bin2hex,['1','0','1','0','1','0','1','0']    or
                           bin2hex,[1,0,1,0,1,0,1,0]
                        The MSB is assumed to come first

               nchar  - the number of characters in the hex format.

 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: hex - the hexadecimal equivalent of the input.
               
 Keywords    : quiet - unless given the hexadecimal number is printed to the
                       terminal

               upper - convert output to upper case else given in lower case

 Calls       : None
               
 Restrictions: Input must be a string or an array of integers or strings.
               
 Side effects: None
               
 Category    : Utils, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-93
               
 Modified    : Add /upper keyword, CDP, 20-Dec-93

 Version     : Version 2, 20-Dec-93

(See .//bin2hex.pro)


BOX_AV

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BOX_AV()
               
 Purpose     : Produce a box average of an array.
               
 Explanation : Takes the input array and averages the data points in boxes
               of a given size.  The dimensions of the output array are the
               same as the input with the elements in the output array
               all given the average value within the box defined. In 1-d
               arrays this is useful as the output array can then be plotted 
               in histogram mode (psym=10).
               
 Use         : IDL>  out_array = box_av(in_array,x_box [,y_box])

                 eg  x = sin(indgen(1000)/100.)
                     plot,x,psym=4 & oplot,box_av(x,60),psym=10
    
 Inputs      : in_array    -  the input array, either 1 or 2-d
               x_box       -  the x-size of the averaging box
               
 Opt. Inputs : y_box       -  the y-size of the averaging box.  If input is
                              2-d and y_box not specified then it defaults
                              to the same value as x_box.
               
 Outputs     : function value on return is the averaged array
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
               
 Restrictions: Only 1 or 2-d arrays.
               
 Side effects: None
               
 Category    : Utilities, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL,  21-Jul-1993
               
 Modified    : 

 Version     : Version 1

(See .//box_av.pro)


BYTESWAP

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BYTESWAP()
               
 Purpose     : Swaps the bytes in an integer (as a function).
               
 Explanation : Call the internal IDL routine BYTEORDER to perform byte
               swapping on integers as a function call.  Handles arrays
               the same as BYTEORDER but passes none of the keywords.
               
 Use         : IDL> ba = byteswap(ab)
    
 Inputs      : ab    - integer [array]
               
 Opt. Inputs : None
               
 Outputs     : Function returns byte swapped version of input
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : IDL BYTEORDER
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : Written by Arnulf (Spacetec)

 Written     : CDS version  C D Pike, RAL, 1 Oct 93
               
 Modified    : Version 1, C D Pike, RAL 1 Oct 93
		Version 2, William Thompson, GSFC, 12 November 1993
			Added /NTOHS to BYTEORDER for platform independence.

 Version     : Version 2, 12 November 1993.

(See .//byteswap.pro)


CDS_GAUSS[1]

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CDS_GAUSS()
               
 Purpose     : Fits Gaussian with constant, linear or quadratic background.
               
 Explanation : Uses the standard IDL curvefit to fit a gaussian but unlike
               IDL's gaussfit, it allows the user to choose the background
               type, ie zero, contant, linear or quadratic.

               ie Fit 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 = 1/e width,
                    a3 = constant term, 
                    a4 = linear term, 
                    a5 = quadratic term.

               The parameters a0,a1,a2,a3 are estimated and then curvefit is
               called.
               Parameters a3, a4, and a5 are optional, depending on the value 
               of k
               
               If the (max-avg) of Y is larger than (avg-min) then it is 
               assumed the line is an emission line, otherwise it is assumed 
               there is an absorption 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 
               extreme until a point is found < the 1/e value.

 Use         : yfit = cds_gauss(x,y,a,k)
    
 Inputs      : x = independent variable, must be a vector.
               y = dependent variable, must have the same number of points
                   as x.
               
 Opt. Inputs : k = determines the order of polynomial to be fitted in 
                   addition to the gaussian part:

               k = 3 : gaussian + a3 + a4*X + a5*X^2
               k = 2 : gaussian + a3 + a4*X
               k = 1 : gausian + a3
               k = 0 or any other k: only gaussian

               If k is not defined, it is assumed k=0

               
 Outputs     : Function returns value yfit = fitted function.
               
 Opt. Outputs: a = coefficients. a (3+k) element vector as described above.
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : Original - gaussfit
               Background flexibility by A. Fludra (MSSL)

 Written     : CDS version by C D Pike, RAL, 7-Jan-94
               
 Modified    : 

 Version     : Version 1, 7-Jan-93

(See .//cds_gauss.pro)


CDS_GAUSS[2]

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CDS_GFUNCT
               
 Purpose     : Evaluate gaussian and its partial derivatives.
               
 Explanation : Used in call to curvefit from cds_gauss
               
 Use         : Only as parameter to curvefit
    
 Inputs      : X = VALUES OF INDEPENDENT VARIABLE.
               A = PARAMETERS OF EQUATION DESCRIBED BELOW.
               
 Opt. Inputs : None
               
 Outputs     : Value of function at each x value
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: For use with cds_gauss and curvefit
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : As below for cds_gauss

 Written     : CDS version C D Pike, RAL, 7-Jan-94
               
 Modified    : Trap no data.  CDP, 18-Jan-95

 Version     : Version 2, 18-Jan-95

(See .//cds_gauss.pro)


DEC2BIN

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : DEC2BIN
               
 Purpose     : Convert integer decimal number to binary representation.
               
 Explanation : The binary representation of a decimal number is calculated
               and can be displayed or returned or both or neither.
               
 Use         : IDL> dec2bin, decimal [, binary, /quiet]
    
 Inputs      : decimal - the number to convert
               
 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: binary - the binary representation of the input.
               
 Keywords    : quiet - unless given the binary number is printed to the
                       terminal

 Calls       : None
               
 Restrictions: Input must be of byte, int or long type.
               
 Side effects: When the input variable DECIMAL is an array, then the output
		variable BINARY is also an array with the dimensions
		(32,N_ELEMENTS(DECIMAL)) no matter what the dimensions of
		DECIMAL are.
               
 Category    : Utils, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-93
               
 Modified    : Version 1, C D Pike, RAL, 7-Oct-93
		Version 2, William Thompson, GSFC, 23 December 1994
			Modified to work with arrays.

 Version     : Version 2, 23 December 1994

(See .//dec2bin.pro)


DEC2HEX

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : DEC2HEX
               
 Purpose     : Convert a non-negative decimal integer to a hex string.
               
 Explanation : 
               
 Use         : IDL> dec2hex,decimal [,hex, nchar=nchar, /quiet, /upper]
    
 Inputs      : decimal - non-negative decimal integer, scalar.  All leading 
                         blanks are removed.
               
 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: hex - the hexadecimal representation of the number.
               
 Keywords    : quiet - if not present, the hex form will be output to the
                       terminal.
               nchar - number of characters in the output hexadecimal string.
                       If not supplied, then the hex string will contain no 
                       leading zeros.

               upper - converts hex letters to uppercase for output

 Calls       : None
               
 Restrictions: Input can only be non-negative integer number.
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : Written by W. Landsman, November, 1990 

 Written     : CDS version by C D Pike, RAL, 7-Oct-93
               
 Modified    : Added /upper keyword, CDP, 20-Dec-1993
               Trap negatives, CDP, 19-May-94

 Version     : Version 3, 19-May-94

(See .//dec2hex.pro)


HEX2BIN

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : HEX2BIN
               
 Purpose     : Convert hexadecimal number to binary representation.
               
 Explanation : The binary representation of a hexadecimal number is calculated
               and can be displayed or returned or both or neither.
               
 Use         : IDL> hex2bin, hexadecimal [, binary, /quiet]
    
 Inputs      : hexadecimal - the number to convert (string).
               
 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: binary - the binary representation of the input.
               
 Keywords    : quiet - unless given the binary number is printed to the
                       terminal

 Calls       : None
               
 Restrictions: Input must be a character string.
               
 Side effects: None
               
 Category    : Utils, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-93
               
 Modified    : 

 Version     : Version 1, 7-Oct-93

(See .//hex2bin.pro)


HEX2DEC

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : HEX2DEC
               
 Purpose     : Convert hexadecimal representation to decimal integer.
               
 Explanation : A hexadecimal string is converted to a decimal integer and 
               can be displayed or returned or both or neither.
               
 Use         : IDL> hex2dec, hex [, decimal, /quiet]
    
 Inputs      : hex - hexadecimal string

 Opt. Inputs : None
               
 Outputs     : See below
               
 Opt. Outputs: decimal - the decimal integer equivalent of the input.
               
 Keywords    : quiet - unless given the decimal number is printed to the
                       terminal

 Calls       : None
               
 Restrictions: Input must be a string.
               
 Side effects: None
               
 Category    : Utils, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-93
               
 Modified    : 

 Version     : Version 1, 7-Oct-93

(See .//hex2dec.pro)


MODE_VAL

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : MODE_VAL()
               
 Purpose     : Returns the modal value of an array.
               
 Explanation : The modal value of an array (any dimension) is deduced from
               the max value of the histogram.  If several values occur
               with equal frequency, a warning is given but only the smallest
               value of the group is returned.
               
 Use         : IDL> m = mode_val(array [,freq])

               eq print,mode_val([2,3,4,5,2,2,3,4,2,2,7,8,9]) --> 2
                  print,mode_val('asdfghaaasdfvbnm') --> a
                  print,mode_val(['asdf','ghaaa','asdf','vbnam'],freq) --> a
                    and freq returned with value 6
    
 Inputs      : array  -  the n-dimensional integer array in which to find the
                         mode.
                         Can be a string array but not a structure. The string
                         option is a little restricted in that whatever the
                         input format, the string is viewed as a byte array
                         and the most frequent byte value returned
               
 Opt. Inputs : None
               
 Outputs     : Function return is the modal value
               
 Opt. Outputs: freq  - the number of occurrences of the modal value
               
 Keywords    : None

 Calls       : None
               
 Restrictions: Non-real arrays or strings only
               
 Side effects: None
               
 Category    : Utilities, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 1-Jul-1993
               
 Modified    : 

 Version     : Version 1,  1-Jul-1993

(See .//mode_val.pro)


NINT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : NINT()
               
 Purpose     : Returns the nearest integers to the input values.
               
 Explanation : Returns the nearest integer (2 or 4 byte) to the input scalar
               or array.  Note this function should be used instead of 
               relying on the IDL FIX or LONG functions to convert a real
               number. Eg fix(1.0/0.001) = 999 but nint(1.0/0.001) = 1000
               
 Use         : IDL> n = nint(x)
    
 Inputs      : x   array for which nearest integers are to be found.
               
 Opt. Inputs : None
               
 Outputs     : Function value  - the nearest integers.
               
 Opt. Outputs: None
               
 Keywords    : LONG	= If this keyword is set and non-zero, then the result
			  of NINT is of type LONG.  Otherwise, the result is
			  either of type INTEGER or LONG depending on the
			  extent of the data.

 Calls       : None
               
 Restrictions: The nearest integer of 2.5 is 3
               the nearest integer of -2.5 is -3
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : Unknown

 Written     : Unknown
               
 Modified    : To CDS format, C D Pike, RaL, 18-May-1993
		Version 2, William Thompson, GSFC, 27 July 1993.
			Added LONG keyword, taken from routine of same name
			written by Wayne Landsman.

 Version     : Version 2, 27 July 1993.

(See .//nint.pro)


NUM_CHK

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : NUM_CHK()
               
 Purpose     : Check if input is valid number.
               
 Explanation : Checks to see if a string is a valid representation of a 
               number the caller can specify whether the string should 
               represent an integer or a floating point value.
               The IDL functions FIX and FLOAT will convert strings into 
               number values.  However FIX and FLOAT only require that the 
               string begins with a valid number.  
               For example FIX('38%h224') will return the integer value 
               38 and no error is flagged.  This function, NUM_CHK, will 
               check the entire string for errors. You will still need to 
               use FIX or FLOAT afterwards once NUM_CHK has confirmed that 
               the string is valid.
               
 Use         : error = NUM_CHK(string)
    
 Inputs      : STRING   - The string to be checked.  
               
 Opt. Inputs : None
               
 Outputs     : Returns error = 0 if the string represents a valid number and
                       error = 1 if it does not.
               
 Opt. Outputs: None
               
 Keywords    : INTEGER  - Set this keyword to specify that the string should
                          represent an integer.  The default is that the 
                          string is assumed to represent a floating point 
                          value.

 Calls       : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : None

 Written     : Andrew Bowen, Tessella Support Services, 8/3/93 
               
 Modified    : 

 Version     : Version 1, 8-Mar-93

(See .//num_chk.pro)


N_DIMENSIONS

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : N_DIMENSIONS()
               
 Purpose     : Returns number of dimensions of a variable.  
               
 Explanation : Returns number of dimensions of a variable.  
               cf. n_elements etc.

 Use         : n = n_dimensions(data)
    
 Inputs      : data - variable to be investigated.
               
 Opt. Inputs : None
               
 Outputs     : Function value returns number of dimensions.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : Idea by Stein Vidar Haugan.

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

 Version     : Version 1, 13-Jan-94

(See .//n_dimensions.pro)


PERIODOGRAM

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : PERIODOGRAM()
               
 Purpose     : Calculate periodogram of (unevenly spaced) time series.
               
 Explanation : Uses method of Horne and Baliuna (Ap.J. 1986) to calculate
               the periodogram within user-set frequency or period limits 
               a time series of data.  Data need not be equally spaced in 
               time.

               eg:
	        IDL> t = findgen(1000)
               IDL> x = sin(2.0*!dpi*t/27.0)
               IDL> power=periodogram(t,x,per=[20,30],npts=100)
               IDL> plot,power(0,*),power(1,*)


 Use         : IDL> power = periodogram(time, data,$
                                 [frequency_range=frequency_range, $
                                 period_range=period_range, taper=taper,$
                                 npts=npts])
    
 Inputs      : time - time values to which values in data correspond.
               data - data values corresponding to 'time'.
               
 Opt. Inputs : Either 'freq' or 'period' (see keywords) values must be 
               specified.
               
 Outputs     : Function returns a (2,npts) array.
               array(0,*) = frequency or period array (depends on input given)
               array(1,*) = periodogram power at returned values of array(0,*)
               
 Opt. Outputs: None
               
 Keywords    : freq   - 2 value array giving interval over which to calculate
                        periodogram, given in frequency.
               OR
               period - period values over which to calculate periodogram.

               np     - number of points in calculated periodogram 
                        (default = number of input data points).
               taper  - fraction of time series to be tapered to alleviate
                        end effects. taper=0.25 tapers first and last 25%
                        (default = 0)

               quiet  - set this to not receive statistical info on screen

 Calls       : None

 Common      : None
               
 Restrictions: Not fast for large data sets.
               
 Side effects: None
               
 Category    : Util,  numerical
               
 Prev. Hist. : Original by Judith Lean/John Mariska, NRL.

 Written     : Cosmetic CDS version by C D Pike, RAL, 16-Jan-95 
               
 Modified    : 

 Version     : Version 1, 16-Jan-95

(See .//periodogram.pro)


REM_COM

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

 Name        :	REM_COM()

 Purpose     :	Finds elements unique to second vector.

 Explanation :	Returns indeces of all those elements which are unique to the second vector,
               removing any duplicate elements or any that are also present in the first 
               vector.

 Use         : 

 Inputs      : vec1 = array of values;
               vec2 = array of values.

 Opt. Inputs : None.

 Outputs     : Array of indeces into vec2 poitnign to unique elements.

 Opt. Outputs:	None.

 Keywords    : None.

 Calls       :	rem_dup.
                
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Command preparation.

 Prev. Hist. :	None.

 Written     :	Version 0.00, Martin Carter, RAL, 14/10/94

 Modified    :	Version 0.01, Martin Carter, RAL, 28/11/94
                            Added proforma.

 Version     :	Version 0.01, 28/11/94

(See .//rem_com.pro)


ROUND_OFF

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : ROUND_OFF()
               
 Purpose     : To round a number to a specified accuracy
               
 Explanation : Rounds the input number to the accuracy specified.
               
 Use         : IDL> out = round_off(x,acc)
               IDL> out = round_off(12.278,0.01) ==> out = 12.28
    
 Inputs      : x    - the number to be operated on
               acc  - the numerical accuracy required
               
 Opt. Inputs : None
               
 Outputs     : The function value is the input rounded to the desired accuracy
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : NINT
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 17-May-1993
               
 Modified    : 

 Version     : Version 1

(See .//round_off.pro)


SAME_DATA

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : SAME_DATA()
               
 Purpose     : Check if two variables are identical.
               
 Explanation : Checks if the values contained in the 2 inputs are the same.
               Works on any type of data input. 
               
 Use         : IDL> if same_data(a,b) then print,'a and b are identical'
    
 Inputs      : a  -  first input
               b  -  second input
               
 Opt. Inputs : None
               
 Outputs     : Function returns 1 for identity, 0 otherwise.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : MATCH_STRUCT

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

 Written     : C D Pike, RAL, 22-Feb-95
               
 Modified    : 

 Version     : Version 1, 22-Feb-95

(See .//same_data.pro)


SHORTHEX

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

 Name        :	SHORTHEX()

 Purpose     :	Converts a short int value into fixed hex string format.

 Explanation :	Converts short integer value in 0xnnnn format.

 Use         : 

 Inputs      : value = short integer value.

 Opt. Inputs : None.

 Outputs     : Character string containing hex value.

 Opt. Outputs:	None.

 Keywords    : None.

 Calls       :	None.
                
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Command preparation.

 Prev. Hist. :	None.

 Written     :	Version 0.00, Martin Carter, RAL, 14/10/94

 Modified    :	Version 0.01, Martin Carter, RAL, 28/11/94
                            Added proforma.

 Version     :	Version 0.01, 28/11/94

(See .//shorthex.pro)


SIZEOF

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : SIZEOF()
               
 Purpose     : Calculates the size of an IDL variable 
               
 Explanation : Calculates the size of an IDL variable. In the current
               Ultrix IDL release (2.3.0 ), size of structures cannot be 
               obtained since recursive calls are not supported. String
               variables are countedas one byte each (??)

               
 Use         : x= sizeof( input )
    
 Inputs      : input -  any IDL variable
               
 Opt. Inputs : None
               
 Outputs     : Function returns size of input variable
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, misc
               
 Prev. Hist. : Arnulf, Oct-93

 Written     : For FM sci_ana program, C D Pike, RAL, 22-Oct-93
               
 Modified    : 

 Version     : Version 1, 22-Oct-93

(See .//sizeof.pro)


STRNUMBER

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

 Name        : 
	STRNUMBER()
 Purpose     : 
	Function to determine if a string is a valid numeric value.
 Explanation : 
	Function to determine if a string is a valid numeric value.

	This routine is mainly here to support routines from the IDL Astronomy
	User's Library.  The routine VALID_NUM performs the same function, but
	is more robust.

 Use         : 
	result = strnumber( st, [val] )
 Inputs      : 
	st - string
 Opt. Inputs : 
	None.
 Outputs     : 
	1 is returned as the function value if the string st has a
	valid numeric value, otherwise, 0 is returned.
 Opt. Outputs: 
	val - (optional) value of the string.  real*8
 Keywords    : 
	None.
 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	None.
 Side effects: 
    (1)   Note that a blank string (e.g. " ") is not a valid numeric value, 
          although an empty string ("") is (=0.0).
    (2)   In V2.2.2 there was a bug in the IDL ON_IOERROR procedure that
          will cause the following statement to hang up IDL

		IDL> print,'' + string( strnumber('xxx') )

          This bug was fixed in V2.3.0
     (3)  As of V2.3.2, an IDL bug is seen in the following statements 

		IDL> st = 'E'
		IDL> q = strnumber(st)  & print,st

         The variable 'st' gets modified to an empty string.   This problem
         is related to the ambiguity of whether 'E' is a number or not 
         (could be = 0.0E).    A fix is expected a new IDL version.
 Category    : 
	Utilities, Numerical
 Prev. Hist. : 
	version 1  By D. Lindler Aug. 1987
 Written     : 
	Don Lindler, GSFC/HRS August 1987.
 Modified    : 
	Version 1, William Thompson, GSFC, 12 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 12 April 1993.

(See .//strnumber.pro)


TIME_AVERAGE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : TIME_AVERAGE()
               
 Purpose     : To form a time average of a set of time series data.
               
 Explanation : Given a time series of data (ie a set of data values and 
               associated time values) the function returns an array of data
               values which are the averages within a user-defined time range.
               The time range to use is specified via a key word.  A time
               array is also returned and this gives the mean of the first
               and last time of data used within the associated time bin.
               
 Use         : out = time_average(time, data [,one-of-the-keywords, $
                                                 top=top,bottom=bottom]
    
 Inputs      : time  -  an structure array of time values in standard CDS 
                        UTC format.
               data  -  the associated data values
               
 Opt. Inputs : None
               
 Outputs     : Function returns a structure array containing a day/time
               structure and an averaged data value.  The make up of the 
               output is 
               out = {{mjd:0L,time:0L}, data:0.0d0}

               On return it is therefore easy to plot the time averaged
               values thus:

               IDL> utplot,out.date,out.data

 Opt. Outputs: None
               
 Keywords    : DAY    -  if specified, the time averaging period is taken as 
                         00:00 on the day of the first datum to day*24 hours 
                         later.

               HOUR   -  if specified, the time averaging period is taken as 
                         nn hours starting at the beginning of the hour of the
                         first datum.

               MINUTE - if specified, the time averaging period is taken as 
                        nn minutes starting at the beginning of the minute of
                        the first datum.

               SECOND - if specified, the time averaging period is taken as 
                        nn seconds.

               TOP    - if present will be returned with an array giving the
                        maximum datum found in each averaged time interval

               BOTTOM - if present will be returned with an array giving the
                        minimum datum found in each averaged time interval

   
 Calls       : None

 Common      : None
               
 Restrictions: Only one of the DAY/HOUR/MINUTE/SECOND keywords must be set.
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 23-Jan-95
               
 Modified    : 

 Version     : Version 1, 23-Jan-95

(See .//time_average.pro)


UNSIGN

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : UNSIGN()
               
 Purpose     : Produces longword equivalent of an unsigned 16-bit integer.
               
 Explanation : If an unsigned 16-bit value is held internally in IDL in an
               INT variable, overflow can occur.  This routine translates 
               the value to a longword so that the value can be handled as
               required.
               
 Use         : lword = unsign( int16 )
    
 Inputs      : int16  - 16-bit integer whose bytes represent an unsigned
                        2-byte integer.
               
 Opt. Inputs : None
               
 Outputs     : Function returns the longword equivalent.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : Original by MK Carter

 Written     : CDS version by C D Pike, RAL, 22-Oct-93
               
 Modified    : Version 1, C D Pike, RAL 22-Oct-93
		Version 2, William Thompson, GSFC, 19 November 1993.
			Modified to speed up.  Added DATATYPE check.

 Version     : Version 2, 19 November 1993.

(See .//unsign.pro)


VALID_NUM

[Previous Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : VALID_NUM()
               
 Purpose     : Check if a string is a valid number representation.
               
 Explanation : The input string is parsed for characters that may possibly
               form a valid number.  It is more robust than simply checking
               for an IDL conversion error because that allows strings such
               as '22.3qwert' to be returned as the valid number 22.3
               See also the original NUM_CHK which returns the status in 
               the opposite sense.

 Use         : IDL> status = valid_num(string  [,value]  [,/integer])
    
 Inputs      : string  -  the string to be tested
               
 Opt. Inputs : None
               
 Outputs     : The function returns 1 for valid, 0 for invalid number
               
 Opt. Outputs: value	- The value the string decodes to.  This will be
			  returned as a double precision number unless /INTEGER
			  is present, in which case a long integer is returned.
               
 Keywords    : Integer   -  if present code checks specfically for an integer.

 Calls       : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Utilities, Numerical
               
 Prev. Hist. : Small changes from NUM_CHK by Andrew Bowen, 
                                             Tessella Support Services, 8/3/93

 Written     : CDS version by C D Pike, RAL, 24-May-93
               
 Modified    : Version 1, C D Pike, RAL, 24-May-93
		Version 2, William Thompson, GSFC, 14 October 1994
			Added optional output parameter VALUE to allow
			VALID_NUM to replace STRNUMBER in FITS routines.

 Version     : Version 1  24-May-93

(See .//valid_num.pro)