SolarSoft 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:27:54 2000.

List of Routines


Routine Descriptions

ABSCAL

[Next Routine] [List of Routines]
 NAME:
	ABSCAL
 PURPOSE:
	Apply the FITS BZERO and BSCALE keyword values to a data array

 CALLING SEQUENCE:
	RESULT = ABSCAL( Value, Header, /DEBUG)

 INPUTS:
	VALUE -  Any scalar, vector, or array (usually an integer type giving a
		relative intensity).
	HEADER - A FITS  header array containing the absolute calibration
		keyword BSCALE, and optionally BZERO and BUNIT.

 OUTPUT:
	RESULT = BSCALE*VALUE + BZERO, where the BSCALE and BZERO scalars
		are taken from the FITS header.  
		If the absolute calibration keywords do not exist, then
		RESULT = VALUE, and !ERR = -1.

 OPTIONAL INPUT KEYWORD:
	DEBUG - If DEBUG is set, then ABSCAL will print the
		calibration units given by the BUNIT keyword.

 REVISION HISTORY:
	Written W. Landsman, STX Corporation     January 1987
	Use DEBUG keyword instead of !DEBUG      September 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/abscal.pro)


ACGAUNT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:		ACGAUNT
 PURPOSE:	Calculate continuum gaunt factor using approximations
		of R. Mewe (18-JUN-85) to full calculations of 
		paper VI (Arnaut and Rothenflug for ion balances).
 CATEGORY:
 CALLING SEQUENCE: cgauntf = acgaunt( wave, te_6)
               cgauntf = acgaunt( wave, te_6, G1=gff, G2=gfb, G3=g2p)

 INPUTS:	wave = Wavelength in Angstrom (1-d vector or scalar)
		te_6 = Temperature in 10^6 K  (1-d vector or scalar)
 OPTIONAL INPUTS: none.
 OUTPUTS: 	Function result
		 = cgauntf(n_elements(te_6), n_elements(wave)) 
		 = array of approximate continuum gaunt factors.
 OPTIONAL OUTPUTS:
		G1 = Free-free  Gaunt factor
		G2 = Free-bound Gaunt factor
		G3 = 2-photon   Gaunt factor

 COMMON BLOCKS: none
 SIDE EFFECTS:  none
 RESTRICTIONS:  none
 PROCEDURE:	see a paper of R. Mewe et al. (A & Ap)
 MODIFICATIONS: written by N.Nitta from a Fortran version, March 1991.
	31-jul-93, JRL, Added a check on the exponent to prevent floating underflow message
       23-Jun-94, DMZ, made Gaunt factors double precision

(See /host/bluemoon/usr2/idllib/ssw/allpro/acgaunt.pro)


AD2XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     AD2XY
 PURPOSE:
     Compute X and Y from  RA and DEC and a FITS  astrometry structure
 EXPLANATION:
     A tangent (gnomonic) projection is computed directly; other projections 
     are computed using WCSXY2SPH.     AD2XY is meant to be used internal to 
     other procedures.   For interactive purposes, use ADXY.

 CALLING SEQUENCE:
     AD2XY, a ,d, astr, x, y   

 INPUTS:
     A -     R.A. in DEGREES, scalar or vector
     D -     Dec. in DEGREES, scalar or vector
     ASTR - astrometry structure, output from EXTAST procedure containing:
        .CD   -  2 x 2 array containing the astrometry parameters CD1_1 CD1_2
               in DEGREES/PIXEL                                   CD2_1 CD2_2
        .CDELT - 2 element vector giving increment at reference point in
               DEGREES/PIXEL
        .CRPIX - 2 element vector giving X and Y coordinates of reference pixel
               (def = NAXIS/2)
        .CRVAL - 2 element vector giving R.A. and DEC of reference pixel 
               in DEGREES
        .CTYPE - 2 element vector giving projection types 

 OUTPUTS:
     X     - row position in pixels, scalar or vector
     Y     - column position in pixels, scalar or vector

 REVISION HISTORY:
     Converted to IDL by B. Boothman, SASC Tech, 4/21/86
     Use astrometry structure,  W. Landsman      Jan. 1994   
     Do computation correctly in degrees  W. Landsman       Dec. 1994
     Only pass 2 CRVAL values to WCSSPH2XY   W. Landsman      June 1995
     Don't subscript CTYPE      W. Landsman       August 1995        
     Understand reversed X,Y (X-Dec, Y-RA) axes,   W. Landsman  October 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/ad2xy.pro)


ADDTIME

[Previous Routine] [Next Routine] [List of Routines]
  Name:
    ADDTIME
  Purpose:
    If optional keyword delta_min is supplied, then add a offset in 
		decimal minutes to an external time (H,M,S,MS,D,M,Y).
    If optional keyword difference is supplied, return the difference 
		as Value = [A] - [B], where Value will be minutes (floating).

  Inputs:
    A	= Base time, any format.

  Calling Sequence:
    Result = addtime(A,delta_min=delta_min)	; Result is [h,m,s,ms,d,m,y]
    Result = addtime(A,difference=B)		; Result is minutes (float)
    Result = addtime(A,difference=B,/sec)	; Result is seconds (float)

  Outputs:
    Function returns New time time, if delta_min keyword is provided.
    Function returns difference of A-B, if B keyword is provied.

  OPTIONAL INPUT KEYWORDS:
    delta_min	Decimal minutes (positive or negative) to add to A.
		If /secs is set, this should be in secs.
    B		2nd time to subtract from A in any format.
    secs	If set, return the result in seconds with diff=keyword
               If set, the input delta should be specified in secs

  Procedure:
    Calls ex2int and int2ex to do the calculations. 

  MODIFICATION HISTORY:
    15-oct-91, Written, JRL
    26-oct-91, Update, JRL - To handle hrs > 24 case
    22-jun-92, Update, JRL - eliminate the 24:00 hour case
    11-sep-92, Update, JRL - Call anytim2ex to convert input to external.
    27-jul-94, JRL - Return the result in secs (with massive help from JMM!)
     6-Mar-95, JRL - Improved logic so delta= doesn't overflow

(See /host/bluemoon/usr2/idllib/ssw/allpro/addtime.pro)


ADD_PATH

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

 NAME:
       ADD_PATH

 PURPOSE:
       Add directory (and optionally all its subdirs) into IDL path

 EXPLANATION:

 CALLING SEQUENCE:
       ADD_PATH, path_name [,/append] [,index=index]

 INPUTS:
       path_name -- A string scalar of a valid directory name.

 OPTIONAL INPUTS:
       INDEX -- Position in the !path where the directory name is inserted;
                ignored if the keyword APPEND is set.

 OUTPUTS:
       None, but !path is changed.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       APPEND -- By default, the given directory name is added in the
                 beginning of !path. Set this keyword will add the directory
                 name in the end of !path.
       EXPAND -- Set this keyword if the PATH_NAME needs to be expanded.

 CALLS:
       CHK_DIR, CONCAT_DIR, STR_SEP, ARR2STR, DATATYPE, OS_FAMILY

 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Utilities, OS

 PREVIOUS HISTORY:
       Written October 8, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 2, Liyun Wang, GSFC/ARC, October 17, 1994
          Added EXPAND keyword
	Version 3, William Thompson, GSFC, 29 August 1995
		Modified to use OS_FAMILY

 VERSION:
       Version 3, 29 August 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/add_path.pro)


ADD_PROP

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

 Name        : ADD_PROP

 Purpose     : Add a property to a map object

 Category    : imaging

 Explanation : 

 Syntax      : add_prop,map,property=value

 Examples    : add_prop,map,units='arcsecs'

 Inputs      : MAP = map structure
               PROPERTY = property name
               VALUE = property value
               REPLACE = set to replace with new value if property exists

 Opt. Inputs : None


 Outputs     : MAP = new map with property added

 Opt. Outputs: 

 Keywords    : See inputs

 Common      : None

 Restrictions: Cannot have two properties with same name

 Side effects: None

 History     : Written 18 March 1998, D. Zarro, SAC/GSFC

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/add_prop.pro)


ADD_SYNOP

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	HESSI

 Name        :	ADD_SYNOP()

 Purpose     :	Adds a record to synoptic database

 Explanation :	

 Syntax      : ADD_SYNOP, DEF, STATUS

 Inputs      :	DEF = This is an anonymous structure containing
		      tags defined by DEF_SYNOP

 Opt. Inputs :	None.

 Outputs     :	STATUS = logical value representing
		whether or not the operation was successful, where 1 is
		successful and 0 is unsuccessful.

 Opt. Outputs:	None.

 Keywords    : ERR    = error string (blank if no errors).
               REPLATE = set to replace a record if it already exists

 Restrictions:	None.

 Side effects:	If input catalog number is already in DB, then input
               DEF will replace current entry, otherwise it
               will be added with a new catalog number.

 Category    :	HESSI Synoptic Analysis Database

 Written     :	Dominic Zarro, SM&A/GSFC, 8 May 1999

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/add_synop.pro)


ADD_TAG

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SDAC

 Name        :	ADD_TAG

 Purpose     :	add a tag to a structure

 Explanation :	

 Use         : NEW_STRUCT=ADD_TAG(STRUCT,TAG,TAG_NAME)

 Inputs      :	STRUCT = input structure (array or scalar)
             : TAG_VALUE = tag variable to add 
             : TAG_NAME = tag name 

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = new structure

 Opt. Outputs:	None.

 Keywords    :	NAME = new name for structure
               INDEX = index or tag name where to append new tag [def = last]
               ERR   = error message [blank if ok]
               DUPLICATE = set to allow duplicate tag names
		TOP_LEVEL = If set, then only the top level is searched to
			    determine if the tag already exists.
               NO_COPY = do not make copy of input TAG variable
                         (it will be destroyed after input)

 Restrictions:	Cannot add more than one tag at a time

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)
               
 Version     :	Version 1.0, 7 November 1994 -- written
               Version 2.0, 16 June 1996    -- cleaned up
		Version 3, 11-Aug-1997, William Thompson, GSFC
			Added keyword TOP_LEVEL
		Version 4 8-Oct-1998, Zarro (SMA/GSFC) - converted to using
                       CREATE_STRUCT

(See /host/bluemoon/usr2/idllib/ssw/allpro/add_tag.pro)


ADJUST

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

 Name        : 
	ADJUST()
 Purpose     : 
	Adjust the range of an image.
 Explanation : 
	Adjusts the range of an image.  Basically equivalent to using the
	">" and "<" operators, except that pixels equal to MISSING are ignored
	and not changed by this procedure.
 Use         : 
	Result = ADJUST( ARRAY,  )
 Inputs      : 
	ARRAY	= Array to be scaled.
 Opt. Inputs : 
	None.
 Outputs     : 
	Result of function is scaled image.
 Opt. Outputs: 
	None.
 Keywords    : 
	MINIMUM	= Lower limit to scale image into.  If not passed, then
		  MIN(ARRAY) is assumed.
	MAXIMUM	= Upper limit to scale image into.  If not passed, then
		  MAX(ARRAY) is assumed.
	MISSING	= Value flagging missing pixels.
 Calls       : 
	GET_IM_KEYWORD
 Common      : 
	None.
 Restrictions: 
	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	None.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	William Thompson, March 1991.
	William Thompson, August 1992, renamed BADPIXEL to MISSING.
 Written     : 
	William Thompson, GSFC, March 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 14 May 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/adjust.pro)


ADJUST_COLOR

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

 Name        : 
	ADJUST_COLOR
 Purpose     : 
	Adjust the color table with the cursor.
 Explanation : 
	Use the graphics cursor to control the lower limit and range of the
	color tables.

	Cursor is repeatedly sampled.  X position is the lower limit (e.g.
	cutoff).  Y position controls range of color table.  Initially, the
	cutoff is set to 0 and the range is 255 with the cursor at the upper
	left corner.  When any key is struck the lower limit and range are
	printed and the procedure is exited.

 Use         : 
	ADJUST_COLOR  [, R,G,B ]
 Inputs      : 
	None required.
 Opt. Inputs : 
	R = Red color gun vector, 256 elements, 0 to 255.
		(usually read from device)
	G = Green color gun vector.
	B = Blue color gun vector.
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	DISABLE	 = If passed, then TVSELECT is not used.
	NOCURSOR = If passed, then TVCRS is not called.  TVCRS is not called
		   for Tektronix terminals in any case.
 Calls       : 
	TVSELECT, TVUNSELECT
 Common      : 
	If the parameters are omitted, the color vectors are read using
	TVLCT,/GET.  Regardless of the number of parameters, the colors in
	common are not changed.
 Restrictions: 
	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	None.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	DMS, JULY, 1982. Written.
	WTT, AUGUST, 1990.  Ported to version 2 for non-windowed devices.
	William Thompson, April 1992, changed to use TVLCT,/GET instead of
				      common block.
 Written     : 
	David M. Stern, RSI, July 1982.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
 Version     : 
	Version 2, 8 April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/adjust_color.pro)


ADJUST_TIMES

[Previous Routine] [Next Routine] [List of Routines]
   Name: adjust_times

   Purpose: check input times and adjust if required 

   Input Parameters:
      t0 - start time 	- any Yohkoh format
      t1 - stop time

   Output Parameters:
      t0 - start time (adjusted)	; output is always Yohkoh string format
      t1 - stop time (adjusted)

   Keyword Parameters
      maxdays   - if set, maximum number of days allowed (t1-t0)
      timerange - 2 element vector; force times to fall in this range
      earliest  - same as timerange(0)
      latest    - same as timerange(1)
      status (output) - true (1) if no problems, false (0) if problems/adjust.
      deltat (output) - delta Time (seconds between final output times)

   History:
      28-sep-1995 (S.L.Freeland) to simplify checking WWW form times

   Warning - input times may be clobbered (I mean adjusted)

(See /host/bluemoon/usr2/idllib/ssw/allpro/adjust_times.pro)


ADSTRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ADSTRING
 PURPOSE:
	Return RA and Dec as character string in sexigesimal format.
 EXPLANATION:
	RA and Dec may be entered as either a 2 element vector or as
	2 scalars.  One can also specify the precision of the declination
	in digits after the decimal point.

 CALLING SEQUENCE
	result = ADSTRING( ra_dec )	      
		or
	result = ADSTRING( ra,dec,[ precision ] )

 INPUTS:
	RA_DEC - 2 element vector giving the Right Ascension and declination
		in decimal degrees.
                     or
	RA     - Right ascension in decimal degrees, numeric scalar
	DEC    - Declination in decimal degrees, numeric scalar

 OPTIONAL INPUT:
	PRECISION  - Integer scalar (0-4) giving the number of digits after the 
		decimal of DEClination.   The RA is automatically 1 digit more.
		This parameter may either be the third parameter after RA,DEC 
		or the second parameter after [RA,DEC].  It is not available 
		for just DEC.   If no PRECISION parameter is passed, a 
		precision of 1 for both RA and DEC is returned to maintain 
		compatibility with past ADSTRING functions.    Values of 
		precision larger than 4 will be truncated to 4.    If
		PRECISION is 3 or 4, then RA and Dec should be input as 
		double precision.

 OUTPUT:
	RESULT - Character string containing HR,MIN,SEC,DEC,MIN,SEC formatted
		as ( 2I3,F5.(p+1),2I3,F4.p ) where p is the PRECISION 
		parameter.    If only a single scalar is supplied it is 
		converted to a sexigesimal string (2I3,F5.1).

 EXAMPLE:
	(1) Display CRVAL coordinates in a FITS header, H

	IDL> crval = sxpar(h,'CRVAL*')  ;Extract 2 element CRVAL vector (degs)
	IDL> print, adstring(crval)     ;Print CRVAL vector sexigesimal format

	(2)  print,adstring(30.42,-1.23,1)  ==>  ' 02 01 40.80  -01 13 48.0'
	     print,adstring(30.42,+0.23)    ==>  ' 02 01 40.8  +00 13 48.0'
	     print,adstring(+0.23)          ==>  '+00 13 48.0'

 PROCEDURES CALLED:
	RADEC, SIXTY()

 REVISION HISTORY:
	Written   W. Landsman                      June 1988
	Addition of variable precision and DEC seconds precision fix. 
	ver.  Aug. 1990 [E. Deutsch]
	Output formatting spiffed up       October 1991 [W. Landsman]
	Remove ZPARCHECK call, accept 1 element vector  April 1992 [W. Landsman]
	Call ROUND() instead of NINT()    February 1996  [W. Landsman]
	Check roundoff past 60s           October 1997   [W. Landsman]
	Work for Precision =4             November 1997  [W. Landsman]

(See /host/bluemoon/usr2/idllib/ssw/allpro/adstring.pro)


ADXY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ADXY
 PURPOSE:
	Use a FITS header to convert celestial (RA,Dec) to pixel coordinates
 EXPLANATION:
	Use an image header to compute X and Y positions, given the
	RA and Dec in decimal degrees.  

 CALLING SEQUENCE:
	ADXY, HDR		;Prompt for Ra and DEC 
	ADXY, hdr, a, d, x, y, [ /PRINT ]

 INPUTS:
	HDR - FITS Image header containing astrometry parameters

 OPTIONAL INPUTS:
	A - Right ascension in decimal DEGREES, scalar or vector
	D - Declination in decimal DEGREES, scalar or vector        

	If A and D are not supplied, user will be prompted to supply
	them in either decimal degrees or HR,MIN,SEC,DEG,MN,SC format.

 OPTIONAL OUTPUT:
	X     - row position in pixels, same number of elements as A and D
	Y     - column position in pixels

 OPTIONAL KEYWORD INPUT:
	PRINT - If this keyword is set and non-zero, then results are displayed
		at the terminal.

 OPERATIONAL NOTES:
	If less than 5 parameters are supplied, or if the /PRINT keyword is
	set, then then the X and Y positions are displayed at the terminal.

	If the procedure is to be used repeatedly with the same header,
 	then it would be faster to use AD2XY.

 PROCEDURES CALLED:
	AD2XY, ADSTRING(), EXTAST, GETOPT()

 REVISION HISTORY:
	W. Landsman                 HSTX          January, 1988
	Use astrometry structure   W. Landsman   January, 1994	
	Changed default ADSTRING format   W. Landsman    September, 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/adxy.pro)


AFFINE

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

 PURPOSE:
	Apply the affine transformation given by the input parameters
       to IMAGE. 
	
 CATEGORY:
	Z3 - Image processing, geometric transforms, image registration.

 CALLING SEQUENCE:
	transformed_image = AFFINE(image,mx,my,sx,theta,xc,yc)

 INPUTS:
       IMAGE:  The image to be transformed. Must be 2-D.
       MX, MY: Magnification factors in x and y directions.
       SX:     Horizontal shear term.
       THETA:  Rotation angle in DEGREES. THETA > 0 => counterclockwise rotation.
       XC, YC: Center of rotation.
               
 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 specified and non-zero, "Cubic convolution"
		interpolation is used.  This is a more
		accurate, but more time-consuming, form of interpolation.
		CUBIC has no effect when used with 3 dimensional arrays.
		If this parameter is negative and non-zero, it specifies the
		value of the cubic interpolation parameter as described
		in the INTERPOLATE function.  Valid ranges are -1 <= Cubic < 0.
		Positive non-zero values of CUBIC (e.g. specifying /CUBIC)
		produce the default value of the interpolation parameter
		which is -1.0.

      MISSING:	The data value to substitute for pixels in the output image 
		that map outside the input image.       

 OUTPUTS:
       NONE

 RETURNS:
       TIMAGE: the affine transformation of input image IMAGE.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Uses POLY_2D to warp the input image according to the 
       given parameters.

	See:	Image Processing for Scientific Applications
               Bernd J\"ahne
		CRC Press, 1997, Chapter 8.

       Same as ROT.PRO but includes shear term and /PIVOT is assumed.

 MODIFICATION HISTORY:
	T. Berger, LMATC, 26-February-1998.
       S.L.Freeland, LMSAL, 10-March-1998 - backward compatible IDV V < 5

(See /host/bluemoon/usr2/idllib/ssw/allpro/affine.pro)


AFFINE_SOLVE

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

 PURPOSE:
	Calculate the parameters of a general affine image
       transformation given a set of points from two images:
       one of the images is assumed to be the reference image,
       the other is assumed to be an image translated, rotated,
       scaled, and possibly sheared relative to the reference image.

       The form of the general transformation is affine:
       X = tranformed coordinates = [T+ M S R T-] X'
       where, in homogeneous coordinates,

              X  = TRANSPOSE[x, y, 1]: test image vector
              T+ = [[1,0,x0],[0,1,y0],[0,0,1]]: translatation of (0,0) back to (x0,y0) 
              M  = [[mx,0,0],[0,my,0],[0,0,1]]:scale
              S  = [[1,sx,0],[0,1,0],[0,0,1]]: horizontal shear
              R  = [[cos(t),-sin(t),0],[sin(t),cos(t),0],[0,0,1]]:
                   rotate clockwise by angle t about origin.
              T- = [[1,0,-x0],[0,1,-y0],[0,0,1]]:center of rotation to (0,0)
              X' = TRANSPOSE[x',y',1]: reference image vector
	
 CATEGORY:
	Z3 - Image processing, geometric transforms, image registration.

 CALLING SEQUENCE:
	AFFINE_SOLVE, xin,xrefin,sx,sy,s,theta,x0,y0

 INPUTS:
	XIN:    2xN dimensional array of points taken from image1 
               which correspond to the same points in the reference image.
               Xi = XIN(0,*)
		Yi = XIN(1,*)
               N is the number of points. 

	XPIN:   2xN dimensional array of points from the "reference image"
               which correspond to points in the image. 
               
 KEYWORDS:
       VERBOSE: If set, print the transformation elements to the screen.

 OUTPUTS:
       MX, MY: Magnification factors in x and y axes, respectively.

       SX:      Horizontal shearing factor.

       THETA:  Rotation angle in degrees. 

       XC,YC:  Center of rotation vector elements OR translation
               vector elements.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	N, the number of matched points in the transformed and reference
       images should be large (greater than 20), should be taken from
       widely spaced locations in the image field-of-view, and should
       be measured to within 1-pixel for greatest accuracy.

       Off-center rotation and translation require a two-stage approach
       for image registration. i.e. in the first stage, apply the parameters 
       given by this routine to the test image. A second set of points
       is then selected from the image and the reference image, and 
       a second run of this program should output a final translation
       to be applied to the test image to bring it in registration with
       the reference image. This is tested for and the user is alerted.

 PROCEDURE:
	Using least squares estimation, determine the elements 
       of the general affine transformation (rotation and/or scaling
       and/or translation and/or shearing) of an image onto a reference 
       image. 

	See:	Image Processing for Scientific Applications
               Bernd J\"ahne
		CRC Press, 1997, Chapter 8.

       Use AFFINE.PRO (or ROT.PRO if no shear is found) to apply the 
       transformation to the test image after computing them with this routine.

 MODIFICATION HISTORY:
	Written: T. Berger, LMATC, 24-Feb-1998.
       Added no rotation/translation test. TEB, 2-March-98.
       10-March-1998 - S.L.Freeland - Backward compatible for IDL V<5

(See /host/bluemoon/usr2/idllib/ssw/allpro/affine_solve.pro)


AFF_DIST

[Previous Routine] [Next Routine] [List of Routines]
	PRINT,x(1),y(1)
	

(See /host/bluemoon/usr2/idllib/ssw/allpro/aff_dist.pro)


AFHREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AFhread
 PURPOSE:
	Subroutine of WFPCREAD to read a GEIS header from an HST STSDAS image.
 EXPLANATION:
	This procedure reads a GEIS header from an HST image.   It then looks
	if a .SHH file is present for FOC images to calculate better 
	astrometry by getting the current PSANGLV3 from this file.   Called by
	 WFPCREAD.PRO

 CALLING SEQUENCE:
	AFhread, HdrFile, hdr

 INPUTS:
	HdrFile - scalar string giving name of STSDAS header for an FOC image	

 OUTPUTS:
	hdr - string array, FITS header for the FOC image.    The position
		angle of the V3 axis of HST (PSANGLV3) is added, if it could 
		be found in the .SHH file	
 REVISION HISTORY:
	Written         Eric W. Deutsch  (U. of Washington)    June, 1994
	Documentation update   W. Landsman  (HSTX)             July, 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/afhread.pro)


AIDE

[Previous Routine] [Next Routine] [List of Routines]
 Aide en ligne des logiciels NRH1


(See /host/bluemoon/usr2/idllib/ssw/allpro/aide.pro)


AIRTOVAC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AIRTOVAC
 PURPOSE:
	Convert air wavelengths to vacuum wavelengths 
 EXPLANATION:
	Wavelengths are corrected for the index of refraction of air under 
	standard conditions.  Wavelength values below 2000 A will not be 
	altered.  Uses the IAU standard for conversion given in Morton 
	(1991 Ap.J. Suppl. 77, 119)

 CALLING SEQUENCE:
	AIRTOVAC, WAVE

 INPUT/OUTPUT:
	WAVE - Wavelength in Angstroms, scalar or vector
		WAVE should be input as air wavelength(s), it will be
		returned as vacuum wavelength(s).  WAVE is always converted to
		double precision upon return.

 EXAMPLE:
	If the air wavelength is  W = 6056.125 (a Krypton line), then 
	AIRTOVAC, W yields an vacuum wavelength of W = 6057.8019

 METHOD:
	See Morton (Ap. J. Suppl. 77, 119) for the formula used

 REVISION HISTORY
	Written W. Landsman                November 1991

(See /host/bluemoon/usr2/idllib/ssw/allpro/airtovac.pro)


AITOFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AITOFF
 PURPOSE:
	Convert Right Ascension, Declination to X,Y using an AITOFF projection.
 EXPLANATION:
	This procedure can be used to create an all-sky map in Galactic 
	coordinates with an equal-area Aitoff projection.  Output map 
	coordinates are zero longitude centered.

 CALLING SEQUENCE:
	AITOFF, L, B, X, Y 

 INPUTS:
	L - longitude - scalar or vector, in degrees
	B - latitude - same number of elements as L, in degrees

 OUTPUTS:
	X - X coordinate, same number of elements as L.   X is normalized to
		be between -180 and 180
	Y - Y coordinate, same number of elements as L.  Y is normalized to
		be between -90 and 90.

 NOTES:
	See AIPS memo No. 46, page 4, for details of the algorithm.  This
	version of AITOFF assumes the projection is centered at b=0 degrees.

 REVISION HISTORY:
	Written  W.B. Landsman  STX          December 1989
	Modified for Unix:
		J. Bloch	LANL SST-9	5/16/91	1.1

(See /host/bluemoon/usr2/idllib/ssw/allpro/aitoff.pro)


AITOFF_GRID

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

 PURPOSE:
	Produce an overlay of latitude and longitude lines over a plot or image
 EXPLANATION:
	The grid is plotted on the current graphics device. AITOFF_GRID 
	assumes that the ouput plot coordinates span the x-range of 
	-180 to 180 and the y-range goes from -90 to 90.

 CALLING SEQUENCE:

	AITOFF_GRID[,DLONG,DLAT,[LINESTYLE=N,/LABELS]

 INPUTS:

	DLONG	= Optional input longitude line spacing in degrees. If left
		  out, defaults to 30.
       DLAT    = Optional input lattitude line spacing in degrees. If left
                 out, defaults to 30.

 OPTIONAL INPUT KEYWORDS:

	LINESTYLE	= Optional input integer specifying the linestyle to
			  use for drawing the grid lines.
	LABELS		= Optional keyword specifying that the latitude and
			  longitude lines on the prime meridian and the
			  equator should be labeled in degrees. If LABELS is
			  given a value of 2, i.e. LABELS=2, then the longitude
			  labels will be in hours and minutes instead of
			  degrees.

 OUTPUTS:
	Draws grid lines on current graphics device.

 CATAGORY:
	SST-9 Graphics routine.

 AUTHOR AND MODIFICATIONS:

	J. Bloch	1.2	6/2/91

(See /host/bluemoon/usr2/idllib/ssw/allpro/aitoff_grid.pro)


ALIGN_CUBE_CORREL

[Previous Routine] [Next Routine] [List of Routines]
   Name: align_cube_correl

   Purpose: align a data cube via cross correlation; update coordinates

   Input Parameters:
      index - the header structures   ; SSW standards w/pointing fields
      data  - the data cube       

   Calling Sequence:
        align_cube_correl, index, incube, outindex, outcube ; header & cube 
   -OR- align_cube_correl, incube, outcube                  ; just cube?
   -OR- align_cube_correl, inoutcube                        ; just cube?
     
   History:
      15-October-1998 - S.L.Freeland
      Distillation based on review of SSW correlation/alignment SW  by:
         G.L.Slater  (SXT..)     get_off, cube-align, translate
         J.P.Wuelser (SXT/MEES)  korrel, poly_movie
         T.Tarbell   (TRACE)     tr_get_disp

      Proto type - When called with 'index' structures, will
      adjust the 'pointing' standard tags to reflect alignement and
      return in 'outindex'
   
   Side Effects:
      Called with one paramater, (input cube), the input is overwritten
      by the aligned version (memory conservation, for example)

   Method: 
      call get_correl_offsets to get the cross correlation offsets for cube
      call image_translate to align the cube (via poly2d method)

   Category:
      2D , 3D, Image, Alignment, Cross Correlation      

   Restrictions:
      update of coordinates not yet implemented

(See /host/bluemoon/usr2/idllib/ssw/allpro/align_cube_correl.pro)


ALL_VALS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ALL_VALS
 PURPOSE:
       Find and sort unique values in an array
 CATEGORY:
 CALLING SEQUENCE:
       out = all_vals(in)
 INPUTS:
	in	any array
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
	out	sorted array of unique values
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
       RDB     Sep-98  Written, modelled on old library routine

(See /host/bluemoon/usr2/idllib/ssw/allpro/all_vals.pro)


ALPHAGEN

[Previous Routine] [Next Routine] [List of Routines]
   Name: alphagen

   Purpose: return array ['A', 'B', 'C'...] (sindgen with alpha)

   Calling Sequence: 
      alpha=alphagen(10 [,/lower])

(See /host/bluemoon/usr2/idllib/ssw/allpro/alphagen.pro)


ALPHA_PAGE

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
       SDAC
 	
 NAME:
	ALPHA_PAGE

 PURPOSE:
 	This procedure switches to alpha from graphics page under Tektronix.

 CATEGORY:
	GRAPHICS

 CALLING SEQUENCE:
	ALPHA_PAGE

 INPUTS:
	None

 OUTPUTS:
	None

 SIDE EFFECTS:
	Issues a carriage return if called.

 RESTRICTIONS:

 PROCEDURE:
	A command string (string(24b)) is issued through print to switch the terminal

 COMMON BLOCKS:
	None.

 MODIFICATION HISTORY:
 	Written by:	AKT
	Version 2:	RAS, 23-Mar-1995, only called for Tektronix
	Version 3, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation

(See /host/bluemoon/usr2/idllib/ssw/allpro/alpha_page.pro)


AMEDIAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AMEDIAN
 PURPOSE:
	Works the same as MEDIAN, but the effect tapers off at the edges.
 CALLING SEQUENCE:
	Result = AMEDIAN( ARRAY, WIDTH )
 INPUT PARAMETERS:
	ARRAY	= One or two-dimensional array to be median filtered.
	WIDTH	= Width of the median filter box.
 OPTIONAL KEYWORD PARAMETERS:
	None.
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	ARRAY must be one or two-dimensional.
 PROCEDURE:
	A larger array is constructed with the border filled with the reflected
	edges of the original array.  Then MEDIAN is applied to this larger
	array, and the area corresponding to the original array is returned as
	the result of the function.
 MODIFICATION HISTORY:
	William Thompson, February 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/amedian.pro)


AMOEBA_C

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

 Name        :	AMOEBA_C

 Purpose     :	Reiteratively fits an arbitrary function

 Explanation :	Fits an arbitrary function to a series of data points via a
		least-squares reiterative technique.

		The procedure used is taken from Numerical Recipes.

 Use         :	AMOEBA_C, X, Y, FNAME, PARAM

 Inputs      :	X	= Positions.
		Y	= Data values.
		FNAME	= Name of function to be fitted (string variable).
		PARAM	= Parameters of fit.  Passed as first guess.  Returned
			  as fitted values.

 Opt. Inputs :	None.

 Outputs     :	PARAM	= Parameters of fit.  See note above.

 Opt. Outputs:	None.

 Keywords    :	
	ACCURACY = Accuracy to cut off at.  Defaults to 1E-5.
	MAX_ITER = Maximum number of reiterations.  Defaults to 20.
	POISSON	 = If set, then a Poisson error distribution is assumed, and
		   the weights are set accordingly to 1/Y.
	ERROR	 = Array of errors.  The weights are set accordingly to
		   1/ERROR^2 (normal distribution).  Overrides POISSON.
	LAMBDA	 = Initial step sizes for PARAM, or if scalar then fraction of
		   PARAM.  Defaults to 1E-2.  When passed as an array, this
		   parameter can be used to hold parameters constant by setting
		   LAMBDA(I)=0 for those parameters.
	NOPRINT	 = If set, then no printout is generated.
	CHISQR	 = Returned value of chi-squared.  Only relevant if ERROR
		   passed explicitly.
	N_ITER	 = Number of iterations used.
	ABSOLUTE = If set, then the sum of the absolute differences is
		   minimized instead of the sum of the squares.  This is
		   equivalent to assuming a double-sided exponential
		   distribution.
	LORENTZ	 = If set, then a Lorentz distribution is used instead of a
		   normal distribution.  Not truely meaningful unless ERROR is
		   passed.
	PRANGE	 = Range of acceptable parameter values.  Must have the
		   dimensions (NPAR,2), where PRANGE(*,0) are the minimum
		   values and PRANGE(*,1) are the maximum values.  Only those
		   ranges where PRANGE(*,1) are larger than PRANGE(*,0) are
		   implemented--all other parameters are considered to be
		   unbounded.

 Calls       :	FORM_CHISQR, FORM_SIGMAS

 Common      :	None

 Restrictions:	The user defined function is passed by name as a character
		string in the variable FNAME.  The function must have the form.

				    Y = F(X,PARAM)

		where X is the independent variable, and PARAM is the vector
		containing the parameters of the fit.

		Unless LAMBDA is passed as an array, if the initial guess for
		PARAM contains any zeroes, then those parameters will be kept
		constant at zero.

 Side effects:	The statistical interpretation of CHISQR is unclear if either
		ABSOLUTE or LORENTZ is set.

 Category    :	Utilities, Curve_Fitting

 Prev. Hist. :	
	William Thompson, August, 1989.
	William Thompson, June 1991, modified to use keywords.
	William Thompson, December 1992, modified to use other fitting
		strategies besides minimizing the root-mean-square.  Also
		removed keyword WEIGHTS as this was incompatible with this
		strategy.

 Written     :	William Thompson, GSFC, August 1989

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library
		Version 2, William Thompson, GSFC, 6 October 1995
			Fixed typo.
		Version 3, William Thompson, GSFC, 10 December 1997
			Renamed to AMOEBA_C to avoid conflict with IDL/v5
			routine of the same name.
		Version 4, William Thompson, GSFC, 05-Jun-1998
			Fixed bug where LAMBDA was not being properly accepted
			if a vector.
		Version 5, William Thompson, GSFC, 27-Apr-1999
			Added keyword PRANGE.
		Version 6, William Thompson, GSFC, 04-May-1999
			Allow for case where either PARAM or LAMBDA is set to
			zero to keep a parameter constant.

 Version     :	Version 6, 04-May-1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/amoeba_c.pro)


AMOEBA_F

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

 Name        :	AMOEBA_F

 Purpose     :	Reiteratively minimizes an arbitrary function

 Explanation :	Minimizes an arbitrary function via a least-squares reiterative
		technique.

		The procedure used is taken from Numerical Recipes.

 Use         :	AMOEBA_F, FNAME, PARAM

 Inputs      :	FNAME	= Name of function to be minimized (string variable).
		PARAM	= Parameters of fit.  Passed as first guess.  Returned
			  as fitted values.

 Opt. Inputs :	None.

 Outputs     :	PARAM	= Parameters of fit.  See note above.

 Opt. Outputs:	None.

 Keywords    :	ACCURACY = Accuracy to cut off at.  Defaults to 1E-5.
		MAX_ITER = Maximum number of reiterations.  Defaults to 20.
		LAMBDA	 = Initial step sizes for PARAM, or if scalar then
			   fraction of PARAM.  Defaults to 1E-2.
		NOPRINT	 = If set, then no printout is generated.
		CHISQR	 = Returned value of chi-squared.  Only relevant if
			   ERROR passed explicitly.
		N_ITER	 = Number of iterations used.

 Calls       :	None.

 Common      :	None

 Restrictions:	The user defined function is passed by name as a character
		string in the variable FNAME.  The function must have the form.

				    Y = F(PARAM)

		where PARAM is the vector containing the parameters of the fit.

		Unless LAMBDA is passed as an array, the initial guess for
		PARAM must not contain any zeroes.

 Side effects:	None.

 Category    :	Utilities, Curve_Fitting

 Prev. Hist. :	William Thompson, August, 1989.
		William Thompson, June 1991, modified to use keywords.

 Written     :	William Thompson, GSFC, August 1989

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library
		Version 2, William Thompson, GSFC, 6 October 1995
			Fixed typo.
		Version 3, William Thompson, GSFC, 05-Jun-1998
			Fixed bug where LAMBDA was not being properly accepted
			if a vector.

 Version     :	Version 3, 05-Jun-1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/amoeba_f.pro)


ANAHEAD

[Previous Routine] [Next Routine] [List of Routines]
returns just the header from a Rice compressed f0 file.

(See /host/bluemoon/usr2/idllib/ssw/allpro/anahead.pro)


ANAHEAD2STRUCT

[Previous Routine] [Next Routine] [List of Routines]
   Name: anahead2struct

   Purpose: convert an ana header (per lapalma) -> SSW structure
  

(See /host/bluemoon/usr2/idllib/ssw/allpro/anahead2struct.pro)


ANIMPROF

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

 PURPOSE:

	Cette procedure trace une serie d'images unidimensionnelles
	(intensite et/ou polarisation)animees
 CATEGORY:
	NRH1 profils

 CALLING SEQUENCE:
	 ANIMPROF,Images, Unit

 INPUTS:
	IMAGES Tableau d'images 2dim(espace,temps) ou 3dim(espace,temps,I:V)
		voir lec1d
	UNIT	Unite associee au tableau

 KEYWORD PARAMETERS:
	INTENSITE trace du parametre I
	POLAR	  trace du parametre V
	ATTENTE	  delais entre le trace de 2 images
	HEURES	  tTableau de chaine de caracteres [Heure debut,Heure de fin]
			format de l'heure "hh:mn:ss:ccc"
	CANAUX	  tableau contenant [Canal de debut, Canal de fin]
			format: valeurs entieres

 OUTPUTS:
	Trace des images sucessives

 COMMON BLOCKS:
	NRH1_GLOBAL

 MODIFICATION HISTORY: (bonmartin@obspm.fr)
	13/11/98) Adapte du logiciel XHELIO

(See /host/bluemoon/usr2/idllib/ssw/allpro/animprof.pro)


ANYTIM

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	anytim
PURPOSE:
	This function converts one of several recognized time formats into the selected
	output format.

CALLING SEQUENCE:
       xx = anytim(roadmap, out_styl='ints') 
       or 
       xx = anytim(roadmap, /INTS) 

       xx = anytim('12:33 5-Nov-91', out_sty='ex')
       or
       xx = anytim('12:33 5-Nov-91', /EX)

       xx = anytim('12:33 91/11/5',/EX)


       xx = anytim([0, 4000], out_style= 'sec')
       or
       xx = anytim([0, 4000], /SEC)

CATEGORY:
	Time, Utplot, time conversions
INPUT:
	item	- The input time
		  Form can be 
		 (1) structure with a .time and .day
		  tags, those tags may also appear in a .gen tag
		  which is the first tag of the top structure,
		  if one element in structure, will return scalar output
		  for 1-d datatypes,  or
		 (2) the standard 7-element external (EX) representation [hh,mm,ss,msec,dd,mm,(yy)yy],
		  or (3) a string of the format "hh:mm dd-mmm-yy" or "yy/mm/dd",
		  or (4) a 2xN array where the two dimensions hold (MSOD, DS79),
			 .i.e. (MilliSecondsOfDay, DaySince 1-jan-1979), so called Internal Structure (INTS), 
		  or (5) a double or float array of seconds from 1-jan-79.
		  1-d, single time element inputs, the EX or array form of INTS, i.e. 
			size(item) is   [ 1, 7, 2, 7] or [1, 2, 3, 2] return scalar results for
		  /sec output.

	!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	N.B. 2 digit year representations in EX or String formats are interpreted between
	years 1950 and 2049.  
	!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       The UTC procedures, utc2int, str2utc, and int2utc are included using
	CALL_FUNCTION so anytim will compile and work without these routines
	and their subsequent calls to procedures in the utc directory.
	Allowed formats include those supported under UTC  code, see STR2UTC.PRO:
 			= A character string containing the date and time.  The
			  target format is the CCSDS ASCII Calendar Segmented
			  Time Code format (ISO 8601), e.g.

				"1988-01-18T17:20:43.123Z"

			  The "Z" is optional.  The month and day can be
			  replaced with the day-of-year, e.g.

				"1988-018T17:20:43.123Z"

			  Other variations include

				"1988-01-18T17:20:43.12345"
				"1988-01-18T17:20:43"
				"1988-01-18"
				"17:20:43.123"

			  Also, the "T" can be replaced by a blank, and the
			  dashes "-" can be replaced by a slash "/".  This is
			  the format used by the SOHO ECS.

			  In addition this routine can parse dates where only
			  two digits of the year is given--the year is assumed
			  to be between 1950 and 2049.

			  Character string months, e.g. "JAN" or "January", can
			  be used instead of the number.  In that case, it
			  assumes that the date is either in day-month-year or
			  month-day-year format, e.g. "18-JAN-1988" or
			  "Jan-18-1988".  However, if the first parameter is
			  four digits, then year-month-day is assumed, e.g.
			  "1988-Jan-18".

			  Dates in a different order than year-month-day are
			  supported, but unless the month is given as a
			  character string, then these are only supported
			  through the /MDY and /DMY keywords.

	End UTC documentation	

OPTIONAL KEYWORD INPUT:
	out_style - Output representation, specified by a string:
      		INTS   	- structure with [msod, ds79]
		STC     - same as INTS
      		2XN    	- longword array [msod,ds79] X N
      		EX     	- 7 element external representation (hh,mm,ss,msec,dd,mm,yyyy)
		UTIME	- Utime format, Real*8 seconds since 1-jan-79, DEFAULT!!!!
               SEC     - same as Utime format
               SECONDS - same as Utime format
		TAI	- standard seconds from 1-jan-1958.  Includes leap seconds unlike "SECONDS" output. 
			NB- The TAI format cannot be used as an input to ANYTIM because it will be interpreted as
			number of days (in seconds) from 1-jan-1979.
		ATIME   - Variable Atime format, Yohkoh
			  Yohkoh style - 'dd-mon-yy hh:mm:ss.xxx'   or
			  HXRBS pub style  - 'yy/mm/dd, hh:mm:ss.xxx'
			  depending on atime_format set by 
			  hxrbs_format or yohkoh_format
		YOHKOH  - yohkoh style string 
		HXRBS   - HXRBS Atime format /pub, 'yy/mm/dd, hh:mm:ss.xxx'
               YY/MM/DD- same as HXRBS
		MJD     - UTC-type structure
			= The UTC date/time as a data structure with the
			  elements:

				MJD	= The Modified Julian Day number
				TIME	= The time of day, in milliseconds
					  since the start of the day.

			  Both are long integers.
		UTC_INT - Same as MJD
		UTC_EXT - UTC external format, a structure
		          containing the elements, YEAR, MONTH, DAY, HOUR, MINUTE,
		          SECOND, and MILLISECOND as shortword integers.
		CCSDS   - A string variable containing the calendar date in the
			 format recommended by the Consultative Committee for
			 Space Data Systems (ISO 8601), e.g.

				"1988-01-18T17:20:43.123Z"

		ECS     - A variation on the CCSDS format used by the EOF Core
			 System.  The "T" and "Z" separators are eliminated, and
			 slashes are used instead of dashes in the date, e.g.

				"1988/01/18 17:20:43.123"

		VMS     - Similar to that used by the VMS operating system, this
			 format uses a three-character abbreviation for the
			 month, and rearranges the day and the year, e.g.

				"18-JAN-1988 17:20:43.123"

		STIME   - Based on !STIME in IDL, this format is the same as the
			 second accuracy, e.g.
			 VMS format, except that the time is only given to 0.01 
			 second accuracy, e.g.

				"18-JAN-1988 17:20:43.12"
			
	or by keywords
		/ints   - 
	        /stc
		/_2xn
		/external
		/utime
		/seconds
		/atimes
		/yohkoh
		/hxrbs
		/yymmdd	
		/mjd
		/utc_int
		/utc_ext
		/ccsds
		/ecs
		/vms
		/stime
		/TAI	 

	mdy	- If set, use the MM/DD/YY order for converting the string date
		
     date_only - return only the calendar date portion, 
                     e.g. anytim('93/6/1, 20:00:00',/date_only,/hxrbs) ==> '93/06/01'
     time_only - return only the time of day portion
                     e.g. anytim('93/6/1, 20:00:00',/time_only,/hxrbs) ==> '20:00:00.000'
	truncate - truncate the msec portion of the time displayed in strings.
keyword output:
	error	- set if an error, dummy for now, ras 18-Nov-93
restrictions:
	one dimensional or scalar longwords will be interpreted as
	double precision seconds unless they have either two or seven
	elements
       Should not be used to interpret an array of mixed string formats.
       If the formats are mixed then the array should be processed element by element.
HISTORY:
	Written 31-Oct-93 ras
	modified 4-jan-94 ras, made argument recognition more robust
		also made output dimensions similar for /yohkoh  and /hxrbs
	modified 25-jan-94 ras, made SEC or SECONDS work
	ras 30-jan-94, fixed string outputs for /date and /time
	ras 9-feb-94, fixed typo
	ras 15-jun-1995, integrated Bill Thompson's UTC formats, for input and output 
		start adjusting to 4 digit years
	ras, 20-jun-1995, put calls to utc functions inside call_function to reduce need
	to include utc directories, default structure is Yohkoh as before,
	utc structures are tested for explicitly
       ras, 23-jun-1995, stopped searching for 'T' to identify CCSDS format, now 'Z'
	   made sear for 4 digit year more exacting
	ras, 28-jul-95, restored item using item_old if necessary
	Version 11, ras, 27-mar-1997, added truncate keyword
	Version 12, ras, 16-jul-1997, fixed truncation problem with date strings
	using atime, yohkoh, hxrbs, or yymmdd keywords.
	Version 13, richard.schwartz@gsfc.nasa.gov
		1. Supports input and output of 4 digit years.
		2. Longword support on all integer day structures.
		3. No modulo reduction of ex year format.
		4. Simplify structure checking for input.
	Version 14, richard.schwartz@gsfc.nasa.gov, 24-oct-1997, cleared bug in checking tags
	in structure inhibiting finding of yohkoh gen tag.  Bug put in on mod 13.
	Version 15, richard.schwartz@gsfc.nasa.gov, 28-oct-1997, DATE and TRUNCATE
	keywords can be used together with vms, ecs, and stime output format
	without producing null strings, same effect as using only DATE keyword.
	Version 16, richard.schwartz@gsfc.nasa.gov, 30-oct-1997, change
	time and date keywords to time_only and date_only for consistency
	with SSW/gen/idl/time routines by W. Thompson.
	Version 17, richard.schwartz@gsfc.nasa.gov, 16-Mar-1998, scalar output for EX format
	in only 1-D array.
	Version 18, richard.schwartz@gsfc.nasa.gov, 20-Apr-1998, added TAI output and supports
       'hh:mm:ss.xxx yy/mm/dd' now.
       Version 19, richard.schwartz@gsfc.nasa.gov, 13-aug-1998, route 4+ month strings to STR2UTC.
	Version 20, richard.schwartz@gsfc.nasa.gov, 9-sep-1998, converts 2 digit years in EXternal format to 
	4 digit years using 1950-2049 window.
	Version 21, richard.schwartz@gsfc.nasa.gov, 24-oct-1998, passes double and single precision seconds through
	unchanged except float converted to double.
	

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim.pro)


ANYTIM2CAL

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : ANYTIM2CAL()
               
 Purpose     : Converts (almost) any time format to calendar format.
               
 Explanation : Tests the type of input and tries to use the appropriate
               conversion routine to create the date/time in a user
               selectable calendar format for, for example, printing in
               documents, tables etc.
               
 Use         : IDL>  utc = anytim2cal(any_format, form=xx)
    
 Inputs      : any_format - date/time in any of the acceptable CDS 
                            time formats -- for acceptable formats see file 
                            aaareadme.txt.
               
 Opt. Inputs : None
               
 Outputs     : Function returns string array in format requested.
               
 Opt. Outputs: None
               
 Keywords    : 
      FORM  = n   where... 
			    n		  output format
			    0		dd/mmm/yy hh:mm:ss  [default]
			    1		dd-mmm-yy hh:mm:ss
			    2		dd/mm/yy  hh:mm:ss
			    3		dd-mm-yy hh:mm:ss
			    4		mm/dd/yy hh:mm:ss
			    5		mm-dd-yy hh:mm:ss
			    6		yy/mm/dd hh:mm:ss
			    7		yy-mm-dd hh:mm:ss
			    8		yyyymmddhhmmss
                           9           dd-mmm-yyyy hh:mm:ss.sss (VMS-like)
                          10           dd-mmm-yyyy hh:mm:ss.ss (!stime-like)
                          11           yyyy/mm/dd hh:mm:ss.sss (cpt use)
			    etc TBD
      DATE   - Output only the date in format above.
      TIME   - Output only the time in format above.
      MSEC   -	Include milliseconds in the "ss" fields above (="ss.sss").
      ERRMSG - If defined and passed, then any error messages will be returned
               to the user in this parameter rather than being printed to
               the screen.  If no errors are encountered, then a null string 
               is returned.  In order to use this feature, the string ERRMSG
               must be defined first, e.g.,

                   ERRMSG = ''
                   ANYTIM2CAL, DT, ERRMSG=ERRMSG, ...
                   IF ERRMSG NE '' THEN ...

 Calls       : ANYTIM2UTC, CHECK_EXT_TIME

 Common      : None
               
 Restrictions: None
               
 Side effects: If no parameters are passed, ERRMSG is returned as a string
               array.  If any other error occurs and ERRMSG is set, ERRMSG
		is returned as a string of '-1'.
               
 Category    : Util, time
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 24-May-94
               
 Modified    :	Version 1, C.D. Pike, RAL, 24 May 1994
		Version 2, Donald G. Luttermoser, GSFC/ARC, 20 December 1994
			Added the keyword ERRMSG.  Added forms 4 and 5.
               Version 3, CDP, make work with vector input and
                               added formats 6 & 7.   5-Jan-95
               Version 4, CDP, fix round off giving 60 in seconds field.
                               23-Jan-95
		Version 5, William Thompson, GSFC, 25 January 1995
			Changed to call intrinsic ROUND instead of NINT.  The
			version of NINT in the Astronomy User's Library doesn't
			automatically select between short and long integers as
			the CDS version does.
		Version 6, Donald G. Luttermoser, GSFC/ARC, 30 January 1995
			Added ERRMSG keyword to internally called procedures.
		Version 7, Donald G. Luttermoser, GSFC/ARC, 8 February 1995
			Added form 8.  Allowed for input to be either scalar
			or vector.
		Version 8, Donald G. Luttermoser, GSFC/ARC, 13 February 1995
			Added the /MSEC keyword.  Streamlined code to get
			rid of redundancies.
		Version 9, William Thompson, GSFC/ARC, 16 February 1995
			Rewrote to call CHECK_EXT_TIME.  This is used instead
			of the logic introduced in version 4 for checking the
			validity of the time returned.
               Version 10 Fixed array input bug in /msec code.  CDP, 20-Feb-95
               Version 11 Add VMS and !stime-like formats 9/10. CDP, 15/3/95
               Version 12 Add type 11 format.  CDP, 15-DEc-95
		Version 13, 18-Mar-1998, William Thompson, GSFC
			Use SAFE_STRING instead of STRING

 Version     :	Version 13, 18-Mar-1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2cal.pro)


ANYTIM2DD79

[Previous Routine] [Next Routine] [List of Routines]
Name:
	anytim2dd79
Purpose:
	Convert time in any standard format to decimal d79,
Input:
	TIME_ARR - The usual suspects
Output:
	N vector of dd79's
History:

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2dd79.pro)


ANYTIM2DOY

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	anytim2doy
PURPOSE:
	Given a time in the form of a (1) structure, (2) 7-element time
	representation, or (3) a string representation, 
	return the day of the year for that day
CALLING SEQUENCE:
	xx = anytim2doy(roadmap)
	xx = anytim2doy('12:33 5-Nov-91')
INPUT:
	tim_in	- The input time
		  Form can be (1) structure with a .time and .day
		  field, (2) the standard 7-element external representation
		  or (3) a string of the format "hh:mm dd-mmm-yy"
OPTIONAL KEYWORD INPUT:
	string	- If set, return the output in the form YYDDD (ie: 98020)
OPTIONAL KEYWORD OUTPUT:
	year	- The year for the time(s) passed in
HISTORY:
	Written 7-Jun-92 by M.Morrison
	11-Jan-94 (MDM) - Updated the header information
	18-Feb-98 (MDM) - Added /STRING option
	 5-Mar-98 (MDM) - Changed from STRING to FSTRING
			- Changed logic to do '1-Jan-YY' conversion
			  once per year rather than the full array
			  (speeds it up considerably for 

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2doy.pro)


ANYTIM2EX

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	anytim2ex
PURPOSE:
       Given a time in the form of a (1) structure, (2) 7-element time
       representation, or (3) a string representation, or (4) an array
       2xN where the first dimension holds (MSOD, DS79)
	convert to the 7-element time representation (hh,mm,ss,msec,dd,mm,yy)
CALLING SEQUENCE:
	xx = anytim2ex(roadmap)
	xx = anytim2ex('12:33 5-Nov-91')
	xx = anytim2ex([0, 4000])
INPUT:
	tim_in	- The input time
		  Form can be (1) structure with a .time and .day
		  field, (2) the standard 7-element external representation
		  or (3) a string of the format "hh:mm dd-mmm-yy"
OPTIONAL KEYWORD INPUT:
	mdy	- If set, use the MM/DD/YY order for converting the string date
HISTORY:
	Written 15-Nov-91 by M.Morrison
	 5-Jan-93 (MDM) - Added /MDY option for TIMSTR2EX
	11-Jan-93 (MDM) - Updated document header

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2ex.pro)


ANYTIM2INTS

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	anytim2ints
PURPOSE:
	Given a time in the form of a (1) structure, (2) 7-element time
	representation, or (3) a string representation, or (4) an array 
	2xN where the first dimension holds (MSOD, DS79)
	convert to the a simple structure with .TIME and .DAY
CALLING SEQUENCE:
	xx = anytim2ints(roadmap)
	xx = anytim2ints('1-sep-91', off=findgen(1000)*86400)
	xx = anytim2ints('12:33 5-Nov-91')
	xx = anytim2ints([0, 4000])
INPUT:
	tim_in	- The input time
		  Form can be (1) structure with a .time and .day
		  field, (2) the standard 7-element external representation
		  or (3) a string of the format "hh:mm dd-mmm-yy"
OPTIONAL KEYWORD INPUT:
	offset	- The input time can be offset by a scalar or vector number of
		  seconds.  If "offset" is an array, it should be the same 
		  length at tim_in
HISTORY:
	Written 30-May-92 by M.Morrison
        5-Jan-93 (MDM) - Added /MDY option for TIMSTR2EX
	12-May-93 (MDM) - Modified to allow TIM_IN to be a single time, and
			  OFFSET to be an array
	11-Jan-94 (MDM) - Updated document header

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2ints.pro)


ANYTIM2JD

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : anytim2jd()
               
 Purpose     : Converts any input time format to full Julian day.
               
 Explanation : Converts any time format to the equivalent Julian
               day value.  Returns result in a structure with the
               tags int (long) and frac (double).
               
 Use         : IDL>  jd = anytim2jd(any_format)
    
 Inputs      : any_format - date/time in any of the acceptable CDS 
                            time formats -- for acceptable formats see file 
                            aaareadme.txt.
               
 Opt. Inputs : None
               
 Outputs     : Function returns JD in a structure {int:0L,frac:0.0d0}.
               
 Opt. Outputs: None
               
 Keywords    : ERRMSG  =  If defined and passed, then any error messages will
                          be returned to the user in this parameter rather 
                          than being printed to the screen.  If no errors are
                          encountered, then a null string is returned.  In 
                          order to use this feature, the string ERRMSG must 
                          be defined first, e.g.,

                             ERRMSG = ''
                             JD = anytim2jd ( DT, ERRMSG=ERRMSG, ...)
                             IF ERRMSG NE '' THEN ...

 Calls       : ANYTIM2UTC, INT2UTC, JULDAY

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

 Written     : C D Pike, RAL, 16-May-94
               
 Modified    :	Version 1, C D Pike, RAL, 16-May-94
		Version 2, William Thompson, GSFC, 14 November 1994
			Changed .DAY to .MJD
		Version 3, Donald G. Luttermoser, GSFC/ARC, 20 December 1994
			Added the keyword ERRMSG.  Included ON_ERROR flag.
		Version 4, Donald G. Luttermoser, GSFC/ARC, 30 January 1995
			Added ERRMSG keyword to internally called procedured.
			Made error handling routine more robust.
		Version 5, Donald G. Luttermoser, GSFC/ARC, 13 February 1995
			Allowed for input to be either scalar or vector.
		Version 6, William Thompson, GSFC, 28 January 1997
			Allow for long input arrays.
		Version 7, Zarro, GSFC, 4 Feb 1997
			Changed name from ANYTIM2JD

 Version     :	Version 7

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2jd.pro)


ANYTIM2TAI

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : ANYTIM2TAI()
               
 Purpose     : Converts any standard CDS time format to TAI.
               
 Explanation : Tests the type of input and tries to use the appropriate
               conversion routine to create the date/time in CDS TAI
               time format.
               
 Use         : IDL>  utc = anytim2tai(any_format)
    
 Inputs      : any_format - date/time in any of the acceptable CDS 
                            time formats -- for acceptable formats see file 
                            aaareadme.txt.
               
 Opt. Inputs : None
               
 Outputs     : Function returns CDS TAI double precision time value.
               
 Opt. Outputs: None
               
 Keywords    : ERRMSG    = If defined and passed, then any error messages 
                           will be returned to the user in this parameter 
                           rather than being printed to the screen.  If no
                           errors are encountered, then a null string is
                           returned.  In order to use this feature, the 
                           string ERRMSG must be defined first, e.g.,

                                ERRMSG = ''
                                UTC = ANYTIM2TAI ( DT, ERRMSG=ERRMSG, ...)
                                IF ERRMSG NE '' THEN ...

 Calls       : DATATYPE, INT2UTC, STR2UTC

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, time
               
 Prev. Hist. : Based on ANYTIM2UTC by C. D. Pike.

 Written     : William Thompson, GSFC, 20 May 1996
               
 Modified    :	Version 1, William Thompson, GSFC, 20 May 1996

 Version     : Version 1, 20 May 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2tai.pro)


ANYTIM2UTC

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : ANYTIM2UTC()
               
 Purpose     : Converts (almost) any time format to CDS UTC format.
               
 Explanation : Tests the type of input and tries to use the appropriate
               conversion routine to create the date/time in CDS UTC
               format (either internal (default), external or string)
               CDS time format.
               
 Use         : IDL>  utc = anytim2utc(any_format)
    
 Inputs      : any_format - date/time in any of the acceptable CDS 
                            time formats -- for acceptable formats see file 
                            aaareadme.txt.
               
 Opt. Inputs : None
               
 Outputs     : Function returns CDS UTC time structure.
               
 Opt. Outputs: None
               
 Keywords    : EXTERNAL  = Create output in external format
               CCSDS     = Create string output in CCSDS format
               ECS       = Create string output in ECS format
		VMS	  = Create string output in VMS format
		STIME	  = Create string output in STIME format

		Only one of the above keywords can be set.  If none of them are
		set, then the output is in internal format.  The following
		keywords are only valid if a string format was selected.

		DMY	  = Normally the date is in the order year-month-day.
			    However, if DMY is set then the order is
			    day-month-year.  Note that if the month is given as
			    a character string, then the default is
			    day-month-year.

		MDY	  = If set, then the date is in the order
			    month-day-year.

		YMD	  = If set, then the date is in the order
			    year-month-day.

		TRUNCATE  = If set, then the time will be truncated to 1 second
			    accuracy.  Note that this is not the same thing as
			    rounding off to the nearest second, but is a
			    rounding down.

		DATE_ONLY = If set, then only the date part of the string is
			    returned.

		TIME_ONLY = If set, then only the time part of the string is
			    returned.

		UPPERCASE = If set, then the month field in either the VMS or
			    STIME format is returned as uppercase.

		NOZ	  = When set, the "Z" delimiter (which denotes UTC
			    time) is left off the end of the CCSDS/ISO-8601
			    string format.  It was decided by the FITS
			    committee to not append the "Z" in standard FITS
			    keywords.

		The following keyword is always valid.

               ERRMSG    = If defined and passed, then any error messages 
                           will be returned to the user in this parameter 
                           rather than being printed to the screen.  If no
                           errors are encountered, then a null string is
                           returned.  In order to use this feature, the 
                           string ERRMSG must be defined first, e.g.,

                                ERRMSG = ''
                                UTC = ANYTIM2UTC ( DT, ERRMSG=ERRMSG, ...)
                                IF ERRMSG NE '' THEN ...

 Calls       : DATATYPE, INT2UTC, STR2UTC

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

 Written     : C D Pike, RAL, 16-May-94
               
 Modified    :	Version 1, C D Pike, RAL, 16-May-94
		Version 2, William Thompson, GSFC, 14 November 1994
			Changed .DAY to .MJD
		Version 3, Donald G. Luttermoser, GSFC/ARC, 20 December 1994
			Added the keyword ERRMSG.  Included ON_ERROR flag.
		Version 4, Donald G. Luttermoser, GSFC/ARC, 30 January 1995
			Added ERRMSG keyword to internally called procedures.
			Made error handling routine more robust.
		Version 5, Donald G. Luttermoser, GSFC/ARC, 8 February 1995
			Allowed for input to be either scalar or vector.
		Version 6, William Thompson, GSFC, 14 March 1995
			Added keywords VDS, STIME, TRUNCATE, DATE_ONLY,
			TIME_ONLY, UPPERCASE
		Version 7, William Thompson, GSFC, 5 May 1995
			Fixed bug with use of ERRMSG keyword.
			Made so that TAI times are supported.
		Version 8, William Thompson, GSFC, 8 May 1995
			Fixed bug introduced in version 7
               Version 9 C D Pike, RAL, 17-May-95
                       Handle time only (no date) string input.
		Version 10, William Thompson, GSFC, 20 December 1995
			Fixed bug with use of ERRMSG keyword when string
			contained no "-" characters.
		Version 11, William Thompson, GSFC, 23 October 1996
			Added keywords DMY, MDY, YMD.
			Removed attempt at automatic recognition of DMY
			option--no longer needed with version 11 of STR2UTC.
		Version 12, William Thompson, GSFC, 28 January 1997
			Allow for long input arrays.
		Version 13, William Thompson, GSFC, 17 September 1997
			Added keyword NOZ.

 Version     :	Version 13, 17-Sep-1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2utc.pro)


ANYTIM2UTPLOT

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

Convert to the "utplot" time format of yy/mm/dd, hhmm:ss.xxx
from any type of input

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2utplot.pro)


ANYTIM2WEEKINFO

[Previous Routine] [Next Routine] [List of Routines]
  
    Purpose: return week-requested information for input time vector

    Input Parameters:
        times - time vector in any SSW format

    Output Parameters:
       years - integer year for input times
       weeks - integer week for input times
  
    Output:
       Function output if /FIRST set, output is YYYYMMDD or YYMMDD (first DOW)
       Function output if /WID   set, output is YYYY_WW or YY_WW   (weekid) 
                                                                    DEFAULT
    Keyword Parameters:
      wid   - (switch) if set, return 'YYYY_WW' (weekid)  DEFAULT
      first - (switch) if set, return 'YYYYMMDD' correponding to 1st DOW
      year2digit (switch) if set, return year as 2 digit (YYMMDD or YY_WW)

    History:
      29-Jan-1998 - S.L.Freeland - package some common TRACE/YOHKOH/SSW
                                   time->week conversions

    Routines Called:
       anytim, anytim2ints, ex2week  

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2weekinfo.pro)


ANYTIM2WEEKS

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	anytim2weeks
PURPOSE:
	Given a starting and ending time, return a vector
	of week numbers and year numbers where the times fall
INPUT:
	sttim	- the start time in "any" format
OPTIONAL INPUT:
	entim	- if not defined, just return the week/year for
		  the start time
OUTPUT:
	weeks	- the week number
	years	- the year numbers
OPTIONAL KEYWORD INPUT:
	nobackup - If set, then do not back up a week if the start
		   time is within 90 minutes of the first day of the week.
	string	- If set, then return the answer in string format (WIDs)
HISTORY:
	Written Feb-92 by M.Morrison
        8-Feb-92 (MDM) - Added code to back up a week if the start time
                         is within 90 minutes of the first day of a week
	29-Aug-94 (MDM) - Added /NOBACKUP option to NOT back up a week
			  when start time is within 90 minutes of the first
			  day of the week.
	20-Sep-94 (MDM) - Added /STRING option

(See /host/bluemoon/usr2/idllib/ssw/allpro/anytim2weeks.pro)


APER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	APER
 PURPOSE:
	Compute concentric aperture photometry (adapted from DAOPHOT) 
 EXPLANATION:
	APER can compute photometry in several user-specified aperture radii.  
	A separate sky value is computed for each source using specified inner 
	and outer sky radii.   

 CALLING SEQUENCE:
	APER, image, xc, yc, [ mags, errap, sky, skyerr, phpadu, apr, skyrad, 
			badpix, PRINT = , /SILENT, /FLUX, SETSKYVAL = ]
 INPUTS:
	IMAGE -  input image array
	XC     - vector of x coordinates. 
	YC     - vector of y coordinates

 OPTIONAL INPUTS:
	PHPADU - Photons per Analog Digital Units, numeric scalar.  Converts
		the data numbers in IMAGE to photon units.  (APER assumes
		Poisson statistics.)  
	APR    - Vector of up to 12 REAL photometry aperture radii.
	SKYRAD - Two element vector giving the inner and outer radii
		to be used for the sky annulus
	BADPIX - Two element vector giving the minimum and maximum value
		of a good pix (Default [-32765,32767])

 OPTIONAL KEYWORD INPUTS:
	PRINT - if set and non-zero then APER will also write its results to
		a file APER.PRT.   One can specify the output file name by
		setting PRINT = 'filename'.
	SILENT -  If supplied and non-zero then no output is displayed to the
		terminal.
	FLUX   -  If set, output fluxes instead of magnitudes.
	SETSKYVAL - Use this keyword to force the sky to a specified value 
		rather than have APER compute a sky value.    SETSKYVAL 
		can either be a scalar specifying the sky value to use for 
		all sources, or a 3 element vector specifying the sky value, 
		the sigma of the sky value, and the number of elements used 
		to compute a sky value.   The 3 element form of SETSKYVAL
		is needed for accurate error budgeting.

 OUTPUTS:
	MAGS   -  NAPER by NSTAR array giving the magnitude for each star in
		each aperture.  (NAPER is the number of apertures, and NSTAR
		is the number of stars).   A flux of 1 digital unit is assigned
		a zero point magnitude of 25.
	ERRAP  -  NAPER by NSTAR array giving error in magnitude
		for each star.  If a magnitude could not be deter-
		mined then ERRAP = 9.99.
	SKY  -  NSTAR element vector giving sky value for each star
	SKYERR -  NSTAR element vector giving error in sky values

 PROCEDURES USED:
	DATATYPE(), GETOPT, MMM, STRN(), STRNUMBER()
 REVISON HISTORY:
	Adapted to IDL from DAOPHOT June, 1989   B. Pfarr, STX
	Adapted for IDL Version 2,               J. Isensee, July, 1990
	Code, documentation spiffed up           W. Landsman   August 1991
	TEXTOUT may be a string                  W. Landsman September 1995
	FLUX keyword added	                 J. E. Hollis, February, 1996
	SETSKYVAL keyword, increase maxsky       W. Landsman, May 1997
	Work for more than 32767 stars           W. Landsman, August 1997
						  

(See /host/bluemoon/usr2/idllib/ssw/allpro/aper.pro)


APPEND_ARR

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

 Name        : APPEND_ARR

 Category    : Utility

 Purpose     : Manageable method for concatanating arrays

 Explanation : 

 Syntax      : IDL> result=append_arr(input,extra)

 Inputs      : INPUT = array (or scalar) that requires appending
               EXTRA = array (or scalar) to append

 Opt. Inputs : None

 Outputs     : None

 Opt. Outputs: None

 Keywords    : SAME = set to force matching same array types

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  1-Oct-1998,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/append_arr.pro)


APPLY_LOCK

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : APPLY_LOCK
               
 Purpose     : create a LOCK file 
               
 Category    : Planning
               
 Explanation : creates a LOCK file with the creation date saved in file.
               
 Syntax      : IDL> apply_lock,lock_file
    
 Examples    : 

 Inputs      : LOCK_FILE = lock file name (with path)
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : ERR - message string
               QUIET - turn off printing
               EXPIRE - seconds after which LOCK file expires

 Common      : None
               
 Restrictions: None
               
 Side effects: None.
               
 History     : Version 1,  17-July-1996,  D M Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/apply_lock.pro)


ARCBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARCBAR
 PURPOSE:
       Display a bar of a specified input size in arcminutes or arcseconds

 CALLING SEQUENCE:
       ARCBAR, hdr, arclen,[  COLOR= , /DATA, LABEL= , /NORMAL, POSITION =, 
                              /SECONDS, SIZE=, THICK= ]

 INPUTS:
       hdr - image FITS header with astrometry, string array
       arclen - numeric scalar giving length of bar in arcminutes (default)
              or arcseconds (if /SECONDS is set) 

 OPTIONAL KEYWORD INPUTS:
       COLOR - integer scalar specifying the color to draw the arcbar (using
               PLOTS), default = !P.COLOR
       DATA - if set and non-zero, then the POSITION keyword is given in data
              units
       LABEL - string giving user defined label for bar.  Default label is size
               of bar in arcminutes
       NORMAL - if this keyword is set and non-zero, then POSITION is given in
               normalized units
       POSITION - 2 element vector giving the (X,Y) position in device units 
               (or normalized units if /NORMAL is set, or data units if /DATA
               is set) at which to place the  scale bar.   If not supplied, 
               then the user will be prompted to place the cursor at the 
               desired position
       SIZE  - scalar specifying character size of label, default = 1.0
       THICK -  Character thickness of the label, default = !P.THICK

 EXAMPLE:
       Place a 3' arc minute scale bar, at position 300,200 of the current
       image window, (which is associated with a FITS header, HDR)

       IDL> arcbar, HDR, 3, pos = [300,200]

 RESTRICTIONS:
       When using using a device with scalable pixels (e.g. postscript)
       the data coordinate system must be established before calling ARCBAR.
       If data coordinates are not set, then ARCBAR assumes that the displayed
       image size is given by the NAXIS1 keyword in the FITS header.
 PROCEDURE CALLS:
       AD2XY, EXTAST, GSSSADXY
 REVISON HISTORY:
       written by L. Taylor (STX) from ARCBOX (Boothman)
       modified for Version 2 IDL,                     B. Pfarr, STX, 4/91
       New ASTROMETRY structures               W.Landsman,  HSTX, Jan 94
       Recognize a GSSS header                 W. Landsman June 94
       Added /NORMAL keyword                   W. Landsman Feb. 96
       Use NAXIS1 for postscript if data coords not set,  W. Landsman Aug 96
       Fixed typo for postscript W. Landsman   Oct. 96
       Account for zeropoint offset in postscript  W. Landsman   Apr 97
       Added /DATA, /SECONDS keywords   W. Landsman    July 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/arcbar.pro)


ARCMIN2HEL

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

 Name        : ARCMIN2HEL()

 Purpose     : Convert arcmin from sun centre to heliographic coords.

 Explanation : Converts an (x,y) position given in arcmins relative to the
               solar disk centre to heliographic coordinates for the date
               supplied ( default date = today).

 Use         : IDL> helio = arcmin2hel(xx,yy,date=date)

 Inputs      : xx  -  E/W coordinate in arc minutes relative to sun center
                      (West is positive); can be a vector
               yy  -  S/N coordinate in arc minutes relative to sun center
                      (North is positive); can be a vector

 Opt. Inputs : None

 Outputs     : Function returns a 2xN element vector: [lat, long] in
               degrees, where N is number of elements in XX and YY

 Opt. Outputs: None

 Keywords    : date      -  date/time in any CDS format

               soho      -  if set uses the SOHO view point rather than
                            the Earth.  Note this functionality is
                            duplicated by the system variable SC_VIEW,
                            which in turn is set by the procedures
                            USE_EARTH_VIEW or USE_SOHO_VIEW.

               off_limb  - flag which is true if the coordinates are beyond
                           the solar limb.
               error     - Output keyword containing error message;
                           a null string is returned if no error occurs
               radius    - solar radius value [output in arcmin units]
               no_copy   - input xx and yy arrays are destroyed
		p	  - If specified, override pb0r for p angle
		b0 	  - If specified, override pb0r for b angle
		r0	  - If specified, override pb0r for solar apparent
			    dia:  r0 is the observer's distance from the
			    Sun, in solar radii (one may use "zunits" to
			    convert fron solar radii to, say, kilometers).
		l0	  - If specified, this is the longitude (relative
			    to Earth- or SOHO- central meridian) of the 
			    sub-observer meridian.  Useful for reprojections
			    and locations far from Earth.
		sphere    - If set, return longitude over the whole sphere
			    rather than mirror reflecting around the 
			    lon=90 meridian.  (Useful for nonzero B angle)

 Calls       : PB0R
               ANYTIM2UTC

 Restrictions: If the supplied coordinates are outside the solar disk, the
               region is projected onto the limb.

 Side effects: None

 Category    : Util, coord

 Prev. Hist. : Original by J P Wuelser.

 Written     : CDS version by C D Pike, RAL, 6 Sept 93

 Modified    : Converted to use CDS time and pb0r routines, CDP, 17-May-94
		Version 3, William Thompson, GSFC, 14 November 1994
                  Modified .DAY to .MJD
               Version 4, July 31, 1995, Liyun Wang, GSFC/ARC
                  Vectorized the input parameters (i.e., the two
                     input parameters can be vectors)
                  Added ERROR keyword
               Version 5, 26-Feb-96, CDP
                  Added SOHO keyword.
               Version 6, March 11, 1996, Liyun Wang, GSFC/ARC
                  Modified such that point of view can be changed to
                     SOHO if the env variable SC_VIEW is set to 1
               Version 7, March 13, 1996, Liyun Wang, GSFC/ARC
                  Allow scalar and vector input.
               Version 8, August 2, 1996, Liyun Wang, NASA/GSFC
                  Error from calling PB0R is ignored
               Version 9, June 10, 1997, Liyun Wang, NASA/GSFC
                  Fixed a bug that occurs when trying to avoid off-limb points
               Version 10, Sept 10, 1997, Zarro SAC/GSFC
                  Added RADIUS output keyword
               Version 11, Oct 7, 1997, Zarro SAC/GSFC
                  Added some calls to TEMPORARY
		Version 12, November 4, 1997 Giulio Del Zanna, UCLAN, UK
		   corrected the fact that the DATE format was changed
		   inside the routine (e.g. string to a structure)
		Version 13, February 20, 1998, Zarro (SAC/GSC)
		   - Added more error checking and improved memory management
                  - Added /NO_COPY (use with care)
		Version 14, Dec 17, 1998, DeForest (Stanford/GSFC)
		   - Added PB0R overrides on a keyword-by-keyword basis
		Version 15, 6-Jan-1999, DeForest (Stanford/GSFC)
		   - Added keyword override to remove mirror-image behavior
		     around the azimuthal meridian.
               Version 16, 7-Jan-99, Zarro (SMA/GSFC)
                  - Made use of SOHO keyword more logical
		Version 17, 8-Apr-99, DeForest (Stanford/GSFC)
		   - Added L0 keyword; renamed R -> R0 to avoid conflict with
			"radius" keyword (FDWIM).
		Version 17.5, 8-Apr-99, DeForest (Stanford/GSFC)
		   - Modified interpretation of R0 keyword to agree with 
		 	hel2arcmin:  observer distance from Sun.
		Version 17.6, 9-Apr-99, Andretta (CUA/GSFC)
                  - Corrected a bug in the distance-radius conversion

 Version     : Version 17.6

(See /host/bluemoon/usr2/idllib/ssw/allpro/arcmin2hel.pro)


ARR2GIF

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

 Name        : ARR2GIF

 Purpose     : Write images to a series of GIF files

 Category    : imaging

 Explanation : 

 Syntax      : IDL> arr2gif,images,file

 Examples    :

 Inputs      : IMAGES = times series of 2-d images (x,y,t)

 Opt. Inputs : None

 Outputs     : FILE = filename with listing of individual GIF filenames

 Opt. Outputs: None

 Keywords    : XSIZE,YSIZE = new sizes to CONGRID images
               FILE = filename with listing of individual GIF filenames
               OUT_DIR = output directory for GIF files (def=curr or home)
               INTERP= smooth images

 History     : Written 22 March 1997, D. Zarro, ARC/GSFC

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/arr2gif.pro)


ARR2STR

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SSW     
                   
 Name        : ARR2STR()
               
 Purpose     : Convert an array to a delimited string.
               
 Explanation : 
               
 Use         : IDL> s = arr2str(array,'-')
                    s = arr2str(array,delim='-')
    
 Inputs      : arr  -  input data array which is to be converted
                       to a simple string.
               
 Opt. Inputs : delim - an alternative positional parameter to specify the
                       delimiter.
               
 Outputs     : Function returns a simple string using the delimiter to 
               separate the elements of the original array.
               
 Opt. Outputs: 
               
 Keywords    : delimiter  -  specify the delimiter to be used, default 
                             delimiter is ','
		trim_str   -  If set, call STRTRIM when converting to string
		compress   -  If set, call STRCOMPRESS after converting
               no_duplicate  If set, inhibit having string with consecutive
                             delimiters such as // 

 Calls       :
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, string
               
 Prev. Hist. : Sam Freeland 11/19/91 
               (Various Slf,MDM,DP mods)

 Written     : Sam Freeland 
               
 Modified    : Version 2, William Thompson, GSFC, 15 June 1995
			Added /TRIM keyword to be compatible with Yohkoh
			version.  Added /COMPRESS keyword
               Version 2.1, Sam Freeland, SSW merge
               Version 3, Zarro (SAC/GSFC) - added /NO_DUPLICATE &
                       renamed TRIM keyword to TRIM_STR to avoid
                       name conflict with TRIM function

 Version     : Version 3

(See /host/bluemoon/usr2/idllib/ssw/allpro/arr2str.pro)


ARRAY_JHUAPL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARRAY_JHUAPL
 PURPOSE:
       Force given argument to be an array.
 CATEGORY:
 CALLING SEQUENCE:
       y = array_jhuapl(x)
 INPUTS:
       x = input which may be an array or scalar.      in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = out which is an array.                      out
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, JHU-APL,  28 Jan, 1986.
       Converted to SUN 14 Aug, 1989 --- R. Sterner.
	30-Apr-92 (MDM) - Renamed from "array.pro" to "array_jhuapl.pro"

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

(See /host/bluemoon/usr2/idllib/ssw/allpro/array_jhuapl.pro)


ARRAY_MATCH

[Previous Routine] [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 /host/bluemoon/usr2/idllib/ssw/allpro/array_match.pro)


ARRAY_XOR

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : ARRAY_XOR()
               
 Purpose     : Returns the XOR elements of two arrays.
               
 Explanation : Given 2 arrays it returns an array containing the elements
               that are in either array but not both.
               
 Use         : IDL> x = [0,1,2,3,4,8]
               IDL> y = [2,3,4,9]
               IDL> print,array_xor(x,y)   -->  0 1 8 9
    
 Inputs      : x,y  - two arrays (any type ecept complex and structure)
               
 Opt. Inputs : None
               
 Outputs     : Function returns exclusive array
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : FIND_COMMON, REST_MASK

 Common      : None
               
 Restrictions: Input arrays must be same type
               
 Side effects: None
               
 Category    : Util
               
 Prev. Hist. : None

 Written     : C D Pike, RAL.  22-Apr-97
               
 Modified    : 

 Version     : Version 1, 22-Apr-97

(See /host/bluemoon/usr2/idllib/ssw/allpro/array_xor.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/ssw/allpro/arrow.pro)


ARROW2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   arrow2
 PURPOSE:
   Wrapper routine for IDL user library ARROW routine.

   arrow2 works with tv2 to provide easier PostScript placement.

 CALLING SEQUENCE:
   arrow2, x0, y0, x1, y1                         ; Provide head & tail coordinates
   arrow2, x0, y0, angle, length, /angle          ; x0,y0 = arrow's tail
   arrow2, x0, y0, angle, length, /angle, /head   ; x0,y0 = arrow's head
   arrow2, x0, y0, angle, length, /angle, /tv2    ; Assume tv2,/init has been 
                                                    previously called (see below).
 INPUTS:
   x0, y0	- Defines the tail of the arrow, or if /head is set, the
		  head of the arrow.
   x1, y1	- Defines the head of the arrow, or if /head is set, the
		  the tail.

   angle	- if /angle is set, is the angle in degrees, counter 
                 clockwise.  0.0 points to the right.
   length	- If /angle is set, is the length of the arrow in device, 
                 data or normalized coordinates.

 OPTIONAL INPUT PARAMETERS:
   /angle	- If set, 3rd and 4th parameters are the angle and length
		  of the arrow, respectively.
   /head	- To change x0, y0 to define the head of the arrow.

   HSIZE, COLOR, HTHICK, THICK, SOLID are the same as in ARROW

    DATA 	- if set, implies that coordinates are in data coords.
    NORMALIZED - if set, coordinates are specified in normalized coords.
    DEVICE	- if set, coordinates are specified in device coords.

    /tv2	- if set, assumes tv2,/init, xsiz_pix, ysiz_pix has
		  be previously called.  In this case, /data, /norm and
		  and /dev will have no effect, since /dev will be assumed for
		  X-output and the pseudo window pixel coordinates will be 
                 assumed for PostScript output.  

 COMMON BLOCKS:
  tv2_blk (which is created by tv2,/init).

 METHOD:
  arrow2 requires the PostScript plotting size to be set by a previous call
  to tv2/init,xsiz_pix,ysiz_pix (see the document header of tv2 for more 
  information), which stores various parameters in common.

 See also the following routines:    
		tv2, ocontour, draw_grid (sxt_grid), plots2

 MODIFICATION HISTORY:
  23-Jan-1996, J. R. Lemen (LPARL), Written.

(See /host/bluemoon/usr2/idllib/ssw/allpro/arrow2.pro)


ARROWS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARROWS
 PURPOSE:
       To display "weathervane" directional arrows on an astronomical image 
 EXPLANATION:
	Overlays a graphic showing orientation of North and East.

 CALLING SEQUENCE:
       arrows,h, [ xcen,ycen, THICK = , CHARSIZE = , ARROWLEN = , COLOR = ,
				/NOTVERTEX, FONT =  ]

 INPUTS:
       h - FITS or STSDAS header array, must include astrometry

 OPTIONAL INPUTS:
       xcen,ycen - numeric scalars, specifying the center position of
		arrows.   Position in device units unless the /NORMALIZED 
		keyword is specified.   If not supplied, then ARROWS
		will prompt for xcen and ycen

 OPTINAL KEYWORD INPUTS:
       thick     - line thickness, default = 1.0, floating point scalar
       charsize  - character size, default = 2.0, floating point scalar
       arrowlen  - length of arrows in terms of normal Y size of vector-drawn
                     character,  default  = 3.5, floating point scalar
       color     - color that the arrows and NE letters should be.  Default
                    value is !P.COLOR
       NotVertex - Normally (historically) the specified xcen,ycen indicated
                    the position of the vertex of the figure.  If this
                    keyword is set, the xcen,ycen coordinates refer to a sort
                    of 'center of mass' of the figure.  This allows the
                    figure to always appear with the area irregardless of
                    the rotation angle.
	Normal - if this keyword is set and nonzero, the input center 
		(xcen,ycen) is taken to be in normalized coordinates.   The
		default is device coordinates.
	Data - if this keyword is set and nonzero, the input center (xcen,
		ycen) is understood to be in data coordinates
	font - IDL vector font number (1-20) to use to display NE letters.
		For example, set font=13 to use complex italic font.
 OUTPUTS:
       none
 EXAMPLE:
	Draw a weathervane at (400,100) on the currently active window, 
	showing the orientation of the image associated with a FITS header, hdr

	IDL> arrows, hdr, 400, 100

 METHOD:
	Uses EXTAST to EXTract ASTrometry from the FITS header.   The 
	directions of North and East are computed and the procedure
	ONE_ARROW called to create the "weathervane".

 PROCEDURES USED:
	EXTAST - Extract astrometry structure from FITS header
	ONE_ARROW - Draw a labeled arrow	
 REVISON HISTORY:
       written by B. Boothman 2/5/86 
       Recoded with new procedures ONE_ARROW, ONE_RAY.  R.S.Hill,HSTX,5/20/92
       Added separate determination for N and E arrow to properly display
         arrows irregardless of handedness or other peculiarities and added
         /NotVertex keyword to improve positioning of figure. E.Deutsch 1/10/93
	Added /DATA and /NORMAL keywords W. Landsman      July 1993
	Recognize GSSS header    W. Landsman       June 1993
	Added /FONT keyword W. Landsman           April 1995
	Modified to work correctly for COLOR=0  J.Wm.Parker, HITC   1995 May 25
	Work correctly for negative CDELT values   W. Landsman   Feb. 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/arrows.pro)


ASCII

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

 PURPOSE: 
       Print ASCII characters based on its numerical decimal value.

 EXPLANATION:
       
 CALLING SEQUENCE: 
       ASCII [,/ext]

 INPUTS:
       None.
 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       EXT -- Prints only extended ASCII characters.

 CALLS:
       None.

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 MODIFICATION HISTORY:
       Written September 12, 1994, by Liyun Wang, GSFC/ARC
       
 VERSION: Version 1, September 12, 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/ascii.pro)


ASK

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

 Name        :	
	ASK
 Purpose     :	
	Gets a single letter response from the keyboard.
 Explanation :	
	Gets a single letter response from the keyboard.  Only responses in the
	array VALID are allowed.  The prompt string is printed, and GET_KBRD is
	called to read in the result.
 Use         :	
	ASK, PROMPT, ANSWER  [, VALID ]

	Example:  ASK, 'Do you want to continue? ', ANSWER

 Inputs      :	
	PROMPT	= Prompt to ask for input.
 Opt. Inputs :	
	VALID	= List of valid responses, put together into one character
		  string.  If not passed, then "YN" is assumed.  All characters
		  are converted to uppercase.
 Outputs     :	
	ANSWER	= Single letter answer.  This is always returned as uppercase.
 Opt. Outputs:	
	None.
 Keywords    :	
	FONT	= Font to use when displaying the prompt widget.  Only
		  meaningful when the prompt is displayed in a text widget
		  (currently only in IDL for Windows).  If not passed, then the
		  first available 20 point font is used.
 Calls       :	
	SETPLOT
 Common      :	
	None.
 Restrictions:	
	Any non-printing key will act just like the return key when used with
	IDL for Microsoft Windows.  This includes the delete and backspace
	keys, which otherwise would erase the previous selected character.
 Side effects:	
	None.
 Category    :	
	Utilities, User_interface.
 Prev. Hist. :	
	W.T.T., Oct. 1989.
	William Thompson, 11 May 1993, converted to use widgets when available.
		This makes it compatible with IDL for Windows, together with a
		small change for carriage returns.  Also added FONT keyword.
	William Thompson, 22 June 1993, converted to use widgets only with IDL
		for Windows.
 Written     :	
	William Thompson, GSFC, October 1989.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 11-Aug-1997
		Changed to be more compatible with IDL v4.
 Version     :	
	Version 2, 11-Aug-1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/ask.pro)


ASMOOTH

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

 Name        :	ASMOOTH()

 Purpose     :	Smooths a one or two-dimensional array.

 Category    :	Image-processing, SU:SERTSIM, Class3

 Explanation :	Does the same thing as the IDL built-in SMOOTH function, except
		that:

		1.  The effect tapers off at the edges of the array, instead
		    of abruptly stopping as in SMOOTH.

		2.  Missing pixels are handled.

 Syntax      :	Result = ASMOOTH( ARRAY, WIDTH )

 Examples    :	

 Inputs      :	ARRAY	= One or two-dimensional array to be smoothed.
		WIDTH	= Width of the smoothing box.

 Opt. Inputs :	None.

 Outputs     :	The result of the function is the smoothed array.

 Opt. Outputs:	None.

 Keywords    :	MISSING	= The value representing missing pixels.

 Calls       :	GET_IM_KEYWORD

 Common      :	None.

 Restrictions:	ARRAY must be one or two-dimensional.

 Side effects:	None.

 Prev. Hist. :	Originally written for the SERTS project, February 1993.

 History     :	Version 1, 14-Aug-1998, William Thompson, GSFC
		Version 2, 29-Oct-1998, William Thompson, GSFC
			Fixed bug at edges of array when MISSING is not used.
		Version 3, 02-Dec-1998, William Thompson, GSFC
			Fixed bug when WIDTH is even, and MISSING not passed.

 Contact     :	WTHOMPSON

(See /host/bluemoon/usr2/idllib/ssw/allpro/asmooth.pro)


ASTDISP

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

 PURPOSE:
	Print astronomical and pixel coordinates in a standard format
 EXPLANATION:
	This procedure (ASTrometry DISPlay) prints the astronomical and
	pixel coordinates in a standard format.  X,Y must be supplied.  RA,DEC
	may also be supplied, and a data number (DN) may also be 
	supplied.   With use of the Coords= keyword, a string containing the 
	formatted data can be returned in addition or instead (with /silent) 
	of printing.

 CALLING SEQUENCE:
	ASTDISP, x, y, [Ra, Dec, DN, COORD = , /SILENT ]

 INPUT:
	X  - The X pixel coordinate(s), scalar or vector
	Y  - The Y pixel coordinate(s), scalar or vector

 OPTIONAL INPUTS:
	RA -  Right Ascention in *degrees*, scalar or vector
	DEC - DEClination in *degrees*, scalar or vector (if RA is supplied, DEC must also be supplied)
	DN -  Data Number or Flux values

	Each of the inputs X,Y, RA, DEC, DN should have the same number of 
		elements
 OPTIONAL INPUT KEYWORDS:
	SILENT    Prevents printing.  Only useful when used with Coords=
 OUTPUT:
	Printed positions in both degrees and sexigesimal format
	All passed variables remain unchanged
 OPTIONAL KEYWORD OUTPUT:
	COORDS    Returns the formatted coordinates in a string
 PROCEDURES CALLED:
	ADSTRING - used to format the RA and Dec
 HISTORY:
	10-AUG-90 Version 1 written by Eric W. Deutsch
	20-AUG-91 Converted to standard header.  Vectorized Code.  E. Deutsch
	20-NOV-92 Added Coords= and /silent.  E.Deutsch

(See /host/bluemoon/usr2/idllib/ssw/allpro/astdisp.pro)


ASTRMFIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ASTRMFIX
 PURPOSE:
	Calculate a rough HST WFPC or FOC astrometry solution
 EXPLANATION:
	This program will calculate a rough HST WFPC or FOC astrometry solution
	using the keyword PSANGLEV3 which gives the angle of the V3 axis of
	HST.    Called by WFPCREAD.

 CALLING SEQUENCE:
	AstrmFix, hdr, chip

 INPUT - OUTPUT:
	hdr - FITS header (string array) from either WFPC or FOC.   Header will
		be updated with rough astrometry 

 INPUT:	
	chip - Scalar (typically 0-3) giving the WFPC chip to read.

 HISTORY:
	??-???-???? Written by Eric W. Deutsch
	22-OCT-1992 Changed all calculations to double precision. (E. Deutsch)
	22-OCT-1992 Updated PC Pixel size of 0.04389 from WFPC IDT OV/SV manual(EWD)
	22-OCT-1992 Updated WF Pixel size of 0.1016 from WFPC IDT OV/SV manual(EWD)
	11-JAN-1993 Added warning message and changed CD001001... to CD1_1... (EWD)

(See /host/bluemoon/usr2/idllib/ssw/allpro/astrmfix.pro)


ASTRO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     ASTRO
 PURPOSE:
     Interactive utility for precession and coordinate conversion.

 CALLING SEQUENCE:
     ASTRO, [ selection, EQUINOX =, /FK4 ]

 OPTIONAL INPUT:
      SELECTION - Scalar Integer (0-6) giving the the particular astronomical
              utility to be used.  (0) Precession, (1) RA, Dec (2000) to Galactic 
              coordinates, (2) Galactic to RA,Dec (2000) (3) RA,Dec (2000) to 
              Ecliptic, (4) Ecliptic to RA, Dec, (5) Ecliptic to Galactic, (6) Galactic
              to Ecliptic.   Program will prompt for SELECTION if this 
              parameter is omitted.

 OPTIONAL KEYWORD INPUT:
       EQUINOX - numeric scalar specifying the equinox to use when converting 
               between celestial and other coordinates.    If not supplied, 
               then the RA and Dec will be assumed to be in EQUINOX J2000.   
               This keyword is ignored by the precession utility.   For 
               example, to convert from RA and DEC (J1975) to Galactic 
               coordinates:

               IDL> astro, 1, E=1975
       /FK4 - If this keyword is set and nonzero, then calculations are done
              in the FK4 system.    For example, to convert from RA and Dec
              (B1975) to Galactic coordinates

               IDL> astro,1, E=1975,/FK4 
 METHOD:
      ASTRO uses PRECESS to compute precession, and EULER to compute
      coordinate conversions.   The procedure GET_COORDS is used to
      read the coordinates, and ADSTRING to format the RA,Dec output.

 NOTES:
      (1) ASTRO temporarily sets !QUIET to suppress compilation messages and
      keep a pretty screen display.   

      (2) ASTRO was changed in December 1998 to use J2000 as the default 
      equinox, **and may be incompatible with earlier calls.***
      
      (3) A nice online page for coordinate conversions is available at
       http://heasarc.gsfc.nasa.gov/cgi-bin/Tools/convcoord/convcoord.pl   
 PROCEDURES USED:
      Procedures: GET_COORDS, EULER       Function: ADSTRING
 REVISION HISTORY
      Written, W. Landsman November 1987
      Code cleaned up       W. Landsman   October 1991
      Added Equinox keyword, call to GET_COORDS, W. Landsman   April, 1992
      Allow floating point equinox input J. Parker/W. Landsman  July 1996
      Make FK5 the default, add FK4 keyword

(See /host/bluemoon/usr2/idllib/ssw/allpro/astro.pro)


ASTROLIB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ASTROLIB
 PURPOSE:
	Add the non-standard system variables used by the IDL Astronomy Library
 EXPLANATION: 
	Also defines the environment variable or VMS 
	logical ASTRO_DATA pointing to the directory containing data files 
	associated with the IDL Astronomy library (system dependent).

 CALLING SEQUENCE:
	ASTROLIB

 INPUTS:
	None.

 OUTPUTS:
	None.

 METHOD:
	The non-standard system variables !PRIV, !DEBUG, !TEXTUNIT, and 
	!TEXTOUT are added using DEFSYSV.

 REVISION HISTORY:
	Written, Wayne Landsman, July 1986.
	Use DEFSYSV instead of ADDSYSVAR           December 1990

(See /host/bluemoon/usr2/idllib/ssw/allpro/astrolib.pro)


ATIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	ATIME
 PURPOSE:
	Convert argument UT to string of format YY/MM/DD, HHMM:SS.XXX or
	YY/MM/DD, HH:MM:SS.XXX, if PUB is set
 CALLING SEQUENCE:
	RESULT = ATIME(UT[,/PUB,/yohkoh])
 INPUTS:
	UT  - Time to convert to string, in any representation
	      double precision seconds since 79/1/1, 0000:00.000
	      7XN integer
	      2XN longword [msod, ds79]
             Structure with .time and .day
	      See ANYTIM for allowed types
 OPTIONAL INPUTS:
	/PUB - Resulting string will have a colon (:) between hours and minutes
		using HXRBS format
	/Yohkoh - Forces Yohkoh date format DD-mon-YY HH:MM:SS.MSC
	/hxrbs  - Forces HXRBS date pub format yy/mm/dd, hh:mm:ss.xxx
		  same effect as /pub
	/nopub  - Forces HXRBS date format w 1 colon, yy/mm/dd, hhmm:ss.xxx
	/date   - return only the calendar date component of the string, i.e. yy/mm/dd
	/time   - return only the time portion of the string, i.e. hh:mm:ss.xxx
	NB, these style booleans may be changed in the code and returned 
	that way if you haven't used the /keyword syntax.

 MODIFICATION HISTORY:
	Written by Richard Schwartz for IDL Version 2, Feb. 1991
	Modified to vectors 7/9/92, RAS
	" uses DAYCNV.PRO from IDL Astronomy Library
	" uses f_atime.pro to format the output
	" preserves dimensionality of input array, vectors, and scalars, 8/10/92
	Yohkoh keyword/format, 30-apr-93, ras
	Added more style control, Yohkoh/HXRBS, 3-Nov-93
	29-Nov-93, Protect against OSF bug in total, ras
	14-Dec-93 (MDM) - Uncommented ATIME_FORMAT line
	5-jan-94, added time and date keywords, ras
	3-mar-94, added error keyword
       RAS 8-mar-94 - protect against strings of the form 14-Feb-93 24:00:00
       15-May-98 (FZ)  - Changed loop variable i to long

(See /host/bluemoon/usr2/idllib/ssw/allpro/atime.pro)


ATMOS

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SDAC
                   
 Name        : ATMOS
               
 Purpose     : This function returns the X-ray cross-sections for the Earth's
	atmosphere in units of cm2/gm
               
 Category    : XRAY, UTIL
               
 Explanation : Using the accepted concentrations of Nitrogen, Oxygen, and Argon
	together with the cross-sections available through xsec.pro, the cross-section
	is computed vs energy from 1.00001 to 999.999 keV.
               
 Use         :  cross_section = Atmos( Energy )
    
 Inputs      :  Energy - scalar or vector in units of keV. 1.00001 to 999.999 keV.
               
 Opt. Inputs : Numberfrac - Array of three numbers totaling 1 for the relative
	percent compositon by weight of N, O, and Ar.
               
 Outputs     : Returns the cross-section in units of cm2/gm.

 Opt. Outputs: None
               
 Keywords    : Type - A string with values 'PE'-photoelectric, 'SI'-Compton scattering,
		'SC'- elastic scattering.  See xsec.pro for more details.

 Calls       : XSEC, CHECKVAR, COEFDATA

 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Written, RAS, ~1988

 Modified    : Version 2, Revised for SSW, RAS, richard.schwartz@gsfc.nasa.gov, 20-jul-1997.

(See /host/bluemoon/usr2/idllib/ssw/allpro/atmos.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    : 
	MISSING	= Value signifying missing pixels.  Any pixels with this value
		  are not included in the average.  If there are no non-missing
		  pixels, then MISSING is returned.
 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 2, William Thompson, GSFC, 3 February 1996
		Added missing keyword.
 Version     : 
	Version 2, 3 February 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/average.pro)


AVG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AVG
 PURPOSE:
	Return the average value of an array, or 1 dimension of an array
 EXPLANATION:
	Calculate the average value of an array, or calculate the average
	value over one dimension of an array as a function of all the other
	dimensions.

 CALLING SEQUENCE:
	RESULT = AVG( ARRAY, [ DIMENSION ] )

 INPUTS:
	ARRAY = Input array.  May be any type except string.

 OPTIONAL INPUT PARAMETERS:
	DIMENSION = Optional dimension to do average over, scalar

 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 = AVG(A,1) 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

 RESTRICTIONS:
	Dimension specified must be valid for the array passed; otherwise the
	input array is returned as the output array.
 PROCEDURE:
	AVG(ARRAY) = TOTAL(ARRAY)/N_ELEMENTS(ARRAY) when called with one
	parameter.
 MODIFICATION HISTORY:
	William Thompson	Applied Research Corporation
	July, 1986		8201 Corporate Drive
				Landover, MD  20785
       Converted to Version 2      July, 1990
       Replace SUM call with TOTAL    W. Landsman    May, 1992

(See /host/bluemoon/usr2/idllib/ssw/allpro/avg.pro)


AVG_WO_CR

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

 Name        :	AVG_WO_CR()

 Purpose     :	Average together multiple images, ignoring cosmic rays

 Category    :	Class3, Analysis

 Explanation :	Averages an array over one of it's dimensions.  The average is
		done such that any pixels which are more than 3 sigma above the
		rest of the pixels making up that average are not counted in
		the average.

 Syntax      :	Result = AVG_WO_CR(ARRAY, DIMENSION, MISSING=MISSING)

 Examples    :	Suppose that A represented a series of three exposures at the
		same location, and had the dimensions (100,100,3).  Also
		suppose that values of -1 represent missing pixels.  Then the
		command

			B = AVG_WO_CR(A,3,MISSING=-1)

		would return an array of (100,100), representing the average of
		the three exposures.  Any pixels in B where there was a cosmic
		ray hit in one of the exposures in A, would only be an average
		of the other two exposures in A.

 Inputs      :	ARRAY	  = Array to be averaged.
		DIMENSION = Dimension to average over.

 Opt. Inputs :	None.

 Outputs     :	The result of the function is the average array.  It has one
		fewer dimension than the input array.

 Opt. Outputs:	None.

 Keywords    :	MISSING	= Value representing missing pixels.  If not passed, or
			  set with the SETFLAG routine, then the routine
			  assigns it's own value, to use for filtering out
			  pixels containing cosmic ray hits.

		MINSIG	= Minimum value to use when estimating the standard
			  deviation in the pixels.

               NO_AVERAGE = Don't perform the final average, ie return
                            original 3-D array with cosmic ray affected 
                            pixels set to the MISSING value.

 Calls       :	AVERAGE, SIG_ARRAY, GET_IM_KEYWORD

 Common      :	None.

 Restrictions:	A critical assumption is made here that the data being averaged
		over are essentially the same thing.  The routine can only
		recognize cosmic rays which are significantly larger than the
		variation between exposures.

 Side effects:	Computationally intensive.

 Prev. Hist. :	None.

 History     :	Version 1, 26-Mar-1996, William Thompson, GSFC
		Version 2, 11-Apr-1996, William Thompson, GSFC
			Corrected problems when DIMENSION not last in array.
			Added keyword MINSIG
		Version 3, 02-Aug-1996, William Thompson, GSFC
			Pay attention to MISSING value set with SETFLAG.

               Version 4, 08-Aug-96, CDP, Include NO_AVERAGE keyword

 Contact     :	WTHOMPSON

(See /host/bluemoon/usr2/idllib/ssw/allpro/avg_wo_cr.pro)


AVOID_SPIKES

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	avoid_spikes
PURPOSE:
	Return the subscript list of data values which don't have spikes
SAMPLE CALLING SEQUENCE:
	ss = avoid_spikes(yarr, nss)
INPUT:
	yarr	- the input array
OUTPUT:
	ss	- the list of subscripts which are ok
	nss	- the number of points which are ok
HISTORY:
	Written 29-May-96 by M.Morrison
	10-Jun-96 (MDM) - Put in protection for problem data (median=0)
	10-Jun-96 (MDM) - Added thresh keyword
	28-Jun-96 (MDM) - Modified logic since it did not protect against
			  positive spikes (it only protected against
			  negative spikes).  It removes twice as many
			  points now.

(See /host/bluemoon/usr2/idllib/ssw/allpro/avoid_spikes.pro)


A_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	A_b
 PURPOSE:
	Compute B band interstellar extinction according to the RC2.
 EXPLANATION:
	The predicted B band extinction is computed as a function of  
	Galactic position  using the 21 parameter function given by
	deVaucouleurs in the 2nd Reference Catalog of Galaxies (RC2).   Note 
	that this formula is no longer used in the RC3 and that reddenings
	are instead obtained from the Burstein-Heiles 21 cm maps.

 CALLING SEQUENCE:
	result = A_b( l2, b2)

 INPUT PARAMETERS
	l2 = Galactic longitude (degrees), scalar or vector
	b2 = Galactic latitude  (degrees), scalar or vector

 OUTPUT PARAMETERS
	RESULT - Interstellar extinction Ab in magnitudes, same number of 
		elements as input l2 and b2 parameters

 NOTES:
	The controversial aspect of the deVaucouleurs reddening curve
	is that it predicts an extinction of about 0.2 at the poles 

	The parameters used here differ from the ones printed in the RC2
	but are the ones actually used for entries in the catalog
	(see Rowan-Robinson 1985) 

 REVISION HISTORY
	Written by R. Cornett and W. Landsman, STX October 1987
	Vectorized code      W. Landsman   STX    December 1992

(See /host/bluemoon/usr2/idllib/ssw/allpro/a_b.pro)


BARYVEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BARYVEL
 PURPOSE:
	Calculates heliocentric and barycentric velocity components of Earth.

 EXPLANATION:
	BARYVEL takes into account the Earth-Moon motion, and is useful for 
	radial velocity work to an accuracy of 	~1 m/s.

 CALLING SEQUENCE:
	BARYVEL, dje, deq, dvelh, dvelb

 INPUTS:
	DJE - (scalar) julian ephemeris date.
	DEQ - (scalar) epoch of mean equinox of dvelh and dvelb. If deq=0
		then deq is assumed to be equal to dje.
 OUTPUTS: 
	DVELH: (vector(3)) heliocentric velocity component. in km/s 
	DVELB: (vector(3)) barycentric velocity component. in km/s

	The 3-vectors DVELH and DVELB are given in a right-handed coordinate 
	system with the +X axis toward the Vernal Equinox, and +Z axis 
	toward the celestial pole.   	

 PROCEDURE CALLED:
	Function PREMAT() -- computes precession matrix

 NOTES:
	Algorithm taken from FORTRAN program of Stumpff (1980, A&A Suppl, 41,1)
	Stumpf claimed an accuracy of 42 cm/s for the velocity.    A 
	comparison with the JPL FORTRAN planetary ephemeris program PLEPH
       found agreement to within about 65 cm/s between 1986 and 1994

 EXAMPLE:
	Compute the radial velocity of the Earth toward Altair on 15-Feb-1994

	IDL> jdcnv, 1994, 2, 15, 0, jd          ;==> JD = 2449398.5
	IDL> baryvel, jd, 2000, vh, vb          
		==> vh = [-17.07809, -22.80063, -9.885281]  ;Heliocentric km/s
		==> vb = [-17.08083, -22.80471, -9.886582]  ;Barycentric km/s

	IDL> ra = ten(19,50,46.77)*15/!RADEG    ;RA  in radians
	IDL> dec = ten(08,52,3.5)/!RADEG        ;Dec in radians
	IDL> v = vb(0)*cos(dec)*cos(ra) + $   ;Project velocity toward star
		vb(1)*cos(dec)*sin(ra) + vb(2)*sin(dec) 

 REVISION HISTORY:
	Jeff Valenti,  U.C. Berkeley    Translated BARVEL.FOR to IDL.
	W. Landsman, Cleaned up program sent by Chris McCarthy (SfSU) June 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/baryvel.pro)


BASELINE

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

 Name        :	BASELINE()

 Purpose     :	Returns baseline value of the input array.

 Category    :	Class3, Analysis

 Explanation :	This function estimates the baseline value of the input array.
		This is determined by rejecting all points more than two sigma
		above the average value.  A reiteration is performed until no
		more points are rejected.

		Two assumptions are made about the data in deriving the
		baseline:

			1.  That any signal is above the baseline,
			    i.e. positive.

			2.  That some subset of points in the input array have
			    no signal, and fluctuate around the average
			    baseline value.

		Examples of the use of this routine include removing readout
		bias levels from CCDs, and removing film fog levels from
		microdensitometered data.

 Syntax      :	Result = BASELINE( ARRAY  [, A_SIG ])

 Examples    :	ARRAY = ARRAY - BASELINE(ARRAY)

 Inputs      :	ARRAY = An input array of values.

 Opt. Inputs :	None.

 Outputs     :	The result of the function is the baseline value.  This is a
		single scalar value.  This routine cannot be used for data
		with a varying (e.g. linear) baseline.

 Opt. Outputs:	A_SIG	= The standard deviation of the points used to
			  calculate the baseline value.

 Keywords    :	MISSING	= Value flagging missing pixels.  These points are not
			  used to calculate the baseline.  If all the points
			  have this value, then it is returned as the value of
			  the function.

 Calls       :	AVERAGE, STDEV

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	Originally written for the SERTS project.

 History     :	Version 1, 22-Jan-1996, William Thompson, GSFC.
			Incorporated into CDS library
			Added MISSING keyword.
		Version 2, 18-Feb-1996, William Thompson, GSFC
			Fixed bug with A_SIG when all values are missing.
		Version 3, 05-Apr-1996, William Thompson, GSFC
			Fixed bug with A_SIG when there is only one valid
			pixel.

 Contact     :	WTHOMPSON

(See /host/bluemoon/usr2/idllib/ssw/allpro/baseline.pro)


BASE_INTERP

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

 Name        :	BASE_INTERP()

 Purpose     :	Interpolate to the base of a curve, ignoring outliers.

 Category    :	Class4, Interpolation

 Explanation :	Makes a polynomial (by default linear) fit to the data, and
		removes any points which are far from the fit, before
		performing the interpolation.

 Syntax      :	Result = BASE_INTERP(Y, X, X0)

 Examples    :	

 Inputs      :	Y  = Array of Y values to interpolate to.
		X  = Array of positions corresponding to the Y array.
		X0 = Array of new positions to interpolate the array to.

 Opt. Inputs :	None.

 Outputs     :	The result of the function is the interpolated array.

 Opt. Outputs:	None.

 Keywords    :	WEIGHTS	= Array of weights to use in fitting the data.  The
			  default is to use equal weights for all points.
		MINSIG	= The minimum value of sigma to use in rejecting
			  points.  Points which are 2*SIGMA away from the
			  fitted curve are ignored.
		ORDER	= Polynomial order to fit to.  The default is 1.

 Calls       :	POLYFITW, INTERPOL

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	None.

 History     :	Version 1, 18-Jun-1996, William Thompson, GSFC
		Version 2, 11-Dec-1997, William Thompson, GSFC
			Don't perform fit unless there are enough points.

 Contact     :	WTHOMPSON

(See /host/bluemoon/usr2/idllib/ssw/allpro/base_interp.pro)


BELL

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : Bell
               
 Purpose     : To ring the terminal bell a specified number of times.
               
 Explanation : Prints ascii code for the terminal bell.
               
 Use         : IDL> bell, n
    
 Inputs      : n   -  number of bell rings required  
               
 Opt. Inputs : As above
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
               
 Restrictions: None
               
 Side effects: Noise
               
 Category    : Utilities, user
               
 Prev. Hist. : None

 Written     : C D Pike, RAL,  31 March 1993
               
 Modified    : 

 Version     : Version 1

(See /host/bluemoon/usr2/idllib/ssw/allpro/bell.pro)


BELLS

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BELLS()
               
 Purpose     : Fits bell splines to data array.
               
 Explanation : Provides a flexible way to 'draw' a curve through a set of 
               data.  The interpolating line's tautness is controlled by the
               number of splines fitted.
               
 Use         : IDL> yapprox = bells(x,y,xapprox,nspline)
    
 Inputs      : x,y - data arrays
               xapprox - x values at which data are to be approximated (can
                         be same array as x.
               nspline - number of splines to fit, small number = taut string
               
 Opt. Inputs : None
               
 Outputs     : Function returns approximated values at xapprox
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Data analysis
               
 Prev. Hist. : From an old Yohkoh routine from an older C program which 
               was copied from an even older Fortran program by J Bok of the 
               Institute of Physics, The Charles University, Prague.

 Written     : C D Pike.  RAL, 22-Nov-96
               
 Modified    : 

 Version     : version 1, 22-Nov-96

(See /host/bluemoon/usr2/idllib/ssw/allpro/bells.pro)


BIGPICKFILE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BIGPICKFILE
               
 Purpose     : Pickfile, but with more space for everything.
               
 Explanation : See below.
               
 Use         : See below.
    
 Inputs      : See below.
 
 Opt. Inputs : See below.
               
 Outputs     : See below.
               
 Opt. Outputs: See below.
               
 Keywords    : See below.

 Calls       : See below.

 Common      : See below.
               
 Restrictions: See below.
               
 Side effects: See below.
               
 Category    : See below.
               
 Prev. Hist. : See below.

 Written     : See below.
               
 Modified    : Version 1, SVH Haugan, 15 September 1997
                       Made bigger fields.
               Version 2, SVHH, 15 December 1997
                       IDL version 5 fix - will call pickfile for 5.0
                       or later.

 Version     : 2, 15 December 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/bigpickfile.pro)


BIN2DEC

[Previous Routine] [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 /host/bluemoon/usr2/idllib/ssw/allpro/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 /host/bluemoon/usr2/idllib/ssw/allpro/bin2hex.pro)


BINUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	binup
 PURPOSE:
	to rebin data into arbitrary dimensions
 CATEGORY:
       utility
 CALLING SEQUENCE:
	b=binup(a,m1,m2,m3,m4...m10)
 INPUTS:
	a= multidimension array
       m_i = factor by which to rebin i'th dimension
 OPTIONAL INPUT PARAMETERS:
       none
 OUTPUTS:
	rebinned array
 OPTIONAL OUTPUT PARAMETERS:
       none
 SIDE EFFECTS:
       none    
 RESTRICTIONS:
      dimensions of input array must not be greater than 10
 PROCEDURE:
       Uses REBIN function , improved to allow non-integer binning
       e.g. if a=a(n1,n2,n3) then
             b=binup(a,m1,m2,m3) = a(n1*m1,n2*m2,n3*m3) if m > 1
                                 = a(n1/m1,n2/m2,n3/m3) if m <-1
             b=binup(a,2) will increase first dimension by 2
             b=binup(a,-2) will decrease first dimension by 2 (i.e. double bin)
 MODIFICATION HISTORY:
	Written by DMZ (ARC) July 1990

(See /host/bluemoon/usr2/idllib/ssw/allpro/binup.pro)


BITS

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	bits
PURPOSE:
	Given a byte or integer, return a vector of 8 or 16 values
	which are the binary representation of the value.
INPUT:
	invalue	- The byte or integer value to check
OUTPUT:
	bitarr	- The 8-element array with values set
		  if the bit is set
HISTORY:
	Written 1988 by M.Morrison
	13-Nov-92 (MDM) - Modified to allow integer*2 values
			  and to allow an array of values.
	 7-Apr-94 (MDM) - Allow integer*4 values
	15-Aug-94 (MDM) - Corrected error from 7-Apr-94 mod which
			  did not allow an array of inputs

(See /host/bluemoon/usr2/idllib/ssw/allpro/bits.pro)


BITS2

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	bits2
PURPOSE:
	Given a byte or integer, return a vector of 8 or 16 values
	which are the binary representation of the value.
INPUT:
	invalue	- The byte or integer value to check
OUTPUT:
	bitarr	- The 8-element array with values set
		  if the bit is set
HISTORY:
	Written 19-dec-1996, RAS after BITS by M.Morrison
	but correcting negative integer problems and returning
	32 byte arrays for longwords regardless of maximum value
	

(See /host/bluemoon/usr2/idllib/ssw/allpro/bits2.pro)


BLANK()

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

 NAME:
       BLANK()

 PURPOSE:
       To make a blank string with a given length

 EXPLANATION:

 CALLING SEQUENCE:
       Result = blank(length)

 INPUTS:
       LENGTH - length of resultant string; if missing a null string is
                returned 

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       None.

 CALLS:
       None.

 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Util, string

 PREVIOUS HISTORY:
       Written April 12, 1995, Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, GSFC/ARC, April 12, 1995

 VERSION:
       Version 1, April 12, 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/blank.pro)


BLINK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BLINK
 PURPOSE:
	To allow the user to alternatively examine two or more windows within
	a single window.

 CALLING SEQUENCE:
	BLINK, Wndw [, T]

 INPUTS:
	Wndw  A vector containing the indices of the windows to blink.
	T     The time to wait, in seconds, between blinks.  This is optional
	      and set to 1 if not present.  

 OUTPUTS:
	None.

 PROCEDURE:
	The images contained in the windows given are written to a pixmap.
	The contents of the the windows are copied to a display window, in 
	order, until a key is struck.

 EXAMPLE:
	Blink windows 0 and 2 with a wait time of 3 seconds

	IDL> blink, [0,2], 3 

 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 2 May 1990.
	Allow different size windows   Wayne Landsman    August, 1991

(See /host/bluemoon/usr2/idllib/ssw/allpro/blink.pro)


BLINK_IMAGES

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

 Name        : 
	BLINK_IMAGES
 Purpose     : 
	Blinks two images together by modifying the color tables.
 Explanation : 
	A combined image is formed in which the lower bits are assigned to
	ARRAY1 and the higher bits to ARRAY2.  Two color tables are defined
	relative to the current one so that the different images are shown by
	changing between these two color tables.

	A better way to blink together two images on an X-windows display is to
	use the routine XBLINK.

 Use         : 
	BLINK_IMAGES
	BLINK_IMAGES, ARRAY1, ARRAY2
 Inputs      : 
	None required.
 Opt. Inputs : 
	ARRAY1	 = First image to be blinked against the second image.
	ARRAY2	 = Second image.  Must have the same dimensions as the first
		   image.

	If the two arrays are not passed, then it is assumed that the images
	are already displayed, and the program goes directly to loading the
	color tables.

 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	NOSQUARE = If passed, then pixels are not forced to be square.
	NOBOX	 = If passed, then box is not drawn, and no space is reserved
		   for a border around the image.
	SIZE	 = If passed and positive, then used to determine the scale of
		   the image.  Returned as the value of the image scale.  May
		   not be compatible with /NOSQUARE.
	DISABLE  = If set, then TVSELECT not used.
	MISSING	 = Value flagging missing pixels.  These points are scaled to
		   zero.
	CHAR	 = Returns the final character entered from the keyboard.
	NOMESSAGE= If set, then the message explaining about the keys is not
		   printed out.  This is for routines such as MOVE_AND_BLINK,
		   which call BLINK_IMAGES, and want to print out their own message.
 Calls       : 
	EXPTV, GET_IM_KEYWORD, TVSELECT, TVUNSELECT
 Common      : 
	None.
 Restrictions: 
	ARRAY1 and ARRAY2 must have the same dimensions.

	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	The combined image formed from ARRAY1 and ARRAY2 is left on the screen.
	It may look a little strange.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	William Thompson, March 1991.
	William Thompson, April 1992, changed to use TVLCT,/GET instead of
				      common block.
	William Thompson, August 1992, renamed BADPIXEL to MISSING.
 Written     : 
	William Thompson, GSFC, March 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 3-Sep-1997
		Renamed to BLINK_IMAGES
	Version 3, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
 Version     : 
	Version 3, 8 April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/blink_images.pro)


BLINK_MAP

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

 Name        : BLINK_MAP

 Purpose     : blink two maps using XINTERANIMATE

 Category    : imaging

 Explanation : 

 Syntax      : blink_map,map1,map2,_extra=extra

 Examples    :

 Inputs      : MAP1,MAP2 = image map structures

 Opt. Inputs : None

 Outputs     : None

 Opt. Outputs: None

 Keywords    : same as PLOT_MAP

 Common      : None

 Restrictions: First map is used to set plotting scale
               Have to be careful setting keywords.
               For example, to plot the first map on a linear scale
               and the second on a log use:
                IDL> blink_map,m1,m2,log=0,log=1
               Also, pair similar keywords when using different ones:
                IDL> blink_map,m1,m2,log=0,log=1,limb=0,limb=1

 Side effects: None

 History     : Written 4 Jan 1999, D. Zarro, SMA/GSFC

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/blink_map.pro)


BOOST_ARRAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BOOST_ARRAY
 PURPOSE:
	Append one array onto a destination array
 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.
 CATEGOBY:
	Utility
 CALLING SEQUENCE:
	BOOST_ARRAY, DESTINATION, APPEND
 INPUT:
	DESTINATION	= Array to be expanded.
	APPEND		= Array to append to DESTINATION.
 OUTPUTS:
	DESTINATION	= Expanded output array.
 RESTRICTIONS:
	DESTINATION and APPEND have to be either both of type string or both of
	numerical types.

	APPEND cannot have more dimensions than DESTINATION.

 MODIFICATION HISTOBY:
	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.

(See /host/bluemoon/usr2/idllib/ssw/allpro/boost_array.pro)


BOOST_TAG

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

 Name        : BOOST_TAG

 Category    : Utility

 Purpose     :	boost a tag value

 Explanation :	Useful for updating history tags in structures

 Syntax      : IDL> new_struct=boost_tag(struct,value,tag_name)

 Inputs      : STRUCT = structure to modify
               VALUE  = value to boost current value
               TAG_NAME = tag name to boost

 Opt. Inputs : None

 Outputs     : NEW_STRUCT = modified structure

 Opt. Outputs: None

 Keywords    : ERR = error string
               NAME = optional new name for output structure
               QUIET = don't echo messages
               RECURSE = recursively search for tag name

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  13-April-1997,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/boost_tag.pro)


BOXAVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BOXAVE
 PURPOSE:
	Box-average a 1 or 2 dimensional array.  
 EXPLANATION:
	This procedure differs from the intrinsic REBIN function in the 
	following two ways: 

	(1) the box size parameter is specified rather than the output 
		array size
	(2) for INTEGER arrays, BOXAVE computes intermediate steps using REAL*4 
		arithmetic.   This is considerably slower than REBIN but avoids 
		integer truncation

 CALLING SEQUENCE:
	result = BOXAVE( Array, Xsize,[ Ysize ] )     

 INPUTS:
	ARRAY - Two dimensional input Array to be box-averaged.  Array may be 
		one or 2 dimensions and of any type except character.   

 OPTIONAL INPUTS:
	XSIZE - Size of box in the X direction, over which the array is to
		be averaged.  If omitted, program will prompt for this 
		parameter.  
	YSIZE - For 2 dimensional arrays, the box size in the Y direction.
		If omitted, then the box size in the X and Y directions are 
		assumed to be equal

 OUTPUT:
	RESULT - Output array after box averaging.  If the input array has 
		dimensions XDIM by YDIM, then RESULT has dimensions
		XDIM/NBOX by YDIM/NBOX.  The type of RESULT is the same as
		the input array.  However, the averaging is always computed
		using REAL arithmetic, so that the calculation should be exact.
		If the box size did not exactly divide the input array, then
		then not all of the input array will be boxaveraged.

 PROCEDURE:
	BOXAVE boxaverages all points simultaneously using vector subscripting

 NOTES:
	If im_int is a 512 x 512 integer array, then the two statements

		IDL> im = fix(round(rebin(float(im_int), 128, 128)))
	        IDL> im  = boxave( im_int,4)

	give equivalent results.   The use of REBIN is faster, but BOXAVE is
	is less demanding on virtual memory, since one does not need to make
	a floating point copy of the entire array.	

 REVISION HISTORY:
	Written, W. Landsman, October 1986
	Call REBIN for REAL*4 and REAL*8 input arrays, W. Landsman Jan, 1992
	Removed /NOZERO in output array definition     W. Landsman 1995
	Fixed occasional integer overflow problem      W. Landsman Sep. 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/boxave.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 /host/bluemoon/usr2/idllib/ssw/allpro/box_av.pro)


BOX_CRS

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

 Name        : 
	BOX_CRS
 Purpose     : 
	Two-button equivalent of BOX_CURSOR for Microsoft Windows.
 Explanation : 
	Emulates the operation of a variable-sized box cursor (also known as
	a "marquee" selector).  Differs from BOX_CURSOR in that only two mouse
	buttons are used.  This makes it useful for Microsoft Windows, where
	all three buttons are not always available.

	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:

	To move box:	Hold down either the left or middle mouse button while
			the cursor is inside the box, and drag the box to the
			desired position.

	To resize box:	Hold down either the left or middle button mouse while
			the cursor is outside the box, and drag the box to the
			desired size.  The corner nearest the initial mouse
			position is moved.

	To exit:	Press the right mouse button to exit this procedure,
			returning the current box parameters.

 Use         : 
	BOX_CRS, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]
 Inputs      : 
	No required input parameters.
 Opt. Inputs : 
	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.
 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.

 Opt. Outputs: 
	None.
 Keywords    : 
	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.

 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	Works only with window system drivers.
 Side effects: 
	A box is drawn in the currently active window.  It is erased on exit.
 Category    : 
	Utilities, User_interface.
 Prev. Hist. : 
	DMS, April, 1990.
	DMS, April, 1992.  Made dragging more intutitive.
	William Thompson, GSFC, 11 June 1993.
		Changed to use two button operation, selecting moving or
		resizing based on whether or not the cursor is inside or
		outside the box.  Renamed to BOX_CRS.
 Written     : 
	David M. Stern, RSI, April 1990.
 Modified    : 
	Version 1, William Thompson, GSFC, 25 June 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
 Version     : 
	Version 2, 8 April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/box_crs.pro)


BOX_CURSOR

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

 PURPOSE:
       Emulate the operation of a variable-sized box cursor

 EXPLANATION:
       This is a better improved version of BOX_CURSOR, a standard procedure
       from the IDL user library. The added keywords are: COLOR, ANYWHERE,
       EVENT_PRO, and STC4EVENT.

 CATEGORY:
       Interactive graphics.

 CALLING SEQUENCE:
       BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]
                   [, COLOR = color]
 INPUTS:
       No required input parameters.

 OPTIONAL INPUT PARAMETERS:
       X0, Y0, NX, NY - 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. 
       EVENT_PRO      - Name of the procedure to be called when the boxed
                        cursor is manipulated. This procedure must have one
                        and only one positional parameter which is a
                        structure. This structure is passed in with the
                        keyword STC4EVENT and must have at least two tags
                        named X and Y being the cursor position in device
                        pixels.    
       STC4EVENT      - Structure to be processed by the procedure specified
                        by EVENT_PRO. It can have any number of tags, but X
                        and Y tags are required ones. 

 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.  
 
                    If this keyword contains *two* elements, each element
                    describes whether or not the corresponding size (nx,ny)
                    is to be kept constant.

       MESSAGE    - If this keyword is set, print a short message describing
                    operation of the cursor.
       COLOR      - Index of color to be used to draw the cursor. Default:
                    !d.table_size-1
       ANYWHERE   - Set this keyword to allow box to be moved outside the
                    window 

 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.

       Turns *on* both draw_button_events and draw_motion_events, if the
       window is a widget (both should already have been set, anyway..)

 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.

 KNOWN PROBLEM:
       The box can be off the display window when resizing. More
       checking is needed to prevent this.

 MODIFICATION HISTORY:
	DMS, April, 1990.
	DMS, April, 1992.  Made dragging more intutitive.
	June, 1993 - Bill Thompson
			prevented the box from having a negative size.
       September 1, 1994 -- Liyun Wang
                            Added the COLOR keyword
       September 9, 1994 -- Liyun Wang, GSFC/ARC
                            Prevented the box from jumpping around
                            when resizing
       May 26, 1995 -- Liyun Wang, GSFC/ARC
                       Added the ANYWHERE keyword
       June 5, 1995 -- Liyun Wang, GSFC/ARC
                       Added EVENT_PRO and STC4EVENT keywords
       26 May 1997 -- SVHH, UiO
                      Added detection of widget windows.
       July 14, 1997 -- Liyun Wang, NASA/GSFC
                      Renamed from BOX_CURSOR2
       15 September 1997 -- SVHH, UiO
                      Added possibility of fixing *one* of the dimensions.
	8 April 1998 -- William Thompson, GSFC
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays

(See /host/bluemoon/usr2/idllib/ssw/allpro/box_cursor.pro)


BOX_CURSOR2

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

 PURPOSE:
       Emulate the operation of a variable-sized box cursor

 EXPLANATION:
       This is a better improved version of BOX_CURSOR, a standard procedure
       from the IDL user library. The added keywords are: COLOR, ANYWHERE,
       EVENT_PRO, and STC4EVENT.

 CATEGORY:
       Interactive graphics.

 CALLING SEQUENCE:
       BOX_CURSOR2, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]
                   [, COLOR = color]
 INPUTS:
       No required input parameters.

 OPTIONAL INPUT PARAMETERS:
       X0, Y0, NX, NY - 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. 
       EVENT_PRO      - Name of the procedure to be called when the boxed
                        cursor is manipulated. This procedure must have one
                        and only one positional parameter which is a
                        structure. This structure is passed in with the
                        keyword STC4EVENT and must have at least two tags
                        named X and Y being the cursor position in device
                        pixels.    
       STC4EVENT      - Structure to be processed by the procedure specified
                        by EVENT_PRO. It can have any number of tags, but X
                        and Y tags are required ones. 

 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.
       COLOR      - Index of color to be used to draw the cursor. Default:
                    !d.n_colors-1
       ANYWHERE   - Set this keyword to allow box to be moved outside the
                    window 

 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.

       Turns *on* both draw_button_events and draw_motion_events, if the
       window is a widget (both should already have been set, anyway..)

 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.

 KNOWN PROBLEM:
       The box can be off the display window when resizing. More
       checking is needed to prevent this.

 MODIFICATION HISTORY:
	DMS, April, 1990.
	DMS, April, 1992.  Made dragging more intutitive.
	June, 1993 - Bill Thompson
			prevented the box from having a negative size.
       September 1, 1994 -- Liyun Wang
                            Added the COLOR keyword
       September 9, 1994 -- Liyun Wang, GSFC/ARC
                            Prevented the box from jumpping around
                            when resizing
       May 26, 1995 -- Liyun Wang, GSFC/ARC
                       Added the ANYWHERE keyword
       June 5, 1995 -- Liyun Wang, GSFC/ARC
                       Added EVENT_PRO and STC4EVENT keywords
       26 May 1997 -- SVHH, UiO
                      Added detection of widget windows.
       15 April 1998 -- Zarro (SAC/GSFC)
                      Added CATCH to set graphics device back to normal

(See /host/bluemoon/usr2/idllib/ssw/allpro/box_cursor2.pro)


BOX_DATA

[Previous Routine] [Next Routine] [List of Routines]
   Name: box_data

   Purpose: return data within user defined box 

(See /host/bluemoon/usr2/idllib/ssw/allpro/box_data.pro)


BPOW

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

 PURPOSE:
	This function returns a broken(double) power-law for an input vector.

 CATEGORY:
	SPEX(spectroscopic analysis), fitting

 CALLING SEQUENCE:
 	Spectrum = BPOW( X, A)

 INPUTS:
	E: Input vector, for X-ray spectroscopy generally an Energy in keV.
	   E must be greater than 0. For a discrete spectrum, these should be 
          the channel energy means (arithmetic or geometric) or an array of
          2xN low and high energy edges.  Then, arithmetic mean is used.
	A: A set of parameters describing the broken power-law.
		A(0): negative power-law index, always greater than 0.0 for E
		      less than A(1)
		A(1): Break point in E. If this value is 0.0 then the whole
		      spectrum is a single power-law. 
		A(2): negative power-law index, always greater than 0.0 for E
		      greater than A(1)
		A(3): Optional low-energy (X) break point.  If it isn't set
		      on input it defaults to the value of "a_cutoff(0)"
		      in the common "function_com"    
		A(4): Optional negative power-law index below A(3).  If it isn't set
		      on input it defaults to the value of "a_cutoff(1)"
		      in the common "function_com"    

 OUTPUTS:
	This function returns a broken(double) power-law for an input vector.

 COMMON BLOCKS:
	FUNCTION_COM: see FUNCTION_COM.PRO

 PROCEDURE:
	Divides the input vector into groups of points based on the break values,
	then calculates the power-law output for each section where the normalization
	is taken as 1.0 and the X values are scaled by "Epivot" given in
	FUNCTION_COM.PRO

 EXAMPLE:
	Spectrum = BPOW( findgen(100)+15.,[2.,40.,3.])

 MODIFICATION HISTORY:
 	Written by:	RAS, documented 12-dec-1995
	Version 2, richard.schwartz@gsfc.nasa.gov, use energy means or 2xn array of energies.

(See /host/bluemoon/usr2/idllib/ssw/allpro/bpow.pro)


BPOW_TAPER

[Previous Routine] [Next Routine] [List of Routines]
 NAME: bpow_taper
	
 PURPOSE: broken power-law function without discontinuities in the
	derivatives
	
 CALLING SEQUENCE: result = bpow_taper(x, a)
	
 INPUTS:
	x - independent variable, nominally energy in keV under SPEX
	a - parameters defined as
	normalization at Epivot is 1
		a(0) - negative power law index below break
		a(1) - break energy
		a(2) - negative power law index above break
		a(3) - low energy cutoff
		a(4) - negative power law index of low energy cutoff, 1

(See /host/bluemoon/usr2/idllib/ssw/allpro/bpow_taper.pro)


BPRECESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BPRECESS
 PURPOSE:
	Precess positions from J2000.0 (FK5) to B1950.0 (FK4)
 EXPLANATION:
	Calculates the mean place of a star at B1950.0 on the FK4 system from
	the mean place at J2000.0 on the FK5 system.    

 CALLING SEQUENCE:
	bprecess, ra, dec, ra_1950, dec_1950, [ MU_RADEC = , PARALLAX = 
					RAD_VEL =, EPOCH =   ]

 INPUTS:
	RA,DEC - Input J2000 right ascension and declination in *degrees*.
		Scalar or N element vector

 OUTPUTS:
	RA_1950, DEC_1950 - The corresponding B1950 right ascension and 
		declination in *degrees*.    Same number of elements as
		RA,DEC but always double precision.

 OPTIONAL INPUT-OUTPUT KEYWORDS
	MU_RADEC - 2xN element double precision vector containing the proper 
		   motion in seconds of arc per tropical *century* in right 
		   ascension and declination.
	PARALLAX - N_element vector giving stellar parallax (seconds of arc)
	RAD_VEL  - N_element vector giving radial velocity in km/s

	The values of MU_RADEC, PARALLAX, and RADVEL will all be modified
	upon output to contain the values of these quantities in the
	B1950 system.  The parallax and radial velocity will have a very 
	minor influence on the B1950 position.   

	EPOCH - scalar giving epoch of original observations, default 2000.0d
	    This keyword value is only used if the MU_RADEC keyword is not set.
 NOTES:
	The algorithm is taken from the Explanatory Supplement to the 
	Astronomical Almanac 1992, page 186.
	Also see Aoki et al (1983), A&A, 128,263

	BPRECESS distinguishes between the following two cases:
	(1) The proper motion is known and non-zero
	(2) the proper motion is unknown or known to be exactly zero (i.e.
		extragalactic radio sources).   In this case, the reverse of 
		the algorithm in Appendix 2 of Aoki et al. (1983) is used to 
		ensure that the output proper motion is  exactly zero. Better 
		precision can be achieved in this case by inputting the EPOCH 
		of the original observations.

	The error in using the IDL procedure PRECESS for converting between
	B1950 and J1950 can be up to 1.5", mainly in right ascension.   If
	better accuracy than this is needed then BPRECESS should be used.

	An unsystematic comparison of BPRECESS with the IPAC precession 
	routine available at ned.ipac.caltech.edu always gives differences 
	less than 0.1".
 EXAMPLE:
	The SAO2000 catalogue gives the J2000 position and proper motion for
	the star HD 119288.   Find the B1950 position. 

	RA(2000) = 13h 42m 12.740s      Dec(2000) = 8d 23' 17.69''  
	Mu(RA) = -.0257 s/yr      Mu(Dec) = -.090 ''/yr

	IDL> mu_radec = 100D* [ -15D*.0257, -0.090 ]
	IDL> ra = ten(13, 42, 12.740)*15.D 
	IDL> dec = ten(8, 23, 17.69)
	IDL> bprecess, ra, dec, ra1950, dec1950, mu_radec = mu_radec
	IDL> print, adstring(ra1950, dec1950,2)
	        ===> 13h 39m 44.526s    +08d 38' 28.63"

 REVISION HISTORY:
	Written,    W. Landsman                October, 1992
	Vectorized, W. Landsman                February, 1994
	Treat case where proper motion not known or exactly zero  November 1994
       Handling of arrays larger than 32767   Lars L. Christensen, march, 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/bprecess.pro)


BREAK_DOC

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

	PURPOSE: extract subset of idl header info for display/verification  
		 this is a check of a two line purpose
		 third purpose line

	CALLING SEQUENCE: 
		break_doc, infile
		break_doc, header

       Input Parameters:
          input - file to extract - assume idl .pro file
		   OR documentation header (from doc_head)

       Optional Keyword Parameters:
          keep_key - if set, keywords from file are retained in the
		      tag value - default is to eliminate since the 
		      tag name contains relavent info. 
	   debug - if set, some programmer info is printed

	Output: 
	   function returns structure containing documentation info 
	   all fields are string type - null fields imply a particular
	   field is missing from the documentation header 

	Category: gen, swmaint, unix_only

	Common Blocks: get_doc_private, doc_strt

	Modification History: S.L.Freeland, 18-July-1992 
			      (derived from sw_head.pro)
			      slf,  9-Aug-1992	added print option
			      slf, 22-Mar-1994 convert to rd_tfile
                             slf,  6-Oct-1998 - add terminators Explana and Use
                             slf, 15-Oct-1998 - Restore Mons Morrison 12-jun-97 mods.

(See /host/bluemoon/usr2/idllib/ssw/allpro/break_doc.pro)


BREAK_FILE

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

 Name        :
	BREAK_FILE
 Purpose     :
	Break a filename into its component parts.
 Explanation :
	Given a file name, break the filename into the parts
	of disk/logical, the directory, the filename, the
	extension, and the file version (for VMS)
 Use         :
	BREAK_FILE, FILE, DISK_LOG, DIR, FILNAM, EXT, FVERSION, NODE
 Inputs      :
	file	- The file name
 Opt. Inputs :
	None.
 Outputs     :
	disk_log- The disk or logical (looks for a ":")
		  This is generally only valid on VMS machines
	dir	- The directory
	filnam	- The filename (excluding the ".")
	ext	- The filename extension (including the ".")
	fversion- The file version (only VMS)
	node	- The Node name (only VMS)
 Opt. Outputs:
	None.
 Keywords    :
	LAST_DOT- For filenames which have "." in the name, it takes
	 	  the LAST "." as the start of the extension.  The
		  default is from the first ".".
 Calls       :
	OS_FAMILY
 Common      :
	None.
 Restrictions:
	VMS:
		Assumes that : always precedes []
	ULTRIX:
		Right now it has trouble with the ultrix option of use
		of "." or ".."
 Side effects:
	None.
 Category    :
	Utilities, Operating_system.
 Prev. Hist. :
	Written 1988 by M.Morrison
	   Aug-91 (MDM) Changed to handle Unix filename convensions
	28-Feb-92 (MDM) * Adjusted to handle arrays
	11-Mar-92 (MDM) - Perform a STRTRIM(x,2) on input string before
			  doing the "break-up"
	 1-Dec-92 (MDM) - Moved code to do filename, extension and version
			  number for both VMS and Unix (previously it
			  did not do version number code for Unix)
	29-Jan-93 (DMZ/MDM) - checked for node in file name
 Written     :
	M. Morrison, August 1991.
 Modified    :
	Version 1, William Thompson, GSFC, 23 April 1993.
		Incorporated into CDS library.
	Version 1.1, William Thompson, GSFC, 7 May 1993.
		Added IDL for Windows compatibility.
	Version 2, William Thompson, GSFC, 15 June 1995
		Merged with Yohkoh version.  Added change 11-Nov-93 by D. Zarro
       	to check for ".]["  and "[000000" in VMS concealed directory
		names
	Version 3, William Thompson, GSFC, 29 August 1995
		Modified to use OS_FAMILY
       Version 4, Liyun Wang, NASA/GSFC, October 11, 1996
               Fixed a bug that occurs in MS Windows
       Version 5, SVH Haugan, UiO, 10 July 1997
               Made "ifil" loop variable a LONG
	Version 6, M.Morrison, LMSAL, 5-Nov-97
		Added /LAST_DOT option

 Version     :
	Version 5, 10 July 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/break_file.pro)


BREAK_MAP

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

 Name        : BREAK_MAP

 Purpose     : Break map up into small pieces

 Category    : imaging

 Explanation : 

 Syntax      : f=break_map(map,pieces,size=size)

 Examples    :

 Inputs      : MAP = map structure 
               PIECES = number of equal pieces 

 Opt. Inputs : None

 Outputs     : f= array of pointers containing each piece

 Opt. Outputs: 

 Keywords    : None

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written 22 Sep 1998, D. Zarro, SMA/GSFC

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/break_map.pro)


BREAK_PATH()

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

 PURPOSE: 
	Breaks up a path string into its component directories.

 CALLING SEQUENCE: 
	Result = BREAK_PATH( PATHS [ /NoCurrent])

 INPUTS: 
	PATHS	= A string containing one or more directory paths.  The
		individual paths are separated by commas, although in UNIX, 
		colons can also be used.  In other words, PATHS has the same 
		format as !PATH, except that commas can be used as a separator 
		regardless of operating system.

		A leading $ can be used in any path to signal that what follows 
		is an environmental variable, but the $ is not necessary.  (In 
		VMS the $ can either be part of the path, or can signal logical
		names for compatibility with Unix.)  Environmental variables
		can themselves contain multiple paths.

 OUTPUT: 
	The result of the function is a string array of directories.
	Unless the NOCURRENT keyword is set, the first element of the array is 
	always the null string, representing the current directory.  All the 
	other directories will end in the correct separator character for the 
	current operating system.

 OPTIONAL INPUT KEYWORD:
       NOCURRENT = If set, then the current directory (represented by
               the null string) will not automatically be prepended to the
               output.

 PROCEDURE CALLS:
       Functions:  DATATYPE(), STR_SEP(), OS_FAMILY()

 REVISION HISTORY:
       Version 1, William Thompson, GSFC, 6 May 1993.
               Added IDL for Windows compatibility.
       Version 2, William Thompson, GSFC, 16 May 1995
               Added keyword NOCURRENT
       Version 3, William Thompson, GSFC, 29 August 1995
               Modified to use OS_FAMILY
	Version 4, Zarro, GSFC, 4 August 1997
               Added trim to input
       Replace TRIM() with STRTRIM()  W. Landsman June 1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/break_path.pro)


BREM_49

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

 NAME: 
	BREM_49

 PURPOSE:
	This function calculates the optically thin continuum thermal bremsstrahlung 
	photon flux incident on
	the Earth from an isothermal plasma on the Sun.  Normalization is for an emission
	measure on the Sun of 1.e49 cm-3

 CATEGORY:
	SPECTRA

 CALLING SEQUENCE:
	Flux = BREM_49( Energy, Kt )

 CALLS:
	ACGAUNT (Gaunt factor function)

 INPUTS:
       Energy - Energy vector in keV
	Kt     - Plasma temperature in keV, a scalar.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Returns the differential photon flux in units of 
	photons/(cm2 s keV) per (1e49 cm-3 emission measure)

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	VERBOSE - If set, prints a message.
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Use at temperatures above line energies.  Never valid for kT lt 0.1 keV.

 PROCEDURE:
	bremsstrahlung radiation function
	differential spectrum seen at Earth in units of photon/(cm2 s keV)

 MODIFICATION HISTORY:
	Identical with the SMM/HXRBS group's DCP 1VTH for an emission measure of 1.e49 cm-3
	Version 2, Documented, RAS, 19-May-1996
	VERSION 3, 21-MAY-1996, Changed to call acgaunt instead of tegfc(obsolete)
	VERSION 4, 23-oct-1996, Made to return row vector

(See /host/bluemoon/usr2/idllib/ssw/allpro/brem_49.pro)


BSCALE

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

 Name        : 
	BSCALE
 Purpose     : 
	Scale images into byte arrays suitable for displaying.
 Explanation : 
	Depending on the keywords passed, the routine BYTSCLI, FORM_INT or
	FORM_VEL is used to scale the image.
 Use         : 
	BSCALE, IMAGE
 Inputs      : 
	IMAGE	= Image to be scaled.
 Opt. Inputs : 
	None.
 Outputs     : 
	IMAGE	= The scaled image is returned in place of the original.
 Opt. Outputs: 
	None.
 Keywords    : 
	NOSCALE  = If set, then the image is not scaled.
	MISSING	 = Value flagging missing pixels.  These points are scaled to
		   zero.
	MAX	 = The maximum value of IMAGE to be considered in scaling the
		   image, as used by BYTSCL.  The default is the maximum value
		   of IMAGE.
	MIN	 = The minimum value of IMAGE to be considered in scaling the
		   image, as used by BYTSCL.  The default is the minimum value
		   of IMAGE.
	TOP	 = The maximum value of the scaled image array, as used by
		   BYTSCL.  The default is !D.TABLE_SIZE-1.
	VELOCITY = If set, then the image is scaled using FORM_VEL as a
		   velocity image.  Can be used in conjunction with COMBINED
		   keyword.  Ignored if NOSCALE is set.
	COMBINED = Signals that the image is to be displayed in one of two
		   combined color tables.  Can be used by itself, or in
		   conjunction with the VELOCITY or LOWER keywords.
	LOWER	 = If set, then the image is placed in the lower part of the
		   color table, rather than the upper.  Used in conjunction
		   with COMBINED keyword.
 Calls       : 
	BYTSCLI, FORM_INT, FORM_VEL, GET_IM_KEYWORD, IM_KEYWORD_SET
 Common      : 
	None.
 Restrictions: 
	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	None.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	William Thompson, May 1992.
	William Thompson, August 1992, renamed BADPIXEL to MISSING.
	William Thompson, September 1992, use COMBINED keyword in place of
					  INTENSITY.
 Written     : 
	William Thompson, GSFC, May 1992.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 14 June 1993.
		Added support for monochrome (dithered) devices.
	Version 3, William Thompson, GSFC, 22 October 1993.
		Modified to call BYTSCLI instead of BYTSCL.
	Version 4, William Thompson, GSFC, 17 July 1996
		Fixed bug when image contains nothing but missing pixels.
	Version 5, William Thompson, GSFC, 8 December 1997
		Pass TOP to FORM_INT and FORM_VEL.
	Version 6, William Thompson, GSFC, 6 January 1998
		Corrected interaction between MIN and MISSING
	Version 7, Zarro (SAC/GSFC), 1 March 1998
		Threw in calls to TEMPORARY for better memory management
 Version     : 
	Version 7

(See /host/bluemoon/usr2/idllib/ssw/allpro/bscale.pro)


BSC_CHECK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BSC_CHECK
 PURPOSE:
       check that index or data structure is of type BSC
 CALLING SEQUENCE:
       S=BSC_CHECK(BSC_INDEX,NSC_DATA)
 INPUTS:
       BSC_INDEX    - BSC index structure
       BSC_DATA     - BSC data structure
 OUTPUTS:
       S            - 1 if BSC structure type
                    - 0 otherwise
 PROCEDURE:
       Simple use of TAG_NAMES function
       if BSC_DATA is entered, then also checks if n_elements match
 HISTORY:
       written by DMZ (ARC) - Mar'93
       April'94 - added check for FLUX tag (DMZ)

(See /host/bluemoon/usr2/idllib/ssw/allpro/bsc_check.pro)


BSC_SPEC_PLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  bsc_spec_plot
 PURPOSE:
  Plot BCS observed or synthetic spectra 
 CALLING SEQUENCE:
  bcs_spec_plot,bsc_index,bsc_data		; Defaults to the first plot
  bcs_spec_plot,bsc_index,bsc_data,ss=10		; Plot spectrum 10
 INPUTS:
  INDEX  = BSC Index structure or wavelength vector
  DATA   = BSC Data structure  or data array
 OPTIONAL INPUT KEYWORDS:
  AINFO   = Optional information structure
  over	  = If set, over plot on an existing plot
  ss	  = Scalar value which specifies the index of bsc_index,bsc_data to plot.
  xoff	  = Number between 0 and 1 which specifies where the plot annotation goes
	    (this is useful in case the user wants to specify a different size window).
  font	  = Specifies the font to use (make this a number -- not a string)
	    0=Use hardware fonts.  -1=The current default fonts
  nobos  = If set, don't plot the data (by default plots data and overplots the fit)
  nofit  = If set, don't plot the fit  (by default plots data and overplots the fit)
  notitle= If set, don't do print title
  title  = User specified title (default title will put the time on the plot)
  color  = color keyword for PLOT
  ocolor = color keyword for OPLOT
  xrange,yrange,psym,linestyle,charsize ==> Normal keywords for plot
  ebar   = overplot error bars [can come in as 0/1 or a vector of errors]
  second = overplot secondary cmpt (if present)
  primary = overplot primary cmpt (if present)
  vunit  = print Td6 in km/s units
  noannotate = do not print annotation
 PostScript Specific:
  hc	  = If set, make a hardcopy version.
  PostScript  = If set, send the output to an idl.ps file 
		 (but don't close or send to printer)
  eps	  = If set, generate encapsulated PostScript file (closed, not sent to printer)
	         (if /Post,/eps is specified, don't close the file)
  xsize  = Specifies the PostScript X-axis length (inches)
  ysize  = Specifies the PostScript Y-axis length (inches)
  xpage  = Specifies the PostScript X page size (inches)
  ypage  = Specifies the PostScript Y page size (inches)
  x0,y0  = Specifies the PostScript X and Y-axis origins (inches)
  portrait= if set, do the plot in portrait mode.  (Recommend /portrait,/noatomic be used)
  file	  = Specify the output plot file name (default = idl.ps)
  noatomic= if set, don't put the atomic code labels on the PS plot (near X-axis labels)
  nodate  = if set, don't put the date on the PS plot
  nouncert= If set, don't put +/- uncertainties on the plot
  
 OPTIONAL OUTPUT KEYWORDS:
  
 MODIFICATION HISTORY:
  30-sep-93, J. R. Lemen (LPARL), Written
   7-oct-93, DMZ and JRL -- Added color and ocolor keywords
  18-Oct-93, DMZ and JRL -- added ebar keyword
  18-Oct-93, DMZ -- allowed for vector and/or scalar inputs for EBAR
  30-Nov-93, DMZ -- added oplot of secondary cmpt (via /SECOND switch)
   9-Dec-93, DMZ -- added VUNIT keyword
  20-Dec-93, DMZ -- fixed small bug in second cmpt plotting and annotation
  29-dec-93, JRL -- Added /portrait,/noatomic,/eps,x0off,y0off,xpage,ypage
   7-jan-94, JRL -- Added an "empty" to flush PS buffer (needed sometimes for /eps)
  23-Jan-94, DMZ -- added /PRIMARY, /NOANNOTATE keywords 
                    + more error checking and general cleanup
   9-Apr-94, DMZ -- fixed bug with /PRIM
  21-Jun-94, DMZ -- further propagated VUNIT
  30-jun-94, JRL -- Added the /NOUNCERT keyword

(See /host/bluemoon/usr2/idllib/ssw/allpro/bcs_spec_plot.pro)


BSC_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
       NAME:
               BSC_STRUCT
       PURPOSE:
               Define the following BSC specific database structures
                       * BSC_Index_Rec            
                       * BSC_Roadmap_Rec          
                       * FIT_BSC_Rec

       CALLING SEQUENCE:
               BSC_STRUCT
       HISTORY:
               written by Mons Morrison, R. Bentley, J. Mariska and D. Zarro, Fall 92
       11-sep-93, JRL + DMZ, Added .valid_ans, .nstart and .nend fields (see **)
        2-Oct-93 (MDM) - Changed the FIT structure a fair amount
       13-Oct-93 (MDM) - Changed the FIT field from Num_inter to Num_iter
        8-Nov-93 (MDM) - Changed comments
        3-Feb-94 (MDM) - Added .SPACECRAFT to .BSC structure
                       - Made a new FIT structure with .ION_MULT
                       - Archived FIT_2041_BSC_Rec to BSC_OLD_STRUCT.INC
        3-Feb-94 (MDM) - Added .DENSITY to .FIT
        8-Aug-94 (MDM) - Added .DISPC and .U_DISPC to .FIT

(See /host/bluemoon/usr2/idllib/ssw/allpro/bsc_struct.pro)


BSORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BSORT
 PURPOSE:
	Function to sort data into ascending order, like a simple bubble sort.
 EXPLANATION:
	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)

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

 INPUT:
	Array - array to be sorted

 OUTPUT:
	result - sort subscripts are returned as function value

 OPTIONAL OUTPUT:
	Asort - sorted array

 OPTIONAL KEYWORD INPUTS:
       /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.

 HISTORY
	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      
	Always return type LONG    W. Landsman     August 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/bsort.pro)


BTEST0

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



(See /host/bluemoon/usr2/idllib/ssw/allpro/btest0.pro)


BUILD_STR

[Previous Routine] [Next Routine] [List of Routines]
   Name: build_str

   Purpose: build data structure for generic files using size 
	     information encoded by wrt_str.pro

   Input Parameters:
      unit - logical unit number (file opened before call)
      mainsize - saved on first call
   Keyword Paramters:
      structure (Input) - string representation of intermediate data
			   structure used in recursive calls

   Method: recursive for nested structures
	    calls make_str for every structure level


   History: SLF, 10/30/91
	10-Feb-96 (MDM) - Modified to handle two dimensional structures

(See /host/bluemoon/usr2/idllib/ssw/allpro/build_str.pro)


BYTE2INT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : BYTE2INT()
               
 Purpose     : Convert byte(s) to integer(s), nothing else.
               
 Explanation : IF DATATYPE(NUMBER) EQ 'BYT' THEN RETURN,FIX(NUMBER)
               
 Use         : result = byte2int(number)
    
 Inputs      : NUMBER: Any variable, scalar or array.
               
 Opt. Inputs : None.
               
 Outputs     : Returns FIX(NUMBER) for byte values, or else simply NUMBER
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Utility
               
 Prev. Hist. : None.

 Written     : Stein Vidar H. Haugan, UiO, 26-February-1996
               
 Modified    : Never.

 Version     : 1, 26-February-1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/byte2int.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 /host/bluemoon/usr2/idllib/ssw/allpro/byteswap.pro)


BYTSCLI

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

 Name        :	BYTSCLI

 Purpose     :	Variation on BYTSCL which allows MAX < MIN.

 Explanation :	BYTSCLI is a variation on the standard IDL BYTSCL routine.  It
		allows for an inverted mapping of input values to output values
		where the keyword MAX is set less than the keyword MIN.
		Substituting BYTSCLI for BYTSCL should give more flexibility in
		image display routines.

		If MAX is greater than MIN, or if either MAX or MIN is not set,
		then BYTSCLI reproduces the behavior of BYTSCL.

 Use         :	Result = BYTSCLI(Arr)

		Default values are supplied for all keywords. If the special case
		is recognized--namely MIN defined, MAX defined, MIN > MAX--then
		an inverted relationship between input and output is returned,
		otherwise the normal byte transformation is applied.

		PRINT,BYTSCLI(INDGEN(11))
		  0  25  51  76 102 127 153 178 204 229 255

		PRINT,BYTSCLI(INDGEN(11),MIN=10,MAX=0)
		  255 229 204 178 153 127 102  76  51  25   0

 Inputs      :	ARR = Array of data values to be scaled.

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    :	MAX = The value of Array corresponding to the largest byte
		      value to be used (TOP). If MAX is not provided, Array is
		      searched for its maximum value.  All values greater than
		      or equal to MAX are set equal to TOP in the result,
		      except that if MAX & MIN are both defined & MAX lt MIN
		      all values LESS than or equal to MAX are set equal to TOP
		      in the result.

		MIN = The value of Array corresponding to the smallest byte
		      value to be used (zero). If MIN is not provided, Array is
		      searched for its smallest value.  All values less than or
		      equal to MIN are set equal to 0 in the result, except
		      that if MAX & MIN are both defined & MAX lt MIN all
		      values GREATER than or equal to MIN are set equal to 0 in
		      the result.

		TOP = The maximum value of the scaled result.  If TOP is not
		      specified, 255 is used.

 Calls       :	None.

 Common      :	None.

 Restrictions:	As with BYTSCL, MAX, MIN & TOP must be scalar. Unlike BYTSCL,
		ARR can also be scalar.

		In general, the SERTS image display routines use several
		non-standard system variables.  These system variables are
		defined in the procedure IMAGELIB.  It is suggested that the
		command IMAGELIB be placed in the user's IDL_STARTUP file.

		Some routines also require the SERTS graphics devices software,
		generally found in a parallel directory at the site where this
		software was obtained.  Those routines have their own special
		system variables.

 Side effects:	None.

 Category    :	Utilities, Image_display.

 Prev. Hist. :	Mark Hadfield, April 1993.

 Written     :	Mark Hadfield, April 1993.

 Modified    :	Version 1, William Thompson, GSFC, 22 October 1993.
			Modified to speed up.
			Incorporated into CDS library.
               Version 2, 13-Jun-98, Zarro (SAC/GSFC) 
                        removed MESSAGE stop for MIN=MAX 

 Version     :	Version 2

(See /host/bluemoon/usr2/idllib/ssw/allpro/bytscli.pro)


C2IDATE

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

 PURPOSE:
	Cette procedure convertit la date chaine de caracteres, en binaire

 CATEGORY:
	NRH1 General

 CALLING SEQUENCE:
	C2IDATE, Chdate, Idate	

 INPUTS:
	CHDATE	Chaine de caracteres contenant DD-MMM-yyYY
	
 KEYWORD PARAMETERS:
	Non

 OUTPUTS:
	IDATE	Tableau de 3 valeurs	IDATE[0] = Jour
					IDATE[1] = Mois
					IDATE[2] = An

 COMMON BLOCKS:
	Non

 SIDE EFFECTS:
	La chaine de caracteres est decodee en fonction de la position des
	caracteres dans la chaine, donc le separateur peut etre quelconque

 PROCEDURE:
	La conversion inverse est faite par I2CDATE

 EXAMPLE:
	C2IDATE, '20/APR/1998', IDATE

 MODIFICATION HISTORY: (bonmartin@obspm.fr)
 08-oct-1996
 Modif novembre 1997: Dates en anglais (KLK)

(See /host/bluemoon/usr2/idllib/ssw/allpro/c2idate.pro)


CALCFLUX

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

 PURPOSE:
	PROCEDURE DE CALCUL DE LA DENSITE DE FLUX 
 DES IMAGES EN FONCTION DU TEMPS PROVENANT DE LA FONCTION LEC1D (IMAGE 1D DU
 RH)	

 CATEGORY:
	NRH1 Calculs

 CALLING SEQUENCE:
	CALCFLUX, Tab, Unit, temps, flux

 INPUTS:
                 TAB ...... Tableau issu de LEC1D contenant les images
                                  (2 dimensions) 
                           TAB(Espace,Temps)
                                  (3 Dim sinon )
                           X(Espace,Temps,type)
                                               type = 0 ---> Intensite
                                               type = 1 ---> Polarisation
                 UNIT ......Numero d'unite logique dont TAB est issu.
	
 KEYWORD PARAMETERS:
	HEURES	Tableau d'heures de debut, de fin, chaines de caracteres
				['hh:mn:ss:ccc','hh:mn:ss:ccc'] 
	CANAUX	Tableau de canaux de debut et fin du calcul [Deb, Fin]

 OUTPUTS:
	TEMPS .........tableau de temps [ms]
	FLUX  .........tableau densites de flux I (flux(*,0))
					et - si disponible dans TAB - 
					V (flux(*,1))

 COMMON BLOCKS:
	NRH1_GLOBAL

 MODIFICATION HISTORY: (bonmartin@obspm.fr)
	23/11/98	Adapte du logiciel XHELIO

(See /host/bluemoon/usr2/idllib/ssw/allpro/calcflux.pro)


CALCPOS

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

 PURPOSE:
	Cette procedure calcule les coordonnees heliographiques d'un point
	a partir des coordonnes instrumentales

 CATEGORY:
	NRH general

 CALLING SEQUENCE:
	CALCPOS,freq,ih,mn,r1,s1,x,y

 INPUTS:
	FREQ	Frequence d'observation em MHz
	IH	Heure de l'image 
	MN	Minutes   "
	R1	position instrumentale EW
	S1	Position instrumentale NS

 KEYWORD PARAMETERS:
	Non

 OUTPUTS:
	X	position heliographique EW
	Y	position heliographique NS

 COMMON BLOCKS:
	Non

 SIDE EFFECTS:
	Ce module contient les procedures intrernes suivantes:
		OMEG_BRUT	calcul de l'angle solide du champ
		POS_HELIO	calcul des positions
		HEURE_TU	calcul du temps TU pour les sources

 MODIFICATION HISTORY: (A Kerdraon)
	Adapte de XHELIO (bonmartin@obspm.fr)

(See /host/bluemoon/usr2/idllib/ssw/allpro/calcpos.pro)


CALC_VOLGAUSS

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

 PURPOSE:
	Calcul du volume gaussien a partir des parametres d'une ellipse et de la valeur 
	du pic	

 CATEGORY:
	RH_2D, recherche de positions

 CALLING SEQUENCE:
	CALC_VOLGAUSS, Ellip, Dimx, Dimy, Tab

 INPUTS:
	Ellip		structure decrivant la source
	Dimx, Dimy:	dimensions de l'image d'origine

 OUTPUTS:
	Tab:		tableau 2D contenant le volume gaussien

 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: C Renie, decembre 1997 

(See /host/bluemoon/usr2/idllib/ssw/allpro/calc_volgauss.pro)


CARR2EX

[Previous Routine] [Next Routine] [List of Routines]
NAME
    CARR2EX
PURPOSE
    Estimate the time of central meridian passage of a Carrington
      rotation number
INPUT
    NCARR - Vector of Carrington rotation numbers (may be non-integral)
OUTPUT
    Time in external format
OPTIONAL KEYWORDS
    OFFSET - Reference heliographic longitude(s).  The default is 0
	     (central meridian).  For example, if offset = 90, then
	     the time at which the supplied Carrington rotation number
	     passed 90 deg heliographic longitude is returned.
    DD    - If set, return time as a string giving
	       decimal day, month, and year
CALLING SEQUENCE
    TIME = CARR2EX(1850.26)
HISTORY
    Feb 11, 1994 - GLS - Written as a generalized version of H. Hara's
		    CARR2BTIME to handle non-integral Carrington numbers.
    Feb 23, 1994 - GLS - Accepts vector input as well as scalar.
    May 28, 1997 - SLF - removed references to 'dd79' SW (use anytim.pro)

(See /host/bluemoon/usr2/idllib/ssw/allpro/carr2ex.pro)


CATEGORY

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CATEGORY
               
 Purpose     : List procedure/function names and categories.
               
 Explanation : Creates a list of all .PRO files and then searches them for
               the standard CDS header and extracts the Name and Category 
               fields.  The resultant one-line documentation is printed to
               the screen or to the file "category.doc".
               
 Use         : IDL> category [,file_spec, /hard, /path, list=list]
               IDL> category, path='userlib
    
 Inputs      : None
               
 Opt. Inputs : file_spec   -  specification of the files to be searched.
                              If omitted, the current directory is used.
               
 Outputs     : The information can be printed to the screen or to the default
               output file "category.doc" (or both).
               
 Opt. Outputs: None
               
 Keywords    : hard    -  specifies that output is to be stored in file
                          category.doc
               path    -  if present (/path or path=1) use current IDL path 
                          (!path) as the search path but select only the "cds"
                          directories, otherwise use any directory whose name
                          contains the string specified by path.

               quiet   -  if specified, do not print to screen.

               list    -  if present, the list of one-liners is returned
                          in a string array.

 Calls       : None
               
 Restrictions: When the /path option is requested, only directories containing
               the letters "cds" will be used.  The VMS option is also very
               fragile in using the path directories and is likely not
               to work if the path contains symbols and libraries etc.
               
 Side effects: None
               
 Category    : Utilities, Documentation, Manual
               
 Prev. Hist. : None

 Written     : Based on PURPOSE, C D Pike,  RAL,  23-Jun-1993
               
 Modified    : Fixed bug in finding Category line.  CDP, 1-Jun-95

 Version     : Version 2, 1-Jun-95

(See /host/bluemoon/usr2/idllib/ssw/allpro/category.pro)


CCM_UNRED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
     CCM_UNRED
 PURPOSE:
     Deredden a flux vector using the CCM 1989 parameterization 
 EXPLANATION:
     The reddening curve is that of Cardelli, Clayton, and Mathis (1989 ApJ.
     345, 245), including the update for the near-UV given by O'Donnell 
     (1994, ApJ, 422, 158).   Parameterization is valid from the IR to the 
     far-UV (3.5 microns to 0.1 microns).    

     Users might wish to consider using the alternate procedure FM_UNRED
     which uses the extinction curve of Fitzpatrick (1999).
 CALLING SEQUENCE:
     CCM_UNRED, wave, flux, ebv, funred, [ R_V = ]      
             or 
     CCM_UNRED, wave, flux, ebv, [ R_V = ]      
 INPUT:
     WAVE - wavelength vector (Angstroms)
     FLUX - calibrated flux vector, same number of elements as WAVE
             If only 3 parameters are supplied, then this vector will
             updated on output to contain the dereddened flux.
     EBV  - color excess E(B-V), scalar.  If a negative EBV is supplied,
             then fluxes will be reddened rather than deredenned.

 OUTPUT:
     FUNRED - unreddened flux vector, same units and number of elements
             as FLUX

 OPTIONAL INPUT KEYWORD
     R_V - scalar specifying the ratio of total selective extinction
             R(V) = A(V) / E(B - V).    If not specified, then R_V = 3.1
             Extreme values of R(V) range from 2.75 to 5.3

 EXAMPLE:
     Determine how a flat spectrum (in wavelength) between 1200 A and 3200 A
     is altered by a reddening of E(B-V) = 0.1.   Assume an "average"
     reddening for the diffuse interstellar medium (R(V) = 3.1)

       IDL> w = 1200 + findgen(40)*50      ;Create a wavelength vector
       IDL> f = w*0 + 1                    ;Create a "flat" flux vector
       IDL> ccm_unred, w, f, -0.1, fnew  ;Redden (negative E(B-V)) flux vector
       IDL> plot,w,fnew                   

 NOTES:
     (1) The CCM curve shows good agreement with the Savage & Mathis (1979)
             ultraviolet curve shortward of 1400 A, but is probably
             preferable between 1200 and 1400 A.
     (2)  Many sightlines with peculiar ultraviolet interstellar extinction 
             can be represented with a CCM curve, if the proper value of 
             R(V) is supplied.
     (3)  Curve is extrapolated between 912 and 1000 A as suggested by
             Longo et al. (1989, ApJ, 339,474)
     (4) Use the 4 parameter calling sequence if you wish to save the 
               original flux vector.

 REVISION HISTORY:
       Written   W. Landsman        Hughes/STX   January, 1992
       Extrapolate curve for wavelengths between 900 and 1000 A   Dec. 1993
       Use updated coefficients for near-UV from O'Donnell   Feb 1994
       Allow 3 parameter calling sequence      April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/ccm_unred.pro)


CDATE

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

 PURPOSE:
	Cette fonction remplace le nom du mois sur 3 caracteres, par le 
	numero du mois

 CATEGORY:
	NRH1 General

 CALLING SEQUENCE:
	Resultat = CDATE( Date )	

 INPUTS:
	DATE	Chaine de caracteres contenant DD-MMM-yyYY
	
 KEYWORD PARAMETERS:
	Non

 OUTPUTS:
	Resultat Chaine de caracteres contenant DD/nm/yyYY

 COMMON BLOCKS:
	Non

 SIDE EFFECTS:
	La chaine de caracteres est decodee en fonction de la position des
	caracteres dans la chaine, donc le separateur peut etre quelconque

 EXAMPLE:
	PRINT, DATE('20/APR/1998')

 MODIFICATION HISTORY: (bonmartin@obspm.fr)


(See /host/bluemoon/usr2/idllib/ssw/allpro/cdate.pro)


CDD

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

 NAME:
       CDD

 PURPOSE:
       Change directory and set IDL prompt to current path name

 EXPLANATION:
       CDD stands for CD with directory name displayed. It is intended to
       replace CD. It offers several advantages that CD lacks: It makes the
       the IDL prompt to reflect the current directory path; it does not bomb
       if cd fails. 

       It's better that you add the following lines in your IDL_STARTUP 
       file so that CDD takes into effect as soon as you get into IDL:
     
           cd, current=dir
           cdd, dir

       Another IDL routine that can be used with CDD is CDUP (cd to an
       upper level of dir).

 CALLING SEQUENCE:
       CDD [, dir_name]

 INPUTS:
       None required. If no directory name is given, user's home directory is
       assumed.

 OPTIONAL INPUTS:
       DIR_NAME -- A string, name of the destination directory

 OUTPUTS:
       None. IDL prompt can be changed though.

 OPTIONAL OUTPUTS:
       CURRENT -- The current directory before CDD takes action.

 KEYWORD PARAMETERS:
       LAST -- Prompt the last part of a directory path if set. It
               has no effect if user's home directory is part of the
               directory path.

 CALLS:
       DATATYPE, CHK_DIR

 COMMON BLOCKS:
       CDD -- Internal common block used by CDD

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Utility, miscellaneous

 PREVIOUS HISTORY:
       Written October 6, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
      Liyun Wang, GSFC/ARC, October 9, 1994
         Added directory validity checking feature.
      Version 2, Liyun Wang, GSFC/ARC, November 12, 1994
         Added CURRENT keyword
      Version 3, Liyun Wang, GSFC/ARC, December 16, 1994
         Made work on VMS machine
      Version 4, Liyun Wang, GSFC/ARC, January 11, 1995
         Added the LAST keyword 
      Version 5, Liyun Wang, GSFC/ARC, January 13, 1995
         Made prompt for home dir be [~] under VMS
      Version 6, September 24, 1997, Liyun Wang, NASA/GSFC
         Chop off '/tmp_nmt' from directory name for UNIX system

 VERSION:
       Version 6, September 24, 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cdd.pro)


CDUP

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

 NAME:
       CDUP

 PURPOSE: 
       Change directory path to an upper level

 EXPLANATION:
       
 CALLING SEQUENCE: 
       CDUP

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       SIMPLE -- If set, the IDL prompt is not changed.

 CALLS:
       CDD

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written October 6, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       
 VERSION:
       Version 1, October 6, 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/cdup.pro)


CENTER_NRH2

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

 PURPOSE:
	Procedure de calcul et de traitement du FLUX des images contenues 
 dans un fichier NRH2

 CATEGORY:
	WIDGET

 CALLING SEQUENCE:
 	CENTER_NRH2, [File],GROUP=group

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUT
	FILE	nom du fichier de position
		si la chaine file n'est pas vide le fichier correspondant 
		sera ouvert

 KEYWORD PARAMETERS:
	GROUP	Identification du widget appelant

 OUTPUTS:
	Describe any outputs here

 COMMON BLOCKS:

	LIMIT	Contenant la structure STR_LIM (NRH_STR_LIM)


 PROCEDURE:
	Cette procedure contient les widgets disponibles pour le trace des
	resultats d'uncalcul de CENTRES ACTIFS

 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin (bonmartin@obspm.fr) le 12/10/98
	23/10/98 modification d'appellation CENTER->SOURCE (JB)
		Definition de SZ pour le trace des positions EW et NS
	10/03/99 modifie la commande zoom, remplace return-event 
		par all_events (JB)
	29/03/99 introduit le style de trace (JB)
	20/04/99 Suprime le controle de fichiers
	10/05/99 Echelle curseurs pour les positions. Supprime YRANGE,
		YLAB pour OPLOT (JB)

(See /host/bluemoon/usr2/idllib/ssw/allpro/center_nrh2.pro)


CENTROIDW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CENTROIDW
 PURPOSE:
	Calculate the weighted average of ARRAY
 CATEGORY:
	
 CALLING SEQUENCE:
	CENTROID,ARRAY,XCEN,YCEN
 INPUTS:
	ARRAY = Rectangular input array of any type except string
 OUTPUTS:
	XCEN = weighted average of X values
	YCEN = weighted average of Y values
 COMMON BLOCKS:
	NONE.
 SIDE EFFECTS:
	NONE.
 PROCEDURE:
	
 MODIFICATION HISTORY:
 	VERSION 1.0, Written J. R. Lemen, 11 Feb 1991

(See /host/bluemoon/usr2/idllib/ssw/allpro/centroidw.pro)


CFIT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT
               
 Purpose     : Make a best fit of the sum of components to the supplied data
               
 Explanation : Given a structure describing the set of components to be
               fitted (a CFIT structure), CFIT first compiles the
               component-wise structure into a "short fit" called SFIT.

               In doing so, for each component it takes the value of each
               parameter's INITIAL tag as the starting point for the search,
               unless the keyword /VALUES is set, in which case the parameter
               tag called VALUE is used instead. Both of these tags store
               nominal parameter values, but the values are converted to
               actual values before being stored in the SFIT structure.

               If the SFIT is already supplied through the SFIT keyword, no
               new SFIT is compiled, and the values stored in the SFIT are
               kept as they are.

               HOWEVER, if the parameter A_NOM is defined, those (nominal)
               parameter values are converted into actual parameter values
               and stored in the SFIT structure, unless the /IGNORE keyword
               is set. This happens whether or not the SFIT structure was
               supplied initially.

               If any components are flagged not to be included in the fit,
               all its parameters are flagged as constant.

               Given these data, CFIT tries to find that set of parameter
               values which gives the best fit of the model to the supplied
               function.

 Use         : YFIT = CFIT(X,Y,A,FIT [,SIGMAA] [+keywords])
    
 Inputs      : X,Y : Tabulated function to be fitted.

               A_NOM : Array of (nominal) parameter values before/after fit.
                   IF DEFINED ON ENTRY, THEN THESE VALUES ARE USED AS INITIAL
                   VALUES, UNLESS /RESET IS SET.

               FIT : Fit structure containing one tag for each component in
                     the fit.

               SIGMAA : Errors for each of the parameter values included in A.
               
 Opt. Inputs : 
               
 Outputs     : 
               
 Opt. Outputs: FAILED, FAIL_TYPE : See MCURVEFIT for an explanation. FAILED
                                   will be nonzero if a failure occured,
                                   FAIL_TYPE contains information on the type
                                   of failure. Note that e.g., loss of
                                   precision failures (type 2) is usually the
                                   result of starting very *close* to the
                                   correct parameter values (thus not a
                                   serious failure).
               
 Keywords    : WEIGHTS : Set to an array containing the weights to be used in
                         the \chi^2 calculations. I.e., if the error is
                         proportional to the square root of the number of
                         counts in Y, set WEIGHTS=1./Y.

               SFIT : Used for internal purposes to speed up execution:

                      When a fit is made, the component-wise organization of
                      a FIT STRUCTURE is "compiled" into a short form called
                      an SFIT structure before subsequent processing.
                      
                      When fitting a series of spectra in a loop, set this
                      keyword to any named variable to avoid re-compilation
                      of the SFIT structure between each time.
                      
                      The parameter values (tag "A_ACT") inside the SFIT
                      structure are stored as the *actual* value, not the
                      *nominal* value. For each parameter:
                      
                      A_ACT = A_NOM*trans_a + trans_b
                      
                      where trans_a/b arrays are compiled from the PARAMETER
                      structure describing each parameter, and also stored as
                      an array inside the SFIT structure.

               VALUES: Create the SFIT structure with values taken from the
                       param(*).value instead of param(*).initial.

                       Whenever SFIT already contains an SFIT structure, the
                       array of *nominal* parameter values A_NOM must be
                       supplied to update the starting values.

               ERROR_ONLY: Passed on to MCURVEFIT, causing no change in the
                           parameter values, but an estimate of the SIGMAA
                           array will be made.

               IGNORE: Set to ignore any values supplied in A_NOM. 

               NOCOMPILE : Don't try to compile the evaluation function. If
                           this keyword is not set, the procedure tries to
                           compile a function evaluating the fitted function.

               DOUBLE : Set to perform fit with double precision arithmetic.

               CONST : An array of bytes, one for each parameter, signifying
                       which components are to be kept constant.

               INCLUDE : An array of bytes, one for each component, with a
                         zero for each component that should be left out.
               
               CHI2 : Contains the \chi^2 value of the final fit.

 Calls       : compile_sfit, make_sfit_stc(), mcurvefit(), update_cfit

 Common      : None.
               
 Restrictions: ...
               
 Side effects: compile_sfit may try to write a program.
               
 Category    : Analysis
               
 Prev. Hist. : Component based fitting inspired by XSPEC

 Written     : S.V.H.Haugan, UiO, 20 January 1997
               
 Modified    : Version 2, 6 February 1997
                       Added KEEP_LIMITS in call to MAKE_SFIT_STC, to avoid
                       clinching min/max limits in spite of values in the
                       CONST keyword.
               Version 3, 24 September 1997
                       Added ERROR_ONLY, FAIL_TYPE keywords.
               Version 4, 20 November 1997
                       Made sure that it's the *nominal* errors that are
                       reported through SIGMAA, by dividing with sfit.trans_a
               Version 5, 19 January 1999
                       Setting default itmax to 200 instead of 20. This may
                       seem odd, but the truth is that allowing a lot of
                       iterations *will* cause the fit to converge in most
                       cases where it failed earlier due to too many
                       iterations. 

 Version     : 5, 19 January 1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit.pro)


CFIT_APATCH

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT_APATCH
               
 Purpose     : Patch CFIT analysis result at specific points
               
 Explanation : Modify fit parameter/status at points given by IX.

               Example - modifying and fixing two parameters on the basis of
               where another parameter is below a certain threshold

                xcfit_block,analysis=ana
                handle_value,ana.result_h,result

                ;; Find points below threshold
                ix = where(result(0,*,*) lt 6 and result(0,*,*) ne -100)
                
                ;; Fix line position (parameter 1) at those points
                average_linepos=average(result(1,*,*),missing=-100)
                cfit_apatch,ana,"RESULT",ix,1,average_linepos
                cfit_apatch,ana,"FREEZE",ix,1

               Also, the PARAM and VALUE parameters may be arrays (with equal
               number of elements!)

               The allowed modes of operation are explained below, see the
               KEY parameter.
               
 Use         : CFIT_APATCH,ANALYSIS,KEY,IX [,PARAM,VALUE]
    
 Inputs      : ANALYSIS : A CFIT analysis structure.

               KEY : A string describing the action to be
                     taken. Possibilities are:

                     FAIL : Set all RESULT values (and chi^2) to missing,
                            freeze them, and flag all fit components as
                            excluded. Ignores PARAM/VALUE.

                     UNFAIL : Restore all RESULT/CONST/INCLUDE values to
                              initial values (given in the fit structure).
                              Inores PARAM/VALUE.

                     INITIAL : Restore [all or some] result values to initial
                               values. PARAM optional, VALUE ignored.

                     FREEZE : Set CONST status for all or some
                              parameters. PARAM optional, VALUE ignored.

                     THAW : Clear CONST status for all/some parameters. PARAM
                            optional, VALUE ignored.

                     RESULT : Set RESULT value(s) specified by PARAM to
                              VALUE.

                     INCLUDE : Set INCLUDE value(s) specified by PARAM to
                               VALUE.

                     CONST : Set CONST value(s) specified by PARAM to VALUE.

               IX : One-dimensional index into e.g. RESULT(0,*,*,*..)
                    specifying which points to be affected by the patch
                    operation. In "pseudo-code" the operation resulting from
                    using the RESULT/INCLUDE/CONST KEY values can be written:

                       (KEY(PARAM,*,*,...*))(IX) = VALUE

 Opt. Inputs : PARAM : Specifies which parameter(s) or component(s) that are
                       to be patched.

               VALUE : The value(s) of the patched RESULT/CONST/INCLUDE
                       points. Must have an equal number of elements as
                       PARAM.
                       
 Outputs     : Alters the values in the ANALYSIS input.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : make_sfit_stc(), cfit_bpatch()

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H. Haugan, 1998
               
 Modified    : Not yet.
                       
 Version     : 1, 3 February 1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit_apatch.pro)


CFIT_APIXLIST

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT_APIXLIST()
               
 Purpose     : Return masked CFIT analysis pixels given masking program
               
 Explanation : This function works like the masking feature in XCFIT_BLOCK
               Select the "Edit masking program" from the "Mask/patch points
               menu". The upper panel of text explains how to write masking
               programs.

               Given a program that is able to calculate a logical mask
               corresponding to each "spatial" point in a CFIT analysis, this
               function will execute the program and return the list of
               pixels where the calculated mask was "true".

               This function is often used in conjunction with the
               CFIT_APATCH (or lower-level CFIT_BPATCH) routine(s).

               Example 1:

               ;; "FAIL" all positions with average flux/pixel less than 5
               ;;
               ix=cfit_apixlist(ana,'mask=average(data,1,miss=missing) LT 5')
               cfit_apatch,ana,"FAIL",ix

               Example 2:
               
               ;; "FREEZE" parameter 1 ONLY at all positions where
               ;; average(signal) is less than 2.5 times average(noise):

               progfail = $
                ['a = sqrt(1./(weights>1e-6)) ; Noise',$
                 'ix=where(data eq missing or weights eq missing) ; Bad px',$
                 'if ix(0) ne -1L then a(ix) = missing  ; Take em out',$
                 'b = average(a,1,missing=missing)     ;Average noise level',$
                 'c = average(data,1,missing=missing)  ;Average signal',$
                 'mask = c lt 2.5*b                    ;Decide...']

               ;; Get list of points
               
               ix=cfit_apixlist(ana,progfail)
               
               cfit_apatch,ana,"FREEZE",cfit_apixlist(ana,progfail),1
               
 Use         : ix = cfit_apixlist(ana,program)
 
 Inputs      : ANA : CFIT analysis structure containing data.

               PROGRAM : Text array with a series of one-line statements.
                         See the explanation given by the 'Edit masking
                         program' option in XCFIT_BLOCK.

 Opt. Inputs : None.

 Outputs     : Returns - literally, the result of "where(mask)"
               
 Opt. Outputs: None.
               
 Keywords    : None

 Calls       : EXIST(), XACK, DELVARX, HAVE_WINDOWS()

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Line fitting.
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 1998
               
 Modified    : Version 2, 3 February 1999
                       Added test for have_windows() before using xack.

 Version     : 2, 3 February 1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit_apixlist.pro)


CFIT_BLOCK

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT_BLOCK
               
 Purpose     : Apply a component fit to a block of data.
               
 Explanation : Given a block of spectra in an array with dimensions
               (LAMBDA,X,Y,..), with corresponding arrays containing the
               wavelengths, fitting weights etc, this routine applies a
               component fit to all the individual spectra, yielding a
               resulting array (PARAMETERS,X,Y,...).

               The first dimension of the result will accommodate all
               parameters (stored consecutively as they appear in the fit
               structure) and the chi^2 value of the fit at that point, i.e,
               the first dimension will have N_PARAMETERS + 1 elements.

               The input data array may have up to 7 dimensions.

               It is possible to supply a "suggestion" result array, whose
               parameter values will be used as initial values for the fit at
               each point, unless the keyword USE_RESULT is explicitly set to
               zero. The RESULT array should have the same size on input as
               it will have on output.

               It is also possible to supply an array controlling where
               specific components should be turned "off" (INCLUDE), as well
               as an array controlling where specific parameters are to be
               kept constant (CONST). The first dimension of these arrays
               should be of size N_COMPONENTS and N_PARAMETERS, respectively.
               
 Use         : CFIT_BLOCK, ANALYSIS = ANALYSIS_STRUCTURE

               or

               CFIT_BLOCK,LAM,DA,WT,CFIT,MISS,RESULT,RESIDUAL [,INCLUDE,CONST]
    
 Inputs      : Either

     ANALYSIS_STRUCTURE : A structure containing handles pointing to the data
                          associated with a data block analysis (all of the
                          below mentioned stuff, incorporated into one
                          structure)

     or ALL of the following:
     
               LAM : Array containing the wavelength (or similar) for each
                     data point. If the wavelength calibration does not vary
                     from point to point, a one-dimensional array with the
                     same size as the first dimension in DA may be used.

               DA : Data Array, containing the counts/fluxes to be fitted.

               WT : The weights of each data point.

               CFIT : Component Fit structure, describing the function to be
                      fitted.

               MISS : The value used for missing pixels. May be undefined, in
                      which case it will default to MIN(DA)-1

               RESULT: (input and output) The values for the fitted
                       parameters and the chi^2 values of the fits, for each
                       data point (X,Y,...). If the CFIT has NP parameters,
                       the first dimension of the RESULT will have NP+1
                       elements. If defined on input, RESULT is taken as the
                       initial values for the fit, unless USE_RESULT is
                       explicitly set to zero.

                       If the fit fails to converge at any point, the
                       corresponding chi^2 value will be set to zero.

 Opt. Inputs : INCLUDE : An array describing where components should be
                         included (or not!) in the fitted function. The first
                         dimension should have the same number of elements as
                         the number of components in the CFIT structure, and
                         the other dimensions should have the same sizes as
                         the input array. A zero in the data array means that
                         the corresponding component is excluded at that
                         point.

               CONST : An array describing where parameters should be kept
                       constant. The first dimension should have the same
                       number of elements as the number of parameters in the
                       CFIT structure, and the other dimensions should have
                       the same sizes as the input array. A nonzero entry in
                       this array means that the corresponding parameter is
                       to be kept constant at that point.

 Outputs     : RESIDUAL : The residual after subtracting the fitted function
                          from the data array. Has identical dimensions as
                          the data array.
               
 Opt. Outputs: SIGMA : An array with the numerically determined 1-sigma
                       values for each parameter. This is only calculated if
                       the keyword MAKE_SIGMA is set.

                       NOTE! Numerically determined sigma levels for
                       parameters depend on several crucial assumptions to be
                       valid - the WEIGHTS should be *correct*, and the
                       fitted function should be *linear* in the
                       parameters.

                       Of course, the fitted function *isn't* linear, but as
                       long as it can be linearized in a neighbourhood around
                       the result that is significantly *larger* than the
                       true 1-sigma region, that's OK. So - for poor signal
                       to noise ratios (where the errors are usually large)
                       the SIGMA values are probably *not* correct.
               
 Keywords    : SMART : Set SMART=1 to sort the data points according to total
                       intensity, and processes them in descending order,
                       using the previous result as the starting point for
                       each new fit (will revert to the "default" set of
                       initial values if a failure results from this
                       approach). Saves some time in the initial fit (order
                       10-20%) on some data sets.

                       Set SMART=2 to recalculate ONLY those points where the
                       initial result entry for chi^2 is ZERO - this assumes,
                       of course, that the initial result was supplied, as
                       well as an appropriate *residual* array.
                       
               DOUBLE : Set to force double precision fit calculation. Highly
                        recommended.

               MAKE_SIGMA : Set this to produce the 1-sigma values (SIGMA).

               ERROR_ONLY : Set this to leave parameter values as they are,
                            but produce a sigma estimate.

               QUIET : Set to suppress messages from MCURVEFIT about failed
                       attempts.
                       
               PCT_SLIDER_ID : Set to the ID of a slider with MAX=100, MIN=0
                               to make it reflect the progress of the
                               calculation.

               X_FACE : Set this keyword to make CFIT_BLOCK create a widget
                        showing the progress of the calculation, as well as
                        providing a button to halt the process.

               USE_RESULT : Set to zero to avoid using any supplied RESULT as
                            initial values for the fitting. Alternatively you
                            may of course use DELVARX,RESULT before the call.

               FILL_ONLY : Set to skip calculations, to just fill out any
                           non-existing arrays.

 Calls       : cfit(), default, dimrebin(), dimreform(), make_sfit_stc(),
               parcheck, trim(), typ(), widget_base(), xkill, xrealize

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 21 January 1997
               
 Modified    : Version 2, SVHH, 28 January 1997
                       Fixed bug in calculating inital value array when not
                       supplied.
               Version 3, SVHH, 4 February 1997
                       Added /QUIET flag.
               Version 4, SVHH, 17 September 1997
                       Added /SMART, /MAKE_SIGMA, SIGMA and /ERROR_ONLY
                       keywords, and the ANALYSIS=ANALYSIS_STC calling option.
               Version 5, SVHH, 6 May 1998
                       Added /FILL_ONLY

 Version     : 5, 6 May 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit_block.pro)


CFIT_BPATCH

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT_BPATCH
               
 Purpose     : Patch block result at specific points
               
 Explanation : Sets result parameter PARAM in BLOCK at points given by IX to
               VALUE.

               Example - modifying and fixing two parameters on the basis of
               where another parameter is below a certain threshold

               > xcfit_block,lam,da,wts,fit,-100,result,residual,inc,const
                
               > ix = where(result(0,*,*) lt 6 and result(0,*,*) ne -100)
               > cfit_bpatch,result,ix,1,average(result(1,*,*),missing=-100)
               > cfit_bpatch,const,ix,1,1b
               > cfit_bpatch,result,ix,2,average(result(2,*,*),missing=-100)
               > cfit_bpatch,const,ix,2,1b

               > xcfit_block,lam,da,wts,fit,-100,result,residual,inc,const

               Also, the PARAM and VALUE parameters may be arrays (with equal
               number of elements!)
               
 Use         : CFIT_BPATCH,BLOCK,IX,PARAM,VALUE
    
 Inputs      : See example above.
               
 Opt. Inputs : None.
               
 Outputs     : Alters the values in BLOCK
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 5 February 1997
               
 Modified    : Version 2, 18 September 1997
                       Added "Use" message.
               Version 3, 24 April 1998
                       Added possibility of patching more than one parameter
                       at a time.
                       
 Version     : 3, 24 April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit_bpatch.pro)


CFIT_ERRDEMO

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CFIT_ERRDEMO
               
 Purpose     : Demonstrate analytical vs empirical errors of line fitting.
               
 Explanation : Generates a known model for NIS data, adding noise according
               to a known formula, and applies a least-square fit with
               calculation of estimated errors (sigmas) on the fitted
               parameters, then prints out various results.

               In general, the estimated errors are correct when the signal
               to noise ratio is "good" and the background is negligible in
               comparison to the flux from the emission line.

               The correct formula for the sigma(line_flux) based on the
               estimated sigmas seem to be:

                 sig_I = 1./sqrt(2) * sqrt((sig_I*w)^2 + (sig_w*I)^2)

               due to the fact that the width and the intensity of a line fit
               are *not* independently drawn quantities (use e.g.,
               CFIT_ERRDEMO,10000,0,NX=1000 to see that the estimated sigma
               without the "normalization factor" becomes approx. sqrt(2)
               times it's correct value.

               There seems to be some coupling between the background level
               and the line intensity error estimate that I haven't yet quite
               figured out - try very high values for the background
               (relative to the emission line) to see what I mean..  The
               fitted result is better than what should be expected from the
               actual noise level - this could be due to the fact that some
               of the (background-related) noise is simply situated outside
               the line profile.

               Hopefully the program is well enough documented to allow any
               logical errors to be caught by others..
               
 Use         : CFIT_ERRDEMO [,INTENSITY [,BACKGROUND]] [,NX=NX]
    
 Inputs      : INTENSITY : Line intensity (amplitude) in peak counts.

               BACKGROUND : Background intensity in peak counts.

               NX : Number of realizations of the data with noise
               
 Opt. Inputs : All..
               
 Outputs     : None.
               
 Opt. Outputs: None.
               
 Keywords    : See inputs

 Calls       : default pix2wave() mk_comp_gauss() mk_comp_poly() eval_cfit
               cfit_block average()

 Common      : None
               
 Restrictions: ...
               
 Side effects: ...
               
 Category    : 
               
 Prev. Hist. : None

 Written     : SVH Haugan, UiO, 13 October 1997
               
 Modified    : Not yet.

 Version     : 1,  13 October 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cfit_errdemo.pro)


CHECKFONT

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT     : SDAC
                   
 NAME:
       CHECKFONT

 PURPOSE:
       This function changes the default widget hardware font to be one of the user's 
	choosing.
       If no hardware font matches are found, then a font widget appears
	for the user to select from.

 CATEGORY:
       widget font

 CALLING SEQUENCE:
       var = CHECKFONT([FONT=font, message=message])

 CALLED BY:
       none

 CALLS TO:
       PICKFONT  (xfont clone)

 INPUTS:
       none

 OPTIONAL INPUTS:

	FONT	:   string or string array listing the hardware font to be 
		    set as the widget default font. Wildcards are allowed. 
	MESSAGE = message to be displayed by the view window.

 OUTPUTS:
       Returns the selected font as a string.

 OPTIONAL OUTPUTS:
       none

 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       The size of the selected font will effect vector drawn fonts.
       A temporary pixmap window is created.

 RESTRICTIONS:
       Need X window device.

 PROCEDURE:
       Search the hardware fonts for a match with the user's input.
       Switch the default widget font to the resulting match.

 MODIFICATION HISTORY:
       oct-1993, Elaine Einfalt (HSTX)

(See /host/bluemoon/usr2/idllib/ssw/allpro/checkfont.pro)


CHECKVAR

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SDAC    
                   
 Name        : CHECKVAR
               
 Purpose     : This procedure checks sets a non-existent variable
		to its default values.
               
 Category    : GEN
               
 Explanation : The variable is checked to see if it is defined,
		if it's not defined it is set to the given
		default.  The ultimate default value is 0.
               
 Use         : 
    
 Inputs      : A - The variable to be checked for existence.
		If A does not exist, then it is set to
		to Deflt or Deflt2 in turn.
		Deflt - The first default, may be a variable.
		Deflt2= The second default, may be a variable,
		if not set then A is set to 0
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls       : None

 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :
		First written by RAS, 1987

 Modified    : 
		Version 2, RAS, 16-Nov-1989
		Version 3, RAS, 5-Feb-1997, 2nd default is zero!

(See /host/bluemoon/usr2/idllib/ssw/allpro/checkvar.pro)


CHECK_COMPILE

[Previous Routine] [Next Routine] [List of Routines]
   Name: check_compile

   Purpose: verify whether input module will compile (syntax checker)

   Input Parameters:
      module_name - name of idl procedure/function file to check

   Keyword Parameters:
      log - contents of output log file

   Calling Sequence:
      status=check_compile(module_name [,log=log])

   History:
      14-Apr-1994 (SLF) Written (to check submitted software)
       5-May-1994 (SLF) Turn off batch monitoring for submitted job

   Restrictions: 
      UNIX only 

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_compile.pro)


CHECK_CONFLICT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CHECK_CONFLICT
               
 Purpose     : To check any conflict of IDL procedure/function names.
               
 Explanation : All .pro file names in the CDS IDL path are checked for 
               duplicate names.
               
 Use         : check_conflict, list [,/quiet, /full]
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None 
               
 Opt. Outputs: list  -  contains a list of any duplicates found.  
               
 Keywords    : quiet - if present results are not output on terminal (except
                       if /full is given, that overrides /quiet for the extra
                       information.

               full  - if present, complete information (ie the result
                       of running PURPOSE on each duplicate file is written
                       to the screen.

 Calls       : PURPOSE
               FIND_DUP
               REMCHAR
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Doc
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 12-Nov-93
               
 Modified    : 

 Version     : Version 1, 12-Nov-93

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_conflict.pro)


CHECK_DUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CHECK_DUP
 PUROSE:
	Check for duplicate file names and print list on screen.
	Written for VMS only.
 CALLING SEQUENCE:
	CHECK_DUP [,DIR=DIR, SEARCH=SEARCH, /YOHKOH_SDAC, FILE=FILE]
 SAMPLE CALL:
	check_dup
	check_dup, search='utplot.pro'
	check_dup, /y, /f
	check_dup, dir='user_disk0:[sdac...]'
 KEYWORD ARGUMENTS:
	DIR - directory specification to search. Default is 
	the current path.
	SEARCH - file name or wildcard specification to search for. 
		Default is '*.pro'.
	YOHKOH_SDAC - if set, will notify you only if one of the files
		is in yohkoh tree (ys:[...]) and the other file isn't.
	FILE - If set, send listing to output file called DUP.DAT.  Or
		specify FILE='filename.ext'.
 MODIFICATION HISTORY:
	Written AKT 93/1/29
	Mod. AKT 93/11/5.  Default to search is !path.  Added /yohkoh_sdac
	  keyword - will only look for duplicates across yohkoh/sdac boundary.
	  And added search and output file keywords and options.

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_dup.pro)


CHECK_EXT_TIME

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

 Name        :	CHECK_EXT_TIME

 Purpose     :	Checks CDS external time values for logical consistency.

 Explanation :	This procedure checks time values in CDS external format to
		ensure that the date-time values have valid values.  If a 
		value is found inaccurate, then these values are repaired
		with CHECK_INT_TIME.

		This procedure should be called whenever the external time is
		modified.

 Use         :	CHECK_EXT_TIME, EXT

 Inputs      :	EXT	= The UTC date/time as a data structure with the
			  elements:

				YEAR		= Integer year (1995).
				MONTH		= Integer month (1-12).
				DAY		= Integer day (1-31).
				HOUR		= Integer hour (0-23).
				MINUTE		= Integer minute (0-59).
				SECOND		= Integer second (0-59).
				MILLISECOND	= Integer millisec (0-999).

 Opt. Inputs :	None.

 Outputs     :	The input array will be repaired to reflect the correct values.

 Opt. Outputs:	None.

 Keywords    :	ERRMSG	= If defined and passed, then any error messages 
			  will be returned to the user in this parameter 
			  rather than using IDL's MESSAGE utility.  If no
			  errors are encountered, then a null string is
			  returned.  In order to use this feature, the 
			  string ERRMSG must be defined first, e.g.,

				ERRMSG = ''
				CHECK_EXT_TIME, EXT, ERRMSG=ERRMSG
				IF ERRMSG NE '' THEN ...

 Calls       :	DATATYPE, UTC2INT, INT2UTC, CHECK_INT_TIME

 Common      :	None.

 Restrictions:	Not valid for dates before 1 January 1972.

 Side effects:	None.

 Category    :	Utilities, Time.

 Prev. Hist. :	None, but uses CHECK_INT_TIME by W. Thompson, NASA/GSFC/ARC
		to check and make the fix.

 Written     :	Donald G. Luttermoser, NASA/GSFC/ARC, 15 February 1995.

 Modified    :	Version 1, Donald G. Luttermoser, GSFC/ARC, 15 February 1995.

 Version     :	Version 1, 15 February 1995.

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_ext_time.pro)


CHECK_FITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CHECK_FITS
 PURPOSE:
	Check that keywords in a FITS header array match the associated data  
 EXPLANATION:
	Given a FITS array IM, and a associated FITS or STSDAS header HDR, this
	procedure will check that
		(1) HDR is a string array, and IM is defined and numeric   
		(2) The NAXISi values in HDR are appropriate to the dimensions 
                   of IM
		(3) The BITPIX value in HDR is appropriate to the datatype of IM
	If HDR contains a DATATYPE keyword (as in STSDAS files), then this is 
	also checked against the datatype of of IM
	If the UPDATE keyword is present, then FITS header will be modified, if
	necessary, to force agreement with the image array

 CALLING SEQUENCE:
	check_FITS, im, hdr, [ dimen, idltype, /UPDATE, /NOTYPE, /SDAS, /SILENT]

 INPUT PARAMETERS:
	IM -  FITS or  STSDAS array, (e.g. as read by SXREAD or READFITS )
	HDR - FITS or  STSDAS header (string array) associated with IM

 OPTIONAL OUTPUTS:
	dimen - vector containing actual array dimensions
	idltype- data type of the FITS array as specified in the IDL SIZE
		function (1 for BYTE, 2 for INTEGER*2, 3 for INTEGER*4, etc.)

 OPTIONAL KEYWORD INPUTS:
	/NOTYPE - If this keyword is set, then only agreement of the array
		dimensions with the FITS header are checked, and not the 
		data type.
	/UPDATE - If this keyword is set then the BITPIX, NAXIS and DATATYPE
		FITS keywords will be updated to agree with the array
	/SDAS - If this keyword is set then the header is assumed to be from
		an SDAS (.hhh) file.    CHECK_FITS will then ensure that (1)
		a DATATYPE keyword is included in the header and (2) BITPIX
		is always written with positive values.
	/FITS -  If this keyword is present then CHECK_FITS assumes that it is
		dealing with a FITS header and not an SDAS header, see notes
		below.
	/SILENT - If keyword is set and nonzero, the informational messages 
		will not be printed
 SYSTEM VARIBLE:
	If there is a fatal problem with the FITS array or header then !ERR is
	set to -1.   ( If the UPDATE keyword was supplied, and the header could
	be fixed, then !ERR = 0.)

 PROCEDURE:
	Program checks the NAXIS1 and NAXIS2 parameters in the header to
	see if they match the image array dimensions.

 NOTES:
	An important distinction between an STSDAS header and a FITS header
	is that the BITPIX value in an STSDAS header is always positive, 
	e.g. BITPIX=32 for REAL*4 data.    Users should use either the /SDAS 
	or the /FITS keyword if it is important whether the STSDAS or FITS 
	convention for REAL*4 data is used.     Otherwise, CHECK_FITS assumes 
	that if a DATATYPE keyword is present then it is dealing with an 
	STSDAS header.

 MODIFICATION HISTORY:
	Written, December 1991  W. Landsman Hughes/STX to replace CHKIMHD
	No error returned if NAXIS=0 and IM is a scalar   W. Landsman  Feb 93
	Fixed bug for REAL*8 STSDAS data W. Landsman July 93
	Make sure NAXIS agrees with NAXISi  W. Landsman  October 93

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_fits.pro)


CHECK_FTP

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO/CDS
                   
 Name        : CHECK_FTP
               
 Purpose     : check if ftp server is alive
               
 Category    : utility
               
 Explanation : uses 'ping' and 'ftp'
               
 Syntax      : IDL> check_ftp,server,alive
    
 Examples    : 

 Inputs      : SERVER = server name (e.g. smmdac.nascom.nasa.gov)
               
 Opt. Inputs : None.
               
 Outputs     : ALIVE = 0/1 if dead or alive

 Opt. Outputs: None.
               
 Keywords    : QUIET = turn off messages
               ERR = error string
               PING = ping before ftp'ing

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 History     : 6-Jan-97, Zarro (SAC) - written

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_ftp.pro)


CHECK_INT_TIME

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

 Name        :	CHECK_INT_TIME

 Purpose     :	Checks CDS internal time values for logical consistency.

 Explanation :	This procedure checks time values in CDS internal format to
		ensure that the milliseconds of day is neither negative nor
		larger than the number of milliseconds in the day in question.
		If either is true, then the day and time is repaired.  Leap
		seconds are taken into account.

		This procedure should be called whenever the internal time is
		modified.

 Use         :	CHECK_INT_TIME, INT

 Inputs      :	INT	= The UTC date/time as a data structure with the
			  elements:

				MJD	= The Modified Julian Day number
				TIME	= The time of day, in milliseconds
					  since the start of the day.

			  Both are long integers.

 Opt. Inputs :	None.

 Outputs     :	The input array will be repaired to reflect the correct number
		of milliseconds in the day.

 Opt. Outputs:	None.

 Keywords    :	ERRMSG    =  If defined and passed, then any error messages 
                            will be returned to the user in this parameter 
                            rather than using IDL's MESSAGE utility.  If no
                            errors are encountered, then a null string is
                            returned.  In order to use this feature, the 
                            string ERRMSG must be defined first, e.g.,

                                ERRMSG = ''
                                CHECK_INT_TIME, INT, ERRMSG=ERRMSG
                                IF ERRMSG NE '' THEN ...

 Calls       :	DATATYPE, GET_LEAP_SEC

 Common      :	None.

 Restrictions:	Not valid for dates before 1 January 1972.

		This procedure requires a file containing the dates of all leap
		second insertions starting with 31 December 1971.  This file
		must have the name 'leap_seconds.dat', and must be in the
		directory given by the environment variable TIME_CONV.  It must
		be properly updated as new leap seconds are announced.

 Side effects:	None.

 Category    :	Utilities, Time.

 Prev. Hist. :	Based on CHECK_TIME by M. Morrison, LPARL.

 Written     :	William Thompson, GSFC, 29 September 1993.

 Modified    :	Version 1, William Thompson, GSFC, 29 September 1993.
		Version 2, Donald G. Luttermoser, GSFC/ARC, 20 December 1994
			Added the keyword ERRMSG.  Added a check for the 
			STRUCTURE-TAG names.
		Version 3, Donald G. Luttermoser, GSFC/ARC, 30 January 1995
			Added ERRMSG keyword to internally called procedures.
			Made the error handling routine more robust.  Note
			that this procedure can handle both vectors and 
			scalars.
		Version 4, William Thompson, GSFC, 28 January 1997
			Allow for long input arrays.

 Version     :	Version 4, 28 January 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_int_time.pro)


CHECK_LOCK

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CHECK_LOCK
               
 Purpose     : check if a LOCK file created by APPLY_LOCK has expired
               
 Category    : Planning
               
 Explanation : checks creation date of LOCK file saved in file.
               
 Syntax      : IDL> expired=check_lock(lock_file)
    
 Examples    : 

 Inputs      : LOCK_FILE = lock file name (with path)
               
 Opt. Inputs : None
               
 Outputs     : EXPIRED  = 1 if expired

 Opt. Outputs: None
               
 Keywords    :
               QUIET    = set to suppress messages
               ERR      = output messages
               TIME     = LOCK file creation time

 Common      : None
               
 Restrictions: LOCK file must be created by APPLY_LOCK
               
 Side effects: None.
               
 History     : Version 1,  17-July-1996,  D M Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_lock.pro)


CHECK_LOG

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

   Name: check_log

   Purpose: check idl batch logfile for abnormal termination

   Calling Sequence:
      check_log, logfile [user=user]

   Input Paramters:
      logfile - idl batch log to check

   Keyword Paramters:
      job    - batch job name (optional)
      user   - user list for e-mail
      window - lines preceding error to include in output (def=5, -1 = all)
      nomail   - switch, if set, inhibit mail on ABNORMAL exit (def=mail)
      mailnorm - switch, if set, mail on NORMAL exit (def=nomail)
      unixerr - switch, if set, limit checks to UNIX errors
      ftperr  - switch, if set, limit checks to ftp errors

   History:
       1-Mar-1994 (SLF)
       2-Mar-1994 (SLF) - add  and  checks
      15-Apr-1994 (SLF) - inhibit message if /quiet is set
      21-Apr-1994 (SLF) - add UNIXERR/FTPERR keywords and action, call sear
			   call search.pro, mail SUBJ: info, other mods...
       3-May-1994 (SLF) - call search.pro with /case_ignore set
      10-May-1994 (SLF) - allow inhibition of unix and ftp checks via log/env
      29-Sep-1994 (SLF) - add REMOVE keyword (succesfully completed jobs&logs)
       4-Sep-1994 (SLF) - do a RENAME instead of a delete (seperate option after testing

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_log.pro)


CHECK_SYNOP

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

   Include file for checking existence and write access to SYNOP DB
        

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_synop.pro)


CHECK_TAPE_DRV

[Previous Routine] [Next Routine] [List of Routines]
 NAME        :	
	CHECK_TAPE_DRV
 PURPOSE     :	
	Associates tape drive numbers with device files.  *Unix only*
 EXPLANATION :	
	This is an internal routine to the CDS/SERTS Unix tape handling
	utilities.  It converts tape drive numbers to actual device
	names, and checks to make sure that the device file is open.

		**Unix only**

 CALLING SEQUENCE:         :	
	CHECK_TAPE_DRV, UNIT, LOGICAL_DRIVE, DRIVE, LUN

 INPUTS      
	UNIT = Tape unit number.  Tape drives are selected via the UNIX
		       environment variables "MT1", "MT2", etc.  The desired
		       tape drive is thus specified by numbers, as in VMS.
		       Must be from 0 to 9.

 OUTPUTS     :	
	LOGICAL_DRIVE = Name of environment variable pointing to tape
				drive device file, e.g. "MT0".
	DRIVE	      = Name of device file, e.g. '/dev/nrst0'.
	LUN	      = Logical unit number used for reads and writes.

 COMMON      :	
	CHCK_TAPE_DRVS contains array TAPE_LUN, containing logical unit
		numbers for each tape device, and TAPE_OPEN, which tells
		whether each device is open or not.

 RESTRICTIONS:	
	The environment variable "MTn", where n corresponds to the
		variable UNIT, must be defined.  E.g.,

			setenv MT0 /dev/nrst0

		Requires IDL v3.0 or later.

 SIDE EFFECTS:	
	If the device file is not yet open, then the tape is rewound,
		and a file unit is opened to it.

 Category    :	Utilities, I/O, Tape.

 Prev. Hist. :	William Thompson, Apr 1991.

 Written     :	William Thompson, GSFC, April 1991.

 Modified    :	Version 1, William Thompson, GSFC, 21 December 1993.
			Added keyword /NOSTDIO to OPEN statement.
			Incorporated into CDS library.
		Version 2, William Thompson, GSFC, 22 December 1993.
			Added spawn to "mt rewind".
		Version 3, W. Landsman GSFC 10-Apr-1996
			Open for Readonly, if Update access is unavailable

 Version     :	Version 3, 10-Apr-1996.

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_tape_drv.pro)


CHECK_TIME

[Previous Routine] [Next Routine] [List of Routines]
Name:
	check_check_time
Purpose:
	check to see that msod is within the range
	0 to 86400000
Input:
	msod
	ds79
Output:
	msod
	ds79
History
	Written Fall '91 by M.Morrison
	27-Jul-92 (MDM) Modified to make "i" a long word
	24-Mar-93 (MDM) - Modified logic - see below
	27-May-93 (MDM) - Changed the algorithm to be mathematical
			  instead of a repeat loop
	 3-Jan-95 (MDM) - Changed to use DOUBLE instead of FLOAT
			  because when using a reference time of
			  1-Jan-79, the resolution/accuracy for dates
			  in 1994 is less than 20 seconds!!

(See /host/bluemoon/usr2/idllib/ssw/allpro/check_time.pro)


CHG_CTABLE

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       CHG_CTABLE

 PURPOSE:
       Change current color table in terms of gamma, bottom and top

 CATEGORY:


 EXPLANATION:
       There are cases where there is a need to change the current color
       table in terms of gamma, first and last color index to
       use. This routine does exactly this.

 SYNTAX:
       chg_ctable, gamma=gamma, bottom=bottom, top=top

 EXAMPLES:
       IDL> loadct, 3
       IDL> chg_ctable, gamma=0.67, bottom=20

 INPUTS:
       None required.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       GAMMA = Gamma value (0.1 to 10.0) to be set
       BOTTOM = First color index to use
       TOP = Last color index to use
	NCOLORS = number of colors to use.  Use color indices from BOTTOM
		to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1.;
 COMMON:
       COLORS

 RESTRICTIONS:
       But be called only after LOADCT (otherwise variables in COLORS
          common blocks will not be defined.

 SIDE EFFECTS:
       Current color table is changed.

 HISTORY:
       Version 1, November 20, 1995, Liyun Wang, NASA/GSFC. Written

 CONTACT:
       Liyun Wang, NASA/GSFC (Liyun.Wang.1@gsfc.nasa.gov)

(See /host/bluemoon/usr2/idllib/ssw/allpro/chg_ctable.pro)


CHILD_POINTER

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

 Name        : CHILD_POINTER()

 Purpose     : to retrieve child of a pointer variable

 Category    : Help

 Explanation : use appropriate WIDGET or HANDLE info routines

 Syntax      : IDL> child=child_pointer(pointer)

 Inputs      :  POINTER = pointer variable

 Opt. Inputs : None

 Outputs     : CHILD = child ID of pointer

 Opt. Outputs: None

 Keywords    : None

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  1-Sep-1995,  D.M. Zarro.  Written
               Version 2, 17-Jul-1997, D.M. Zarro. Modified
                 -- Updated to version 5 pointers

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/child_pointer.pro)


CHKARG

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SDAC

 Name        : 
	CHKARG
 Purpose     : 
	Determine calling arguments of procedure or function.
 Explanation : 
	Determines the calling arguments of an IDL procedure or function.  Used
	by SCANPATH, but can also be called separately.
 Use         : 
	CHKARG  [, NAME ]
 Inputs      : 
	None required.
 Opt. Inputs : 
	NAME	= Name of procedure to check arguments of.  If not passed, then
		  it will be prompted for.
 Outputs     : 
	The arguments of the procedure are printed to the screen.
 Opt. Outputs: 
       name  = name of routine
	proc  = string array with lines of procedure 
       lname = libr/direc location of procedure
       found = 1/0 if file is found/not found
 Keywords    : 
	PATH  = optional directory/library search path.  Same format
		and semantics as !PATH.  If omitted, !PATH is used.
       SEARCH_ONLY = search path but do not print procedure arguments
       RESET = clear commons
       FOUND = 1 if found, 0 otherwise
       PROGRESS = present progress bar
       OUT = list of function/procedure calls
       QUIET = turnoff printing
 Calls       : 
	DATATYPE, GET_LIB, GET_MOD, GET_PROC, LOC_FILE
 Common      : 
	None.
 Restrictions: 
       Cannot access built-in IDL procedures
 Side effects: 
	None.
 Category    : 
	Documentation, Online_help.
 Prev. Hist. : 
       Written DMZ (ARC) Oct 1990
       Converted to version 2 (DMZ Jul'92)
 Written     : 
	D. Zarro, GSFC/SDAC, October 1990.
 Modified    : 
	Version 1, William Thompson, GSFC, 23 April 1993.
		Incorporated into CDS library.
       Version 2, Dominic Zarro, GSFC, 1 August 1994.
               Cleaned up
       Version 3, Dominic Zarro (GSFC) 21 September 1994.
                  added checks for blank lines in documentation
       Version 4, Zarro (GSFC), 21 April 1995
                  added SEARCH keyword
       Version 5, Zarro (SM&A/GSFC), 10 Feb 1999
                  put on steroids
       Version 6, Zarro (SM&A/GSFC), 20 May 1999
                  added OUT and QUIET keywords

(See /host/bluemoon/usr2/idllib/ssw/allpro/chkarg.pro)


CHKLOG

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

 Name        :
	CHKLOG
 Purpose     :
	Determine actual name of logical or environment variable.
 Explanation :
	This routine determines the actual name of a logical name (VMS) or
	environment variable (UNIX).  In VMS the routine TRNLOG,/FULL is used;
	otherwise GETENV is used.
 Use         :
	Result = CHKLOG( VAR  [, OS ] )
 Inputs      :
	VAR = String containing the name of the variable to be translated.
 Opt. Inputs :
	None.
 Outputs     :
	The result of the function is the translated name, or (in VMS) an array
	containing the translated names.
 Opt. Outputs:
       OS = The name of the operating system, from !VERSION.OS.
 Keywords    :
	DELIM = delimiter to use for separating substrings
       FULL = do full translation (VMS only)
       PRESERVE = return input name if no translation found
 Calls       :
	None.
 Common      :
	None.
 Restrictions:
	None.
 Side effects:
	None.
 Category    :
	Utilities, Operating_system.
 Prev. Hist. :
       Written  - DMZ (ARC) May 1991
       Modified - DMZ (ARC) Nov 1992, to use GETENV
 Written     :
	D. Zarro, GSFC/SDAC, May 1991.
 Modified    :
	Version 1, Zarro, ARC/GSFC 23 April 1993.
       Version 2, GSFC, 1 August 1994.
               Added capability for vector inputs
       Version 3, Liyun Wang, GSFC/ARC, January 3, 1995
               Added capability of interpreting the "~" character under UNIX
       Version 4, Zarro, GSFC/ARC, February 17 1997
               Added call to EXPAND_TILDE, corrected many potential bugs
       Version 5, Zarro, GSFC/SAC, June 9 1998
               Added recursive call for environment variables embedded
               in input
       Version 6, Zarro, GSFC/SAC, August 10 1998
               Added recursive call for nested environment variables
               (after RAS broke it)
       Version 7, Zarro, SM&A/GSFC, 16 May 1999
               Added check for "naked" "$" or "~" inputs
       Version 8, Zarro, SM&A/GSFC, 10 June 1999
               Added check for different OS delimiters and made Windows
               friendly

 VERSION:
       Version 8

(See /host/bluemoon/usr2/idllib/ssw/allpro/chklog.pro)


CHKTAG

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SDAC

 Func Name   :	CHKTAG

 Purpose     : Check for presence of a particular tag in a structure

 Explanation :

 Use         : check=chktag(stc,tag)

 Inputs      :
          	STC  = structure name
               TAGS = tag name to check for;
 Opt. Inputs : None.

 Outputs     : 1 if present, 0 otherwise

 Opt. Outputs: None.

 Keywords    : RECUR = set to search recursively down nested structures

 Calls       : None.

 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : 

 Prev. Hist. : None.

 Written     :	DMZ (ARC) Oct 1993

 Modified    :

 Version     : 1.0

(See /host/bluemoon/usr2/idllib/ssw/allpro/chktag.pro)


CHK_DIR()

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

 NAME:	
       CHK_DIR()

 PURPOSE:
       Check the validity of a directory name.

 EXPLANATION:

 CALLING SEQUENCE: 
       Result = CHK_DIR(dir_name)

 INPUTS:
       DIR_NAME -- A string specifying the directory name. For VMS system,
                   a valid directory name can be a logical name, or
                   any string with a format of '[...]', '[...]aaa.dir', 
                   or 'aaa.dir'

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RESULT -- 1 if the directory name is valid, 0 otherwise

 OPTIONAL OUTPUTS:
       OUTPUT -- A string indicating the real directory path

 KEYWORD PARAMETERS: 
       FULLNAME -- if set and OUTPUT is present, OUTPUT will contain the full
                   path specification for the directory

 CALLS:
       DATATYPE, CHKLOG, STR_INDEX, OS_FAMILY

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written October 9, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 2, Liyun Wang, GSFC/ARC, December 16, 1994
          Made work for VMS directories
       Version 3, Liyun Wang, GSFC/ARC, December 29, 1994
          Added keyword FULLNAME
          Fixed bug of false reporting if the given string represents 
             a plain file under Unix OS
	Version 4, William Thompson, GSFC, 29 August 1995
		Modified to use OS_FAMILY()
	Version 5, Zarro, 29 April 1997
		Added check for blank input

 VERSION:
       Version 5

(See /host/bluemoon/usr2/idllib/ssw/allpro/chk_dir.pro)


CHK_STRUCT_NAME

[Previous Routine] [Next Routine] [List of Routines]
 Project     :	SDAC

 Name        :	CHK_STRUCT_NAME

 Purpose     :	check if a structure name is unique

 Explanation :	

 Use         : STATUS=CHK_STRUCT_NAME(SNAME)

 Inputs      :	SNAME = structure name to check

 Opt. Inputs :	None.

 Outputs     :	STATUS =0/1 if SNAME already exists/doesn't exist

 Opt. Outputs:	None.

 Keywords    :	TEMPLATE = extant structure with name SNAME
             : VERBOSE = for messages

 Calls       :	EXECUTE

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 7 July 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/chk_struct_name.pro)


CHNIVEAUX

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

 Computation of contour levels

 Parameters:	Cmax	Highest contour to be drawn 		(input)
 		Cmin	Lowest contour to be drawn (opt. if linear scaling)
								(input)
		nlevels	Number of contours to be drawn		(input)
		Ctype	Scaling of contour levels 		(input)
				(1 = linear, 2 = logarithmic base 10)
		Levels	Array of contour levels			(output)

(See /host/bluemoon/usr2/idllib/ssw/allpro/chniveaux.pro)


CH_SCALE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SDAC
                   
 Name        : CH_SCALE
               
 Purpose     : This procedure scales text for TEKTRONIX default screens.
               
 Category    : GRAPHICS
               
 Explanation : 
 	scale text in graphics output to that of TEKTRONIX graphics
 	also scale to multiplot environment
 	SCALE TO Y DISTANCE, XSCALING MUST BE DONE IN SETTING UP DISPLAY.
 	XSCALING ALLOWED USING KEYWORD
 	Scaling for plot axes is different than for xyouts because of
 	the scaling factor of 0.5 applied to plot text when any dimension of
 	!p.multi exceeds 2.  This factor is not applied to text labels in
 	xyouts!
               
 Use         : 
	scale = Ch_scale( Scale [,/xyouts] [,/xcorr])

 Examples    :
    xyouts, nx1lab, ylab, 'N', /normal, chars = ch_scale(.8,/xy), col=fcolor(9)
      utplot, xsc4(*,0), yplotted, yminor=-1, $
        ymargin=[10,2],xmargin=[13,5], title=desc(0), ytitle='Counts S!u-1!n', $
        xtitle=' ', xrange=[xmin,xmax], yrange=[ymin,ymax], $
        ytype=logplot, psym=psym, chars = ch_scale(0.8), color=9
    
 Inputs      : 
	Scale - Normal scaling factor used in TEKTRONIX graphics.
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 
	XYOUTS  -Keyword indicating scale used in XYOUTS call.   (input)
	XCORR   -Keyword indicating to use scaling along x axis. (input)

 Calls       :
	FCHECK
 Common      : 
	SCALECOM
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :
 		RAS 4/92

 Modified    : 
        Modified 8/29/94 by Amy Skowronek to check for global variable.
        If variable is set, result multiplied by global.  To scale up
        text in multiple plot.
	Version 3, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation

(See /host/bluemoon/usr2/idllib/ssw/allpro/ch_scale.pro)


CIC

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

 PURPOSE:
       This function interpolates an irregularly sampled field to a
       regular grid using Cloud In Cell (nearest grid point gets
       weight 1-dngp, point on other side gets weight dngp, where
       dngp is the distance to the nearest grid point in units of the
       cell size).

 CATEGORY:
       Mathematical functions, Interpolation

 CALLING SEQUENCE:
       Result = CIC, VALUE, POSX, NX[, POSY, NY, POSZ, NZ, 
                     AVERAGE = average, WRAPAROUND =  wraparound,
                     ISOLATED = isolated, NO_MESSAGE = no_message]

 INPUTS:
       VALUE: Array of sample weights (field values). For e.g. a
              temperature field this would be the temperature and the
              keyword AVERAGE should be set. For e.g. a density field
              this could be either the particle mass (AVERAGE should
              not be set) or the density (AVERAGE should be set).
       POSX:  Array of X coordinates of field samples, unit indices: [0,NX>.
       NX:    Desired number of grid points in X-direction.
       
 OPTIONAL INPUTS:
      POSY: Array of Y coordinates of field samples, unit indices: [0,NY>.
      NY:   Desired number of grid points in Y-direction.
      POSZ: Array of Z coordinates of field samples, unit indices: [0,NZ>.
      NZ:   Desired number of grid points in Z-direction.

 KEYWORD PARAMETERS:
       AVERAGE:    Set this keyword if the nodes contain field samples
                   (e.g. a temperature field). The value at each grid
                   point will then be the weighted average of all the
                   samples allocated to it. If this keyword is not
                   set, the value at each grid point will be the
                   weighted sum of all the nodes allocated to it
                   (e.g. for a density field from a distribution of
                   particles). (D=0). 
       WRAPAROUND: Set this keyword if you want the first grid point
                   to contain samples of both sides of the volume
                   (see below).
       ISOLATED:   Set this keyword if the data is isolated, i.e. not
                   periodic. In that case total `mass' is not conserved.
                   This keyword cannot be used in combination with the
                   keyword WRAPAROUND.
       NO_MESSAGE: Suppress informational messages.

 Example of default allocation of nearest grid points: n0=4, *=gridpoint.

     0   1   2   3     Index of gridpoints
     *   *   *   *     Grid points
   |---|---|---|---|   Range allocated to gridpoints ([0.0,1.0> --> 0, etc.)
   0   1   2   3   4   posx

 Example of ngp allocation for WRAPAROUND: n0=4, *=gridpoint.

   0   1   2   3         Index of gridpoints
   *   *   *   *         Grid points
 |---|---|---|---|--     Range allocated to gridpoints ([0.5,1.5> --> 1, etc.)
   0   1   2   3   4=0   posx


 OUTPUTS:
       Prints that a CIC interpolation is being performed of x
       samples to y grid points, unless NO_MESSAGE is set. 

 RESTRICTIONS:
       Field data is assumed to be periodic with the sampled volume
       the basic cell, unless ISOLATED is set.
       All input arrays must have the same dimensions.
       Postition coordinates should be in `index units' of the
       desired grid: POSX=[0,NX>, etc.
       Keywords ISOLATED and WRAPAROUND cannot both be set.

 PROCEDURE:
       Nearest grid point is determined for each sample.
       CIC weights are computed for each sample.
       Samples are interpolated to the grid.
       Grid point values are computed (sum or average of samples).
 NOTES:
       Use tsc.pro for a higher-order interpolation scheme, ngp.pro for a lower
       order interpolation scheme.    A standard reference for these 
       interpolation methods is:   R.W. Hockney and J.W. Eastwood, Computer 
       Simulations Using Particles (New York: McGraw-Hill, 1981).
 EXAMPLE:
       nx=20
       ny=10
       posx=randomu(s,1000)
       posy=randomu(s,1000)
       value=posx^2+posy^2
       field=cic(value,posx*nx,nx,posy*ny,ny,/average)
       surface,field,/lego

 MODIFICATION HISTORY:
       Written by Joop Schaye, Feb 1999.

(See /host/bluemoon/usr2/idllib/ssw/allpro/cic.pro)


CIRCLE_SYM

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CIRCLE_SYM
               
 Purpose     : Define (part of) a circle as the user plotting symbol.
               
 Explanation : Calls usersym to define an circle as the user symbol
               to be used when psym=8 is specified in (o)plot. The symbol
               will be filled if requested.
               
 Use         : IDL> circle_sym, quad, thick=2, /fill
               IDL> plot,indgen(10),psym=8
    
 Inputs      : quad  - defines which quadrant of the circle to plot.
                       zero or undefined means use full circle.
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : thick  - the thickness of the perimeter line
               fill   - means fill the symbol

 Calls       : None

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

 Written     : C D Pike, RAL, 21-Apr-94
               
 Modified    : 

 Version     : Version 1, 21-Apr-94

(See /host/bluemoon/usr2/idllib/ssw/allpro/circle_sym.pro)


CIRRANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CIRRANGE
 PURPOSE:
	To force an angle into the range 0 <= ang < 360.
 CALLING SEQUENCE:
	CIRRANGE, ang, [/RADIAN]

 INPUTS/OUTPUT:
	ang     - The angle to modify, in degrees.  This parameter is
	          changed by this procedure.  Can be a scalar or vector.
		  The type of ANG is always converted to double precision
		  on output.

 OPTIONAL INPUT KEYWORDS:
	RADIANS - If present and non-zero, the angle is specified in
  	          radians rather than degrees.  It is forced into the range
	          0 <= ang < 2 PI.
 PROCEDURE:
	The angle is transformed between -360 and 360 using the MOD operator.	
	Negative values (if any) are then transformed between 0 and 360
 MODIFICATION HISTORY:
	Written by Michael R. Greason, Hughes STX, 10 February 1994.
	Get rid of WHILE loop, W. Landsman, Hughex STX, May 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/cirrange.pro)


CIR_MASK()

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       CIR_MASK()

 PURPOSE: 
       Get indices of a circular mask over a 2D array

 CATEGORY:
       Utility
 
 EXPLANATION:
       There are cases where there is a need of getting indices of
       all pixels of a circular region in a 2D array. This routine
       does just that.

 SYNTAX: 
       Result = cir_mask(array, x0, y0, r0)

 INPUTS:
       ARRAY - 2D array
       X0    - X position of the center of the circular region, in pixels
       Y0    - Y position of the center of the circular region, in pixels
       R0    - Radius of the circular region, in pixels

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RESULT - Indices of pixels inside (or outside, if OUTSIDE keyword 
                is set) the circular region. A -1 is returned if an
                error occurs 

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       OUTSIDE - Set this keyword to mask outside of the circular region
       ERROR   - Error message returned; a null string if no error

 COMMON:
       None.

 RESTRICTIONS: 
       Number of elements in ARRAY cannot exceed the maximum limit of
       long integer

 SIDE EFFECTS:
       None.

 HISTORY:
       Version 1, February 15, 1996, Liyun Wang, GSFC/ARC. Written

 CONTACT:
       Liyun Wang, GSFC/ARC (Liyun.Wang.1@gsfc.nasa.gov)

(See /host/bluemoon/usr2/idllib/ssw/allpro/cir_mask.pro)


CLEANPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CLEANPLOT
 PURPOSE:
	Reset all system variables (!P,!X,!Y,!Z) to their default values
 EXPLANATION:
	Reset all system variables (!P,!X,!Y,!Z) which are set by the user 
	and which affect plotting to their default values.

 CALLING SEQUENCE:
	Cleanplot

 INPUTS:	
	None

 OUTPUTS:	
	None

 SIDE EFFECTS:	
	The system variables that concern plotting are reset
	to their default values.  A message is output for each
	variable changed.   The CRANGE, S, WINDOW, and REGION fields of the
	!X, !Y, and !Z system variables are not checked since these are 
	set by the graphics device and not by the user.    

 PROCEDURE:
	This does NOT reset the plotting device.
	This does not change any system variables that don't control plotting.

 RESTRICTIONS:
	If user default values for !P, !X, !Y and !Z are different from
	the defaults adopted below, user should change P_old etc accordingly

 MODIFICATION HISTORY:
	Written IDL Version 2.3.0  W. Landsman & K. Venkatakrishna May '92
	Handle new system variables in V3.0.0     W. Landsman   Dec 92
	Assume user has at least V3.0.0           W. Landsman   August 95
	V5.0 has 60 instead of 30 TICKV values    W. Landsman   Sep. 97
	Change !D.N_COLORS to !D.TABLE_SIZE for 24 bit displays
			W. Thompson, GSFC  April 1998
	

(See /host/bluemoon/usr2/idllib/ssw/allpro/cleanplot.pro)


CLEAN_EXPOSURE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CLEAN_EXPOSURE
               
 Purpose     : Clean cosmic rays from single (slit spectrogram) exposure
               
 Explanation : This routine identifies cosmic rays by comparing pixels with
               the median of the surrounding pixels inside a rectangular box.

               The routine is specifically designed to work with slit
               spectrograms, with the first dimension of the data being the
               dispersion direction, and the second dimension along the
               slit. The rectangular box used to calculate the local median
               value is longer in the slit direction than in the dispersion
               direction. The size of the median box can be set through the
               keywords XBOX/YBOX.

               The routine does a fairly good job of identifying cosmic rays
               when comparing with cosmic rays identified by eye. The method
               is, however, not foolproof. Both false alarms and undetected
               cosmic rays do occur, so manual inspection is encouraged.

               A pixel P is determined to be a (first approximation) cosmic
               ray:

               IF   ( P LT LIMIT AND (P - MEDIAN) GT MAX_VAR_LOW )
                 OR ( P GE LIMIT AND (P / MEDIAN) GT MAX_FACTOR_HI )

		where LIMIT, MAX_VAR_LOW and MAX_FACTOR_HI can be set through
		keywords. They have useful default values for debiased CDS NIS
		exposures.  For other instruments, these parameters, as well as
		XBOX,YBOX, will need to be retuned.

               Since this definition often leaves (minimally) affected pixels
               on the borders of cosmic ray hits untouched, all pixels having
               a (first approximation) cosmic ray neighbour to its left or
               right, or directly above or below will be marked as cosmic
               rays as well. This may be turned off by setting the keyword
               NO_NEIGHBOUR, or modified by setting the KERNEL keyword to a
               convolution kernel that is used to flag neighbours.

               If a MISSING value is supplied, identified cosmic ray pixels
               are set to this value. Supplying the MISSING value will also
               leave pixels with this value out in the calculation of the
               local median.

               If the keyword FILL is set, or if no MISSING value is
               supplied, the cosmic ray pixels are filled with the median of
               the surrounding pixels.
               
 Use         : CLEAN_EXPOSURE,EXPOSURE
    
 Inputs      : EXPOSURE : A 2-dimensional array of counts.
               
 Opt. Inputs : None.
               
 Outputs     : EXPOSURE is altered.
               
 Opt. Outputs: None.
               
 Keywords    : MISSING : The value of possible missing data (like
                         already-identified cosmic rays), and the value used
                         to flag the cosmic ray pixels. If this value is not
                         supplied, the FILL option is automatically used.

               FILL : Set this flag to fill in the cosmic ray pixels with the
                      value of the local median.

               NO_NEIGHBOUR : Set this flag to avoid flagging nearest
                              neighbours (left, right, above, below) of first
                              approximation cosmic ray pixels as cosmic rays.
                              
                              The effect of the KERNEL keyword is turned off
                              when NO_NEIGHBOUR is set.

               XBOX/YBOX: Determines the size of the box used to calculate
                          the local median.

               LIMIT : Determines the dividing line between high/low pixels,
                       see the algorithm description.

               MAX_VAR_LOW : See the algorithm description

               MAX_FACTOR_HI : See algorithm description.

               KERNEL : See algorithm description, and it's use in the
                        program. Setting NO_NEIGHBOUR disables this keyword.

 Calls       : default, fmedian()

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : General Utility
               
 Prev. Hist. : None.

 Written     : S. V. H. Haugan, UiO, 11 December 1996
               
 Modified    : Version 2, SVHH, 6 May 1998
               Version 3, SVHH, 17 August 1998
                          Fixed bug introduced with the kernel keyword in
                          version 2. Without NO_NEIGHBOUR set, the default 
                          kernel was always applied twice (regardless of 
                          the KERNEL keyword setting), causing the neighbours
                          of neighbours to be flagged too).

 Version     : 3, 17 August 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_exposure.pro)


CLEAN_GIF

[Previous Routine] [Next Routine] [List of Routines]
 Name:
	CLEAN

 Purpose:
	To fix-up a gif image with a weird color table.  Gifs, in general,
	have color tables in random order.  It is helpful to have them sorted
	out in intensity order.  CLEAN_GIF does that.  It is designed to be 
	used on memory-resident gif images or as a replacement for READ_GIF
	(with a slight change of parameter order from READ_GIF).

 Usage:
	ZFIX_GIF,a,r,g,b,f  - Read a gif image, clean, and return in (a,r,g,b)
	ZFIX_GIF,a,rgb,f    - Read a gif image, clean, and return in (a,rgb)
	ZFIX_GIF,a,f	    - Read a gif image, clean, and return in (a)
	ZFIX_GIF,a,r,g,b    - Clean (a,r,g,b) in place
	ZFIX_GIF,a,rgb      - Clean (a,rgb) in place
 
 PARAMETERS:
	A   - the image to fix.  (I/O; if 'F' specified, output only)
	RGB - a 256x3 matrix containing the complete color table (I/O)
		(This may be used INSTEAD of r,g, and b).
	R   - a 256 element array; the red   part of the color table (I/O)
	G   - a 256 element array; the green part of the color table (I/O)
	B   - a 256 element array; the blue  part of the color table (I/O)
	F   - A file to load in. (Input only)
 
 Method: 
	If necessary, a gif image is read in from a file.  Then the 
	color table is sorted and the image values diddled to match the
	sorting order.  Finally, appropriate values are stuck back into th
	parameters.

 History:
	Written by Craig DeForest, 2-Sep-98

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_gif.pro)


CLEAN_GOES

[Previous Routine] [Next Routine] [List of Routines]
 Project     :  SDAC
                   
 Name        :  CLEAN_GOES
               
 Purpose     :  This procedure finds and removes the glitches in the
 		 GOES xray data due to the changes in the analogue
		 filtering used to accommodate the full dynamic range.
               
 Category    :  GOES
               
 Explanation :  CLEAN_GOES finds bad data points (spikes or bad values due to gain changes)
                eliminates them, and interpolates across them by using the surrounding
                points.

               
 Use         : clean_goes, goes, tarray = tarray, yarray = yarray, yclean = yclean, $
               bad0 = bad0, bad1 = bad1, numstat=numstat, tstat=tstat, stat=stat, error=error
    
 Inputs      : 
               
 Opt. Inputs : GOES - structure obtained from RD_GXD with tags time, day, lo, and hi
		replacing TARRAY and YARRAY.
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : TARRAY- time in utime format, sec from 1-jan-1979, dblarr(nbins)
		YARRAY- raw GOES, fltarr(nbins, 2)
		YCLEAN- despiked YARRAY
		SATELLITE- GOES satellite number, GOES8 and 9 are considerably more
		resilient to gain change spikes, use integers
		BAD0 - indices of cleaned Lo channel
		BAD1 - indices of cleaned Hi channel
		NUMSTAT- Default value is -1, if not then data are assumed
		to originate in SDAC format GOES fits files.  Gain change
		times are indicated in TSTAT
		TEST- scaling factor for glitch test, default 7, larger
		values make the clean more (too) sensitive.
		SECOND- Second pass through for clean
		TSTAT
		STAT
		ERROR

 Calls       : CHECKVAR, ANYTIM, DATATYPE, FIND_FITS_BAD, FCHECK, SPLINE, F_DIV

 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : New version of CLEAN_GOES, based on clean_goes.old by AKT
		This version uses a faster and simpler despike algorithm
		based exclusively on scaled first differences.  This is
		a test version.  When the spikes are located, the spline
		interpolation algorithm is used to fill the data.
		Version 1, ras, 29-jan-1997
		Version 2, ras, 4-feb-1997, good data is checked to avoid
		repeats before using spline interpolation.  Spline interpolation
		only used over short intervals containing bad data points
		instead of passing the entire observing interval to the
		spline routine.
		Version 3, ras, 7-feb-1997, data isn't cleaned if it is
		less than default values of ([7e-8,1e-8])(ich), cleaning
		test more stringent on GOES8+, removed 2nd cleaning,
		added satellite keyword.
		Version 4, RAS, 9-apr-1997, modified cleaning algorithm to
		exclude long gaps.
		Version 5, RAS, 19-May-1997, long gap algorithm patched 
		temporarily, needs re-examination.

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_goes.pro)


CLEAN_GOES2

[Previous Routine] [Next Routine] [List of Routines]
 Project     :  GOES
                   
 Name        :  CLEAN_GOES
               
 Purpose     :  This procedure finds and removes the glitches in the
 		 GOES xray data due to the changes in the analogue
		 filtering used to accommodate the full dynamic range.
               
 Category    : 
               
 Explanation :  CLEAN_GOES finds bad data points (spikes or bad values due to gain changes)
                eliminates them, and interpolates across them by using the surrounding
                points.

               
 Use         : clean_goes, goes, tarray = tarray, yarray = yarray, yclean = yclean, $
               bad0 = bad0, bad1 = bad1, numstat=numstat, tstat=tstat, stat=stat, error=error
    
 Inputs      : 
               
 Opt. Inputs : GOES - structure obtained from RD_GXD with tags time, day, lo, and hi
		replacing TARRAY and YARRAY.
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : TARRAY- time in utime format, sec from 1-jan-1979, dblarr(nbins)
		YARRAY- raw GOES, fltarr(nbins, 2)
		YCLEAN- despiked YARRAY
		BAD0 - indices of cleaned Lo channel
		BAD1 - indices of cleaned Hi channel
		NUMSTAT- Default value is -1, if not then data are assumed
		to originate in SDAC format GOES fits files.  Gain change
		times are indicated in TSTAT
		TEST- scaling factor for glitch test, default 7, larger
		values make the clean more (too) sensitive.
		SECOND- Second pass through for clean
		TSTAT
		STAT
		ERROR

 Calls       : CHECKVAR, ANYTIM, DATATYPE, FIND_FITS_BAD, FCHECK, SPLINE

 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : New version of CLEAN_GOES, based on clean_goes.old by AKT
		This version uses a faster and simpler despike algorithm
		based exclusively on scaled first differences.  This is
		a test version.  When the spikes are located, the spline
		interpolation algorithm is used to fill the data.
		Version 1, ras, 29-jan-1997
 

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_goes2.pro)


CLEAN_JOURNAL

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

 NAME: 
       CLEAN_JOURNAL

 PURPOSE:
	This procedure removes some of the output in journal files to make
	the resultant files more easily modified into procedures.

 CATEGORY:
	UTIL, GEN, STRING

 CALLING SEQUENCE:
	clean_journal, file, items=items

 CALLS:
	none

 INPUTS:
       File: The file to clean.

 OPTIONAL INPUTS:
       ITEMS: An array of text strings.  The lines which begin with these strings are
	eliminated.  The defaults are:
	['print',';','retall','xmanager','wdelete','chkarg', $
	'.',',','help','$']

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, RAS 5-June 1996
	Version 2, RAS 4-dec-1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_journal.pro)


CLEAN_PATH

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

 Name        : CLEAN_PATH

 Purpose     : clean up SSW path by reorganizing directories

 Category    : utility

 Explanation : use this to move SUMER and YOHKOH UCON libraries to
               end of IDL path to avoid potential conflicts.

 Syntax      : clean_path,new_path

 Examples    :

 Inputs      : None

 Opt. Inputs : None

 Outputs     : NEW_PATH = rearranged IDL !path

 Opt. Outputs: None

 Keywords    : NOSITE = exclude site directories
               RESET = reset back to original state
               UCON = include Yohkoh UCONS

 Common      : None

 Restrictions: None

 Side effects: If NEW_PATH not on command line, !path is reset automatically

 History     : Written 22 Oct 1997, D. Zarro, SAC/GSFC

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/clean_path.pro)


CLEARPLOT

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	clearplot
PURPOSE:
	To clear the IDL plotting parameters
HISTORY:
	Written Sep-91 by M.Morrison
	 3-Mar-92 (MDM) - Added !x.margin and !y.margin and
			  !p.title

(See /host/bluemoon/usr2/idllib/ssw/allpro/clearplot.pro)


CLEAR_SCREEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CLEAR_SCREEN
 PURPOSE:
	Writes escape sequence to clear screen and set cursor to top left corner
 CALLING SEQUENCE:  
	clear_screen
 INPUTS:
	none
 OUTPUTS:
	none
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB  17-Feb-94	Written

(See /host/bluemoon/usr2/idllib/ssw/allpro/clear_screen.pro)


CLEAR_STRUCT

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

 Name        :	CLEAR_STRUCT

 Purpose     :	clear all field values in a structure

 Explanation :	initializes field values by setting to 0 or blank
               strings as appropriate.

 Use         : NEW_STRUCT=CLEAR_STRUCT(STRUCT)

 Inputs      :	STRUCT = input structure

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = initialized original structure

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       :	NEW_STRUCT (recursively for nested structures)

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 22 September 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/clear_struct.pro)


CLEAR_UTPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CLEAR_UTPLOT
 PURPOSE:
	Restores plotting structures !x and !y to their values prior to calls to
	SET_UTPLOT or UTPLOT.. 
 CALLING SEQUENCE:
	CLEAR_UTPLOT
 KEYWORD INPUTS:
	NO_UTBASE - Don't clear UTBASE from common.  Useful for datasets where
	the data is relative to the base and only the plot limits need clearing.
 COMMON BLOCKS:
       COMMON CLEARCOMMON,XOLD,YOLD,CLEARSET = holding area for previous
	!x and !y structures if clearset=1
	common utcommon - utbase,utstart,utend,xst
 RESTRICTIONS:
	None.
 PROCEDURE:
	Restores structures !x and !y and resets the common variable CLEARSET.  
	Next call to SET_UTPLOT will again store !x and !y.
	Call CLEAR_UTPLOT if execution stops in the middle of any UTPLOT 
	package calls to clear plotting structures !x and !y.
 MODIFICATION HISTORY:
	Written by Richard Schwartz for IDL Version 2   91/02/17
       20-Aug-92 (MDM) Added clearing UTBASE, UTSTART and UTEND
        1-Nov-92 (DMZ) Added check that xold and yold exist
       17-Mar-93 (MDM) Set !quiet=0 instead of =1
	16-nov-93 removed !quiet
	27-jan-1998, richard.schwartz@gsfc.nasa.gov, added NO_UTBASE keyword.

(See /host/bluemoon/usr2/idllib/ssw/allpro/clear_utplot.pro)


CLIPBOX

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CLIPBOX
               
 Purpose     : To draw a box around the outside of the clip box
               
 Explanation : PLOTS is used to draw a box on the outside of clip box.
               
 Use         : CLIPBOX,THICK
    
 Inputs      : None necessary.
               
 Opt. Inputs : THICK : Thickness of the line. Default 1
               
 Outputs     : None.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : 
               
 Prev. Hist. : None.

 Written     : SVHH, 26 May 1994
               
 Modified    : 

 Version     : 1 - 26 May 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/clipbox.pro)


CLON2EX

[Previous Routine] [Next Routine] [List of Routines]
Name:
	clon2ex
Purpose:
	Calculate times corresponding to input 'Carrington'
	longitudes.
Input:
	CLON_ARR - A 2xN array with rotation number in the first index
		   and longitude in degrees in the second index,
				OR
		   An N vector containing decimal rotation numbers.
Output:
	TIME_ARR
History:
	Written 16-Aug-92 by G. Slater

(See /host/bluemoon/usr2/idllib/ssw/allpro/clon2ex.pro)


CLOSE_ANACUBE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CLOSE_ANACUBE
 PURPOSE:
       Close ANA data cube opened with OPEN_ANACUBE
 CATEGORY:
 CALLING SEQUENCE:
	close_anacube
 INPUTS:
       none
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
       anacube,anacube_window
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:

 MODIFICATION HISTORY:
          Mar-99  RDB  Written

(See /host/bluemoon/usr2/idllib/ssw/allpro/close_anacube.pro)


CLS

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

 NAME:
       CLS

 PURPOSE: 
       Clear screen (in Xterm's VT102 mode)

 EXPLANATION:
       
 CALLING SEQUENCE: 
       CLS 

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       BOTTOM -- Keep cursor at the bottom line if set.

 CALLS:
       None.

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Utility, miscellaneous

 PREVIOUS HISTORY:
       Written December 29, 1994, Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       
 VERSION:
       Version 1, December 29, 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/cls.pro)


CMP_ALL_PRO

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

 Name        : CMP_ALL_PRO

 Purpose     : Compares all procedure files in one path against another.

 Explanation : 

 Use         : CMP_ALL_PRO, PATH1, PATH2

 Inputs      : PATH1	= Primary path to use in the comparison.  All the
			  ".pro" files in PATH1 will be compared against their
			  equivalents (if any) in PATH2.

		PATH2	= Secondary path list.  This is a character string
			  listing one or more paths to use in looking for
			  equivalents of the procedure files found in PATH1.
			  The format is that used by FIND_WITH_DEF.

 Opt. Inputs : None.

 Outputs     : Messages about which files differ, or are not found, are
		printed to the terminal screen.

 Opt. Outputs: None.

 Keywords    : CODE_ONLY = If set, then the FILE_DIFF routine is called to
			    determine whether or not the routine differs only
			    in documentation, or in the code as well.

 Calls       : CMP_FILES, FIND_WITH_DEF, CONCAT_DIR, BREAK_PATH

 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : Software_management.

 Prev. Hist. : None.

 Written     : William Thompson, GSFC, 30 April 1993.

 Modified    : Version 1, William Thompson, GSFC, 30 April 1993.
		Version 2, William Thompson, GSFC, 21 June 1993.
			Modified so that "not found" messages are shorter.
		Version 3, William Thompson, GSFC, 21 August 1997
			Added keyword CODE_ONLY

 Version     : Version 3, 21 August 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cmp_all_pro.pro)


CMP_FILES

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

 Name        : CMP_FILES()

 Purpose     : Checks whether two text files are identical or not.

 Explanation : This routine reads in two text files and compares them line by
		line to determine if they are different or not, similar to the
		Unix routine "cmp".

 Use         : Result = CMP_FILES( FILENAME1, FILENAME2 )

		IF CMP_FILES('file1.pro','file2.pro') EQ 1 THEN	$
			PRINT,'file1.pro and file2.pro are different'

 Inputs      : FILENAME1, FILENAME2 are the names of the two files to check
		against each other.

 Opt. Inputs : None.

 Outputs     : The result of the function is one of the following values:

			0 = The files are identical
			1 = The files are different
			2 = An error occured

 Opt. Outputs: None.

 Keywords    : CODE_ONLY = If set, then the FILE_DIFF routine is called to
			    determine whether or not the routine differs only
			    in documentation, or in the code as well.  This is
			    only applicable to IDL .pro files.

 Calls       : None.

 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : Software_management.

 Prev. Hist. : None.

 Written     : William Thompson, GSFC, 30 April 1993.

 Modified    : Version 1, William Thompson, GSFC, 30 April 1993
		Version 2, William Thompson, GSFC, 21 August 1997
			Added keyword CODE_ONLY

 Version     : Version 2, 21 August 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cmp_files.pro)


CMP_LIBS

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

 Name        : CMP_LIBS

 Purpose     : Compares one IDL library against another.

 Explanation : Compares all procedure files in one path against any matches
		found in another path.  This routine differs from CMP_TREES in
		that it does not expect the two libraries to be organized in
		the same way.  Only procedure files found in the first
		directory tree will be used for comparison.

 Use         : CMP_LIBS, DIR1, PATH2

 Inputs      : DIR1	= Start of the first directory tree to use in the
			  comparison.  All the files "*.pro" in DIR1 and
			  subdirectories will be compared against their
			  equivalents (if any) in the tree given by PATH2.

		PATH2	= A path expression for the second library (or set of
			  libraries.  Use a plus sign before any directory to
			  signal that the tree should be expanded.

 Opt. Inputs : None.

 Outputs     : Messages about which files differ, or are not found, are
		printed to the terminal screen.

 Opt. Outputs: None.

 Keywords    : OUTPUT	= The name of a file to store the output in.  If not
			  passed, then the output is written to the screen
			  using /MORE.
		FILES	= The filenames to compare.  If not passed, then
			  "*.pro" is used.  The FILES keyword can be used to
			  change this to "*.*" for instance.
		UNIX	= If set, then the Unix "cmp" command is used to do the
			  comparison, rather than depending on IDL.

		CODE_ONLY = If set, then the FILE_DIFF routine is called to
			    determine whether or not the routine differs only
			    in documentation, or in the code as well.  This is
			    only applicable to IDL .pro files.  Ignored if
			    /UNIX is set.

		DIFFER_ONLY = If set, then don't print any messages about files
			      which are not found in the second library.

 Calls       : CMP_FILES, FIND_WITH_DEF, CONCAT_DIR, FIND_ALL_DIR

 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : Software_management.

 Prev. Hist. : None.

 Written     : William Thompson, GSFC, 26 May 1995

 Modified    : Version 1, William Thompson, GSFC, 26 May 1995
		Version 2, William Thompson, GSFC, 21 August 1997
			Added keyword CODE_ONLY
		Version 3, William Thompson, GSFC, 17 February 1998
			Added /NOCURRENT to FIND_WITH_DEF call

 Version     : Version 3, 17 February 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/cmp_libs.pro)


CMP_TREES

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

 Name        : CMP_TREES

 Purpose     : Compares all procedure files in one path against another.

 Explanation : Compares all procedure files in one path against the
		corresponding files in another parallel path.  This routine
		differs from CMP_LIBS in that the two trees are expected to be
		identically structured.  If a routine is found in a particular
		directory in the first tree, then it is expected to be in same
		directory in the second tree.

 Use         : CMP_TREES, DIR1, DIR2

 Inputs      : DIR1	= Start of the first directory tree to use in the
			  comparison.  All the files "*.pro" in DIR1 and
			  subdirectories will be compared against their
			  equivalents (if any) in the tree starting with DIR2.

		DIR2	= Start of the second path list.

 Opt. Inputs : None.

 Outputs     : Messages about which files differ, or are not found, are
		printed to the terminal screen.

 Opt. Outputs: None.

 Keywords    : OUTPUT	= The name of a file to store the output in.  If not
			  passed, then the output is written to the screen
			  using /MORE.
		FILES	= The filenames to compare.  If not passed, then
			  "*.pro" is used.  The FILES keyword can be used to
			  change this to "*.*" for instance.
		UNIX	= If set, then the Unix "cmp" command is used to do the
			  comparison, rather than depending on IDL.

		CODE_ONLY = If set, then the FILE_DIFF routine is called to
			    determine whether or not the routine differs only
			    in documentation, or in the code as well.  This is
			    only applicable to IDL .pro files.  Ignored if
			    /UNIX is set.

 Calls       : CMP_FILES, FIND_WITH_DEF, CONCAT_DIR, FIND_ALL_DIR

 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : Software_management.

 Prev. Hist. : None.

 Written     : William Thompson, GSFC, 31 May 1994

 Modified    : Version 1, William Thompson, GSFC, 31 May 1994
		Version 2, William Thompson, GSFC, 13 June 1994
			Added keyword FILES.  Changed FILENAME to OUTPUT.
			Added keyword UNIX.
		Version 3, William Thompson, GSFC, 15 June 1994
			Changed so that output is the same, regardless of
			whether or not the UNIX keyword is set.
		Version 4, William Thompson, GSFC, 31 March 1995
			Changed so that only the directories where differences
			are found are printed out.
		Version 5, William Thompson, GSFC, 14 April 1995
			Made compatible with VMS.
		Version 6, William Thompson, GSFC, 21 August 1997
			Added keyword CODE_ONLY

 Version     : Version 6, 21 August 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cmp_trees.pro)


CNTRD

[Previous Routine] [Next Routine] [List of Routines]
  NAME: 
	CNTRD
  PURPOSE:
	Compute the centroid coordinates of a stellar object 
	using the algorithm in the DAOPHOT FIND subroutine.

  CALLING SEQUENCE: 
	CNTRD, img, x, y, xcen, ycen, [ fwhm , /SILENT, /DEBUG]

  INPUTS:     
	IMG - Two dimensional image array
	X,Y - Scalar or vector integers giving approximate stellar center

  OPTIONAL INPUT:
	FWHM - floating scalar; Centroid is computed using a box of half
		width equal to 1.5 sigma = 0.637* FWHM.  CNTRD will prompt
		for FWHM if not supplied

  OUTPUTS:   
	XCEN - the computed X centroid position, same number of points as X
	YCEN - computed Y centroid position, same number of points as Y

	Values for XCEN and YCEN will not be computed if the computed
	centroid falls outside of the box, or if the computed derivatives
	are non-decreasing.   If the centroid cannot be computed, then a 
	message is displayed and XCEN and YCEN are set to -1.

  OPTIONAL OUTPUT KEYWORDS:
	SILENT - Normally CNTRD prints an error message if it is unable
		to compute the centroid.   Set /SILENT to suppress this.
	DEBUG - If this keyword is set, then CNTRD will display the subarray
		it is using to compute the centroid.

  PROCEDURE: 
	Maximum pixel within distance from input pixel X, Y  determined 
	from FHWM is found and used as the center of a square, within 
	which the centroid is computed as the value (XCEN,YCEN) at which 
	the derivatives of the partial sums of the input image over (y,x)
	with respect to (x,y) = 0.

  MODIFICATION HISTORY:
	Written 2/25/86, by J. K. Hill, S.A.S.C., following
	algorithm used by P. Stetson in DAOPHOT.
	Allowed input vectors        G. Hennessy       April,  1992
	Fixed to prevent wrong answer if floating pt. X & Y supplied
		W. Landsman        March, 1993
	Convert byte, integer subimages to float  W. Landsman  May 1995

(See /host/bluemoon/usr2/idllib/ssw/allpro/cntrd.pro)


CNVT_COORD()

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
       SOHO

 NAME:
       CNVT_COORD()

 PURPOSE:
       Conversion between any 2 of 4 coord systems for solar images

 EXPLANATION:
       For image displaying, especially for the solar images, there
       can be at least four coordinate systems involved, and they are:

           1. Device coordinate system, in device pixels
           2. Data (image) coordinate system, in data pixels (base 1)
           3. Solar disk coordinate system, in arc seconds
           4. Heliographic coordinate system, in degrees

       This routine can do the conversion between any two of
       them. For the solar disk system (with origin at the disk
       center), the positive directions of the X and Y axes point to
       the west limb and north limb, respectively.

 CALLING SEQUENCE:
       Result = CNVT_COORD(xx [, yy], csi=csi, from=from, to=to)

 INPUTS:
       XX  -- X coordinates of points to be converted. Scalar or
              vector if YY is passed; if YY is not passed,
              XX must be either 2-element vector or Nx2 array.
              Depending on the coordinate system, values of XX can be
              pixel number in X direction for device system (1) or
              data (image) system (2), or Solar X in arcsec in solar
              disk system (3), or latitude in degrees for
              heliographic system (4).  

       CSI -- Coordinate system information structure that contains some
              basic information of the coordinate systems
              involved. For more information about CSI, take a look
              at itool_new_csi.pro

              Note: Units used for CRVAL1 and CRVAL2 are arc seconds in
                    case of solar images. If the reference point is
                    the solar disk center, CRVAL1 = CRVAL2 = 0.0. The
                    reference point can also be the first pixel of
                    the image (i.e., the pixel on the lower-left
                    corner of the image).

       FROM -- Code for the original coordinate system (see explanation)
       TO   -- Code for the new coordinate system to be converted
               to. Possible values are the same as those of FROM

 OPTIONAL INPUTS:
       YY  -- Y coordinates of points to be converted. Scalar or
              vector; must have the same number of elements as XX
              Depending on the coordinate system, values of YY can be
              pixel number in Y direction for device system (1) or
              data (image) system (2), or Solar Y in arcsec in solar
              disk system (3), or longitude in degrees for
              heliographic system (4). 

 OUTPUTS:
       RESULT -- A Nx2 array, containing new coordinates;
                 refer to the input description of XX (and YY) for returned
                 values for different coordinate systems. A scalar
                 value of -1 will be returned for a non-valid
                 conversion or wrong type of data.

 OPTIONAL OUTPUTS:
       OFF_LIMB -- Flag which is true if the coordinates are beyond
                   the solar limb. Only used for converting to the
                   heliographic system

 KEYWORD PARAMETERS:
       DATE -- date in CCSDS or ECS time format; required for
               conversion between heliographic coordinate system to
               or from other system. If not passed, CSI.DATE_OBS
               will be used.

 CALLS:
       ARCMIN2HEL, HEL2ARCMIN

 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 HISTORY:
       Version 1, November 16, 1994, Liyun Wang, GSFC/ARC, Written.
       Version 2, August 28, 1996, Liyun Wang, NASA/GSFC
          Used ROUND (instead of FIX) to get coordinates for device
             and data systems
       Version 3, August 13, 1997, Liyun Wang, NASA/GSFC
          Made conversion from 1 to 3 more accurate especially when
             showing images with less pixels
          Made DATE as optional keyword.
       Version 4, September 2, 1997, Liyun Wang, NASA/GSFC
          Modified to use column major array for I/O.

 VERSION:
       Version 4, September 2, 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/cnvt_coord.pro)


COEFDATA

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
	SDAC

 NAME: 
	COEFDATA


 PURPOSE: 
	This procedures reads in coefficients needed to calculate xray xsections
	from 1-1000 keV.  Coefficients are taken from McMaster et al 1968.

 CATEGORY: 
	SPECTRA, XRAYS, XRAY RESPONSE, xray analysis,


 CALLING SEQUENCE:   
	COEFDATA, Coef


 CALLED BY: xcross


 CALLS:
	none

 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
       coef - structure with need coefficients

 EXPLANATION FOR TAG_NAMES 
	Z:	ATOMIC NUMBER
	AT_DEN:	ATOMIC DENSITY - DENSITY IN UNITS OF 10^24 ATOMS/CC
	CONV:	CONVERSION CONSTANT - CROSS_SECTION(CM2/GM)*CONV=CS(BARNES/ATOM)
	EDGE:	SHELL EDGES IN KEY
	PE  :   COEFFICIENTS FOR PHOTOELECTRIC CROSS SECTION
	SCC :	COEFFICIENTS FOR COHERENT SCATTERING (RAYLEIGH)
	SCI :	COEFFICIENTS FOR INCOHERENT SCATTERING (COMPTON)
 KEYWORDS:
	ERROR - If set can't find or read data file.
 COMMON BLOCKS:
	xrcoef,n,z,ad,conversion,edge,pearr,scc,sci

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	87 elements from 1-94
	missing z=[83,85,87,88,89,91,93]
 PROCEDURE:
	none

 MODIFICATION HISTORY:
	documented, ras, 20-dec-94
	ras, 12-jan-95, include conv_vax_unix for unix
	ras, 16-jan-96, include conv_vax_unix for unix for n
	Version 4, ras, 8-apr-97, add SSWDB_XRAY to data file search and ERROR.
       Version 5, richard.schwartz@gsfc.nasa.gov, 24-jul-1997, removed PERM_DATA.
       Version 6, richard.schwartz@gsfc.nasa.gov, 8-feb-1999, add call to use_vax_float.
	Need a more permanent solution, e.g. a FITS file!

(See /host/bluemoon/usr2/idllib/ssw/allpro/coefdata.pro)


COLLEXC

[Previous Routine] [Next Routine] [List of Routines]
  NAME:
    collexc
  PURPOSE:
    Compute effective excitation rate coefficients for a given Temperature
    in units of cm^3 s-1

  CALLING SEQUENCE:
     collexc,ato_data,Te6,wave,stage,exrate

     The line intensity is I (ph cm-3 s-1) = Ne * Nz * exrate where
     Ne (cm-3) and Nz (cm-3) are the electron density and the number density
     of the responsible stage.

  INPUTS:
     ato_data	= Structure containing atomic data (returned from rd_atodat)
     Te6	= Vector of electron temperatures (MK)
  OPTIONAL INPUT KEYWORD:
     Dens	= Log10(Ne) where Ne = electron density in cm-3
		  This keyword only has an effect on S XV calculations
  OPTIONAL OUTPUT KEYWORD:
     qdens	= log10(Ne) of returned data
  OUTPUTS:
     wave	= Wavelength (in Ang) of lines
     stage	= Vector describing ion stage as number of electrons (1=H like)
     exrate	= Effective excitation rate (cm+3 s-1)
  RESTRICTIONS:
     The density-dependent ratios x/w, y/w, z/w must be in the ato_data
     structure if the dens= keyword can have any effect.  
  HISTORY:
   10-sep-93, J. R. Lemen (LPARL), Written
   27-oct-93, JRL, Te6 no longer needs to be monotonic
   11-mar-94, JRL, Added dens and qdens keywords

(See /host/bluemoon/usr2/idllib/ssw/allpro/collexc.pro)


COLORSET

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

 PURPOSE:
    Select true color (24 bit) if available, or pseudo color (8 bit) visual
    consistently on X, Windows, and Macintosh.

 CATEGORY:
    Startup utilities.

 CALLING SEQUENCE:
    COLORSET

 INPUTS:
    None

 OPTIONAL INPUTS:
    None
	
 KEYWORD PARAMETERS:
    RETAIN        Specifies the default method used
                  for backing store when creating new windows.
                  0 => No backing store
                  1 => Server or window system performs backing store
                  2 => Make IDL perform backing store (DEFAULT)
    DECOMPOSED    Specifies the the way in which graphics
                  color index values are interpreted when using displays with
                  decomposed color (TrueColor or DirectColor visuals).
                  0 = > Color indices given by single 8 bit values (DEFAULT)
                  1 = > Color indices given by three 8 bit values
    QUIET         If set, no color information is printed
                  (default is to print the color table size, and number of colors)
              
 OUTPUTS:
    None

 OPTIONAL OUTPUTS:
    None

 COMMON BLOCKS:
    None

 SIDE EFFECTS:
    This routine changes the IDL visual for the rest of the IDL session.

 RESTRICTIONS:
    Only affects X, WIN, and MAC displays.    
    Only has an effect if run before any windows have been
    created, and if no DEVICE commands have been executed.

 EXAMPLE:
 ;Execute the following command immediately after IDL startup.
 colorset

 MODIFICATION HISTORY:
    Written by: Liam.Gumley@ssec.wisc.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/colorset.pro)


COLOR_BAR

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

 Name        : 
	COLOR_BAR
 Purpose     : 
	Display a color bar on an image display screen.
 Explanation : 
	Unless the optional parameters are set, the user is prompted to enter
	in where the color bar should be placed.
 Use         : 
	COLOR_BAR  [, ARRAY ]
	COLOR_BAR, [ ARRAY, ]  MX, MY, IX, IY
	COLOR_BAR, [ ARRAY, ]  X1, X2, Y1, Y2, /NORMAL
 Inputs      : 
	None required.
 Opt. Inputs : 
	ARRAY	= Image array to use in determining the scale.

	One of the following two sets of parameters can be used to specify the
	position of the color bar.  Otherwise, the color bar can be positioned
	interactively.

	MX, MY	= Dimensions of color bar, in device coordinates
	IX, IY	= Position of lower left-hand corner of color bar.

		or

	X1, X2	= Position of the left and right edges of the color bar, in
		  normalized coordinates.  Requires the /NORMAL keyword to be
		  set.
	Y1, Y2	= Position of the bottom and top edges of the color bar, in
		  normalized coordinates.
	
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	NORMAL	 = If set, then the normalized positioning option is selected.
	COLOR	 = Color used for drawing the box around the color bar.
	MAX	 = The maximum value of ARRAY to be considered in scaling the
		   color bar, as used by BYTSCL.  The default is either the
		   highest color index available, or the value set by SETFLAG.
	MIN	 = The minimum value of ARRAY to be considered in scaling the
		   color bar, as used by BYTSCL.  The default is either zero
		   or the value set by SETFLAG.
	TOP	 = The maximum value of the scaled color bar, as used by
		   BYTSCL.  The default is !D.TABLE_SIZE-1.
	VELOCITY = If set, then the image is scaled using FORM_VEL as a
		   velocity image.  Can be used in conjunction with COMBINED
		   keyword.  Ignored if NOSCALE is set.
	COMBINED = Signals that the image is to be displayed in one of two
		   combined color tables.  Can be used by itself, or in
		   conjunction with the VELOCITY or LOWER keywords.
	LOWER	 = If set, then the image is placed in the lower part of the
		   color table, rather than the upper.  Used in conjunction
		   with COMBINED keyword.
	MISSING	 = Value flagging missing pixels.  Used when passing ARRAY to
		   help determine the scale.
	ABOVE	 = If set, and the color bar is horizontal, then the axis label
		   is drawn above the color bar rather than below.
	RIGHT	 = If set, and the color bar is vertical, then the axis label
		   is drawn to the right of the color bar, instead of the left.
	TITLE	 = Character string label to apply to color bar.  Default is
		   none.
	TICKLEN	 = Length of tick marks.  Default is !TICKLEN.
	TICKNAME = String array giving the annotation of each tick.
	TICKS	 = Number of major tick intervals to draw.
	TICKV	 = Array of values for each tick mark.
	TYPE	 = If 1, then the scaling is logarithmic.  If this option is
		   used, then the scale must be explicitly set, with the
		   minimum and maximum values being greater than zero.
 Calls       : 
	EXPAND_TV, GET_IM_KEYWORD, SELECT_BOX, TVAXIS, TVSELECT, TVUNSELECT
 Common      : 
	None.
 Restrictions: 
	To get the best results, care must be taken to make the color bar range
	match that of the displayed image.  The easiest way to do this is to
	use SETFLAG,MIN=...,MAX=... to control the range for both displaying
	the image and the color bar.  Or one can pass the image array to this
	routine to calculate the scale from.

	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	Messages about the size and position of the displayed image are printed
	to the terminal screen.  This can be turned off by setting !QUIET to 1.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	William Thompson, May 1992.
	William Thompson, August 1992, renamed BADPIXEL to MISSING.
	William Thompson, September 1992, use COMBINED keyword in place of
					  INTENSITY.
 Written     : 
	William Thompson, GSFC, May 1992.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 19 October 1994
		Added keywords TICKLEN,TICKNAME,TICKS,TICKV,TYPE
	Version 3, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
	Version 4, William Thompson, GSFC, 18 Sep 1998
 Version     : 
	Version 4, 18 Sep 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/color_bar.pro)


COMBINE_COLORS

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

 Name        : 
	COMBINE_COLORS
 Purpose     : 
	Combines two color tables into one.
 Explanation : 
	Combines two color tables into the lower and upper parts of a combined
	color table.  To use this color table, scale intensities using
	FORM_INT.  Alternately, use the /COMBINED and /LOWER keywords with
	EXPTV and PUT, which then call FORM_INT and FORM_VEL automatically.
 Use         : 
	COMBINE_COLORS

	The following example shows how to put one intensity image I1 using
	color table #3 next to another image I2 using color table #5.
 
	LOADCT,3				;Select first color table
	COMBINE_COLORS,/LOWER			;Save lower color table
	LOADCT,5				;Select second color table
	COMBINE_COLORS				;Combine the color tables
	PUT,I1,1,2,/COMBINED,/LOWER		;Display first image on left
	PUT,I2,2,2,/COMBINED			;And second image on right
 
 Inputs      : 
	None.
 Opt. Inputs : 
	None.
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	UPPER	= Save the current color table in a common block, to be the
		  upper part of the combined table.  If neither the UPPER nor
		  LOWER keyword is set, then UPPER is assumed.
	LOWER	= Save the current color table in a common block, to be
		  the lower part of the combined table.
	DISABLE	= If set, then TVSELECT is not used.
 Calls       : 
	TVSELECT, TVUNSELECT
 Common      : 
	COLORS:	The IDL color common block.
	COMBINE_COL: Used internally to save the two color tables between
	calls.
 Restrictions: 
	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	The color table is changed so that values in the lower half of the
	device range (typically 0-127) use the first color table, and values in
	the upper half (typically 128-255) use the second color table.  Each
	part of the color table has only half the resolution of the original
	color tables.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	W.T.T., Feb. 1992, from COMBINE_VEL.
	William Thompson, April 1992, changed to use TVLCT,/GET instead of
		common block, and added DISABLE keyword.
	W.T.T., Sep. 1992.  Returned COLORS common block.
	William Thompson, Oct 1992, added UPPER keyword, and rewrote to allow
		loading the upper and lower common blocks in any order, and to
		allow each to be independently reloaded.
 Written     : 
	William Thompson, GSFC, February 1992.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
 Version     : 
	Version 2, 8 April 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/combine_colors.pro)


COMBINE_VEL

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

 Name        : 
	COMBINE_VEL
 Purpose     : 
	Combines current color table with a velocity color table.
 Explanation : 
	Combines the current color table with the velocity color table as
	formed by LOAD_VEL.

	The procedure gets the current color tables using TVLCT,/GET, and then
	uses LOAD_VEL to get the velocity color table.
 
	To use this color table, scale velocities using FORM_VEL with the
	/COMBINED keyword, and scale intensities using FORM_INT.  Alternately,
	use the /COMBINED and /VELOCITY keywords with EXPTV and PUT, which then
	call FORM_INT and FORM_VEL automatically.
 
 Use         : 
	COMBINE_VEL

	The following example shows how to put an intensity image I next to its
	corresponding velocity image V.  Standard color table #3 is used for
	the intensity image.
 
	LOADCT,3			   ;Select color table for int. image
	COMBINE_VEL			   ;Combine with velocity color table
	PUT,I,1,2,/COMBINED		   ;Display intensity image on left
	PUT,V,2,2,/COMBINED,/VELOCITY	   ;And velocity on right
 
 Inputs      : 
	None.
 Opt. Inputs : 
	None.
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	REVERSE_SWITCH	= If passed, and non-zero, then the red and blue color
			  tables in the velocity color table are switched.
	TURQUOISE	= If set, then turquoise is used instead of blue.
	GREEN_SWITCH	= If set, then red and green are used instead of red
			  and blue.  Ignored if TURQUOISE is set.
	LIGHTEN		= If set, then some green is added to the blue to
			  lighten the image.  Ignored if TURQUOISE or
			  GREEN_SWITCH are set.
	DISABLE		= If set, then TVSELECT not used.
	PRELOADED	= If set, then a color table preloaded using
			  COMBINE_VEL or COMBINE_COLORS is combined with the
			  velocity color table instead of the current table.
 Calls       : 
	COMBINE_COLORS, LOAD_VEL, TVSELECT, TVUNSELECT
 Common      : 
	None, but calls COMBINE_COLORS which uses the COLORS and COMBINE_COL
	common blocks.
 Restrictions: 
	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	The color table is changed so that values in the lower half of the
	device range (typically 0-127) represent velocities as formed by the
	routine FORM_VEL, and values in the upper half (typically 128-255)
	represent intensities.  Each part of the color table has only half the
	resolution of the original color tables.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	W.T.T., Oct. 1987.
	W.T.T., Nov. 1990.  Modified for version 2 of IDL.
	W.T.T., Jan. 1991.  Changed REVERSE_SWITCH to keyword.  Added keywords
		GREEN_SWITCH and LIGHTEN.
	William Thompson, April 1992, changed to use TVLCT,/GET instead of
		common block, and added DISABLE keyword.
	W.T.T., Sep. 1992.  Returned COLORS common block.
	William Thompson, Oct 1992, changed to use COMBINE_COLORS, and added
		PRELOADED keyword.
 Written     : 
	William Thompson, GSFC, October 1987.
 Modified    : 
	Version 1, William Thompson, GSFC, 13 May 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 13 May 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/combine_vel.pro)


COMDIM

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

 NAME:
	COMDIM

 PURPOSE:
	Collapse degenerate dimensions of an array.

 CATEGORY:
	GEN

 CALLING SEQUENCE:
	Result = COMDIM(Array)

 INPUTS:
       Array:	Array to be collapsed.

 OUTPUTS:
       Result:	Reformed array.

 RESTRICTIONS:
       Use Version 2 function Reform to make Version 1 code compatible.

 MODIFICATION HISTORY:
       Mod. 05/06/96 by RCJ. Added formal documentation.

(See /host/bluemoon/usr2/idllib/ssw/allpro/comdim.pro)


COMPARE_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COMPARE_STRUCT  
 PURPOSE:
	Compare all matching tag names and return differences
 EXPLANATION:
 	Compare all matching Tags names (except for "except_Tags")
	between two structure arrays (may be different struct.defs.),
	and return a structured List of fields found different.
 CATEGORY:
			Structures
 CALLING SEQUENCE:
	diff_List = compare_struct( struct_A, struct_B )
 INPUTS:
	struct_A, struct_B : the two structure arrays to compare.
	Struct_Name : for internal recursion use only.
 KeyWords:
		EXCEPT = string array of Tag names to ignore (NOT to compare).
		/BRIEF = number of differences found for each matching field
						of two structures is printed.
		/FULL = option to print even if zero differences found.
		/RECUR_A = option to search for Tag names
				in sub-structures of struct_A,
				and then call compare_struct recursively
				for those nested sub-structures.
		/RECUR_B = search for sub-structures of struct_B,
				and then call compare_struct recursively
				for those nested sub-structures.
	Note:
		compare_struct is automatically called recursively
		for those nested sub-structures in both	struct_A and struct_B
		(otherwise cannot take difference)
 OUTPUT:
	Returns a structure array describing differences found,
	which can be examined using print,diff_List or help,/st,diff_List.
 PROCEDURE:
	Match Tag names and then use where function on tags.
 MODIFICATION HISTORY:
	written 1990 Frank Varosi STX @ NASA/GSFC (using copy_struct)
	modif Aug.90 by F.V. to check and compare same # of elements only.

(See /host/bluemoon/usr2/idllib/ssw/allpro/compare_struct.pro)


COMPILE_SFIT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COMPILE_SFIT
               
 Purpose     : Write and compile evaluation function for given SFIT
               
 Explanation : Every SFIT corresponds to a specific function that can be
               compiled and executed by e.g., MCURVEFIT in to evaluate the
               function being fitted. This routine writes and compiles that
               function, unless it's already compiled or unless errors
               occur.

               The output is placed in the directory pointed to by the
               environment variable "IDL_COMPILE_DIR", or in the current
               directory if IDL_COMPILE_DIR is not set. The directory pointed
               to by the environment variable should be in the IDL !path, of
               course, and be writable.

               NOTE that IDL_COMPILE_DIR should be a *private* directory,
               to avoid security problems.
               
 Use         : COMPILE_SFIT,SFIT
    
 Inputs      : SFIT : "Short" fit structure -- see e.g., MAKE_SFIT_STC
               
 Opt. Inputs : None.
               
 Outputs     : None.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : concat_dir(), since_version(), test_open(), trim(), wrt_ascii

 Common      : COMPILE_SFIT_COMMON
               To circumvent routine_info() bug.
               
 Restrictions: See Explanation for the IDL_COMPILE_DIR, though most problems
               are caught and handled correctly, signalling failure by
               setting SFIT.COMPILED = 2b
               
 Side effects: Writes an IDL program to IDL_COMPILE_DIR, or to current
               directory. 
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 21 January 1997
               
 Modified    : Version 2, SVHH, 2 April 1997
                       Added CATCH,error to work with demo mode.
               Version 3, SVHH, 15 January 1999
                       Using common block instead of routine_info() to
                       log successfully compiled functions.
                       
 Version     : 3, 15 January 1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/compile_sfit.pro)


COMP_BGAUSS

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COMP_BGAUSS
               
 Purpose     : Evaluate broadened Gaussian for use in CURVEFIT/CFIT/MCURVEFIT
               
 Explanation : Evaluates a single Gaussian component, plus broadening wings.
               The first three parameters have the same meaning as the
               Gaussian parameters in the standard GAUSSFIT procedure, i.e.:
               
			G(x) = A0 * EXP(-((x-A1)/A2)^2/2)

               The wings are defined as

			W(x) = A0 * Alpha / ( ((x-A1)/(Kappa*A2))^2 + 1 )

		where Kappa=2*SQRT(2*ALOG(2)) and Alpha is defined as

			Alpha = A3		;x GE A1 (right wing)
			Alpha = A3 * A4		;x LT A1 (left wing)

		Thus, A3 is the wing amplitude, and A4 is the left/right
		asymmetry.  The broadened Gaussian is then defined as

			F(x) = (1 - Alpha) * G(x)  +  W(x)

 Use         : COMP_BGAUSS,X,A,F [,PDER]
    
 Inputs      : As usual for any CURVEFIT function
               
 Opt. Inputs : PDER : Partial derivatives are calculated if parameter is
                      present 
               
 Outputs     : F : The evaluated broadened Gaussian at the given points
               
 Opt. Outputs: PDER
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : Modified from COMP_GAUSS by S.V.H. Haugan.

 Written     : William Thompson, GSFC, 05-Jan-1999
               
 Modified    : Version 1, 05-Jan-1999, William Thompson, GSFC

 Version     : Version 1, 05-Jan-1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_bgauss.pro)


COMP_CIRCLE

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

 PURPOSE:
	This procedure compute the polar parameters to plot a circle

 CATEGORY:
	NRH General

 CALLING SEQUENCE:
	COMP_CIRCLE, radius, angle, rayon 

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	RADIUS	circle radius, =1. if parameter = 0
	
 KEYWORD PARAMETERS:
	RESOL	Number of the angle points computation, = 101 if
		no present 

 OUTPUTS:
	ANGLE	Array of angle values (Size= Resol)
	RAYON	Circle radius (size=Resol)

 COMMON BLOCKS:
	Non


 MODIFICATION HISTORY: (bonmartin@obspm.fr)
	Ecrit par:Ludwig Klein, J Bonmartin le 11/12/98

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_circle.pro)


COMP_DATE

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

 PURPOSE:
	Cette fonction compare 2 chaines de caracteres contenant des dates.
	Si la date 1 est posterieure a la date 2 elle retourne 1, sinon elle
	retourne -1
	Elle retourne 0 en cas d'erreur de format de date 

 CATEGORY:
	Calculs

 CALLING SEQUENCE:
	Resultat = COMP_DATE( Date1, Date2)

 INPUTS:
	DATE1	Date sous forme 'AAAA/MM/JJ' ou 'JJ/MM/AA'
	DATE2	Date sous forme 'AAAA/MM/JJ'.ou 'JJ/MM/AA'

 KEYWORD PARAMETERS:


 OUTPUTS:

 EXAMPLE:
	RES = COMP_DATE (Date, '21/04/98')
		Res = -1 si date anterieure au 21 Avril 1998 

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin le 07/04/98 (bonmartin@obspm.fr)
	Traitement de l'annee sur 4 chiffres le 09/06/98 (J B)

(See /host/bluemoon/usr2/idllib/ssw/allpro/upd_nrh2dfits.pro)


COMP_FIL_LIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  comp_fil_list
 PURPOSE:
  Compare two unix directory listings and produce a list of file names
  which differ in some way (size, time of creation, ownership, protection).

 CALLING SEQUENCE:
  comp_fil_list, source_list, ref_list=ref_list, ofiles, status=status
  comp_fil_list, source_list, ref_list=ref_list, files=files, ofiles, status=status

  If all cases if source_list match ref_list, then status = 0
  Else, status = number of cases that DO NOT match.

 INPUTS:
  source_list	- Unix type of directory listing made from ls -l .
 OPTIONAL INPUT KEYWORDS:
  ref_list	- Unix type of directory listing made from ls -l .
  files	- List of target files that should be checked (all other
		  files in source_list are ignored).
 OUTPUTS:
  ofiles	- List of files that differ (just the file name is returned).
  status	- If in the range 0 to N, the number of files which differ.
		 -1: No files in ifiles match the list in source_list
 METHOD:
  It is assumed that source_list and ref_list are string arrays containg 
  directory listings produced by an ls -l type of operation. Thus, the 
  last column is assumed to the filename.

 HISTORY:
   1-Feb-96, J. R. Lemen (LPARL), written.
  28-Feb-96, JRL, Minor bug fix
-

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_fil_list.pro)


COMP_FITS_CEN

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO, YOHKOH

 Name        : COMP_FITS_CEN

 Purpose     : compute XCEN (or YCEN) from FITS standard keywords

 Category    : imaging, FITS

 Explanation : 

 Syntax      : xcen=comp_fits_cen(crpix1,cdelt1,naxis1,crval1)
                                   OR
               ycen=comp_fits_cen(crpix2,cdelt2,naxis2,crval2)
 Examples    :

 Inputs      : CRPIX = reference pixel coordinate
               CDELT = pixel scaling
               NAXIS = pixel dimension of image

 Opt. Inputs : CRVAL = reference data coordinate [def=0]

 Outputs     : CEN = center of FOV in data units

 Opt. Outputs: None

 Keywords    : None

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written, 15 November 1998, D.M. Zarro (SM&A)

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_fits_cen.pro)


COMP_FITS_CRPIX

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO, YOHKOH

 Name        : COMP_FITS_CRPIX

 Purpose     : Compute CRPIX from FOV center 

 Category    : imaging, FITS

 Explanation : 

 Syntax      : crpix=comp_fits_crpix(cen,cdelt,naxis,crval)

 Examples    :

 Inputs      : CEN = data coordinate of FOV center
               CDELT = pixel scaling
               NAXIS = pixel dimension of image

 Opt. Inputs : CRVAL = reference data coordinate [def=0]

 Opt. Inputs : None

 Outputs     : CRPIX = reference pixel coordinate

 Opt. Outputs: None

 Keywords    : None

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written, 15 November 1998, D.M. Zarro (SM&A)

 Contact     : dzarro@solar.stanford.edu

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_fits_crpix.pro)


COMP_GAUSS

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COMP_GAUSS
               
 Purpose     : Evaluate gaussian component for use in CURVEFIT/CFIT/MCURVEFIT
               
 Explanation : Evaluates a single gaussian component. The parameters have the
               same meaning as the gaussian parameters in the standard
               GAUSSFIT procedure.
               
 Use         : COMP_GAUSS,X,A,F [,PDER]
    
 Inputs      : As usual for any CURVEFIT function
               
 Opt. Inputs : PDER : Partial derivatives are calculated if parameter is
                      present 
               
 Outputs     : F : The evaluated gaussian at the given points
               
 Opt. Outputs: PDER
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 21 January 1997
               
 Modified    : Version 2, SVHH, 27 May 1997
                       Calculating only points where z2 < 1000, to avoid
                       unnecessary time spent and unnecessary illegal operand
                       errors.

 Version     : 2, 27 May 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_gauss.pro)


COMP_POLY

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COMP_POLY
               
 Purpose     : Evaluate polynomial component for fitting.
               
 Explanation : Input coefficients A determine degree of polynomial, otherwise
               this is straightforward - see e.g., CURVEFIT for explanations
               about this type of function.
               
 Use         : COMP_POLY,X,A,F [,PDER]
    
 Inputs      : As all CURVEFIT evaluation functions
               
 Opt. Inputs : PDER
               
 Outputs     : F : Evaluated function 
               
 Opt. Outputs: PDER : Partial derivatives.
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : None.

 Written     : S.V.H.Haugan, UiO, 21 January 1997
               
 Modified    : Not yet

 Version     : 1, 21 January 1997

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_poly.pro)


COMP_VOIGT

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COMP_VOIGT
               
 Purpose     : Evaluate Voigt profile for use in CURVEFIT/CFIT/MCURVEFIT
               
 Explanation : Evaluates a single Voigt component.  The parameters are
		amplitude, line position, doppler width, and rocking width.
		The Voigt profile is then evaluated as

		   PVOIGT, ABS(A3/A2), (x-A1)/A2, H
		   F(x) = A0 * H(x) / (SQRT(!PI)*A2)
               
 Use         : COMP_VOIGT,X,A,F [,PDER]
    
 Inputs      : As usual for any CURVEFIT function
               
 Opt. Inputs : PDER : Partial derivatives are calculated if parameter is
                      present 
               
 Outputs     : F : The evaluated Voigt profile at the given points
               
 Opt. Outputs: PDER
               
 Keywords    : None.

 Calls       : None.

 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Analysis
               
 Prev. Hist. : Modified from COMP_GAUSS by S.V.H. Haugan, and from MVOIGT by
		Dominic Zarro.

 Written     : William Thompson, GSFC, 08-Jan-1999
               
 Modified    : Version 1, 12-Jan-1999, William Thompson, GSFC

 Version     : Version 1, 12-Jan-1999

(See /host/bluemoon/usr2/idllib/ssw/allpro/comp_voigt.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 /host/bluemoon/usr2/idllib/ssw/allpro/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 /host/bluemoon/usr2/idllib/ssw/allpro/concat3d.pro)


CONCAT4DOS

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

 Name        :	
	CONCAT4DOS
 Purpose     :	
	Concatenates IDL procedure files for copying to DOS machine.
 Explanation :	
	Concatenates IDL procedure files together into a form suitable for
	copying to a DOS machine.

	All the .PRO files in the current directory are copied into a special
	"dos" subdirectory, with the following changes made:

		1.  All filenames are truncated to eight characters.
		2.  All procedure files with names beginning with the same
		    first eight characters are concatenated together into a
		    single file.

 Use         :	
	CD, directory		;(go to desired directory)
	CONCAT4DOS		;or CONCAT4DOS, /SUBDIRECTORIES
 Inputs      :	
	None.
 Opt. Inputs :	
	None.
 Outputs     :	
	None.
 Opt. Outputs:	
	None.
 Keywords    :	
	SUBDIRECTORIES = If set, then subdirectories are also recursively
			 processed.
 Calls       :	
	FDECOMP
 Common      :	
	None.
 Restrictions:	
	None.
 Side effects:	
	A "dos" subdirectory is created.  On VMS machines, a temporary command
	file called "CONCAT4DOS.COM" is created and then destroyed.  On UNIX
	machines the temporary file is called "concat4dos.sh".
 Category    :	
	Utilities, Operating_system.
 Prev. Hist. :	
	William Thompson, August 1992.
 Written     :	
	William Thompson, GSFC, August 1992.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
		Modified so that a temporary file is created on UNIX machines
			as well, to speed up.
	Version 2, William Thompson, GSFC, 18 April 1994.
		Added SUBDIRECTORIES switch, and copying of documentation (.txt
		or .tex) files.
 Version     :	
	Version 2, 18 April 1994.

(See /host/bluemoon/usr2/idllib/ssw/allpro/concat4dos.pro)


CONCAT_DIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:   
       CONCAT_DIR
               
 PURPOSE:     
       To concatenate directory and file names for current OS.
 EXPLANATION:
       The given file name is appended to the given directory name with the 
       format appropriate to the current operating system.

 CALLING SEQUENCE:               
       result = concat_dir( directory, file) 

 INPUTS:
       directory  - the directory path (string)
       file       - the basic file name and extension (string)
                                   can be an array of filenames.

 OUTPUTS:     
       The function returns the concatenated string.  If the file input
       is a string array then the output will be a string array also.
               
 EXAMPLES:         
       IDL> pixfile = concat_dir('$DIR_GIS_MODEL','pixels.dat')

       IDL> file = ['f1.dat','f2.dat','f3.dat']
       IDL> dir = '$DIR_NIS_CAL'
       IDL> f = concat_dir(dir,file)

 RESTRICTIONS: 
       Assumes Unix type format if os is not VMS or windows.
               
       The version of CONCAT_DIR available at 
       http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/system/concat_dir.pro
       includes additional VMS-specific keywords.

 CATEGORY    
        Utilities, Strings
               
 REVISION HISTORY:
       Prev Hist. : Yohkoh routine by M. Morrison
       Written     : CDS version by C D Pike, RAL, 19/3/93
       Version     : Version 1  19/3/93
       Documentation modified Nov-94   W. Landsman 
       Add V4.0 support for Windows    W. Landsman   Aug 95
       Converted to IDL V5.0   W. Landsman   September 1997
       Changed loops to long integer   W. Landsman   December 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/concat_dir.pro)


CONCAT_STRUCT

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

 Name        :	CONCAT_STRUCT

 Purpose     :	concatanate two structures

 Explanation :	concatanates two structures by using COPY_STRUCT to
               avoid the problem of concatanating two differently named
               structures.

 Use         : NEW_STRUCT=CONCAT_STRUCT(STRUCT1,STRUCT2)

 Inputs      :	STRUCT1,2 = input structures

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = concatanated structure

 Opt. Outputs:	None.

 Keywords    :	ERR = err string
               NOTAG_CHECK = don't check if tag names match.
               NONEST_CHECK = don't check if nested elements differ

 Calls       :	COPY_STRUCT

 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 22 September 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/concat_struct.pro)


CONFAC

[Previous Routine] [Next Routine] [List of Routines]
   Name: confac

   Purpose: simplify interface to congrid

   Input Parameters:
      image  - image to congrid
      factor - congrid factor

   Keyword Parameters:
       interpolate - bilinear interp - (see congrid)
       cubic       - cubic spline inter (see congrid)
 
   History:
      Written by Tom Berger, LMSAL
      12-Nov-1998 - S.L.Freeland - added a little doc -> SSW

(See /host/bluemoon/usr2/idllib/ssw/allpro/confac.pro)


CONFIGURE_HTTP

[Previous Routine] [Next Routine] [List of Routines]
   Name: configure_http

   Purpose: configure an HTTP server within the SSW environment

   Input Parameters:
     path_http  - pathname for 'top  HTTP' (prompted if not supplied)
     top_http  -  URL for 'top  HTTP'      (prompted if not supplied)
   
   Keyword_parameters:
     imply relative to http parent 

   Calling Sequence:
       configure_http [path_http, top_http]
  -OR- configure_http,/XXX   ; set path and url http => parent_http/XXX   
  -OR- configure_http,/LOCAL ; use current directory 
      
   History:
     2-jun-1997 -   S.L.Freeland (sxt/ypop/eit/trace...)
     4-April-1998 - S.L.Freeland slightly more general (cdaw prep)
    14-April-1998 - S.L.Freeland - add /LOCAL switch and function
     
   Motivation:
      http utilities available under SSW use the enviromentals
      $path_http and $top_http to generate WWW documents, etc.
      For sites with only ONE parent http, those environmentals may
      be set in $SSW/site/setup/setup.ssw_env  - this routine allows
      multiple 'tops' at a site, interactive or batch job re-definitions   
  

(See /host/bluemoon/usr2/idllib/ssw/allpro/configure_http.pro)


CONFLX

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

 PURPOSE:
	Calculate continuum flux in (ph s-1 A-1) or (erg s-1 A-1).
	The resultant flux assumes an emission measure of 1.e50 cm^3.

 CALLING SEQUENCE:
	Continuum_flux = CONFLX(TE_6,WAVE)		; photons s-1 A-1
	Continuum_flux = CONFLX(TE_6,WAVE,/erg)		; erg     s-1 A-1

 INPUTS:
	TE_6    = Electron temperature in MK.  (1-d vector or scalar)
	WAVE	= Wavelength in Angstroms.     (1-d vector or scalar)

 OPTIONAL INPUTS:
 	OPT	 = Options: (must be scalar integer)
	Bit Value   Effect
	 0    1     This bit sets the units of the flux calculations. 
		    If this bit is not set: photons s-1 
		    If this is set:         erg s-1.
	 1    2     This bits controls the calculation which is used
		    to compute the continuum flux.
		    If this bit is NOT set:  approx of Mewe, Groenschild,
		    and van den Oord (1985, Paper V).
		    If this bit IS set:  Mewe, Lemen, and van den Oord (1986,
		    Paper VI).

  ****	Prior to 29-Sep-94 default was OPT = 0 *****
  ****	After    29-Sep-94 default is  OPT = 2 *****

	ERG	= 1 Will force Bit 0 of OPT to be set: calculation in erg s-1.
	APPROX	= 1 Will unset Bit 1 of OPT (to use Mewe Paper V approximations)

  **** ERG and/or APPROX keywords will be ignored if OPT is defined. *****

 OUTPUTS:
	Function result  = Vector (or array) continuum fluxes.

	If one input is a scalar and other is a vector, the result will be 
	a vector which is the length of the input variable.

	If both inputs are vectors, the output will be a two-dimensional
	array of the type: FLTARR(N_ELEMENTS(TE_6),N(ELEMENTS(WAVE)).

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	TE_6 	must not be of complex type.
	WAVE 	must not be of complex type.

	TE_6 and WAVE must be scalers or 1-d vectors.  Multi-dimensional
	arrays are not permitted and may cause the routine to halt with 
	an error.

 PROCEDURE:
   OPT = 0 (OPT and 2) eq 0 [bit 0 is not set]
	Calculation is based on equations no. 29 and 30
	in R. Mewe, J. Schrijver, and J. Sylwester (A. & A. Suppl., 40, 327.), 
	but the G_c formula was updated and is given by Mewe, Gronenchild, 
	and van den Oord (Paper V, A. & A. Suppl. Ser. 62, 197).  Equation (3)
	of Paper V reads as:
	  G_c = 27.83*(Te_6+0.65)^(-1.33) + 0.15 * wave^0.34 * Te_6^0.422

	The approximation works well in the range of the BCS (e.g., 1.8 - 3.2 A).

   OPT => (OPT and 2) eq 2  [bit 1 is set]
	Calculation is performed using the ACGAUNT routine given by Mewe, 
	Lemen, and van den Oord (Paper VI, 1986, A. & A. Suppl., 65, 511.).

	If OPT is not set, will default to OPT=2

 MODIFICATION HISTORY:
	Mar, 1986,	Written, J.R. Lemen, MSSL
	Dec, 1987,	J.R. Lemen, LPARL
		Removed the restriction that either TE_6 or WAVE could be a
		vector, but not both.  See discussion above under "OUTPUTS:".
		The option to use the improved approximation given by Mewe,
		Lemen, and van den Oord (1986) was added.
	Feb, 1988,	J.R. Lemen, LPARL
		Added the option of erg s-1 A-1 or ph s-1 A-1
	Feb, 1991,	N.Nitta
		Changed to IDL Version 2.0 format (getting rid of linkimage)     
	31-jul-93, JRL, Added check on exponent to prevent Floating underflow message
       22-sep-94, JMM, removed check on the exponent, do calculation in logs
                       to avoid the underflows.
	29-sep-94, JRL, Added ERG and APPROX switches.  Changed default to opt=2
	 1-oct-94, JRL, Removed a diagnostic stop
       22-Feb-96, JRL, Minor change to document header

(See /host/bluemoon/usr2/idllib/ssw/allpro/conflx.pro)


CONGRDI

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

 Name        : 
	CONGRDI()
 Purpose     : 
	Interpolates an array into another array.
 Explanation : 
	This procedure interpolates an array into another array.  It emulates
	CONGRIDI, except that the image is smoothed from edge to edge.
	Consequently, the points will not interpolate the same way.  CONGRIDI
	uses the formula:

		I_NEW = I_OLD * N_NEW / N_OLD

	where I_OLD is a point in the original array, N_OLD is the size of the
	old array (in one of the dimensions), and N_NEW is the size of the new
	array.  CONGRDI, on the other hand, uses the formula:

		I_NEW = I_OLD * (N_NEW - 1) / (N_OLD - 1)

	In this case, a point on the edge I_OLD = N_OLD-1 will transform to
	N_NEW-1.

 Use         : 
	NEW_ARRAY = CONGRDI( ARRAY, NXP, NYP )
 Inputs      : 
	ARRAY		= The two-dimensional array to be interpolated.
	NXP, NYP	= The dimensions of the output array.
 Opt. Inputs : 
	None.
 Outputs     : 
	The function returns the interpolated array.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : 
	None.
 Common      : 
	None.
 Restrictions: 
	ARRAY must be two-dimensional, and NXP and NYP must both be > 1.

	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	None.
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	W.T.T., Oct. 1987.
 Written     : 
	William Thompson, GSFC, October 1987.
 Modified    : 
	Version 1, William Thompson, GSFC, 13 May 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 13 May 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/congrdi.pro)


CONS_DEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CONS_DEC
 PURPOSE:
	Obtain the X and Y coordinates of a line of constant declination
 EXPLANATION:
	Returns a set of Y pixels values, given an image with tangent projection
	astrometry, and either
	(1)  A set of X pixel values, and a scalar declination value, or
	(2)  A set of declination values, and a scalar X value

	Form (1) can be used to find the (X,Y) values of a line of constant
	declination.  Form (2) can be used to find the Y positions of a set
	declinations, along a line of constant X.

 CALLING SEQUENCE:
	Y = CONS_DEC( DEC, X, CD, ASTR, ALPHA)

 INPUTS:
	DEC - Declination value(s) in DEGREES (-!PI/2 < DEC < !PI/2).  
		If X is a vector, then DEC must be a scalar.
	X -   Specified X pixel value(s) for line of constant declination 
		If DEC is a vector, then X must be a scalar.
	ASTR - Astrometry structure, as extracted from a FITS header by the
		procedure EXTAST
 OUTPUT:
	Y   - Computed set of Y pixel values.  The number of Y values is the
		same as either DEC or X, whichever is greater.

 OPTIONAL OUTPUT:
	ALPHA - the right ascensions (DEGREES) associated with the (X,Y) points

 RESTRICTIONS:
	Implemented only for the TANgent and SIN projections

 NOTES:
	The algorithm (and notation) is based on AIPS Memo 27 by Eric Greisen,
	with modifications for a coordinate description (CD) matrix as 
	described in Appendix B of Greisen & Calabretta (1996, A&A, in press).
	These documents are available from http://fits.cv.nrao.edu/documents/
	wcs/wcs.html

 REVISION HISTORY:
	Written, Wayne Landsman  STX Co.	                  April 1988
	Use new astrometry structure,     W. Landsman    HSTX     Jan. 1994
	Use CD matrix, add SIN projection   W. Landsman  HSTX     April, 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/cons_dec.pro)


CONS_RA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CONS_RA
 PURPOSE:
	Obtain the X and Y coordinates of a line of constant right ascension
 EXPLANATION:
	Return a set of X pixel values given an image with astrometry, 
	and either
	(1) a set of Y pixel values, and a scalar right ascension, or
	(2) a set of right ascension values, and a scalar Y value.

	In usage (1), CONS_RA can be used to determine the (X,Y) values
	of a line of constant right ascension.  In usage (2), CONS_RA can
	used to determine the X positions of specified RA values, along a
	line of constant Y.

 CALLING SEQUENCE:
	X = CONS_RA( RA, Y, ASTR)

 INPUTS:         
	RA -  Right Ascension value in DEGREES (0 < RA < 2*PI).  If Y is a
		vector, then RA must be a scalar
	Y -   Specified Y pixel value(s) for line of constant right ascension
		If RA is a vector, then Y must be a scalar
	ASTR - Astrometry structure as extracted from a FITS header by the 
		procedure EXTAST
 OUTPUTS
	X   - Computed set of X pixel values.   The number of elements of X
		is the maximum of the number of elements of RA and Y.

 RESTRICTIONS:
	Program will have difficulty converging for declination values near
	90.    For tangent projection only.  

 REVISION HISTORY:
	Written, Wayne Landsman  STX Co.	April, 1988
	Algorithm adapted from AIPS memo No. 27 by Eric Griessen
	New astrometry structure

(See /host/bluemoon/usr2/idllib/ssw/allpro/cons_ra.pro)


CONTV

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

 Name        : 
	CONTV
 Purpose     : 
	Places contour plots over displayed images.
 Explanation : 
	Places contour plots over images displayed with the EXPTV or similar
	procedure.
 Use         : 
	CONTV, ARRAY
	CONTV, ARRAY, MX, MY, JX, JY
 Inputs      : 
	ARRAY	 = Image to make contour plot from.  This may have a different
		   number of pixels as the original image being overlaid.
		   Also, the origin and pixel scale(s) may differ from the
		   original image.
 Opt. Inputs : 
	MX, MY	 = The size of the image on the display screen.
	JX, JY	 = The position of the lower left-hand corner of the image on 
		   the display screen.

	If the optional parameters are not passed, then they are retrieved with
	GET_TV_SCALE.  It is anticipated that these optional parameters will
	only be used in extremely rare circumstances.

 Outputs     : 
	The values of MX, MY and JX, JY are printed to the terminal screen.
 Opt. Outputs: 
	None.
 Keywords    : 
	COLOR	 = Color to use for drawing the contours.
	LEVELS	 = Levels to use for drawing the contours.
	MAX_VALUE= Maximum value to use for drawing the contours.  Pixels with
		   values above MAX_VALUE will be ignored in drawing the
		   contours.
	DISABLE  = If set, then TVSELECT not used.
	THICK	 = Plotting thickness.
	ORIGIN	 = Two-element array containing the coordinate value in
		   physical units of the center of the first pixel in the
		   image.  If not passed, then [0,0] is assumed.
	SCALE	 = Pixel scale in physical units.  Can have either one or two
		   elements.  If not passed, then 1 is assumed in both
		   directions.
 Calls       : 
	GET_TV_SCALE, TVSELECT, TVUNSELECT
 Common      : 
	None.
 Restrictions: 
	ARRAY must be two-dimensional.

	It is important that the user select the graphics device/window, and
	image region before calling this routine.  For instance, if the image
	was displayed using EXPTV,/DISABLE, then this routine should also be
	called with the /DISABLE keyword.  If multiple images are displayed
	within the same window, then use SETIMAGE to select the image before
	calling this routine.

	In general, the SERTS image display routines use several non-standard
	system variables.  These system variables are defined in the procedure
	IMAGELIB.  It is suggested that the command IMAGELIB be placed in the
	user's IDL_STARTUP file.

	Some routines also require the SERTS graphics devices software,
	generally found in a parallel directory at the site where this software
	was obtained.  Those routines have their own special system variables.

 Side effects: 
	If the optional parameters MX, MY, and JX, JY are passed, then it is
	assumed that the image being overlaid was displayed with the same
	settings, and that the scale was in pixels (SCALE=1) with the first
	pixel in the original image being equivalent to [0,0].
 Category    : 
	Utilities, Image_display.
 Prev. Hist. : 
	W.T.T., Oct. 1987.
	W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
	William Thompson, May 1992, changed to call GET_TV_SCALE.
	William Thompson, Nov 1992, removed call to INIT_SC1_SC4.
	William Thompson, Dec 1992, added THICK keyword.
	William Thompson, Jan 1993, corrected small positioning error.
 Written     : 
	William Thompson, GSFC, October 1987.
 Modified    : 
	Version 1, William Thompson, GSFC, 13 May 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 3 September 1993.
		Added ORIGIN and SCALE keywords.  Rewrote to use the graphics
		scale generated by the routine that displayed the image.  This
		relaxes some of the restrictions imposed by the original
		routine.  It is no longer necessary for the overlaid contour
		plot and the original image to match pixel for pixel.
	Version 3, William Thompson, GSFC, 9 November 1993.
		Removed (unnecessary) restriction that scales be positive.
 Version     : 
	Version 3, 9 November 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/contv.pro)


CONVERT_2_STREAM

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
	SDAC
 NAME: 
	CONVERT_2_STREAM

 PURPOSE: 
	This procedure converts fixed-length-record files to stream files.

 CATEGORY: 
	GEN, I/O

 CALLING SEQUENCE: 
	convert_2_stream, filename [,/delete]

 CALLS:
	BREAK_FILE, FCHECK	

 INPUTS:
       filename - name of indexed file to convert to stream
		   new file has _stream appended to its extension,
                  unless delete keyword is activated
 KEYWORD INPUTS:
	rec_length - logical record length.  For fixed-record-length files that have
	been ftp'd onto a VMS system, pad bytes are placed at the end of the file to
	fill out the last 512 block record.  if 
 OPTIONAL INPUTS:
	delete - if set delete the old file

 OUTPUTS:
       none

 OPTIONAL OUTPUTS:
	Outfile - filename to write to if given.

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	new file is created in the directory of the old file
	IF file is already a stream file it will be deleted
 RESTRICTIONS:
	Only run on VMS machines.
	File must not be in STREAM format Already 
	must have permission to create the new file and delete the old

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	ras, 16-apr-95
	eac, 23-aug-95 ; if delete keyword activated, then 
                        new filename will be same as old, only 1 ver higher
	eac, 23-aug-95 ; add +vers to newfile name, so program won't bomb
 			 on version numbers > 1
	ras, added more documentation, 7 June 1996
	Version 5, richard.schwartz@gsfc.nasa.gov, 1-sep-1997, added outfile arg.
	Version 6, richard.schwartz@gsfc.nasa.gov, 8-oct-1997, check for VMS.

(See /host/bluemoon/usr2/idllib/ssw/allpro/convert_2_stream.pro)


CONVOLVE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CONVOLVE
 PURPOSE:
	Convolution of an image with a Point Spread Function (PSF)
 EXPLANATION:
	The default is to compute the convolution using a product of 
	Fourier transforms (for speed).

 CALLING SEQUENCE:

	imconv = convolve( image1, psf, FT_PSF = psf_FT )
  or:
	correl = convolve( image1, image2, /CORREL )
  or:
	correl = convolve( image, /AUTO )

 INPUTS:
	image = 2-D array (matrix) to be convolved with psf
	psf = the Point Spread Function, (size < or = to size of image).

 OPTIONAL INPUT KEYWORDS:

	FT_PSF = passes out/in the Fourier transform of the PSF,
		(so that it can be re-used the next time function is called).
	FT_IMAGE = passes out/in the Fourier transform of image.

	/CORRELATE uses the conjugate of the Fourier transform of PSF,
		to compute the cross-correlation of image and PSF,
		(equivalent to IDL function convol() with NO rotation of PSF)

	/AUTO_CORR computes the auto-correlation function of image using FFT.

	/NO_FT overrides the use of FFT, using IDL function convol() instead.
		(then PSF is rotated by 180 degrees to give same result)
 METHOD:
	When using FFT, PSF is centered & expanded to size of image.
 HISTORY:
	written, Frank Varosi, NASA/GSFC 1992.

(See /host/bluemoon/usr2/idllib/ssw/allpro/convolve.pro)


CONV_A2H

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        CONV_A2H
 PURPOSE:
          Converts arcmins-from-suncenter coordinates to heliographic
	   coordinates.
 METHOD:  
	 This is a vectorized version and replacement of PIX2HEL. It calls 
	 GET_PB0R with the date to get the line-of-sight axial tilt. The SXT 
	 roll angle correction is no longer default, allowing use with GBO data. 
	 It will also work with any CONSISTENT pixel resolution.
 CALLING SEQUENCE:  
	 lonlat = conv_a2h(ang, date)
	 lonlat = conv_a2h(ang, date, /string)
	 lonlat = conv_a2h(ang, date, off_limb=off_limb)
 INPUT:
	ang	- is a vector of angles from sun center in default units of
		  arcseconds.  It should be 2xN.
			(0,*) = angle in E/W direction with W positive
			(1,*) = angle in N/S direction with N positive
	date	- Unless the date is supplied, today's date is used.
		  This will affect the Solar axial tilt, B0. 
 OUTPUT:
	lonlat  - Heliographic coordinates in decimal degrees.
                       (0,*) = longitude (degrees) W positive
                       (1,*) = latitude (degrees) N positive
		  If the input coordinates are off the solar limb, 
		  the output is the radial projection back to the nearest 
		  point on the limb.
		  Output is FLOAT (or DOUBLE if input is DOUBLE)
 OPTIONAL KEYWORD INPUT:
	arcmin	- when set the input is in arcminutes.
	string	- If set, returns coordinates as strings
		  with 'N/S' and 'W/E' attatched.
 OPTIONAL KEYWORD OUTPUT:
	off_limb- A flag which is set to 1 when there are 
		  points off the limb.
 CAUTIONS:	 Note the treatment of points off the limb.
 CALLS: 	ANYTIM2INTS, GET_PB0R.                                            
 HISTORY:
	Written by A.McAllister Jun-93
	16-Jun-93 (MDM) - Various changes.
       17-Jun-93 (MDM) - Renamed variable XYZ to avoid conflict with astron
                         library function called XYZ
	22-Jun-93 (MDM) - Corrected typo
	29-Jun-93 (AHM) - Fixed up the large longitude and pole point code.
	 3-Aug-93 (MDM) - Corrected the date option
			- Incorporated  27-jul-93 (AHM) bug fix in large 
			  longitude code.
	16-Oct-93 (MDM) - Changed the header information

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_a2h.pro)


CONV_A2P

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	conv_a2p
PURPOSE:
	To convert from a an angle from sun center to a pixel location
SAMPLE CALLING SEQUENCE:
	pix = conv_a2p(ang, date)
	pix = conv_a2p(ang, suncenter=[400,400])
INPUT:
	ang	- The angle in arcseconds as viewed from the earth.
			(0,*) = E/W direction with W positive
			(1,*) = N/S direction with N positive
OPTIONAL INPUT:
	date	- The date for the conversion in question.  This is needed
		  for SXT so that the pixel location of the center of the sun
		  can be determined.
OUTPUT:
	pix	- The pixel coordinates of the point(s) in question.  Larger pixel
		  address towards the N and W.
			(0,*) = E/W direction
			(1,*) = N/S direction
OPTIONAL KEYWORD INPUT:
	roll	- This is the S/C roll value in degrees
	
	hxa	- If set, use HXA_SUNCENTER to determine the location of the
		  sun center in pixels.  Default is to use GET_SUNCENTER.
	cmd	- If set, use SXT_CMD_PNT to determine the location of the
                 sun center in pixels. Default is to use GET_SUNCENTER.
	suncenter- Pass the derived location of the sun center in pixels (x,y)

	pix_size- The size of the pixels in arcseconds.  If not passed, it
		  uses GT_PIX_SIZE (2.45 arcsec).  This option allows the
		  routine to be used for ground based images.
	radius	- The radius in pixels.  GET_RB0P is called to get the radius
		  and it is used to get the pixel size.  This option allows the
		  routine to be used for ground based images.
HISTORY:
	Written 16-Jun-93 by M.Morrison
	29-Jun-93 (AHM) Corrected calling sequence.
	 3-Aug-93 (MDM) Corrected the date option
	16-Oct-93 (MDM) Removed the "tilt" keyword option

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_a2p.pro)


CONV_H2A

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CONV_H2A
 PURPOSE:
	Computes arcsecs-from-suncenter coordinates from 
	heliographic coordinate inputs (inverse of CONV_A2H). 
 CALLING SEQUENCE: 
	arcvec = conv_h2a(helio, date [,/arcmin])
 INPUT:
       helio	- is a vector of heliocentric coordinates.  It should be 2xN.
                       (0,*) = longitude (degrees) W positive
                       (1,*) = latitude (degrees) N positive
		  They can also be strings in the form 'N30W23'.
	date	- Unless the date is supplied, today's date is used.
                 This will affect the Solar axial tilt, B0.
 OUTPUT:
	arcvec	- The angle in arcseconds as viewed from the earth.
                       (0,*) = E/W direction with W positive
                       (1,*) = N/S direction with N positive
 OPTIONAL KEYWORD INPUT:
	arcmin	- If set, output is in arcminutes, rather than 
		  arcseconds.
 OPTIONAL KEYWORD OUTPUT:
	behind  - Returns a binary vector set to 1 when points are behind
		  the visible limb.
 CAUTIONS: 	There is a limit (although large) on how many pixels IDL's
		memory will support at once. 
 CALLS: ANYTIM2INTS, GET_RB0P                                               
 HISTORY: 
	Written 10-Jun-93 by A. McAllister (using HEL2PIX and then VEC_H2P 
					    as the starting point)
	16-Jun-93 (MDM) - Modified the header and parameters somewhat
	17-Jun-93 (MDM) - Renamed variable XYZ to avoid conflict with astron
			  library function called XYZ
	22-Jun-93 (MDM) - Corrected typo
	28-Jun-93 (AHM) - Fixed bug affecting vector usage.
	29-Jun-93 (AHM) - added BEHIND keyword.
	21-Jul-93 (MDM) - Modified header information
	 3-Aug-93 (MDM) Corrected the date option
         

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_h2a.pro)


CONV_H2P

[Previous Routine] [Next Routine] [List of Routines]
NAME:
	conv_h2p
PURPOSE:
	To convert from a pixel location to heliocentric coordinates
SAMPLE CALLING SEQUENCE:
	pix = conv_h2p(helio, date)
	pix = conv_h2p( [ew,ns], date)
	pix = conv_h2p(helio, suncenter=[400,400])
INPUT:
	helio	- The heliocentric angle in degrees
                       (0,*) = longitude (degrees) W positive
                       (1,*) = latitude (degrees) N positive
OPTIONAL INPUT:
	date	- The date for the conversion in question.  This is needed
		  for SXT so that the pixel location of the center of the sun
		  can be determined.
OUTPUT:
	pix	- The pixel coordinates of the point(s) in question.  Larger pixel
		  address towards the N and W.
			(0,*) = E/W direction
			(1,*) = N/S direction
OPTIONAL KEYWORD INPUT:
	roll	- This is the S/C roll value in degrees
	
	hxa	- If set, use HXA_SUNCENTER to determine the location of the
		  sun center in pixels.  Default is to use GET_SUNCENTER.
	cmd	- If set, use SXT_CMD_PNT to determine the location of the
                 sun center in pixels. Default is to use GET_SUNCENTER.
	suncenter- Pass the derived location of the sun center in pixels (x,y)

	pix_size- The size of the pixels in arcseconds.  If not passed, it
		  uses GT_PIX_SIZE (2.45 arcsec).  This option allows the
		  routine to be used for ground based images.
	radius	- The radius in pixels.  GET_RB0P is called to get the radius
		  and it is used to get the pixel size.  This option allows the
		  routine to be used for ground based images.
OPTIONAL KEYWORD OUTPUT:
	behind -  A flag which is set to 1 when there are points behind the limb.
HISTORY:
	Written 16-Jun-93 by M.Morrison
       Corrected keyword useage 29-jun-93 A.McA.
       16-Oct-93 (MDM) - Removed the tilt keyword input

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_h2p.pro)


CONV_STSDAS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CONV_STSDAS
 PURPOSE:
	Convert internal format of an STSDAS image to host machine architecture
 EXPLANATION:
	Converts the internal format of an STSDAS image (.hhh and .hhd file)
	to the host machine architecture.     Useful for copying STSDAS files
	between different machines.     If the host is not a VMS machine, then
	by default CONV_STSDAS assumes the image originated on VMS.   If the
	host is VMS, then CONV_STSDAS assumes that the image originated on
	an IEEE machine (e.g. SparcStation).

 CALLING SEQUENCE:
	CONV_STSDAS, sdas_name, [ /FROM_IEEE]

 INPUTS:
	sdas_name - scalar string giving name of the STSDAS image
		CONV_STSDAS assumes a default header extension of .hhh -- 
		otherwise the header extension should be included in sdas_name.
		The internal format of the file will be modified by CONV_STSDAS.

 OPTIONAL KEYWORD INPUT:
	/FROM_IEEE - On little endian machines (OSF, windows) this keyword
		indicates that the STSDAS file originated on an IEEE machine
		(e.g SparcStation) rather than a VMS machine

 EXAMPLE:
	Suppose files test.hhd and test.hhh have been copied with FTP from
	a Vax to a Sparcstation.   Convert these files to the SparcStation
	internal format.

	IDL> conv_stsdas, 'test'

 METHOD:
	CONV_STSDAS reads each group image and parameter block and uses 
	IEEE_TO_HOST or CONV_VAX_UNIX to convert the internal format.   The
	converted images and parameter blocks are written back to the orginal
	file.

 PROCEDURE CALLS
	sxopen, fdecomp, datatype(), sxgpar(), ieee_to_host, conv_vax_unix()

 NOTES:
	(1)  When copying STSDAS files to VMS, be sure the .hhh file is 
		formatted as fixed block 80 byte.
	(2)  CONV_STSDAS has no way of knowing if a file really came from
		a different machine architecture.    If it is applied to a file
		that already has the correct internal format, then CONV_STSDAS
		will "convert" this file and corrupt the internal format.
	(3)  Note that CONV_STSDAS currently does not support conversion *from*
		a little-endian machine (OSF, windows)		

 REVISION HISTORY:
	Written   W. Landsman                     January, 1993
	Don't require .hhh extension		April, 1993
	Increase speed by calling SXGINFO	May, 1993

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_stsdas.pro)


CONV_UNIX_VAX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      CONV_UNIX_VAX
 PURPOSE:
      To convert Unix IDL data types to Vax IDL data types. 
 EXPLANATION:
      CONV_UNIX_VAX assumes the Unix IDL data type is IEEE standard in either
      big-endian or little-endian format.

 CALLING SEQUENCE:
      CONV_UNIX_VAX, variable, [ SOURCE_ARCH = ]

 PARAMETERS:
      variable - The data variable to be converted.  This may be a scalar
            or an array.  Valid datatypes are integer, longword,
            floating point, and double precision. The result of the 
            conversion is passed back in the original variable.
 OPTIONAL INPUT KEYWORD:  
      SOURCE_ARCH = name (string) of source architecture
            if using this function on a VAX, otherwise
            !VERSION.ARCH is used to determine the conversion.
            **If run on a VAX, the default is to assume the source to be
            a little-endian machine with IEEE floating point
            (e.g. MIPSEL or Alpha***).
 RESTRICTIONS:
      Requires that data be from IEEE standard Unix machines
      (e.g. SUN, MIPSEL, or Alpha).
 EXAMPLE:
      Read a 100 by 100 matrix of floating point numbers from a data
      file created on a Sun.  Then convert the matrix values into
      VAX format.

      IDL> openr,1,'vax_float.dat
      IDL> data = fltarr(100,100)
      IDL> forrd,1,data
      IDL> CONV_UNIX_VAX,data,SOURCE_ARCH='sparc'

 MODIFICATION HISTORY:
      Version 1      By John Hoegy            13-Jun-88
      04-May-90 - WTT:  Created CONV_UNIX_VAX from VAX2SUN,
                         reversing floating point procedure.
       Modified  P. Keegstra             September 1994
           Implemented MIPSEL and ALPHA architecture,
           distinguishing VMS and OSF
       Modified  P. Keegstra             February 1995
           Added 386 PC based architectures
       If since V5.1 then VMS is always little endian    June 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_unix_vax.pro)


CONV_VAX_UNIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      CONV_VAX_UNIX     
 PURPOSE:
      To convert VAX IDL data types to UNIX (Sun,MIPS,etc.) IDL data types.
 EXPLANTION:
      Generally used on non-VMS machines to parse data created on VMS.
      The architecture is obtained from IDL sys.var. !VERSION.ARCH.   

 CALLING SEQUENCE:
      var_unix = conv_vax_unix( var_vax, [TARGET_ARCH = ] )

 INPUT PARAMETER:
      var_vax - The data variable to be converted.  This may be a scalar
            or an array.  All IDL datatypes are valid (including 
            structures).   The result of the conversion is returned by the
             function.

 OPTIONAL INPUT KEYWORD:  
      TARGET_ARCH = name (string) of desired target architecture
            (e.g. 'sparc' or 'mipsel').    If not supplied, then 
            !VERSION.ARCH is used to determine the target architecture.
            Note that CONV_VAX_UNIX will leave variables unchanged on a
            VMS machine, unless the TARGET_ARCH keyword is set.
            
 EXAMPLE:
      Read a 100 by 100 matrix of floating point numbers from a data
      file created on a VAX.  Then convert the matrix values into Sun format.

      IDL> openr,1,'vax_float.dat'
      IDL> data = fltarr(100,100)
      IDL> readu,1,data
      IDL> data = conv_vax_unix( data )
 NOTE:
       The architecture "alpha" is ambiguous, since VMS alpha IDL
       uses VAX D-float while OSF/1 alpha IDL uses little-endian IEEE.
       The program uses !VERSION.OS to do the right thing when
       converting to a representation appropriate for the current
       platform.  To convert to a representation appropriate for
       an OSF/1 alpha on a VAX or VMS alpha, please specify
       the "mipsel" (or "i386") architecture.

 MODIFICATION HISTORY:
       Written   F. Varosi               August 1990
       Modified  P. Keegstra             April 1992
           Implemented MIPSEL architecture
       Modified  P. Keegstra             July 1994
           Implemented ALPHA architecture, distinguishing VMS and OSF
       Modified  P. Keegstra             February 1995
           Added 386 PC based architectures
       Modified  P. Keegstra             March 1995
           Added note, restored and fixed old specifiers 
           for 386 PC based architectures
      Modified W. Landsman for VAX problems in V4.0        August 1995
      Work for double complex variables                    August 1995
      Remove informational messages under VMS              August 1997
      Since V5.1, IDL VMS uses little endian IEEE          June 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/conv_vax_unix.pro)


COORD_CONV

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT: 
	SDAC

 NAME: 
	COORD_CONV

 PURPOSE:
	This procedure computes the data, normal, and device coordinates for an input point that
 	is any of the three types, and returns the 3 types in xout and yout in
 	that order.

 CATEGORY:


 CALLING SEQUENCE:
	COORD_CONV, X, Y,  Xout, Yout
 CALLS:
	none

 INPUTS:
 
 Default type for input point is data.  Otherwise specified by keywords DATA,NORMAL, DEVICE.
       x: xaxis coordinate, must be scalar
	y: yaxis coordinate, must be scalar

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Xout: the input coordinate converted to [DATA, NORMAL, DEVICE ] units as a vector
	Yout: the input coordinate converted to [DATA, NORMAL, DEVICE ] units as a vector

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	DATA:   If set, input is in DATA coordinates
	NORMAL: If set, input is in NORMAL coordinates
	DEVICE: If set, input is in DEVICE coordinates
	
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

 Kim Tolbert 11/26/91

(See /host/bluemoon/usr2/idllib/ssw/allpro/coord_conv.pro)


COPY_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COPY_STRUCT
 PURPOSE:
 	Copy all fields with matching tag names from one structure to another
 EXPLANATION
	Fields with matching tag names are copied from one structure array to 
	another structure array of different type.
	This allows copying of tag values when equating the structures of
	different types is not allowed, or when not all tags are to be copied.
	Can also recursively copy from/to structures nested within structures.
	Note that the number of elements in the output structure array
	is automatically adjusted to equal the length of input structure array.
	If this not desired then use pro copy_struct_inx which allows
	specifying via subscripts which elements are copied where in the arrays.

 CALLING SEQUENCE:

	copy_struct, struct_From, struct_To, NT_copied
	copy_struct, struct_From, struct_To, EXCEPT=["image","misc"]
	copy_struct, struct_From, struct_To, /RECUR_TANDEM

 INPUTS:
	struct_From = structure array to copy from.
	struct_To = structure array to copy values to.

 KEYWORDS:

	EXCEPT_TAGS = string array of tag names to ignore (to NOT copy).
		Used at all levels of recursion.

	SELECT_TAGS = tag names to copy (takes priority over EXCEPT).
		This keyword is not passed to recursive calls in order
		to avoid the confusion of not copying tags in sub-structures.

	/RECUR_FROM = search for sub-structures in struct_From, and then
		call copy_struct recursively for those nested structures.

	/RECUR_TO = search for sub-structures of struct_To, and then
		call copy_struct recursively for those nested structures.

	/RECUR_TANDEM = call copy_struct recursively for the sub-structures
		with matching Tag names in struct_From and struct_To
		(for use when Tag names match but sub-structure types differ).

 OUTPUTS:
	struct_To = structure array to which new tag values are copied.
	NT_copied = incremented by total # of tags copied (optional)

 INTERNAL:
	Recur_Level = # of times copy_struct calls itself.
		This argument is for internal recursive execution only.
		The user call is 1, subsequent recursive calls increment it,
		and the counter is decremented before returning.
		The counter is used just to find out if argument checking
		should be performed, and to set NT_copied = 0 first call.
 EXTERNAL CALLS:
	pro match	(when keyword SELECT_TAGS is specified)
 PROCEDURE:
	Match Tag names and then use corresponding Tag numbers.
 HISTORY:
	written 1989 Frank Varosi STX @ NASA/GSFC
 	mod Jul.90 by F.V. added option to copy sub-structures RECURSIVELY.
	mod Aug.90 by F.V. adjust # elements in TO (output) to equal
			# elements in FROM (input) & count # of fields copied.
	mod Jan.91 by F.V. added Recur_Level as internal argument so that
			argument checking done just once, to avoid confusion.
			Checked against Except_Tags in RECUR_FROM option.
	mod Oct.91 by F.V. added option SELECT_TAGS= selected field names.
	mod Aug.95 by W. Landsman to fix match of a single selected tag.
	mod Mar.97 by F.V. do not pass the SELECT_TAGS keyword in recursion.

(See /host/bluemoon/usr2/idllib/ssw/allpro/copy_struct.pro)


COPY_STRUCT_INX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COPY_STRUCT_INX
 PURPOSE:
	Copy matching tags & specified indices from one structure to another
 EXPLANATION:
 	Copy all fields with matching tag names (except for "except_Tags")
	from one structure array to another structure array of different type.
	This allows copying of tag values when equating the structures of
	different types is not allowed, or when not all tags are to be copied.
	Can also recursively copy from/to structures nested within structures.
	This procedure is same as copy_struct with option to
	specify indices (subscripts) of which array elements to copy from/to.
 CALLING SEQUENCE:

	copy_struct_inx, struct_From, struct_To, NT_copied, INDEX_FROM=subf
               	or
	copy_struct_inx, struct_From, struct_To, INDEX_FROM=subf, INDEX_TO=subto

 INPUTS:
	struct_From = structure array to copy from.
	struct_To = structure array to copy values to.

 KEYWORDS:

	INDEX_FROM = indices (subscripts) of which elements of array to copy.
		(default is all elements of input structure array)

	INDEX_TO = indices (subscripts) of which elements to copy to.
		(default is all elements of output structure array)

	EXCEPT_TAGS = string array of Tag names to ignore (to NOT copy).
		Used at all levels of recursion.

	SELECT_TAGS = Tag names to copy (takes priority over EXCEPT).
		This keyword is not passed to recursive calls in order
		to avoid the confusion of not copying tags in sub-structures.

	/RECUR_FROM = search for sub-structures in struct_From, and then
		call copy_struct recursively for those nested structures.

	/RECUR_TO = search for sub-structures of struct_To, and then
		call copy_struct recursively for those nested structures.

	/RECUR_TANDEM = call copy_struct recursively for the sub-structures
		with matching Tag names in struct_From and struct_To
		(for use when Tag names match but sub-structure types differ).

 OUTPUTS:
	struct_To = structure array to which new tag values are copied.
	NT_copied = incremented by total # of tags copied (optional)

 INTERNAL:
	Recur_Level = # of times copy_struct_inx calls itself.
		This argument is for internal recursive execution only.
		The user call is 1, subsequent recursive calls increment it,
		and the counter is decremented before returning.
		The counter is used just to find out if argument checking
		should be performed, and to set NT_copied = 0 first call.
 EXTERNAL CALLS:
	pro match	(when keyword SELECT_TAGS is specified)
 PROCEDURE:
	Match Tag names and then use corresponding Tag numbers,
	apply the sub-indices during = and recursion.
 HISTORY:
	adapted from copy_struct: 1991 Frank Varosi STX @ NASA/GSFC
	mod Aug.95 by F.V. to fix match of a single selected tag.
	mod Mar.97 by F.V. do not pass the SELECT_TAGS keyword in recursion,
		and check validity of INDEX_FROM and INDEX_TO in more detail.

(See /host/bluemoon/usr2/idllib/ssw/allpro/copy_struct_inx.pro)


COPY_TAG_VALUES

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : COPY_TAG_VALUES
               
 Purpose     : Copy tag values of one structure into another structure
               
 Explanation : The values of the tags in the SOURCE structure are copied into
               the tags of the DESTINATION structure which have matching tag
               names. Tag names may be truncated as long as an unambiguous
               identification can be made.

               The datatypes of the tags in the DESTINATION stucture are not
               changed, and type conversions of the SOURCE values are handled
               in the same way IDL normally handles type conflicts.
               
               If the STATUS parameter is used, it is set to one if
               everything is OK, and the procedure tries to catch all errors
               to return a zero in STATUS if something goes wrong. In this
               case, some or all the relevant values may have been copied,
               but there is no guarantee about anything.
 
               Attempts to set non-existing tags in DESTINATION will be
               ignored, as will any ambiguous assignment, although the STATUS
               flag will be set to zero to signal the error.

 Use         : COPY_TAG_VALUES,DESTINATION,SOURCE [,STATUS]
    
 Inputs      : DESTINATION : Any structure.

               SOURCE : A structure with some tags bearing the new values of
                        the corresponding tags in DESTINATION.
               
 Opt. Inputs : None.
               
 Outputs     : DESTINATION is altered to reflect the new values.
               
 Opt. Outputs: STATUS : Set to 1 on successful completion, or zero if an
               error occurred.
               
 Keywords    : None.

 Calls       : PARCHECK, TYP()

 Common      : None.
               
 Restrictions: The structures must be single structures.
               
 Side effects: None known.
               
 Category    : Utility
               
 Prev. Hist. : Taken out of cw_pzoom

 Written     : SVH Haugan (UiO), 30 April 1996
               
 Modified    : Version 2, SVHH, 6 June 1996
                       Using the stc.(i)=stc.(j) construct instead of
                       dummy=execute(..).

 Version     : 2, 6 June 1996

(See /host/bluemoon/usr2/idllib/ssw/allpro/copy_tag_values.pro)


COPY_VAR

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

 Name        : COPY_VAR

 Purpose     : to copy data by pointer

 Category    : utility

 Explanation : Copy data by moving address location. 
               Effectively the same as: new_var=temporary(var)
               but more elegant.

 Syntax      : IDL> new_var=copy_var(var)

 Inputs      : VAR = data variable to copy

 Opt. Inputs : None

 Outputs     : NEW_VAR = new data variable to receive value of VAR

 Opt. Outputs: None

 Keywords    : None

 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written, 22-Feb-98, Zarro (SAC/GSFC)
               Modified, 15-Jun-99, Zarro (SM&A/GSFC) - switched back to using TEMPORARY

 Contact     : DZARRO@SOLAR.STANFORD.EDU

(See /host/bluemoon/usr2/idllib/ssw/allpro/copy_var.pro)


CORREL_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CORREL_IMAGES
 PURPOSE:
       Compute the 2-D cross-correlation function of two images
 EXPLANATION:
       Computes the 2-D cross-correlation function of two images for
       a range of (x,y) shifting by pixels of one image relative to the other.

 CALLING SEQUENCE:
       Result = CORREL_IMAGES( image_A, image_B, 
                        [XSHIFT=, YSHIFT=, XOFFSET_B=, YOFFSET_B=, REDUCTION=, 
                        MAGNIFICATION=, /NUMPIX, /MONITOR  )

 INPUTS:
       image_A, image_B = the two images of interest.

 OPTIONAL INPUT KEYWORDS:
       XSHIFT = the + & - shift to be applied in X direction, default=7.
       YSHIFT = the Y direction + & - shifting, default=7.

       XOFFSET_B = initial X pixel offset of image_B relative to image_A.
       YOFFSET_B = Y pixel offset, defaults are (0,0).

       REDUCTION = optional reduction factor causes computation of
                       Low resolution correlation of bin averaged images,
                       thus faster. Can be used to get approximate optimal
                       (x,y) offset of images, and then called for successive
                       lower reductions in conjunction with CorrMat_Analyze
                       until REDUCTION=1, getting offset up to single pixel.

       MAGNIFICATION = option causes computation of high resolution correlation
                       of magnified images, thus much slower.
                       Shifting distance is automatically = 2 + Magnification,
                       and optimal pixel offset should be known and specified.
                       Optimal offset can then be found to fractional pixels
                       using CorrMat_Analyze( correl_images( ) ).

       /NUMPIX - if set, causes the number of pixels for each correlation
                       to be saved in a second image, concatenated to the
                       correlation image, so Result is fltarr( Nx, Ny, 2 ).
       /MONITOR causes the progress of computation to be briefly printed.

 OUTPUTS:
       Result is the cross-correlation function, given as a matrix.

 PROCEDURE:
       Loop over all possible (x,y) shifts, compute overlap and correlation
       for each shift. Correlation set to zero when there is no overlap.

 MODIFICATION HISTORY:
       Written, July,1991, Frank Varosi, STX @ NASA/GSFC
       Use ROUND instead of NINT, June 1995, Wayne Landsman HSTX
       Avoid divide by zero errors, W. Landsman HSTX April 1996
	Remove use of !DEBUG    W. Landsman   June 1997
       Subtract mean of entire image before computing correlation, not just 
          mean of overlap region   H. Ebeling/W. Landsman   June 1998
       

(See /host/bluemoon/usr2/idllib/ssw/allpro/correl_images.pro)


CORREL_OPTIMIZE

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

 PURPOSE:
	Find the optimal (x,y) pixel offset of image_B relative to image_A
 EXPLANATION"
	Optimal offset is computed by means of maximizing the correlation 
	function of the two images.

 CALLING SEQUENCE:
	CORREL_OPTIMIZE, image_A, image_B, xoffset_optimum, yoffset_optimum 
		[ XOFF_INIT=, YOFF_INIT=, MAGNIFICATION=, /PRINT, /NUMPIX, 
		  /MONITOR, PLATEAU_THRESH=  ]

 INPUTS:
	image_A, image_B = the two images of interest.

 OPTIONAL INPUT KEYWORDS:
	XOFF_INIT = initial X pixel offset of image_B relative to image_A,
	YOFF_INIT = Y pixel offset, (default offsets are 0 and 0).
	MAGNIFICATION = option to determine offsets up to fractional pixels,
			(example: MAG=2 means 1/2 pixel accuracy, default=1).
	/NUMPIX: sqrt( sqrt( # pixels )) used as correlation weighting factor.
	/MONITOR causes the progress of computation to be briefly printed.
	/PRINT causes the results of analysis to be printed.
	PLATEAU_THRESH = threshold used for detecting plateaus in 
		the cross-correlation matrix near maximum, (default=0.01),
		used only if MAGNIFICATION > 1.    Decrease this value for
		high signal-to-noise data

 OUTPUTS:
	xoffset_optimum = optimal X pixel offset of image_B relative to image_A.
	yoffset_optimum = optimal Y pixel offset.

 CALLS:
	function  correl_images( image_A, image_B )
	pro  corrmat_analyze

 PROCEDURE:
	The combination of function correl_images( image_A, image_B ) and
	corrmat_analyze of the result is used to obtain the (x,y) offset
	yielding maximal correlation. The combination is first executed at
	large REDUCTION factors to speed up computation, then zooming in 
	recursively on the optimal (x,y) offset by factors of 2.
	Finally, the MAGNIFICATION option (if specified)
	is executed to determine the (x,y) offset up to fractional pixels.
	
 MODIFICATION HISTORY:
	Written, July,1991, Frank Varosi, STX @ NASA/GSFC
	Added PLATEAU_THRESH keyword  June 1997,  Wayne Landsman  STX   

(See /host/bluemoon/usr2/idllib/ssw/allpro/correl_optimize.pro)


CORRMAT_ANALYZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CORRMAT_ANALYZE 
 PURPOSE:
	Find the optimal (x,y) offset to maximize correlation of 2 images
 EXPLANATION:
	Analyzes the 2-D cross-correlation function of two images
	and finds the optimal(x,y) pixel offsets.
	Intended for use with function CORREL_IMAGES.

 CALLING SEQUENCE:
	corrmat_analyze, correl_mat, xoffset_optimum, yoffset_optimum, 
		max_corr, edge, plateau, [XOFF_INIT=, YOFF_INIT=, REDUCTION=, 
		MAGNIFICATION=, PLATEAU_THRESH=, /PRINT]

 INPUTS:
	correl_mat = the cross-correlation matrix of 2 images.
			(as computed by function CORREL_IMAGES( imA, imB ) ).

 NOTE:
	If correl_mat(*,*,1) is the number of pixels for each correlation,
	(the case when /NUMPIX was specified in call to CORREL_IMAGES)
	then sqrt( sqrt( # pixels )) is used as correlation weighting factor.

 OPTIONAL INPUT KEYWORDS:
	XOFF_INIT = initial X pixel offset of image_B relative to image_A.
	YOFF_INIT = Y pixel offset, (both as specified to correl_images).
	REDUCTION = reduction factor used in call to CORREL_IMAGES.
	MAGNIFICATION = magnification factor used in call to CORREL_IMAGES,
		this allows determination of offsets up to fractions of a pixel.
	PLATEAU_THRESH = threshold used for detecting plateaus in 
		the cross-correlation matrix near maximum, (default=0.01),
		used only if MAGNIFICATION > 1
	/PRINT causes the result of analysis to be printed.

 OUTPUTS:
	xoffset_optimum = optimal X pixel offset of image_B relative to image_A.
	yoffset_optimum = optimal Y pixel offset.
	max_corr = the maximal correlation corresponding to optimal offset.
	edge = 1 if maximum is at edge of correlation domain, otherwise=0.
	plateau = 1 if maximum is in a plateua of correlation function, else=0.

 PROCEDURE:
	Find point of maximum cross-correlation and calc. corresponding offsets.
	If MAGNIFICATION > 1:
	the  correl_mat is checked for plateau near maximum, and if found,
	the center of plateau is taken as point of maximum cross-correlation.

 MODIFICATION HISTORY:
	Written, July-1991, Frank Varosi, STX @ NASA/GSFC
	Use ROUND instead of NINT, June 1995 Wayne Landsman HSTX
	Remove use of non-standard !DEBUG system variable   W.L. HSTX 

(See /host/bluemoon/usr2/idllib/ssw/allpro/corrmat_analyze.pro)


COUNTDOWN

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

 Name        : 
	COUNTDOWN
 Purpose     : 
	Prints a message showing where you are in a long job.
 Explanation : 
	Calling COUNTDOWN,n_steps,/OPEN prints a character string consisting of
	some spaces, a slash, and the total number of steps.  Then each
	subsequent call prints out the iteration number on the same line in the
	spaces before the slash.  COUNTDOWN,/CLOSE then resets the behavior of
	the terminal to the default, and linefeeds to a new line.

	If the graphics device supports widgets, then a text widget is used
	instead of the terminal screen/window.

 Use         : 
	COUNTDOWN, N_STEPS, /OPEN	;To begin
	COUNTDOWN, I_STEP		;Each step
	COUNTDOWN, /CLOSE		;To finish
 Inputs      : 
	NUMBER	= Either the total number of steps, or the step number.  Not
		  required when closing the countdown.
 Opt. Inputs : 
	None.
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	OPEN	= Used to open the countdown.
	CLOSE	= Used to close the countdown.
	FONT	= Font to use when displaying the countdown widget.  Only
		  meaningful when the graphics device supports widgets.  If not
		  passed, then the first available 20 point font is used.
 Calls       : 
	TRIM
 Common      : 
	Common block COUNT_DOWN is used simply to keep track of the logical
	unit number used, and whether the countdown is open or not.  It also
	keeps track of those variables used by the widget part of the software,
	when applicable.
 Restrictions: 
	No other output can be sent to the screen when countdown is in effect
	(unless the graphics device uses widgets).  Should not be used in a
	batch job.
 Side effects: 
	If the individual steps are too close together in time, then this could
	slow down the calling routine.
 Category    : 
	Utilities, User_interface.
 Prev. Hist. : 
	William Thompson, October 1991.
	William Thompson, 12 May 1993, converted to use widgets when available.
		This makes it compatible with IDL for Windows.  Also added FONT
		keyword.
 Written     : 
	William Thompson, GSFC, October 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 14 May 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 14 May 1993.

(See /host/bluemoon/usr2/idllib/ssw/allpro/countdown.pro)


COVSRT

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

 NAME:
       COVSRT

 PURPOSE: 
       Repack the covariance matrix to the true order of the parameters

 EXPLANATION:
       Given the covariance matrix COVAR of a fit for MFIT of MA total
       parameters, and their ordering IA(i), repack the covariance matrix to
       the true order of the parameters. Elements associated with fixed
       parameters will be zero.

 CALLING SEQUENCE: 
       COVSRT, covar, ia, mfit

 INPUTS:
       COVAR -- 
       IA    --
       MFIT  --

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       COVAR -- 

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       None.

 CALLS:
       None.

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written November 10, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       
 VERSION:
       Version 1, November 10, 1994

(See /host/bluemoon/usr2/idllib/ssw/allpro/covsrt.pro)


CP_FLUXPOS_NRH2

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

 PURPOSE:
	Cette fonction calcule le flux d'une position a un temps donne

 CATEGORY:
	RH_2D, recherche de positions

 CALLING SEQUENCE:
	flux = CP_FLUXPOS_NRH2(Str_gaus, Rayon, Freq, Npx, Npy)

 INPUTS:
	Str_gaus:	struture decrivant le volume gaussien
	Rayon:		rayon solaire
	Freq:		frequence
	Npx, Npy:	nombres de pixels en x et y

 OUTPUTS:
	flux	valeur du flux pour le volume gaussien Str_gaus

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par: C. Renie Sept. 1998

(See /host/bluemoon/usr2/idllib/ssw/allpro/cp_fluxpos_nrh2.pro)


CP_FLUX_NRH2

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

 PURPOSE:
	Cette procedure calcule le flux correspondant a des images
 2D du NRH

 CATEGORY:
	Calculs NRH

 CALLING SEQUENCE:
	TR_FLUX_NRH2,file, Str_lim, Flux, Time

 INPUTS:
	File	Nom du fichier
	Str_lim structure contenant les limites de traitement (voir RH_2D)
	
 KEYWORD PARAMETERS:
	STOKES	calcul sur STOKESV si = 1, sur STOKESI si =0

 OUTPUTS:
	FLUX	Tableau de flux
	TIME	Tableau des temps
	
 PROCEDURE:
	Le calcul s'effectue sur une region  et d'une heure
 de debut et de fin determinees.
	Par defaut les operations sont effectuees sur l'ensemble de l'image
 et du debut a la fin du fichier
	Les operations sont effectuees image par image donc le volume du
 fichier ne constitue pas une limitation

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin le 12/01/98 (bonmartin@obspm.fr)

(See /host/bluemoon/usr2/idllib/ssw/allpro/cpt_flux_nrh2.pro)


CRANGE

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT:
       SDAC

 NAME:	
	CRANGE

 PURPOSE:	
	This function returns the plot range limits for the X,Y, or Z coordinate.

 EXPLANATION:
	The values of !c.xrange depends on whether plot scale is linear or log.
	This function  returns the ACTUAL  values of the range by interrogating !(xyz).type.

 CATEGORY:
	GRAPHICS

 CALLING SEQUENCE:
	range = crange( XYZ )
 EXAMPLE:
	yoffset = (!y.crange(1) - !y.crange(0)) / 30.

 INPUTS:
	XYZ- a string specifying the axis of interest.

 OUTPUTS:
	None, Function returns the actual values of the range.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 MODIFICATION HISTORY:
 	Written by:	RAS, 1/6/93
	Version 2, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation

(See /host/bluemoon/usr2/idllib/ssw/allpro/crange.pro)


CREATE_NRH_CFILE

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

 PURPOSE:
	Cette procedure cree un fichier de type CFILE de NRH

 CATEGORY:
	NRH flux

 CALLING SEQUENCE:
	CREATE_NRH_FILE, FILE, HEADER, TYPE

 INPUTS:
	FILE	nom du fichier a ouvrir

	HEADER	Headre primaire du fichier ayant servi a calcukler le flux

	TYPE	Type des donnees contenues dans le fichier, Chaine de 
		caracteres mis dans le KEYWORD NRH_DATA

 PROCEDURE:
	Cete procedure cree un fichier de resultats de calculs du NRH
  s'il n'existe pas et ecrit le header primaire correspondant a partir du
  header du fichier ayant servi au calcul
	Si le fichier existe, elle est inoperante. Les donnees sont ecrites
  dans les extensions suivantes

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par:J Bonmartin (obspm.fr) le 15/09/98

(See /host/bluemoon/usr2/idllib/ssw/allpro/create_nrh_cfile.pro)


CREATE_NRH_PFILE

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

 PURPOSE:
	Cette procedure cree un fichier vide de type PFILE (positons) de NRH

 CATEGORY:
	RH_2D, Recherche de position

 CALLING SEQUENCE:
	CREATE_NRH_PFILE, File, Fimg

 INPUTS:
	File:	nom du fichier de positions a creer
	Fimg:	nom du fichier d'images correspondant

 EXAMPLE:
	Please provide a simple exa