Headers for LASCO IDL Library: DATA_ANAL

This page was created by IDL lasco_mk_html_help.pro on Fri Jan 12 09:28:47 2007.


List of Routines


Routine Descriptions

ADJUST_DATE_OBS

[List of Routines] (See ./adjust_date_obs.pro)

 NAME:
       ADJUST_DATE_OBS

 PURPOSE:
       This function returns a structure of two string elements containing the
       adjusted date-obs and time-obs for a given C1, C2, or C3 image header.
       c2_time_offsets.dat file is used to get the time offset using first 
       value extend, interpolation, or last value extend. It then calculates
       the corrected date-obs and time-obs and returns them.

 CATEGORY:
       LASCO DATA_ANAL

 CALLING SEQUENCE:
       adj = adjust_date_obs(hdr) 

 INPUTS:
       hdr: A C1, C2, or C3 image header

 OPTIONAL INPUTS:
       verbose: print diagnostic messages.
                adj = adjust_date_obs(hdr,/verbose)

 OUTPUTS:
      A two element structure of DATE and TIME containing the adjusted
      DATE_OBS and TIME_OBS.

 Example:
     hdr.DATE_OBS = '1998/01/01'
     hdr.TIME_OBS = '00:10:11.181'

     adj = adjust_date_obs(hdr)

     adj.DATE =     '1998/01/01'
     adj.TIME =     '00:13:06.590'
     

 MODIFICATION HISTORY:
       Written by:     Ed Esfandiari, Feb 1999
	 7/24/00, nbr - Add SCCS version, reduce_history commmon block
	11. 6.01, nbr - Use OPENR instead of OPENU
	11.30.01, nbr - Change fnm for windows SSW compatibility
	 7. 5.02, nbr - Fix SCCS version syntax
       09/22/05  Ed Esfandiari -  Check hhdr and if time_obs='' assume level-1
                                  file and do not adjust date_time (already adjusted). 


	@(#)adjust_date_obs.pro	1.8, 09/22/05 - NRL LASCO IDL LIBRARY


ADJUST_HDR_TCR

[List of Routines] (See ./adjust_hdr_tcr.pro)

 Name:
    ADJUST_HDR_TCR
 Purpose:
    To return an IDL structure containing corrected date-obs, sun-center, and roll-angle
    for a input level 0.5 image header. These can then be used to adjust the level-1 image
     headers in the level-1 processing.

 Input Parameters:
    HDR              - A C1, C2, C3, or C4 (EIT) header. For C1 and C4, only the returned
                       date-obs is valid (roll is set to zero and center is not changed).
 Output:
    None

 RETURN VALUE:       - This function returns an IDL structure containing the following tags:
                         DATE: adjusted date-obs (string)
                         TIME: adjusted time-obs (string)
                         ERR : delta-erros from the time_correction routine (string)
                         XPOS: adjusted x-center (float) 
                         YPOS: adjusted y-center (float) 
                         ROLL: roll angle (float) degrees

 Keywords:
    VERBOSE           - If set, print out information from various steps of the processing.

 Calling Sequence:
    adj = ADJUST_HDR_TCR(hdr,/verbose)

 History:
 2003 March 11 - Ed Esfandiari (first version).
 2003 March 11, nbr - Add version info to header; change path derivation of data files
 2004 April 1 , nbr - Adjust HISTORY kewyords for header
 2004 July 17, nbr - good thru March 31, 2004
 2004 Oct 4, nbr - good thru Aug 15, 2004
 2004 Nov 24, AEE - read in last day from a .sav file instead of hard coded date.
 2005 Jan 25, AEE - changed linterp call linear_interp.

ersion= '@(#)adjust_hdr_tcr.pro	1.6, 11/24/04 using: ' ; LASCO IDL Library (NRL)


BK

[List of Routines] (See ./bk.pro)

 NAME:
	BK

 PURPOSE:
	This function returns a K-coronal image from the total B image by
	subtracting off the F-coronal model.

 CATEGORY:
	DATA_ANAL

 CALLING SEQUENCE:
	Result = BK(Img,Hdr)

 INPUTS:
	Img:	Array containing an image of total brightness.  It is the output
    		from level 1 processing (for polarizer=clear)
	Hdr:	FITS image header

 OUTPUTS:
	This routine returns an image of the K-brightness.

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL, 6 Nov 1996

	@(#)bk.pro	1.1 10/04/96 LASCO IDL LIBRARY


C2_DISTORTION

[List of Routines] (See ./c2_distortion.pro)

 NAME:
       C2_DISTORTION

 PURPOSE:
       This function returns distance in arcseconds, given distance
       in pixels.

 CATEGORY:
       DATA_ANAL

 CALLING SEQUENCE:
       RESULT = C2_DISTORTION(data)

 INPUTS:
       Data:        distances in pixels

 OUTPUT:
       Result:      distances in arcseconds

 OPTIONAL OUTPUTS:

       None

 PROCEDURE:
       Given the distance between the sun center and a point (x, y)
       on the CCD, in pixels, this function returns the distance to
       (x, y) in arcseconds.  This function is returns a position
       accurate to within less than one pixel, for all possible
       distances.  However, this function does not work as well for
       points in the same quadrant as the post supporting the
       occulter.

 MODIFICATION HISTORY:
       Written by:     D.A. Biesecker, 24 Nov 1998
                       Ed Esfandiari   24 Nov 1998 - used DISTORTION_COEFFS to
                                                     get the coefficients.


C2_WARP

[List of Routines] (See ./c2_warp.pro)

 NAME:
       C2_WARP 

 PURPOSE:
       This function distorts a C2 image and returns it. 

 CALLING SEQUENCE:
       Result = C2_WARP(Image,Header) 

 INPUTS:
       Image :   C2 image to be distorted
       Header:   C2 image header 


 OUTPUTS:
       The distorted image is returned. Control points at every 32 pixels
       are used for distortion.

 COMMON BLOCKS:
       NONE

 MODIFICATION HISTORY:
               Written  Ed Esfandiari, NRL
   Version 1   aee 19 Nov 1998    Initial release (based on C3_WARP)
               aee 24 Nov 1998    changed get_sun_center call to occltr_cntr.
               dw  10 Dec 1998    Corrected handling of summed images
		NBR 24 Aug 2000	   Switch x/y and x0/y0 around in call to WARP_TRI;
				   Add reduce_history COMMON block

 KNOWN BUGS:

 1. Subfield images are not handled correctly - dw

ersion= '@(#)c2_warp.pro	1.4 08/24/00' ; LASCO IDL LIBRARY 


C3_DISTORTION

[List of Routines] (See ./c3_distortion.pro)

 NAME:
       C3_DISTORTION

 PURPOSE:
       This function returns distance in arcseconds, given distance
       in pixels.

 CATEGORY:
       DATA_ANAL

 CALLING SEQUENCE:
       RESULT = C3_DISTORTION(data)

 INPUTS:
       Data:        distances in pixels

 OUTPUT:
       Result:      distances in arcseconds

 OPTIONAL OUTPUTS:

       None

 PROCEDURE:
       Given the distance between the sun center and a point (x, y)
       on the CCD, in pixels, this function returns the distance to
       (x, y) in arcseconds.  This function is returns a position
       accurate to within less than one pixel, for all possible
       distances.  However, this function does not work as well for
       points in the same quadrant as the post supporting the
       occulter.

 MODIFICATION HISTORY:
       Written by:     D.A. Biesecker, 29 September 1996
	10/5/98 by N B Rich	use coefficients from A. Llebaria
       11/24/98 Ed Esfandiari  used DISTORTION_COEFFS to get the coefficients.

 @(#)c3_distortion.pro	1.2 05/14/97 :NRL Solar Physics


C3_WARP

[List of Routines] (See ./c3_warp.pro)

 NAME:
       C3_WARP 

 PURPOSE:
       This function distorts a C3 image and returns it. 

 CALLING SEQUENCE:
       Result = C3_WARP(Image,Header) 

 INPUTS:
       Image :   C3 image to be distorted
       Header:   C3 image header 


 OUTPUTS:
       The distorted image is returned. Control points at every 32 pixels
       are used for distortion.

 COMMON BLOCKS:
       reduce_history

 SIDE EFFECTS:
	changes cmnver (procedure and version info) in reduce_history common block

 MODIFICATION HISTORY:
               Written  Ed Esfandiari, NRL
   Version 1   aee 28 Oct 1997    Initial release
               aee 24 Nov 1998    changed get_sun_center call to occltr_cntr.
               dw  10 Dec 1998    Corrected handling of summed images
		NBR 24 Aug 2000	   Switch x/y and x0/y0 around in call to WARP_TRI;
				   Add reduce_history COMMON block
		NBR,  6 Nov 2001 - Simplify header handling
		NBR, 14 Mar 2003 - Add subfield functionality

 KNOWN BUGS:

ersion= '03/14/03 @(#)c3_warp.pro	1.7' ; NRL LASCO IDL LIBRARY 


CR_REM_ARRAY

[List of Routines] (See ./cr_rem_array.pro)

Project	: SOHO-LASCO/EIT

Name		: cr_rem_array

Purpose	: Remove cosmic rays from LASCO/EIT images

Explanation	: This procedure removes cosmic rays from an array 
		  previously defined in the idl session by first
		  using statistical techniques to identify regions
		  containing cosmic rays (or stars) and then replaces
		  the pixel values in that region with new values 
		  determined by taking the average of column and row
		  fits across the region based on neighboring points.
		  Statistical noise based upon the quality of the
		  fit to the neighboring data is added to the fit
		  to give realistic local variation for aesthetic
		  purposes.

 Syntax	: result=cr_rem_array(image,telescope,
				BASE_IMAGE=base_image,
				BLOCK=block,
				GROUP_SIZE=groupsize,
				N_SIGMA=n_sigma,
				CX=cx,CY=cy,
				RMIN=rmin,RMAX=rmax,
				RFILE=rfile,
				USE_ROI=use_roi,
				ORDER=order)

 Inputs	: image : The array name of a previously read-in image
		  telescope  :	An integer denoting the telescope used for the
				image. C1=1, C2=2, C3=3, EIT=4

 Keywords	: BASE_IMAGE : 	Image to subtract from the input image array if
			       	differencing is desired
		  BLOCK      : 	Size in pixels of the larger neighborhoods used
			     	to determine the statistical characteristics
				which determine which smaller neighborhoods have
				possible cosmic rays. Default is 32.
		  GROUP_SIZE :	Size in pixels of the smaller neighborhoods
				which are examined for cosmic rays. 
				Default is 8.
		  N_SIGMA    :	Statistical requirement used to determine
				candidate smaller neighborhoods withing a larger
				neighborhood. The maximum value of a given
				smaller neighborhood must deviate 
				from the median value of the means of the 
				smaller	neighborhoods comprising a larger
				neighborhood in order to be considered a 
				candidate.
		  ORDER	     :	The order of the polynomial fit to use to model
				the data in the smaller neighborhoods being 
				corrected. Default is 2. Errors may occur for
				values higher than 3. For smaller neighborhoods
				abutting the occulter or abutting telemetry
				dropout regions, a linear fit is used.

 ***	The program is designed to handle the occulter and vignetted outer edge
	of the circular FOV of the instruments. The high intensity gradients
	at these edges leads to poor cosmic ray correction when candidate 
	pixel groups are identified there. The following keywords should be
	included when using this feature.
		  CX,CY      : 	Coordinates of the center of the occulter in
				the image. Only required if the occulter region
				is to be ignored in the removal process. This
				is done in processing LASCO images to avoid 
				problems arising from having large regions
 				with values drastically different
				from neighboring valid data. In EIT images it is
				done to avoid processing disk data because some
				bright features on the disk are
				indistinguishable from cosmic rays using these
				statistical methods.
		  RMIN,RMAX  :	The minimum and maximum radial values to
				consider for the processing. The minimum value
				should be slightly larger than the radius of 
				the occulter in the image. The maximum should
				be slightly smaller than the radius of the
				unvignetted field of view. IF RMIN is defined
				but RMAX is not, the entire field of view
				outside RMIN will be corrected.
		  RFILE      :  The name of a file containing the radial
				distance of each pixel in the image from
				the center coordinates CX, CY. If the file
				does not exist, it will be generated. If the
				file exists, but the size of the image or the 
				center coordinates have changed, the file is
				regenerated. 
		  USE_ROI     : Sometimes one might want to exclude a region from
				cosmic ray removal processing, such as when a bright
			 	star or a comet appears in the field of view. To
				do this, set this keyword and then use the mouse
				buttons to set the ROI (=region of interest). The left
				mouse button draws line segments, the middle button
				removes them if necessary, and the right button 
				closes the region. See the description of DEFROI
				in the IDL manual.

 Calls		: generate_r_matrix

 Restrictions	:

 Side effects	:

 Category	: Image processing

 Prev. Hist.	: None

 Written	: Norm Moulton, NRL, Sept. 1996

 Modified	:

 Version	:


CR_REM_FILE

[List of Routines] (See ./cr_rem_file.pro)

Project	: SOHO-LASCO/EIT

Name		: cr_rem_file

Purpose	: Remove cosmic rays from LASCO/EIT images

Explanation	: This procedure removes cosmic rays from a named FITS
		  file by first using statistical techniques to identify 
		  regions containing cosmic rays (or stars) and then replaces
		  the pixel values in that region with new values 
		  determined by taking the average of column and row
		  fits across the region based on neighboring points.
		  Statistical noise based upon the quality of the
		  fit to the neighboring data is added to the fit
		  to give realistic local variation for aesthetic
		  purposes.

 Syntax	: result=cr_rem_file(image_file,telescope,
				BASE_IMAGE=base_image_file,
				BLOCK=block,
				GROUP_SIZE=groupsize,
				N_SIGMA=n_sigma,
				CX=cx,CY=cy,
				RMIN=rmin,RMAX=rmax,
				RFILE=rfile,
				USE_ROI=use_roi,
				ORDER=order)

 Inputs	: image_file : The file name of an image (FITS)
		  telescope  :	An integer denoting the telescope used for the
				image. C1=1, C2=2, C3=3, EIT=4

 Keywords	: BASE_IMAGE : 	Filename of image to subtract from the input 
				image array if differencing is desired.
		  BLOCK      : 	Size in pixels of the larger neighborhoods used
			     	to determine the statistical characteristics
				which determine which smaller neighborhoods have
				possible cosmic rays. Default is 32.
		  GROUP_SIZE :	Size in pixels of the smaller neighborhoods
				which are examined for cosmic rays. 
				Default is 8.
		  N_SIGMA    :	Statistical requirement used to determine
				candidate smaller neighborhoods withing a larger
				neighborhood. The maximum value of a given
				smaller neighborhood must deviate 
				from the median value of the means of the 
				smaller	neighborhoods comprising a larger
				neighborhood in order to be considered a 
				candidate.
		  ORDER	     :	The order of the polynomial fit to use to model
				the data in the smaller neighborhoods being 
				corrected. Default is 2. Errors may occur for
				values higher than 3. For smaller neighborhoods
				abutting the occulter or abutting telemetry
				dropout regions, a linear fit is used.

 ***	The program is designed to handle the occulter and vignetted outer edge
	of the circular FOV of the instruments. The high intensity gradients
	at these edges leads to poor cosmic ray correction when candidate 
	pixel groups are identified there. The following keywords should be
	included when using this feature.
		  CX,CY      : 	Coordinates of the center of the occulter in
				the image. Only required if the occulter region
				is to be ignored in the removal process. This
				is done in processing LASCO images to avoid 
				problems arising from having large regions
 				with values drastically different
				from neighboring valid data. In EIT images it is
				done to avoid processing disk data because some
				bright features on the disk are
				indistinguishable from cosmic rays using these
				statistical methods.
		  RMIN,RMAX  :	The minimum and maximum radial values to
				consider for the processing. The minimum value
				should be slightly larger than the radius of 
				the occulter in the image. The maximum should
				be slightly smaller than the radius of the
				unvignetted field of view. IF RMIN is defined
				but RMAX is not, the entire field of view
				outside RMIN will be corrected.
		  RFILE      :  The name of a file containing the radial
				distance of each pixel in the image from
				the center coordinates CX, CY. If the file
				does not exist, it will be generated. If the
				file exists, but the size of the image or the 
				center coordinates have changed, the file is
				regenerated. 
		  USE_ROI     : Sometimes one might want to exclude a region from
				cosmic ray removal processing, such as when a bright
			 	star or a comet appears in the field of view. To
				do this, set this keyword and then use the mouse
				buttons to set the ROI (=region of interest). The left
				mouse button draws line segments, the middle button
				removes them if necessary, and the right button 
				closes the region. See the description of DEFROI
				in the IDL manual.

 Calls		: generate_r_matrix

 Restrictions	:

 Side effects	:

 Category	: Image processing

 Prev. Hist.	: None

 Written	: Norm Moulton, NRL, Sept. 1996

 Modified	:

 Version	:


DIST2SUN

[List of Routines] (See ./dist2sun.pro)

 NAME:
	DIST2SUN

 PURPOSE:
	This function computes the distance from SOHO to the sun in km

 CATEGORY:
	DATA_ANAL

 CALLING SEQUENCE:
	Result = DIST2SUN(Date)

 INPUTS:
	Date:	The date in any CDS time format

 OUTPUTS:
	This function returns the distance from SOHO to the sun in km.
	The type is double precision.

 PROCEDURE:
	The orbit ephemeris files are read for the desired date.
	The solar vector is returned and the distance is computed.

	If an error is found getting the orbit file, the result will be zero

 EXAMPLE:
	dist = DIST2SUN('1995-dec-21')

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, 25 Jan 2001

	@(#)dist2sun.pro	1.1 01/25/01 LASCO IDL LIBRARY


EIT_TIME_CORRECTION

[List of Routines] (See ./eit_time_correction.pro)

 Name:
    EIT_TIME_CORRECTION

 Purpose:
    To interpolate or extrapolate the most recent OBE - LOBT time difference
	from the values in TIME_DIFFERENCE_DB.

 Input Parameters:
    None

 Output:
    None

 Keywords:
    CORRECTION_STRING	-	Used to return an ASCII string with the
				time difference.
    INTERP             -       Turn on interpolation

 Calling Sequence:
    dt = EIT_TIME_CORRECTION(obe_time, CORRECTION_STRING = CORRECTION_STRING)
 
 Restrictions:
    If large jumps in the difference occur between realtime contacts, this
	routine could return inaccurate values.

 History:
    1997 April 17 -	D.M. fecit.
    1997 August 27 -	Added CORRECTION_STRING keyword		D.M. fecit.
    1999 Feb 7   - Added binary search and indexing to speed finding
                   the right record, created unix version for Solaris -  DW
    1999 Feb 8   - Added INTERP keyword - IMPORTANT due to time offset jumps
                   during out of contact periods, interpolation can produce
		    totally bogus answers - DW

 @(#)eit_time_correction.pro	1.2 02/09/99 NRL IDL LIBRARY


ELTHEORY

[List of Routines] (See ./eltheory.pro)

 NAME:
	ELTHEORY

 PURPOSE:
	This procedure computes various properties of the Thomson scattered
	light by an electron in the solar corona.

 CATEGORY:
	CME

 CALLING SEQUENCE:
	ELTHEORY, Rin, T, R, B, Bt, Br, Pol

 INPUTS:
	Rin:	Impact Distance (in solar radii)
	T:	Angle from plane of sky (in degrees)

 OUTPUTS:
	R:	Distance of electron from sun center (in solar radii)
	B:	Total Brightness for one electron at R,T
	Bt:	Tangential Brightness for one electron at R,T
	Br:	Radial Brightness for one electron at R,T
	Pol:	Polarization for one electron at R,T

 KEYWORDS:
	LIMB:	The limb darkening coefficient. If not set then use
		0.63 (550 nm).
	CENTER:	If set, then the output is returned as the central solar
		disk brightness.  THe default is mean solar brightness.

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	None

 PROCEDURE:
	This procedure uses the Thomson electron scattering equations 
	to compute the total brightness, the radial and tangential 
	components and the polarization associated with one electron.
	Limb darkening of 0.63 is included.
	The results are returned in units of mean solar brightness.
	

 MODIFICATION HISTORY:
	Created IDL version 16 May 1996, RA Howard, NRL
	RAH 11/25/98	Added common block for VDH coefficients
	RAH 09/01/99	Added keyword for limb darkening
	RAH 10/02/99	Changed output to be mean solar brightness
	RAH 10/27/99	Added keyword for central/mean solar brightness

	@(#)eltheory.pro	1.5 11/29/05 LASCO IDL LIBRARY


FCORPOL_KL

[List of Routines] (See ./fcorpol_kl.pro)

 NAME:
	FCORPOL_KL

 PURPOSE:
	This function returns the Koutchmy-Lamy model of the F-coronal polarization

 CATEGORY:
	LASCO DATA_ANAL

 CALLING SEQUENCE:
	Result = FCORPOL_KL(Rho)

 INPUTS:
	Rho:	Distance from sun center in solar radii

 OUTPUTS:
	This function returns the degree of polarization (0,1) in the F-corona.

 RESTRICTIONS:
	Valid for distances to 115 solar radii.

 PROCEDURE:

 MODIFICATION HISTORY:
 	Written by:	Andrew Hayes, NRL, 12/98

	@(#)fcorpol_kl.pro	1.1 10/08/00 LASCO IDL LIBRARY


FCOR_KL

[List of Routines] (See ./fcor_kl.pro)

 NAME:
	FCOR_KL

 PURPOSE:
	This function returns the F-coronal brightness model of Koutchmy-Lamy

 CATEGORY:
	LASCO DATA_ANAL

 CALLING SEQUENCE:
	Result = FCOR_KL(Rho,Etas)

 INPUTS:
	Rho:	The distance in solar radii
	Etas:

 OUTPUTS:
	This function returns the F-coronal brightness for each point in mean
	solar brightness units.

 RESTRICTIONS:
	None

 PROCEDURE:

 MODIFICATION HISTORY:
 	Written by:	Andrew Hayes, NRL, 12/98
	Modified by:	Andrew Hayes, NRL, 16 AUG 2000 returns 0 for rho eq 0 instead of crashing

	%W% %H% LASCO IDL LIBRARY


FILTER_PRODUCT

[List of Routines] (See ./filter_product.pro)

 NAME:
	FILTER_PRODUCT

 PURPOSE:
	This procedure computes the product of two filter curves

 CATEGORY:
	NRL DATA_ANALYSIS

 CALLING SEQUENCE:
	FILTER_PRODUCT,WL_a,TR_a,WL_b,TR_b,WL,Q

 INPUTS:
	WL_a:	1D array of the wavelengths for curve A
	TR_a:	1D array of the transmitances for curve A
	WL_b:	1D array of the wavelengths for curve B
	TR_b:	1D array of the transmitances for curve B

 OUTPUTS:
	WL:	1D array of the wavelenths for the product
	Q:	1D array of the transmittance product

 RESTRICTIONS:

 PROCEDURE:
	The wavelength interval that is common to both curves is
	determined by finding the greater of the two minimum
	wavelengths and the less of the two maximum wavelengths.

	Then a common set of wavelengths (# pts = 100) is generated,
	and the two filter curves interpolated at these wavelengths.

	The product of the two curves is then computed.

	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	One curve is described by two arrays for the wavelength and 
	transmittances in wave1, trans1.  The other curve is described
	in wave2 and trans2.  Put the ouput into wl and result:

		FILTER_PRODUCT,wave1,trans1,wave2,trans2,wl,result

	result is the product of trans1 and trans2.  The corresponding
	wavelengths are in wl.

 MODIFICATION HISTORY:
 	Written by:	RAHoward, NRL	10/6/00

 @(#)filter_product.pro	1.1 10/08/00 :LASCO IDL LIBRARY


FIND_CHORD_CTR

[List of Routines] (See ./find_chord_ctr.pro)

 NAME:
	FIND_CHORD_CTR

 PURPOSE:
	Find the center of the occulting disk by the method of chords

 CATEGORY:
	LASCO Analysis

 CALLING SEQUENCE:
	FIND_CHORD_CTR, Img, Xcen, Ycen

 INPUT PARAMETERS:
	Img:	The 2-D image

 KEYWORDS:
	INTEN:	Threshold intensity (Default = 1000)
	INTERP:	Flag to perform interpolation (Should be set)
	PYLON:	Flag to avoid pylon (should be used for C2/C3)
	HDR:	Use header to determine starting center

 OUTPUT PARAMETERS:
	Xcen:	The value of the center in X
	Ycen:	The value of the center in Y

 OPTIONAL OUTPUT PARAMETERS: 	None

 COMMON BLOCKS:
	Used for debug

 SIDE EFFECTS:
	Draws chords and computed center on current window

 RESTRICTIONS:

 PROCEDURE:
	Finds the occulter boundary by finding the row and column 
	numbers where the image exceeds a threshold intensity.

	Uses the center of the image as the initial center of the occulter

	If the keyword, Inten, is not present, the default is 1000

	For each row, the column numbers for the left and right boundaries 
	of the chord are computed.  If the optional input parameter, Interp, 
	is present then linear interpolation is used to find a fractional 
	column number.  Otherwise the pixel number of the first pixel 
	exceeding the threshold is used.  The column center is then the 
	midpoint of the chord.  The process is stopped when two boundaries, 
	separated by at least 50 pixels, cannot be found. Then the average 
	of all rows is computed to find the average column number.

	The process is repeated for each column to find the average row number.

 MODIFICATION HISTORY:		Written RA Howard, NRL, 20 December 1995
	V1	RAH	Initial Release
	V2	RAH	16 Feb 96, Added rejection of outliers to average
	V3	RAH	18 Mar 96, Corrected 1 pixel error in right/top edge 
	nbr, 1/30/01 - Fix PYLON keyword; change Debug output; plots on open window

	%W% %H% LASCO IDL LIBRARY


FIX2IMGS

[List of Routines] (See ./fix2imgs.pro)

 NAME:
	FIX2IMGS

 PURPOSE:
	Construct a single image from 2 identical images which might have missing lines 

 CATEGORY:
	DATA_ANAL

 CALLING SEQUENCE:
	FIX2IMGS, A,Ha,B,Hb,CC,Hc

 INPUTS:
	A:	Image #1
	Ha:	Image #1 Header
	B:	Image #2
	Hb:	Image #2 Header

 OUTPUTS:
	CC:	Output image
	Hc:	Output image header

 RESTRICTIONS:
	The two input images must be identical except for missing lines.
	They should be created by reading out the same image to TM using
	the debug readout mode. 

 PROCEDURE:
	The debug readout mode on LASCO does not block the image.  Therefore
	missing pixels will cause the rest of the image to be shifted.  This
	is difficult to analyze.  This procedure calls FIX_CONTROL to
	correct the two images individually and then searches line by line in
	the two images to find matches.  If a match is not found, it searches
	ahead to find the next match and adds the missing lines to the
	the output image.  A match is defined to be two consecutive 
	lines with identical values.

 EXAMPLE:
	a = LASCO_READFITS(name1,ha)
	b = LASCO_READFITS(name2,hb)
	FIX2IMGS,a,ha,b,hb,c,hc

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL, Mar 29, 1999

	@(#)fix2imgs.pro	1.1 03/31/99 LASCO IDL LIBRARY


FIX_CONTRO

[List of Routines] (See ./fix_contro.pro)

 NAME:
	FIX_CONTRO

 PURPOSE:
	Fixes the continuous readout images that are transmitted in debug mode

 CATEGORY:
	DATA_ANAL

 CALLING SEQUENCE:
	Result = FIX_CONTRO (A,Ha)

 INPUTS:
	A:	Image array
	Ha:	Image Header

 OUTPUTS:
	This function returns an image which has only good rows

 RESTRICTIONS:
	The input image should be created by reading out to TM using the 
	debug readout mode. It must have underscan and overscan pixels.

 PROCEDURE:
	The underscan and overscan pixels are assumed to be those that
	have intensities that are no more than 20 DN above the offset
	bias.  

	The input array is reformed into a singly dimensioned array.
	The indices of all of the pixels less than 20 DN are found.
	Then the complete lines are found by finding those indices that
	are separated by 1026 points, which is the length of the imaging
	array (1024) plus 2.  Then the beginning of the underscan is
	set as that point -18 pixels and the end of the line is set
	from the naxis1 variable in the header.

 EXAMPLE:
	a = LASCO_READFITS(name,ha)
	Result = FIX_CONTRO(a,ha)

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL, Mar 29, 1999

	@(#)fix_contro.pro	1.1 03/31/99 LASCO IDL LIBRARY


FPC1_2IMG

[List of Routines] (See ./fpc1_2img.pro)

 NAME:  
	fpc1_2img

 PURPOSE:
	To calculate LASCO C1 emission line signal. (Note: the output is in
	the same units as the input images. No photometric correction is
	made.)

 CALLING SEQUENCE:
	ee = fpc1_2img(ref1,img,cref1,cref2,cimg)	

 INPUTS:
	ref1	first open-door off-line image
	img	open door on-line image
	cref1	first closed-door off-line image 
	cref2	second closed-door off-line image
	cimg	closed door on-line image
	dz      for the comp1 model, this is a "repair" to f that is a function
                 of position. Default value is zero.

 OPTIONAL INPUTS:
       none

 KEYWORD PARAMETERS
	z    this is an array of the form [xmin,ymin,xmax,ymax] which specifies
            the two corners of a particular rectangle in the images. It will be
            assumed that this region contains zero median emission line signal,
            and if any is detected it will be assumed that this is due to an
            exposure error in the on-line image (img). Accordingly, the on-line image
            will be multiplied by a constant such that the median emission
            signal over this region will be exactly zero. If this keyword is
            omitted, all images will be assumed to be correct, and no exposure
            correction will be made.

       model - A number of models are available. The default model is 'comp1' 
	     'subtract' - a simple subtraction of the offline (ref1) from the online (img)
	     'standard' - assumes no white light background  
            'comp1'    - estimates the white light background with the three-gaussian model

 OUTPUTS:
	Returns an image consisting of only that part of the signal due to
	the emission line irradiance. Note that this signal will not be proportional
       to the irradiance, but needs to be further corrected by the instrument
       response in order to obtain photometrically correct results.

 OPTIONAL OUTPUTS:
	none

 METHOD

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	All five input images must be of the same size and at the same location
	on the CCD. Images ref1 and cref1 form an open and closed door image
	pair and must have the same command wavelength. The same is true
	of the img and cimg image pair. Image ref1 must be off line.
	All images must be corrected for offset bias and exposure.

 MODIFICATION HISTORY:
	V 1.00 - Oct 06/98 written by Paul Reiser
	V 1.10 - Jul 15/00 included zeroing box
 
 CONTACT:	Paul Reiser	reiser@susim.nrl.navy.mil
		Dennis Socker	socker@lambda.nrl.navy.mil


FPC1_3IMG

[List of Routines] (See ./fpc1_3img.pro)

 NAME:  
	fpc1_3img

 PURPOSE:
	To calculate LASCO C1 emission line signal. (Note: the output is in
	the same units as the input images. No photometric correction is
	made.)

 CALLING SEQUENCE:
	ee = fpc1_3img(ref1,ref2,img,cref1,cref2,cimg)	

 INPUTS:
	ref1	first open-door off-line image
	ref2	second open-door off-line image
	img	open door on-line image
	cref1	first closed-door off-line image 
	cref2	second closed-door off-line image
	cimg	closed door on-line image

 OPTIONAL INPUTS:
       none

 KEYWORD PARAMETERS
	z    this is an array of the form [xmin,ymin,xmax,ymax] which specifies
            the two corners of a particular rectangle in the images. It will be
            assumed that this region contains no average emission line signal,
            and if any is detected it will be assumed that this is due to an
            exposure error in the on-line image (img). Accordingly, the on-line image
            will be multiplied by a constant such that the average emission
            signal over this region will be exactly zero. If this keyword is
            omitted, all images will be assumed to be correct, and no exposure
            correction will be made.

 OUTPUTS:
	Returns an image consisting of only that part of the signal due to
	the emission line irradiance. Note that this signal will not be proportional
       to the irradiance, but needs to be further corrected by the instrument
       response in order to obtain photometrically correct results.

 OPTIONAL OUTPUTS:
	none

 METHOD

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	All six input images must be of the same size and at the same location
	on the CCD. Images ref1 and cref1 form an open and closed door image
	pair and must have the same command wavelength. The same is true
	of the ref2 and cref2 image pair, and the img and cimg image pair. 
	All images must be corrected for offset bias and exposure.

 MODIFICATION HISTORY:
	V 1.00 - written by Paul Reiser February 23, 1998 (2/23/98)

 CONTACT:	Paul Reiser	reiser@susim.nrl.navy.mil
		Dennis Socker	socker@lambda.nrl.navy.mil


FPC1_PHOT

[List of Routines] (See ./fpc1_phot.pro)

 NAME:  
	fpc1_phot	

 PURPOSE:
	To convert a lasco signal image (DN/pixel/sec) to intensity (erg/sec/cm^2/sr/A)

 CALLING SEQUENCE:
	int = fpc1_phot(s,ix,iy,leb,[dataset])

 INPUTS:
	s - the signal image
	ix,iy - the coordinates of the lower left of the signal image in CCD (1024x1024) coordinates
	leb - binning (1 or 2, usually)

 OPTIONAL INPUTS:
	dataset - the closed door dataset used for calibration (e.g. dataset = '980306')

 KEYWORD PARAMETERS: none

 OUTPUTS:
	Returns the intensity image corresponding to the input signal image. Units 
	of intensity are erg/sec/cm^2/sr/A

 OPTIONAL OUTPUTS: none

 METHOD
	The signal image is multiplied by the calibration image after the calibration image
	is suitable rebinned and cropped.

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS: none

 MODIFICATION HISTORY:
	V 1.00 - written by Paul Reiser Nov 01, 1999 (11/01/99) 

 CONTACT:	Paul Reiser	reiser@susim.nrl.navy.mil
		Dennis Socker	socker@lambda.nrl.navy.mil

 REFERENCES
	http://lasco-www.nrl.navy.mil/~reiser/C1phot.html


FPC1_WCW

[List of Routines] (See ./fpc1_wcw.pro)

 NAME:  
	fpc1_wcw	

 PURPOSE:
	To determine the C1 instrument function central wavelength
	as a function of pixel position (x,y), command wavelength
	(wc) and FP order (m).

 CALLING SEQUENCE:
	WCW(x,y,wc,[m],[\air])

 INPUTS:
	x  - x position(s) (pixels on a 1024x1024 image)
	y  - y position(s) (pixels on a 1024x1024 image)
	wc - command wavelength(s) (Angstroms)

 OPTIONAL INPUTS:
	m  - FP order(s). If zero or unspecified, a nominal order
	     is assumed.

 KEYWORD PARAMETERS:
	AIR	if this keyword is set, the returned wavelength is
		for air, otherwise it is for vacuum. (Note: the
		NSO[1] solar spectrum is given in air wavelengths)

 OUTPUTS:
	Returns the C1 instrument function central wavelength
	in Angstroms. The table below shows the region of 
	applicability for each blocking filter The first column
	is the blocker ID and the second column is the nominal 
	wavelength of the feature which was measured to determine
	the wavelength scale. The next two columns are the 
	minimum and maximum wavelength of the region over which
	the wavelength correction is valid. The last column is
	the std. deviation of the absolute error in wavelength
	when using this method. This error holds only at the
	nominal wavelength. It increases with distance from
	the nominal wavelength to double its value at
	the boundaries of the region of validity. The relative
	error in wavelength from scan to scan is on the
	order of 0.02 A. All wavelengths in the table below are
	in Angstroms.

	Blocker	  Nom.     Min.    Max.   Error	
	  ID	  wav.     wav.    wav.

	FeXIV	  5302.27  5300    5318   0.03
	CaXV	  5693.09  5690    5710   0.07
	NaI	  5891.59  5885    5907   0.08
	FeX	  6373.12  6372    6390   0.05
	H Alpha	  6564.63  6562    6583   0.04

 OPTIONAL OUTPUTS:
	If the order was not specified on input, the nominal order
	used will be returned in the m parameter.

 METHOD
	The central wavelength calibration was determined by comparing
	in-flight FP scans of the photospheric Fraunhofer spectrum
	with the NSO[1] solar spectrum. 

	The FP instrument function was also determined using
	in-flight measurements. The optimum instrument function was
	found to be a Voigt profile.

	A paraboloid of revolution was fitted to the 
	measured variation of wavelength with position in the image.

	The above steps were carried out for each of the five
	blocking filters.

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	In order to increase speed, x, y, and wc may be arrays. There
	are four acceptable situations: 
       1. x,y, and wc are all scalar
       2. x and y are arrays of the same type, and wc is a scalar
       3. x and y are scalars and wc is an array
       4. x,y and wc are arrays of the same type

       A further restriction is that wc must lie inside a blocker
       passband as described above in the output section.

 MODIFICATION HISTORY:
	V 1.00 - written by Paul Reiser September 26, 1997 (9/26/97)
       V 1.10 - PR 1/8/98  Allow arrays for pixel positions

 CONTACT:	Paul Reiser	reiser@susim.nrl.navy.mil
		Dennis Socker	socker@lambda.nrl.navy.mil

 REFERENCES
	1. "Solar Flux Atlas From 296 to 1300 nm", National Solar
	Observatory Atlas No. 1, June 1984.


FPC1_WWC

[List of Routines] (See ./fpc1_wwc.pro)

 NAME:  
	FPC1_WWC

 PURPOSE:
	Given a true wavelength (w) and a pixel position on
	a LASCO C1 image (x,y) and an order (m), the function
	will return the command wavelength for the FP in order
	that the true wavelength be transmitted by the FP
	at that position.

 CATEGORY:
	???

 CALLING SEQUENCE:
	fpc1_wwc,x,y,w,[m],[AIR=air]

 INPUTS:
	x - x position (pixels)
	y - y position (pixels)
	w - true wavelength (Angstroms)

 OPTIONAL INPUTS:
	m  - the FP order. If none is specified, a nominal order
	     is assumed.

 KEYWORD PARAMETERS:
	AIR	if this keyword is set, the input wavelength is
		taken as an air wavelength, otherwise it is for
		vacuum.

 OUTPUTS:
	The value returned is the command wavelength for the image
	such that the FP transmits the given true wavelength at the
	given position and order. If the order was not specified on
	input, the nominal order used will be returned in the m
	parameter. The table below shows the region of applicability
	for each blocking filter The first column 
	is the blocker ID and the second column is the nominal 
	wavelength of the feature which was measured to determine
	the wavelength scale. The next two columns are the 
	minimum and maximum wavelength of the region over which
	the wavelength correction is valid. The last column is
	the std. deviation of the absolute error in wavelength
	when using this method. This error holds only at the
	nominal wavelength. It increases with distance from
	the nominal wavelength to double its value at
	the boundaries of the region of validity. The relative
	error in wavelength from scan to scan is on the
	order of 0.02 A. All wavelengths in the table below are
	in Angstroms.

	Blocker	  Nom.     Min.    Max.   Error	
	  ID	  wav.     wav.    wav.

	FeXIV	  5302.27  5300    5318   0.03
	CaXV	  5693.09  5690    5710   0.07
	NaI	  5891.59  5885    5907   0.08
	FeX	  6373.12  6372    6390   0.05
	H Alpha	  6564.63  6562    6583   0.04

 OPTIONAL OUTPUTS
	If the order was not specified on input, the nominal
	order used will be returned in the m parameter.
	
 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	This procedure may not converge unless the input order
	is close to the nominal order.

 MODIFICATION HISTORY:
	Version 1.00 written by Paul Reiser July 22, 1997.
       Version 1.10 PR 1/8/98 allows array x and y


FP_IWCW

[List of Routines] (See ./fpc1_iwcw.pro)

 NAME:  
	fp_iwcw

 PURPOSE:
	Determine C1 instrument function central wavelength map array
	for a monochromatic image.

 CATEGORY:
	image reduction routines

 CALLING SEQUENCE:
	w = fp_iwcw(im,h,[x],[y],[xps],[yps],[/air])

 INPUTS:
	im - primary or secondary c1 monochromatic image array

		A primary monochromatic image array is herein defined as an
		IDL LASCO/C1 image array whose pixel dimensions, position
		and extent in the field of view match those of the original
		telemetered and rectified image array. It may be a subfield
		of the c1 CCD. 

		A secondary monochromatic image array is herein defined as
		an IDL LASCO/C1 image array whowse pixel dimensions and/or
		extent in the field of view do not match those of the
		original telemetered and rectified image array. 

	h - header associated with an original telemetered c1 monochromatic
	    image array (im) 

 OPTIONAL INPUTS: (??? no, these are outputs ???)

	(x,y) - the position of the lower left corner of the array (im)
	        in the telemetered image array. (Of the 4 corners of
		the image rectangle, x and y are the minimum values
		of the horizontal and vertical coordinates respectively) 

	(xps,yps) - x and y dimension pixel count multiplier of the input
		image array 
		im with respect to the telemetered array

 KEYWORD PARAMETERS:

	AIR	if this keyword is set, air wavelength in angstroms is
		returned, otherwise vacuum wavelength in angstroms is
		returned. 

 OUTPUTS:

	Returns an array (wim) with the same dimensions as arry im
	containing the calibrated instrument function central wavelengths
	(in Angstroms) corresponding to each pixel of the associated C1 
	monochromatic image array im.

 OPTIONAL OUTPUTS
	none
	
 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	None 

 PROCEDURE:

 MODIFICATION HISTORY:
	1997 Aug 12 Written by Paul Reiser 


GETBKGIMG

[List of Routines] (See ./getbkgimg.pro)

 Project     : SOHO - LASCO/EIT
                   
 Name        : GETBKGIMG
               
 Purpose     : Get background image for given telescope
               
 Explanation : This routine returns a model image (stray light and/or
		f-corona) for a given telescope, date, image size.
               
 Use         : bkgimg = GETBKGIMG(hdr, model_hdr)
    
 Inputs      : None.
               
 Opt. Inputs : ops	Start time of display in TAI.
               
 Outputs     : None.
               
 Opt. Outputs: None.
               
 Keywords    : use /FFV to return full field of view model (1024x1024 image)
		use /ALL to return yearly minimum otherwise closest monthly minimum images
		are interpolated for given date
		use /ANY_YEAR to return monthly minimum over multiple years.
	ROLLED	Look in $MONTHLY_IMAGES/rolled

 Calls       : 

 Common      : SOHO_DATA	Contains start and end times of SOHO roll periods.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Data analysis
               
 Prev. Hist. : None.

 Written     : Scott Paswaters, NRL
               
 Modified    : 06 Oct 1997 SEP - Added year independent option /ANY_YEAR
		28 Jul 1998 NBR - added time to tai computation; comment out
				STRPUT lines in interpolation section
		23 Sep 1998 NBR - finish repair to year difference problem in interpolation
		29 Sep 1998 NBR - for /FFV, rebin result to size of input image
		 5 Oct 1998 NBR - add call for level_1 images
		13 Nov 1998 NBR - Fix year difference repair
		25 Mar 1999 NBR - Do not interpolate if DATE_OBSs are equal
		 6 Apr 1999 NBR - Use congrid to resize if necessary
		 9 Apr 1999 NBR - Set year2 = year1 for ANY_YEAR
		   Dec 1999 NBR - Fix Y2K glitch for finding ind
		   Jan 2000 NBR - Tinker with resize of imgm; ReFix y2k bug for finding ind
		   Feb 2000 NBR - Rebin both imgm and imgm2 before interpolating
	Jun 2000 NBR - Add ROLL keyword for rolled images
	3/23/01, NBR - Check if bkgimg should be rolled in this procedure, making ROLL keyword 
			unnecessary
	3/30/01, NBR - Redo year problem for any-year
	11/20/01, NBR - Use ROLL_TIMES.pro and change ROLL to ROLLED to be consistent with other pros
	12/17/01, NBR - Fix ANY_YEAR end-of-year problem
	 3/ 8/02, NBR - Fix computation of factor for interpolation
	 7/10/02, NBR - Implement new method of finding images (not offset by 14 days) (except for 
			ANY_YEAR)
	030721	jake	added "OR hdr.CROTA1 EQ 180." to ROLLED check
	 9/03/03, NBR - change hdr.CROTA1 check
	03.10.10, nbr - Do ANY_YEAR if time since last available CURRENT monthly image is GT 15 days
	04.02.18, nbr - use doy to determine endofyear and begofyear
	04.03.02, nbr - Change behavior when model is >15 days old
	04.04.09, nbr - Level-1 bkg is ANY_YEAR only
       05/09/2006 KarlB - Level-1 bkg no longer ANY_YEAR. Various mods have been made to allow for 
                        level-1 processed backgrounds. None of these changes affect LZ/QL data.

 	@(#)getbkgimg.pro	1.24, 05/09/06 - NRL LASCO IDL Library
            
 (SCCS variables for IDL use)


GET_IMG_CENTER

[List of Routines] (See ./get_img_center.pro)

 NAME:
       GET_IMG_CENTER

 PURPOSE:
       This function returns the center of the image relative to the
	sun center in arc seconds.

 CATEGORY:
       LASCO_ANALYSIS

 CALLING SEQUENCE:
       Result = GET_IMG_CENTER (Hdr)

 INPUTS:
       Hdr:    A LASCO header structure for the image that the center is desired

 OPTIONAL INPUTS:
	Pixel:	If set the values are returned in pixels rather than arc seconds

 OUTPUTS:
       This function returns the image center as a two element array
       in which the first element is the azimuthal distance from sun
	center in arc seconds and the second element is the elevation
	distance from sun center.

 RESTRICTIONS:
       Returns the center for the readout port "C"

 PROCEDURE:
       Returns values that have been determined by other means and put
       into a table here.

 MODIFICATION HISTORY:LASCO_FITSHDR2STRUCT(hdr)
       Written by:     R.A. Howard, NRL, 11 Feb 1997
       Updated:

	@(#)get_img_center.pro	1.2 07/11/97 LASCO IDL LIBRARY


GET_ROLL_OR_XY

[List of Routines] (See ./get_roll_or_xy.pro)

 NAME:
       GET_ROLL_OR_XY

 Version     : 
 05/02/06 @(#)get_roll_or_xy.pro	1.4 :NRL Solar Physics

 PURPOSE:
       This function returns the roll angle  of solar north in radians 
       or the sun center position as a 2 element array
       {sun_center,xcen:xcen,ycen:ycen} (pixels).

       It uses C2 and C3 center and roll files created by star routines
       after adjusting header times using EIT/LASCO time-offsets. It should
       only be used with ql or lz level_05 data. For other telescopes, the
       roll, and center are set to but if a roll is requested and it is zero, 
       the SOHO roll is returned instead - as was the case in old version of
       get_roll_or_xy.

 CATEGORY:
       LASCO_ANALYSIS

 CALLING SEQUENCE:
       Result = GET_ROLL_OR_XY (Hdr, Roll_xy)

 INPUTS:
       Hdr:      A LASCO header structure
       Roll_xy: 'ROLL' :  return the roll angle
                'CENTER': return the sun center

 OUTPUTS:
       Roll angle in radians OR sun center {xcen,ycen} in pixels.

 OPTIONAL OUTPUTS:
   	ROLL_OUT=named_var	Named_var contains value of roll angle
   	CENTER_OUT=named_var	Named_var contains sun center structure

 OPTIONAL KEYWORD INPUTS:
       MEDIAN:  Not used - kept for compatability with previous version.
       STAR:    Not used - kept for compatability with previous version.
       AVG:     Not used - kept for compatability with previous version.
       SILENT:  Stop printing of warning and informational messages
       DEGREES: Return roll angle in degrees not radians

 OPTIONAL IO:
       source: On output, returns 
               'Data generated from SunDec files using EIT/LASCO adjusted time-offsets.'

 History:
 2005 January 05 - Ed Esfandiari  First version - based on adjust_hdr_tcr.
 2005 January 05 - Ed Esfandiari  Changed call to linterp to linear_interp.
 2005 April 12   - Karl Battams - Fixed problem with incompatible date formats
 2006 April 25   - Nathan Rich - Add ROLL_OUT and CENTER_OUT keywords


GET_SEC_PIXEL

[List of Routines] (See ./get_sec_pixel.pro)

 NAME:
	GET_SEC_PIXEL

 PURPOSE:
	This function returns plate scale in arc seconds per pixel.

 CATEGORY:
	LASCO_ANALYSIS

 CALLING SEQUENCE:
	Result = GET_SEC_PIXEL (Hdr)

 INPUTS:
	Hdr:	A LASCO header structure

 OPTIONAL INPUTS:
       FULL=FULL:      If the image has been placed in a square field. Ex:
                   Result = GET_SEC_PIXEL (Hdr, FULL=1024)
                   Result = SEC_PIXEL (Hdr, FULL=512)

 OUTPUTS:
	arc seconds per pixel


 PROCEDURE:
	Returns values that have been determined by other means and put
	into a table here.

 MODIFICATION HISTORY:
 	Written by:	S.E. Paswaters, 30 August 1996
       Updated:
                       96/10/04  SEP  Changed FULL to allow different sizes.
			98/08/28  RAH  Mods for MLO/MK3
	99/08/05  NBR	Fixed FULL keyword to compute floating point factor
	00/01/14  DAB	Mods for MLO/MK4
	01/02/12  NBR	Mods for MK4 and elimination of sec_pix as array

	08/19/05 @(#)get_sec_pixel.pro	1.12 : LASCO IDL LIBRARY


GET_SOLAR_RADIUS

[List of Routines] (See ./get_solar_radius.pro)

 NAME:
       GET_SOLAR_RADIUS

 PURPOSE:
       This function returns the radius of the sun in arc seconds.

 CATEGORY:
       LASCO_ANALYSIS

 CALLING SEQUENCE:
       Result = GET_SOLAR_RADIUS (Hdr)

 INPUTS:
       Hdr:    A LASCO header structure

 KEYWORDS:
	PIXEL	Output result in pixels
	DISTANCE	Set equal to variable which will contain distance 
			to sun in km

 OUTPUTS:
       solar radius in arc seconds


 PROCEDURE:
	Determines the solar radius from the position of SOHO as
	defined in the *.cdf format files.

 MODIFICATION HISTORY:
       Written by:     D.A. Biesecker, 12 September 1996
	General routine taken from POINTING3.PRO written by S.P. Plunkett
       Modified 30 Sept. 1996 by DAB: return default values of the solar
        radius if calls to read the SOHO orbit files fail.
	RA Howard 5/20/97	Added keyword PIXEL to return solar radius in pixels
	NB Rich 8/25/98		Use detector instead of telescop to allow MVIHDR
	NB Rich 12/16/98	Use get_orbit_cdf2 instead of get_orbit_cdf
	NB Rich 11/13/01	Use solar_ephem instead of sohoephem if linux is OS
	NB Rich 07/15/03	Ditto for darwin (MaxOSX)
	NB Rich 04.03.29	Fix /pixel for linux case
   NB Rich, 05.08.19 - Try to make general for any (FITS) header

	08/19/05 @(#)get_solar_radius.pro	1.13 - LASCO IDL LIBRARY


GET_SOLAR_ROLL

[List of Routines] (See ./get_solar_roll.pro)

 NAME:
       GET_SOLAR_ROLL

 PURPOSE:
       This function returns the roll angle of solar north in radians.
       1. If /STAR keword is set, it returns the roll angle computed from
          the stars from the daily time files.
       2. If /MEDIAN keyword is set, it returns the running median
          roll angle from the daily time files.
       3. If /AVG keyword is set (or if no /STAR, /MEDIAN, or /AVG
          keyword is set), it returns the median average roll angle from 
          an average file.
       4. IF /STAR or /MEDIAN keyword is used but the daily time files
          do not contian the needed information, the average files will
          be used instead.

 CATEGORY:
       LASCO_ANALYSIS

 CALLING SEQUENCE:
       Result = GET_SOLAR_ROLL (Hdr)

 INPUTS:
       Hdr:    A LASCO header structure

 OPTIONAL KEYWORD INPUTS:
       MEDIAN: Return the running median roll angle from the daily time files.
                   Result = GET_SOLAR_ROLL (Hdr, /MEDIAN)
       STAR:   Return the roll angle computed from the stars from the daily
               time files.
                   Result = GET_SOLAR_ROLL (Hdr, /STAR)
       AVG:    Return the average roll angle for a period to which the image
               belongs from an average file. This is used as default if no
               MEDIAN, STAR, or AVG keyword is used.
                   Result = GET_SOLAR_ROLL (Hdr, /AVG) or
                   Result = GET_SOLAR_ROLL (Hdr)

 OUTPUTS:
       roll angle in radians

 CALLED PROGRAMS:
       GET_ROLL_OR_XY

 PROCEDURE:
	Determines the solar north roll angle from the time files or the
       average files.

 MODIFICATION HISTORY:
       Written by:     
       Updated:        98/10/06  AEE  Changed to use the c?_rollxy_yymmdd.dat
                                      files instead of returning 0.0 (it still
                                      returns zero if the file is not found
                                      or if found it does not contain info for
                                      the image) by calling get_roll_or_xy pro.
                       98/10/28  AEE  Added AVG keyword and made it default.
                       98/12/11  AEE  now returns the source used (STAR,MEDIAN,
                                      AVG,NONE) as a parameter. 

	@(#)get_solar_roll.pro	1.1 05/14/97 LASCO IDL LIBRARY


GET_SUN_CENTER

[List of Routines] (See ./get_sun_center.pro)

 NAME:
	GET_SUN_CENTER

 PURPOSE:
       This function returns a 2 element array of the column and row 
       numbers as the sun center.
       1. If /STAR keword is set, it returns the center computed from
          the stars from the daily time files.
       2. If /MEDIAN keyword is set, it returns the running median
          center from the daily time files.
       3. If /AVG keyword is set (or if no /STAR, /MEDIAN, or /AVG
          keyword is set), it returns the median average center from  
          an average file.
       4. IF /STAR or /MEDIAN keyword is used but the daily time files
          do not contian the needed information, the average files will
          be used instead. 
       5. If no time or average file contains the required sun center (get_
          roll_or_xy returns {0.0,0.0}), then the center of the occulting 
          disk is used instead. 
       The number, in time files, average files, and occulting disk starts
       at 0. The definition in the FITS header starts from 1.

 CATEGORY:
	LASCO_ANALYSIS

 CALLING SEQUENCE:
	Result = GET_SUN_CENTER (Hdr)

 INPUTS:
	Hdr:  A LASCO header structure for the image that the center is desired

 OPTIONAL INPUTS:
       MEDIAN: Return the running median sun center from the daily time files.
                   Result = GET_SUN_CENTER (Hdr, /MEDIAN)
       STAR:   Return the sun center computed from the stars from the daily
               time files.
                   Result = GET_SUN_CENTER (Hdr, /STAR)
       AVG:    Return the average sun center for a period to which the image 
               belongs from an average file. This is used as default if no 
               MEDIAN, STAR, or AVG keyword is used.
                   Result = GET_SUN_CENTER (Hdr, /AVG) or
                   Result = GET_SUN_CENTER (Hdr) 
	FULL=FULL:  If the image has been placed in a square field. Ex:
	       	    Result = GET_SUN_CENTER (Hdr, FULL=1024)
	       	    Result = GET_SUN_CENTER (Hdr, FULL=512)
       RAW:	If set, no corrections are applied 
       DOCHECK:	If set, corrected header is read in
       NOCHECK:	If set, input header is used
   	DEGREES:    Value returned in ROLL keyword is in degrees, else is radians.

 OUTPUTS:
	This function returns the sun center as a two element array in which 
       the first element is the column center and the second element is the
       row center.

 OPTIONAL OUTPUT:
   	ROLL=named_var	Named_var will contain roll value

 OPTIONAL IO:
       source: On output, returns one of the following sources used to
               get the sun center: STAR, AVG, MEDIAN, OCC.


 CALLED PROGRAMS:
       GET_ROLL_OR_XY

 RESTRICTIONS:
	Returns the center for the readout port "C"

 PROCEDURE:
	Returns values that have been determined by other means and put
	into a table here.

 MODIFICATION HISTORY:
 	Written by:	S.E. Paswaters, 30 August 1996
 	Updated:
 	        	96/10/04  SEP  Changed FULL to allow different sizes.

     			97/01/08  SHH  Added correction for cropped images.
     			97/02/11  RAH  Added keyword to return raw center
     			97/12/16  SEP  updated check for EIT date_obs
     			98/08/24  RAH  added capability to handle MLO/MK3 images
     			98/08/26  DW   fixed problem 
                       98/10/06  AEE  Added code to use time files for getting
                                      the sun center, first. A returned center
                                      of {0.0,0.0} from get_roll_or_xy means 
                                      center info for the image was not in a
                                      time file and, so, occ_cen_arr is used,
                                      as before.
                       98/10/26  AEE  Added AVG keyword and made it default.
                                      It still uses occ_cen_arr if zero is 
                                      returned by get_roll_or_xy.
                       98/11/05  AEE  Corrected nocheck and added docheck
     			98/11/12  RAH  Changed MLO/MK3 cam to be MK3
                       98/11/13  AEE  Corrected docheck. Assign all of complete
                                      hdr to shdr.
                       98/12/01  AEE  changed call to read_occ_dat to
                                      occltr_cntr.
                       98/12/11  AEE  now returns the source used for sun
                                      center (STAR,MEDIAN,AVG,OCC) as an
                                      optional parameter.
	99/05/14  NBR	Change name of sun_cen stucture for MK3
	99/06/22  NBR	Make factor floating point for /FULL
	00/01/14  DAB	Added MK4 telescope
	01/01/08  NBR	Do not correct for subfield if keyword FULL is set
	04.04.01, nbr - add COMMON reduce_history
   	06.04.25, nbr - Add ROLL and DEGREES keywords

ersion= '@(#)get_sun_center.pro	1.27, 05/02/06' ; LASCO IDL LIBRARY




IMAGE_PLOT

[List of Routines] (See ./image_plot.pro)

Name:
       IMAGE_PLOT

Purpose:
    generates standard plots for image analysis

Usage:
       IMAGE_PLOT,A,Hdr

Inputs:
       A   = image
       Hdr = FITS header


IMG_ADD

[List of Routines] (See ./img_add.pro)

 NAME: 
                       IMG_ADD 
 
 PURPOSE: 
                       This function routine performs a weighted sum 
                       of two images, in which the weights are the 
                       same.  This would be used as a check of the 
                       procedure, since it is easier to just add  
                       the two arrays together. 
 
 CATEGORY: 
                       ANALYSIS 
 
 CALLING SEQUENCE: 
                       Result = IMG_ADD (Img1,Img2) 
 
 INPUTS: 
                       Img1:   Array containing image #1 
                       Img2:   Array containing image #2  
 
 OPTIONAL INPUTS: 
        
 KEYWORD PARAMETERS: 
 
 OUTPUTS: 
                       Result: The sum of the two input images if 
                                       the operation is successful or -1 
                                       if it is not. 
 
 OPTIONAL OUTPUTS: 
 
 COMMON BLOCKS: 
                       None 
 
 SIDE EFFECTS: 
                       None 
 
 RESTRICTIONS: 
                       The size of both arrays must be the same or  
                       the routine will exit and set result to be  
                       -1. 
 
 PROCEDURE: 
                       The two weighting functions are set to unity. 
                       Then the routine, IMG_WT_SUM, is called. 
 
 EXAMPLE: 
 
 MODIFICATION HISTORY: 
       Written by:     RA Howard, NRL, 27 November 1995 
 
	@(#)img_add.pro	1.1 10/04/96 LASCO IDL LIBRARY


IMG_COMP_DIST

[List of Routines] (See ./img_comp_dist.pro)

 NAME: 
                       IMG_COMP_DIST 
 
 PURPOSE: 
                       This function routine creates a composite  
                       image from two images based on two radial  
                       distances.   For radii less than R1, the  
                       values from image #1 are used.  For radii  
                       greater than R2, the values from image  #2  
                       are used.  For radii between R1 and R2, the  
                       values fade linearly from image #1 to #2. 
 
 CATEGORY: 
                       ANALYSIS 
 
 CALLING SEQUENCE: 
                       Result = IMG_COMP_DIST (Img1,Img2,Sun,R1,R2) 
 
 INPUTS: 
                       Img1:   Array containing image #1 
                       Img2:   Array containing image #2 
                       Sun:            A four element array containing the  
                                       solar coordinates: 
                                       Column of the center of the sun 
                                       Row of the center of the sun 
                                       Roll angle to solar north 
                                       Plate scale in arc secs per pixel 
                       R1:             Radius specifying the outer  
                                       boundary of only Img1  
                       R2:             Radius specifying the inner 
                                       boundary of only Img2 
 
 OPTIONAL INPUTS: 
                       None 
        
 KEYWORD PARAMETERS: 
                       None 
 
 OUTPUTS: 
                       Result: The composite of the two input  
                                       images if the operation is  
                                       successful or -1 if it is not. 
 
 OPTIONAL OUTPUTS: 
                       None 
 
 COMMON BLOCKS: 
                       None 
 
 SIDE EFFECTS: 
                       None 
 
 RESTRICTIONS: 
                       The plate scale and sun center must be the 
                       same for the two images prior to entering the  
                       routine. 
                       The size of both arrays must be the same or  
                       the routine will exit and set result to be  
                       -1. 
 
 PROCEDURE: 
                       The procedure, SUNDIST, is called to compute  
                       the distance matrix from sun center. 
                       The two weighting functions are computed. 
                       Then the routine, IMG_WT_SUM, is called. 
 
 EXAMPLE: 
 
 MODIFICATION HISTORY: 
       Written by:     RA Howard, NRL, 27 November 1995 
 
	@(#)img_comp_dist.pro	1.1 10/04/96 LASCO IDL LIBRARY


IMG_COMP_INT

[List of Routines] (See ./img_comp_int.pro)

 NAME: 
                       IMG_COMP_INT 
 
 PURPOSE: 
                       This function routine creates a composite  
                       image from two images, based on intensity  
                       values.  For intensities less than Int1, 
                       the values from image #1 are used.  For  
                       intensities greater than Int2, the values  
                       from image #2 are used.  For intensities  
                       between Int1 and Int2, the values from both 
                       images are added together. 
 
 CATEGORY: 
                       ANALYSIS 
 
 CALLING SEQUENCE: 
                       Result = IMG_COMP_INT (Img1,Img2,Int1,Int2) 
 
 INPUTS: 
                       Img1:   Array containing image #1 
                       Img2:   Array containing image #2 
                       Int1:   Intensity specifying the upper  
                                       limit for using only Img1  
                       Int2:   Intensity specifying the lower 
                                       limit for using only Img2 
 
 OPTIONAL INPUTS: 
                       None 
        
 KEYWORD PARAMETERS: 
                       None 
 
 OUTPUTS: 
                       Result: The composite of the two input  
                                       images if the operation is  
                                       successful or -1 if it is not. 
 
 OPTIONAL OUTPUTS: 
                       None 
 
 COMMON BLOCKS: 
                       None 
 
 SIDE EFFECTS: 
                       None 
 
 RESTRICTIONS: 
                       The plate scale and sun center must be the 
                       same for the two images prior to entering the  
                       routine. 
                       The size of both arrays must be the same or  
                       the routine will exit and set result to be  
                       -1. 
 
 PROCEDURE: 
                       The two weighting functions are computed 
                       to form the composite image based on the 
                       intensity values of the two images. 
                       Range           Value 
                       0-Int1          3*Img1+1*Img1 
                       Int1-Int2               3*Img1+3*Img2 
                       Int2-Max                1*Img1+3*Img2 
                       Then the routine, IMG_WT_SUM, is called. 
 
 EXAMPLE: 
 
 MODIFICATION HISTORY: 
       Written by:     RA Howard, NRL, 27 November 1995 
 
	@(#)img_comp_int.pro	1.1 10/04/96 LASCO IDL LIBRARY


IMG_SUM_2X2

[List of Routines] (See ./img_sum_2x2.pro)

 NAME:
	IMG_SUM_2X2

 PURPOSE:
	This function does a rebinning into an array that is 1/2 the size of
	the original image in each axis, by summing 2x2 pixels.  This increases
	signal to noise.  

 CATEGORY:
	LASCO ANALYSIS

 CALLING SEQUENCE:
	Result = IMG_SUM_2X2 ( Img )

 INPUTS:
	Img:	Input image, can be any type other than string

 OPTIONAL INPUTS:
	None
	
 OUTPUTS:
	This function returns an image which is the result of the 2x2 pixel summing.

 RESTRICTIONS:
	Forces the input array to have an even number of rows and columns.

 PROCEDURE:
	Generates the indices of the 2x2 pixels and forms the summing explicitly from
	these indices.

 MODIFICATION HISTORY:
 	Written by:	RA Howard, 12 March 1996.

	@(#)img_sum_2x2.pro	1.1 10/04/96 LASCO IDL LIBRARY


IMG_WT_SUM

[List of Routines] (See ./img_wt_sum.pro)

 NAME: 
                       IMG_WT_SUM 
 
 PURPOSE: 
                       This function routine performs a weighted sum 
                       of two images. 
 
 CATEGORY: 
                       ANALYSIS 
 
 CALLING SEQUENCE: 
                       Result = IMG_WT_SUM (Img1,Wt1,Img2,Wt2) 
 
 INPUTS: 
                       Img1:   Array containing image #1 
                       Wt1:            Array containing the weights for 
                                       image #1 
                       Img2:   Array containing image #2  
                       Wt2:            Array containing the weights for 
                                       image #2 
 
 OPTIONAL INPUTS: 
        
 KEYWORD PARAMETERS: 
 
 OUTPUTS: 
                       Result: The sum of the two input images if 
                                       the operation is successful or -1 
                                       if it is not. 
 
 OPTIONAL OUTPUTS: 
 
 COMMON BLOCKS: 
                       None 
 
 SIDE EFFECTS: 
                       None 
 
 RESTRICTIONS: 
                       The size of all of the arrays must be the 
                       same or the routine will exit and set result 
                       to be -1. 
 
 PROCEDURE: 
                       The size of the arrays is verified to be the  
                       same. 
                       The weights are set to zero where the image  
                       values are zero. 
                       The normalizing factor is computed and set to  
                       1 where the factor is 0. 
                       Then the routine forms the weighted sum. 
  
 EXAMPLE: 
 
 MODIFICATION HISTORY: 
       Written by:     RA Howard, NRL, 27 November 1995 
 
	@(#)img_wt_sum.pro	1.1 10/04/96 LASCO IDL LIBRARY


INSTF

[List of Routines] (See ./fpc1_insf.pro)

 NAME:  
	instf

 PURPOSE:
	Return the C1 instrument function Voigt parameters.

 CATEGORY:
	image reduction routines

 CALLING SEQUENCE:
	fpc1_insf,w,fl,fg

 INPUTS:
	w -	wavelength in Angstroms at which the instrument function
		parameters are desired.

 OPTIONAL INPUTS:

	NONE

 KEYWORD PARAMETERS:

	NONE

 OUTPUTS:

	Returns two arrays - fl and fg. The instrument function is
	a Voigt profile which is a convolution of a Gaussian and
	a Lorentzian profile. fg is the full width at half maximum
	of the Gaussian profile G(w):

		G(w) = exp(-w^2/(2*s^2))/(s*sqrt(2*!pi) 

	where s is the variance and fg = 2*s*sqrt(2*alog(2))

	fl is the full width at half maximum of the Lorentzian
	profile L(w):

		L(w) = (fl/(2*!pi))/(w^2+(fl/2)^2)

	The values of both fl and fg are returned in Angstroms

 OPTIONAL OUTPUTS
	NONE
	
 COMMON BLOCKS:
	NONE

 SIDE EFFECTS:
	NONE

 RESTRICTIONS:
	NONE 

 PROCEDURE:

 MODIFICATION HISTORY:
	1997 Oct 20 Written by Paul Reiser 


LIMB_DARK

[List of Routines] (See ./limb_dark.pro)

 NAME:
	LIMB_DARK

 PURPOSE:
	This function returns the limb darkening coefficient given the wavelength

 CATEGORY:
	DATA ANALYSIS

 CALLING SEQUENCE:
	Result = LIMB_DARK (Lambda)

 INPUTS:
	Lambda:	Wavelength in nanometers

 KEYWORDS
	MEANFLUX	If present, the limb darkening is the ratio of the mean flux
			to the intensity at the center of the disk.  The default is
			the ratio of the intensity at the limb to the intensity at
			the center.
	ALLEN		If present the values from Allen "Astrophysical Quantities"
			are returned rather than from Pierce and Allen.

 OUTPUTS:
	This function returns the limb darkening for the input wavelength(s).

 RESTRICTIONS:
	The range of wavelengths can be between 305 nm and 995 nm.  If any
	input values are outside of this range, the program will exit without
	computing anything and will return a value of -1.

 PROCEDURE:
	The limb darkening values derived from Table 2 of Pierce and Allen,
	"The Solar Spectrum Between 0.3 and 10 micron", pp169-192, in "The
	Solar Output and its Variation" O.R. White, ed, Colorado University
	Press, Boulder, 1977.

	Column 6 of Table 2 gives a limb darkening function as the ratio of the
	average solar flux to the intensity at disk center.  We want the ratio
   	of the intensity at the limb to the intensity at the center of the disk
   	Allen, "Astrophysical Quantities" p170 relates the limb darkening
   	coefficient, u, to the ratio of the total flux to the intensity at
   	disk center as approximately:

		u = 3*[F/I((0)]-2

   	where, F/I(0) is the mean to center ratio given in Pierce and Allen.

	Calls the IDL routine INTERPOL to perform the interpolations.

 EXAMPLE:
	To obtain the limb darkening at 730 nm (7300 Angstrom):

		u = LIMB_DARK(730.)

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL, September, 1999

 @(#)limb_dark.pro	1.3 08/10/05 :LASCO IDL LIBRARY


MAKE_AVG_DAILY_ROLL

[List of Routines] (See ./make_avg_daily_roll.pro)

ro make_avg_daily_roll, rollsi, timesi, rollso, timeso, C3=c3, C2=c2, NYEARS=nyears

 Writes file with a median value for roll for each day in input file

 INPUTS
  rollsi	FLTARR	array of roll values
  timesi	UTC Structure ARR	utc date,time of each roll value

 KEYWORDS (1 is required)
  /C2	write c2 file
  /C3	write c3 file

  NYEARS = number of years included in inputs (default 1)

 %H, %W - IDL NRL LASCO Library


NE_FROM_PB

[List of Routines] (See ./ne_from_pb.pro)

 NAME:
	NE_FROM_PB

 PURPOSE:
	This function does the inversion of a radial fit to pB to electron density.

 CATEGORY:
	LASCO DATA_ANALYSIS

 CALLING SEQUENCE:
	NE_FROM_PB,Radii,Q,Coeff,Exps

 INPUTS:
	Radii:	An array of radial points for which the inversion is to be done
	Q:	The limb darkening parameter (0<1)
	Coeff:	The coefficients in the fit of pB versus R
	Exps:	The coefficients in the expansion of pB versus R

 OUTPUTS:
	This function returns the electron density inverted from the fit of pB.

 RESTRICTIONS:
	The pB fit is assumed to be only of the K-corona.  Any F-coronal contribution
	must be removed.

 PROCEDURE:
	The procedure follows the method of van de Hulst, Bull Astron Institutes Netherlands, 
	vol XI, 2 Feb 1950, pp135-150

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	RA Howard, NRL, 27 Nov 1998

	@(#)ne_from_pb.pro	1.1 11/28/98 LASCO IDL LIBRARY


OCCLTR_CNTR

[List of Routines] (See ./occltr_cntr.pro)

 NAME:
	OCCLTR_CNTR

 PURPOSE:
	This function returns the center of the occulting disk (for LASCO)
       and Sun Centers (for EIT) as a 2 element array of the column and
       row numbers.  The number starts at 0.  The definition in the FITS
	header is starting from 1.
       

 CATEGORY:
	LASCO_ANALYSIS

 CALLING SEQUENCE:
	Result = OCCLTR_CNTR (Hdr)

 INPUTS:
	Hdr:	A FITS header for the image that the center is desired. 
               It can be either a string header  or a structure header.

 OUTPUTS:
	This function returns the occulter center as a two element array
	in which the first element is the column center and the second
	element is the row center.

 RESTRICTIONS:
	Returns the center for the readout port "C"

 PROCEDURE:
       occulter_center.dat file is used first but if related data is 
       not found, then default values that have been determined by
       other means and put into a table, here, are used.

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, 14 March 1996
	17 Oct 96	RAH, Revised C1 coords
	04 Dec 96	RAH, Corrected case statement default value
       01 Dec 98       AEE, added code to use occulter_center.dat before 
                            attempting to use the defaults in this file.
                            Also added defaults for EIT in the case statement.
	14 Mar 01	NBR, Use different method to retrieve C3 center using
				time-varying points
	 3 Dec 01	NBR, Change path to Windows and SSW compatible for GSV

	12/07/01, @(#)occltr_cntr.pro	1.9 - LASCO NRL IDL LIBRARY


ORBIT_FILE_TYPE

[List of Routines] (See ./orbit_file_type.pro)

 NAME:
       ORBIT_FILE_TYPE

 PURPOSE:
       This function returns an identifier, indicating which type of
       orbit files exist at the site.  If files of more than one type
       exist, then a fits file is returned if possible.

 CATEGORY:
       

 CALLING SEQUENCE:
       Result = ORBIT_FILE_TYPE (Date)

 INPUTS:
       Date:    format 'DD-Mmm-YYYY HH:MM:SS.SSS'

 OUTPUTS:
       Type:    'CDF'  - cdf format orbit files
                'FITS' - fits format orbit files
                'NULL' - no orbit files found


 PROCEDURE:
       Determines whether the available orbit files are definitive or
       predictive, whether the available file types are *.CDF or
       *.FITS, and whether the prefix is SO_OR_* or YYMMDD*.cdf

 MODIFICATION HISTORY:
       Written by:     D.A. Biesecker, 12 September 1996
       Adapted from GET_ORBIT_CDF written by S.P. Plunkett

	@(#)orbit_file_type.pro	1.1 10/04/96 LASCO IDL LIBRARY


PLOT_LASCO_SPECTRA

[List of Routines] (See ./plot_lasco_spectra.pro)

 NAME:
	PLOT_LASCO_SPECTRA

 PURPOSE:
	This procedure plots the LASCO filter spectral data

 CATEGORY
	CALIBRATION

 CALLING SEQUENCE:
	PLOT_LASCO_SPECTRA,Tel

 INPUTS:
	Tel:	string containing the telescope: 'c1','c2','c3'

 KEYWORD PARAMETERS:
	SINGLE:	If set then a single plot is made.  The default is
		to plot all of the spectra.

 OUTPUTS:
	Generates a plot

 MODIFICATION HISTORY:
	Written by R.A. Howard, NRL

 @(#)plot_lasco_spectra.pro	1.1 07/31/97 :NRL Solar Physics


POINT_FILTER

[List of Routines] (See ./point_filter.pro)

 
 NAME:
	point_filter

 PURPOSE:
	This procedure filters out the pixels which are brighter than
	the area in which they are found.

 CALLING SEQUENCE:
	point_filter,indata,bw,tol,niter,outdata,outpts

 INPUTS:
	indata  = 2-dim array of data to be filtered
	bw	= width of square filter box - must be ODD, recommended
		  value 5.
	tol	= scaling factor to controll how bright the point
		  is before being replaced, recommended value 7.
	niter	= number of time to repeat the process

 OUTPUTS:
	outdata = the filtered array
	outpts	= the value and location of the points removed from
		  the indata array.  outpts is an (n,3) array.
		  n is the number of points subtracted; ,0 is the data
		  value (indata - outdata) with pixel coordinates of
		  x=,1, and y=,2.
 PROCEDURE:
	Uses filter_image to calculate the mean, median, and variance
	over a square box of size bw.  For those point which differ from
       the mean by more than tol*standard deviation, replace the value
       with the median.  Finally, fill the outpoint array with the 
       subtracted values and pixel coordinates.

  MODIFICATION HISTORY:
	Written by Mike Andrews LASCO/NRL/HUGHES STX  12 Feb 1996.
       Modified by MDA 20 Mar 1996 to reduce memory requirement by
		reusing the hold array.
	Modified by MDA 26 Feb 97 to calculate x and y correctly.


POPUP_HELP[1]

[List of Routines] (See ./popup_help.pro)


 file POPUP_HELP.PRO - Creates a widget that displays a pop up message,
                      modifed from DMZ's acknowledge.pro -- LYW


POPUP_HELP[2]

[List of Routines] (See ./popup_help.pro)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 pro popup_help_event, event

 The event handler for PRO POP_HELP
  calls to  :  none
  common    :  none

  The only purpose of the routine is to kill the message window, 
     created by PRO POP_HELP, AFTER the user reads the message.
     The user clicks the "Dismiss" button to get here.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


POPUP_HELP[2]

[List of Routines] (See ./popup_help.pro)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 pro popup_help, message [, title=title, group=group]

  Creates a message window that informs the user with a message and
     requires the user to read the message and to dismiss the window   
     before control will return to the calling procedure.

  calls to  :  xregistered('pop_help'), xmanager,'popup_help'
  common    :  none


 INPUT
     message:  string or string vector containing a message
		that will be displayed on the screen for the 
		user to read.
		(multi-line messages are aesthetically better)
     title:    Optional title of the message window
 OUTPUT
     none

 MODIFICATION HISTORY
	JAN 1993        -- Elaine Einfalt (HSTX)
       August 19, 1994 -- Liyun Wang (ARC)
       August 31, 1994 -- Liyun Wang (ARC), added GROUP keyword
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


QUICK_LOOK

[List of Routines] (See ./quick_look.pro)

 Project     : SOHO - LASCO/EIT
                   
 Name        : QUICK_LOOK
               
 Purpose     : 
               
 Explanation : 
               
		
               
 Use         : IDL> QUICK_LOOK, img
    
 Inputs      : img		2 Dimensional image.
               
 Opt. Inputs : caller		A structure containing the id of the caller.
               
 Outputs     : None.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : 

 Common      : QUICK_LOOK_SHARE
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : Image Display.
               
 Prev. Hist. : None.

 Written     : Scott Paswaters, NRL, January 1995.
               
 Modified    : 

 Version     : Version 0.1, January 9, 1995


REMOVE_CR

[List of Routines] (See ./remove_cr.pro)

 NAME:
       REMOVE_CR 

 PURPOSE:
       Removes cosmic rays (and other bright pixels which are not stars). 

 PROCEDURE:
	Compares each pixel of crnt_im with the pixel in im1 where 
	a star would be if there was a star in that pixel. If the ratio
	exceeds 'threshold', then that pixel = median value of superpixel
	in the previous image.

 CALLING SEQUENCE:
       Result = REMOVE_CR(im1,h1,crnt_im,h2,again) 

 INPUTS:
       im1	(num)ARR	previous image
       h1	STRUCT		header from previous image
	crnt_im (num)ARR	current image
	h2	STRUCT		header from current image
	AGAIN	STRING 		'y' to prompt for ROI
	shrink	FLOAT		Factor by which the image is shrunk from 1024x1024

 KEYWORDS:
	ALL	remove cosmic rays AND stars
	INIT	define ROI on first time through
	SUMSTARS	Sum star images
	PF	Return point-filtered image

 Returned in Common block:
	N_CR	Returns number of pixels removed
 	COORDS	Returns coordinates of removed pixels


 OUTPUTS:
       crnt_im with cosmic rays removed is returned

 PROCEDURE:
 Compute point filtered image. Subtract point filtered image from current image (imdiff). 
 Subtract background image from point filtered image (bkgdiff).
 Compute std dev of each superpixel of bkgdiff. Candidate crays 
 and stars are where imdiff is greater than TWICE the interpolated standard deviation for each 
 superpixel of bkgdiff. For each candidate pixel, check in the previous image in a 5x5 box 
 where that pixel should have been if it was a star, based on a given star motion across 
 the FOV. If the maximum value from this box is less than the value of that pixel in the 
 current image minus the standard deviation of the superpixel from diff, than replace with 
 the median value of the superpixel of the previous image.



 MODIFICATION HISTORY:
               Written 12/23/98, N Rich - NRL/Interferometrics
	4/12/99 NBR	Use median-filtered image to check for CRs
	7/14/99 NBR	Fix problem when gaps in im1
	11/14/00 NBR	Add N_CR keyword, reduce_history common block; use point_filter
	11/21/00 NBR - Optimized for raw images
	12/28/00 NBR - Use C3clearmask2.fts for defining no-check area
	 7/19/01 NBR - Tinkering; using dn/sec images

 LIMITATIONS:
	- may remove comets, planets, etc. if not exempted by setting 
	  again to 'y' which calls the DEFROI routine

ersion = '@(#)remove_cr.pro	1.2 11/02/01'  ; NRL LASCO IDL LIBRARY


ROLL_TIMES

[List of Routines] (See ./roll_times.pro)

 NAME:
	ROLL_TIMES

 PURPOSE:
	Returns dates/times of time periods when SOHO is rolled in TAI seconds

 CATEGORY:
	Attitude

 CALLING SEQUENCE:
	roll_times,stautc,enutc

 INPUTS:
	None

 OUTPUTS:
    Double-arrays of seconds (times)
  stautc	Start times of roll periods
  enutc	End times of roll periods
	
 KEYWORD PARAMETERS:


 MODIFICATION HISTORY:
 	Written by:	Nathan Rich, NRL/Interferometrics - 20 Nov. 2001

	@(#)roll_times.pro	1.1, 11/30/01 LASCO IDL LIBRARY


SCALE_ROTATE

[List of Routines] (See ./scale_rotate.pro)

 NAME:  
            SCALE_ROTATE  
  
 PURPOSE:  
            This function moves, scales and rotates an
            image to a new position and plate scale   
            factor.  
  
 CATEGORY:  
            ANALYSIS  
  
 CALLING SEQUENCE:  
            Result = SCALE_ROTATE (Img,Roll,  
                                   Oldscale,Xcen,Ycen,
                                   Newscale,Newxcen,Newycen)
  
 INPUTS:  
            Img:      Input image array  
            Roll:     Angle between solar north and the top
                      of the image measured eastward (radians)
            Oldscale: Plate scale (arc sec/pixel) of input image
            Xcen:     Column of sun center of input  
            Ycen:     Row of sun center of input  
            Newscale: Plate scale (arc sec/pixel) of output image
            Newxcen:  Column of sun center to move to  
            Newycen:  Row of sun center to move to  
  
 OPTIONAL INPUTS:  
            None  
  
 KEYWORD PARAMETERS:  
            Xsize:  Number of columns in output image  
                    Default is input image  
            Ysize:  Number of rows in output image  
                    Default is input image  
  
 OUTPUTS:  
            Result: The scaled and rotated image  
  
 OPTIONAL OUTPUTS:  
            None  
  
 COMMON BLOCKS:  
            None  
  
 SIDE EFFECTS:  
            None  
  
 RESTRICTIONS:  
  
 PROCEDURE:  
  
 EXAMPLE:  
  
 MODIFICATION HISTORY:  
       Written by:     RA Howard, NRL, 27 Nov 1995.  
 
 @(#)scale_rotate.pro	1.2 05/14/97 :NRL Solar Physics


SCAN_PROFILE

[List of Routines] (See ./scan_profile.pro)

 NAME: SCAN_PROFILE

 PURPOSE:
	This function returns the values of the Img in a straight line between
	the end points specified by P0 and P1.

 CATEGORY:
	LASCO ANALYSIS

 CALLING SEQUENCE:
	Result = SCAN_PROFILE(Img,P0,P1,Col,Row)

 INPUTS:
	Img:	A 2-D array containing the image intensities
	P0:	A 2 element array containing the column and row 
		values of one of the end points
	P1:	A 2 element array containing the column and row 
		values of the other end point

 OUTPUTS:
	Result:	An array containing the scan profile from P0 to P1

 OPTIONAL OUTPUTS:
	COL:	An array containing the image column values,
		where the Function result has been computed.
	ROW:	An array containing the image row values,
		where the Function result has been computed.


 MODIFICATION HISTORY:
 	Written by:	RA Howard, 17 Mar 1996
 
 @(#)scan_profile.pro	1.2 05/14/97 :NRL Solar Physics



SPM_FCOR

[List of Routines] (See ./spm_fcor.pro)

 TITLE:
		SPM_FCOR

 PURPOSE:
  		This function returns the Saito-Poland-Munro F corona

 INPUT PARAMETERS:
		R:		Radius (in solar radii) Can be a single number or an array

 OPTIONAL INPUT PARAMETERS:
		PA:		Position angle (in degrees).  If omitted, then the equatorial
				corona is returned (PA=90)

 OUTPUTS:
		The F corona is returned in Mean Solar Brightness units as an array
		of floating point numbers corresponding to the size of the input R
		array.

 RESTRICTION:
		The F corona is only valid for radial distances from 1.5 to 5 solar
		radii.

 PROCEDURE:
		The F-coronal values for the polar and equatorial cases given in
		Saito, Poland and Munro, Solar Physics, vol 55, pp 121-134, 1977 are
		used as the reference points.  The logs of the brightness values are
		linearly interpolated to obtain the brightness at the desired radii.
		To obtain the brightness for a position angle between the pole and
		equator, the polar and equatorial values are linearly interpolated
		(in the log).

 EXAMPLES:
		To obtain the polar F-corona at 2.8 solar radii:
			f = SPM_FCOR(2.8,0)
		To obtain the equatorial K-corona at 2.8 solar radii:
			f = SPM_FCOR(2.8,90)
			or
			f = SPM_FCOR(2.8)
		To obtain the F-corona at 45 degrees at 2, 3, 4, 5,  and 6 Rs:
			r = [2,3,4,5,6]
			f = SPM_FCOR(r,45)

 WRITTEN:
		18 Dec 1997,	RAHoward, NRL

 @(#)spm_fcor.pro	1.1 12/30/97 :LASCO IDL LIBRARY


SPM_KCOR

[List of Routines] (See ./spm_kcor.pro)

 TITLE:
		SPM_KCOR

 PURPOSE:
  		This function returns the Saito-Poland-Munro K corona

 INPUT PARAMETERS:
		R:		Radius (in solar radii) Can be a single number or an array

 OPTIONAL INPUT PARAMETERS:
		PA:		Position angle (in degrees).  If omitted, then the equatorial
				corona is returned (PA=90)

 OUTPUTS:
		The K corona is returned in Mean Solar Brightness units as an array
		of floating point numbers corresponding to the size of the input R
		array.

 PROCEDURE:
		The K-coronal values for the polar and equatorial cases given in
		Saito, Poland and Munro, Solar Physics, vol 55, pp 121-134, 1977 are
		used as the reference points.  The logs of the brightness values are
		linearly interpolated to obtain the brightness at the desired radii.
		To obtain the coronal intensity for a position angle between the pole
		and equator, the polar and equatorial values are linearly interpolated
		(in the log).

 EXAMPLES:
		To obtain the polar K-corona at 2.8 solar radii:
			K = SPM_KCOR(2.8,0)
		To obtain the equatorial K-corona at 2.8 solar radii:
			K = SPM_KCOR(2.8,90)
			or
			K = SPM_KCOR(2.8)
		To obtain the K-corona at 45 degrees at 2, 3, 4, 5,  and 6 Rs:
			r = [2,3,4,5,6]
			k = SPM_KCOR(r,45)

 WRITTEN:
		18 Dec 1997,	RAHoward, NRL

 @(#)spm_kcor.pro	1.1 12/30/97 :LASCO IDL LIBRARY


SPM_NE

[List of Routines] (See ./spm_ne.pro)

 TITLE:
		SPM_NE

 PURPOSE:
  		This function returns the Saito-Poland-Munro electron density

 INPUT PARAMETERS:
		R:		Radius (in solar radii) Can be a single number or an array

 OPTIONAL INPUT PARAMETERS:
		Region:	=0:  Return the equatorial corona density
				=1:  Return the polar coronal density
				=2:  Return the coronal hole density
				If omitted, then the equatorial corona density is returned

 OUTPUTS:
		The electron density in particles per cm^3 as an array of floating
		point numbers corresponding to the size of the input R array.

 PROCEDURE:
		The electron density for the polar, equatorial and coronal hole cases
		given in Saito, Poland and Munro, Solar Physics, vol 55, pp 121-134,
		1977 are used as the reference points.  The density models are given
		in a function form as
				Ne = c1 * R^d1 + c2 * R^d2
		The coefficients c1, c2, d1 and d2 are given by SPM for each of the
		three models.

 EXAMPLES:
		To obtain the polar electron density at 2.8 solar radii:
			dne = SPM_NE(2.8,1)
		To obtain the equatorial K-corona at 2.8 solar radii:
			dne = SPM_NE(2.8,0)
			or
			dnef = SPM_NE(2.8)
		To obtain the electron density in an equatorial coronal hole at 2, 3, 4, 5,  and 6 Rs:
			r = [2,3,4,5,6]
			dne = SPM_NE(r,2)

 WRITTEN:
		18 Dec 1997,	RAHoward, NRL
		16 Aug 2000,	AHayes, NRL, switched polar and equatorial CH order to agree with paper

 @(#)spm_ne.pro	1.2 08/16/00 :LASCO IDL LIBRARY


SPM_PB

[List of Routines] (See ./spm_pb.pro)

 TITLE:
		SPM_PB

 PURPOSE:
  		This function returns the Saito-Poland-Munro polarization brightness

 INPUT PARAMETERS:
		R:		Radius (in solar radii) Can be a single number or an array

 OPTIONAL INPUT PARAMETERS:
		Region:	=0:  Return the equatorial pB
				=1:  Return the polar pB
				=2:  Return the coronal hole pB
				If omitted, then the equatorial pB is returned

 OUTPUTS:
		The polarization brightness in mean solar brightness units is returned
		as an array of floating point numbers corresponding to the size of the
		input R array.

 PROCEDURE:
		The polarization brightness for the polar, equatorial and coronal hole cases
		given in Saito, Poland and Munro, Solar Physics, vol 55, pp 121-134,
		1977 are used as the reference points.  The pB models are given
		in a function form as
				pB = c1 * R^d1 + c2 * R^d2
		The coefficients c1, c2, d1 and d2 are given by SPM for each of the
		three models.

 EXAMPLES:
		To obtain the polar pB model at 2.8 solar radii:
			pb = SPM_PB(2.8,1)
		To obtain the equatorial K-corona at 2.8 solar radii:
			pb = SPM_PB(2.8,0)
			or
			pb = SPM_PB(2.8)
		To obtain the pB in an equatorial coronal hole at 2, 3, 4, 5,  and 6 Rs:
			r = [2,3,4,5,6]
			pb = SPM_PB(r,2)

 WRITTEN:
		18 Dec 1997,	RAHoward, NRL
		16 Aug 2000,	AHayes, NRL, corrected order of polar and CH

 @(#)spm_pb.pro	1.2 08/16/00 :LASCO IDL LIBRARY


STDIMGPLOT

[List of Routines] (See ./stdimgplot.pro)

Name:
       STDIMGPLOT

Purpose:
    generates standard plots for image analysis

Usage:
       STDIMGPLOT,A,Hdr

Inputs:
       A   = image
       Hdr = FITS header, header structure

 SCCS variables for IDL use
 
 %W% %H% :NRL Solar Physics


STDIMGPLOT2

[List of Routines] (See ./stdimgplot2.pro)

Name:
       STDIMGPLOT2

Purpose:
    generates standard plots for analysis of 64x1024 images 

Usage:
       STDIMGPLOT2,A,Hdr

Inputs:
       A   = image
       Hdr = FITS header

 
 %W% %H% :LASCO IDL LIBRARY


SW_NE

[List of Routines] (See ./ne_sw.pro)

 NAME:
	SW_NE

 PURPOSE:
	This function returns the electron density in the solar wind for
	the input solar radii values

 CATEGORY:
	DATA ANALYSIS

 CALLING SEQUENCE:
	 
	Result = NE_SW(RSUN, NE1AU)

 INPUTS:
	RSUN:	the radial distance (in solar radii) to compute the electron
		density

 OPTIONAL INPUTS:
	NE1AU:	the electron density at 1 AU.  If not specified, a value of
		7.2/cm3 is used
	
 KEYWORD PARAMETERS:
	None

 OUTPUTS:
	This function returns the electron density in particles/cm3

 OPTIONAL OUTPUTS:
	None

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	None

 PROCEDURE:
	Uses the results from Leblanc, Dulk, Bougeret (Solar Physics, v183,
	pp165-180 (1998) who give the functional form of the electron 
	density as a function of solar radius.  The result is scaled to 
	a value of 7.2 particles per cubic centimeter at 1 AU.  The function
	was determined by radio Type III bursts.

 EXAMPLE:
	neprofile = NE_SW (Rsun,10)
		Rsun is an array of solar radii
		10 is the electron density at 1 AU

 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL 10 June 2004.

	%W% %H% LASCO IDL LIBRARY


TELESCOPE_POINTING

[List of Routines] (See ./telescope_pointing.pro)

 NAME:
	TELESCOPE_POINTING

 PURPOSE:
	This function returns the telescope pointing information for SUNDIST.

 CATEGORY:
	LASCO DATA_ANAL

 CALLING SEQUENCE:
	Result = TELESCOPE_POINTING (Hdr)

 INPUTS:
	Hdr:	The image header as a LASCO header structure.

 OUTPUTS:
	This function returns a 4 element floating point array of the
	telescope pointing information:
	word 1:	 column coordinates of the center of the sun
	word 2:  row coordinates of the center of the sun
	word 3:  roll angle to solar north, in degrees, measured westward
	word 4:  size of the solar radius in pixels

 SIDE EFFECTS:
	Calls GET_SUN_CENTER, GET_SEC_PIXEL, GET_SOLAR_RADIUS, GET_SOLAR_ROLL

 PROCEDURE:
	The SUNDIST procedure needs the pointing information to be supplied
	in an array.

 EXAMPLE:
	Return the pointing information for the image pointed to by header.

		Coords = TELESCOPE_POINTING(Hdr)

 MODIFICATION HISTORY:
 	Written by:	RA Howard, 30 Apr 1997
	Mods to accept MLO headers

	@(#)telescope_pointing.pro	1.3 08/28/98 LASCO IDL LIBRARY


TIME_CORRECTION

[List of Routines] (See ./time_correction.pro)

 Name:
    TIME_CORRECTION

 Purpose:
    To return the OBE - LOBT time difference that is equal to or right before the
    the input obe-time from the values in TIME_DIFFERENCE_DB.

 Input Parameters:
    OBE_TIME           -       An input obe_time for which the time offset is to be obtained.

 Output:
    DELTA_ERROR        -       A two element string array.

 RETURN VALUE:
    DT                 -       A two element long array containing the time offset as
                               delta_mjd and delta_ms.

 Keywords:
    CORRECTION_STRING	-	Used to return an ASCII string with the
				time difference.
    VERBOSE            -       If set, print out time selection info.

 Calling Sequence:
    dt = TIME_CORRECTION(obe_time, delta_error, CORRECTION_STRING = CORRECTION_STRING, /VERBOSE)
 
 Restrictions:
    If large jumps in the difference occur between realtime contacts, this
	routine could return inaccurate values.

 History:
    1997 April 17  - D.M. fecit.
    1997 August 27 - Added CORRECTION_STRING keyword		D.M. fecit.
    1999 Feb 7     - Added binary search and indexing to speed finding
                     the right record, created unix version for Solaris -  DW
    2002 Jul 10    - Added DELTA_ERROR parameter                        -  Ed Esfandiari
    2002 Jul 10    - Also added a true binary search                    -  Ed Esfandiari
    2003 Mar 11    - Add REDUCE_HISTORY common block; 
			change datafile calls; delta_error=N/A for c2_offsets - NRich
    2004 Sep 15 - Change OS_version check to 'endian-ness' check, since
			not all unix platforns are necessarily big-endian - GR Lawrence

 @(#)time_correction.pro	1.4, 10/03/05  NRL IDL LIBRARY


VDHAN[1]

[List of Routines] (See ./vdhan.pro)

 NAME:
	VDHAN

 PURPOSE:
	This function computes the "an" coefficient in equation 24 of van de 
	Hulst's paper

 CATEGORY:
	LASCO DATA_ANALYSIS

 CALLING SEQUENCE:
	VDHAN,N

 INPUTS:
	N:	The index of the term

 OUTPUTS:
	This function returns the an coefficient.

 RESTRICTIONS:
	The index must be positive and less than 34.

 PROCEDURE:
	The procedure computes the an coefficient in equations 24a and 24b of 
	van de Hulst, ;	Bull Astron Institutes Netherlands, vol XI, 2 Feb 1950, 
	pp143.  The definition of the coefficient is given in equation 25:
	
	an = pi * n! / ((n/2)!)^2 / 2^(n+1)

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	RA Howard, NRL, 27 Nov 1998

	@(#)vdhan.pro	1.4 11/02/01 LASCO IDL LIBRARY


VDHAN[2]

[List of Routines] (See ./vdhan_new.pro)

 NAME:
	VDHAN

 PURPOSE:
	This function computes the "an" coefficient in equation 24 of van de 
	Hulst's paper

 CATEGORY:
	LASCO DATA_ANALYSIS

 CALLING SEQUENCE:
	VDHAN,N

 INPUTS:
	N:	The index of the term

 OUTPUTS:
	This function returns the an coefficient.

 RESTRICTIONS:
	The index must be positive and less than 34.

 PROCEDURE:
	The procedure computes the an coefficient in equations 24a and 24b of 
	van de Hulst, ;	Bull Astron Institutes Netherlands, vol XI, 2 Feb 1950, 
	pp143.  The definition of the coefficient is given in equation 25:
	
	an = pi * n! / ((n/2)!)^2 / 2^(n+1)

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	RA Howard, NRL, 27 Nov 1998

	@(#)vdhan_new.pro	1.1 11/02/01 LASCO IDL LIBRARY


VDHCOEFF

[List of Routines] (See ./vdhcoeff.pro)

 NAME:
	VDHCOEFF

 PURPOSE:
	This procedure returns the Van de Hulst coefficients for electron scattering.

 CATEGORY:
	LASCO Data Analysis

 CALLING SEQUENCE:
	VDHCOEFF,RADII,Q,AVDH,BVDH

 INPUTS:
	RADII:	Array of positions above sun center in solar radii
	Q;	Limb darkening coefficient

 OUTPUTS:
	AVDH:	Van de Hulst "A" coefficient
	BVDH:	Van de Hulst "B" coefficient

 COMMON BLOCKS:
	COM_ELTHEORY:	R,AEL,BEL,CEL,DEL

 PROCEDURE:
	The functions that describe the scattering of photospheric sunlight from 
	electrons have been developed by van de Hulst (Bulletin of the Astronomical 
	Institutes of the Netherlands, Volume XI, Number 410, February 2, 1950, 
	pp 135-150.  The equations were originally developed in a different form by 
	Minnaert (Zeitschrift fur Astrophysics, Vol 1, 209, 1930) and are included 
	in Billings book "A Guide to the Solar Corona.  The IDL routine, ELTHEORY 
	in the NRL IDL library, computes the Minnaert coefficients, which are only 
	slightly different from the van de Hulst functions in equations 11 and 12 of 
	his paper.  To compute the electron densities from pB, the VDH functions, 
	A and B, are quite useful.
	
	The routine ELTHEORY is called to return the Minnaert coefficients and then 
	the VDH coefficients are computed from them.

 EXAMPLE:
	To return the VDH coefficients, you must specify an array for the radial 
	distance from the sun and the limb darkening coefficient.  

	VDHCOEFF,R,Q,A,B

 MODIFICATION HISTORY:
 	Written by:	RA Howard, 27 Nov 1998..

	@(#)vdhcoeff.pro	1.3 10/27/99 LASCO IDL LIBRARY


VDH_INVERSION

[List of Routines] (See ./vdh_inversion.pro)

 NAME:
	VDH_INVERSION

 PURPOSE:
	This function does the inversion of a radial fit to pB to electron density.

 CATEGORY:
	LASCO DATA_ANALYSIS

 CALLING SEQUENCE:
	VDH_INVERSION,Radii,Q,Coeff,Exps

 INPUTS:
	Radii:	An array of radial points for which the inversion is to be done
	Q:	The limb darkening parameter (0<1)
	Coeff:	The coefficients in the fit of pB versus R
	Exps:	The coefficients in the expansion of pB versus R

 OUTPUTS:
	This function returns the electron density inverted from the fit of pB.

 RESTRICTIONS:
	The pB fit is assumed to be only of the K-corona.  Any F-coronal 
	contribution must be removed.
	The pB fit coefficients must be a polynomial of the form, r^(-n).
	The exponents don't need to be incrementing by 1 and may be 
	fractional.

 PROCEDURE:
	The procedure follows the method of van de Hulst, Bull Astron Institutes 
	Netherlands, vol XI, 2 Feb 1950, pp135-150

	The Ne is assumed to be axially symmetic.

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	RA Howard & Andrew Hayes, NRL, Dec 1998

	@(#)vdh_inversion.pro	1.2 10/08/00 LASCO IDL LIBRARY


[1]

[List of Routines] (See ./image_profiles.pro)

 NAME:

       GET_PT
       
 PURPOSE:
 
        Digitize a point on a previously plotted curve, and return
        the corresponding array element.

 CALLING SEQUENCE:
 
        Result = GET_PT(XAXIS,YAXIS,XPOINT,YPOINT)
        
 INPUTS:
 
        XAXIS - the x axis vector which was used to make the plot.
        
        YAXIS - the y axis vector which was used to make the plot.
		
 KEYWORD PARAMETERS:
 
        NOHIGHLIGHT - set to inhibit putting a red mark on the curve
                      at the digitized point.
			
        MESSAGE - a string to print as the message to the user.
                  Default = 'Digitize a point: '
			
        NOINIT - set to inhibit placing the cursor in the center of
                 the plot window.
		    
 OUTPUTS:
 
        Result - The array subscript of the digitized point.

 OPTIONAL OUTPUT PARAMETERS:
 
        XPOINT, YPOINT - the digitized points.

 SIDE EFFECTS:
 
        A mark is drawn on the plot at the digitized point.

 PROCEDURE:

        The user is asked to digitize a point on the curve using the
        mouse.  The VALUE_TO_INDEX function is used to find the
        closest array element.
		
 MODIFICATION HISTORY:
 
        D. L. Windt, Bell Laboratories, November 1989
        Feb. 1991, Removed call to TEK_COLOR
        Mar. 1997, replaced index search code with call to
        VALUE_TO_INDEX function.

        windt@bell-labs.com


[2]

[List of Routines] (See ./reduce_std_size.pro)

 NAME:

	REDUCE_STD_SIZE

 PURPOSE:

	Create a "full image" 512x512 of the input image.  Accounts for sub 
	images and pixel summing.

 CATEGORY:

	LASCO DATA REDUCTION

 CALLING SEQUENCE:

	Result = REDUCE_STD_SIZE(Img,Hdr)

 INPUTS:

	Img:	Input Image array
	Hdr:	FITS header or LASCO header structure

 OPTIONAL INPUTS:
	None
	
 KEYWORD PARAMETERS:

	FULL:	   Returns an image of size 1024x1024 pixels if set. The default is a 
		   512x512 image.

	NO_REBIN:  Set this to return an array which has not been rescaled 
		   into 512 or 1024.  The default is to perform a rebin to 
                  resize the image.

	BIAS:	Subtracts bias and corrects values for binning before returning image. 
		If the bias is set to 1, then the OFFSET_BIAS routine is called.
               If the bias is greater than 1, then the value in the bias keyword is used.

	SAVEHDR:	Do not put new values in header

 OUTPUTS:

	The function result is a full image, with the input image inserted into
	the correct place in the full image. Also, hdr is modified.

 OPTIONAL OUTPUTS:
	bias

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	None

 PROCEDURE:

	The input image is inserted into its proper place in a full image.  
	On-chip and off-chip pixel summing are properly considered. The output 
	image is resized to a 512 x 512 image.  Optionally, it can be resized 
	to 1024 x 1024 or any size, or not resized at all.  

	If the image is not resized, then each dimension would be determined
	by the amount of summing along each axis according to 1024 / SUM,
	where SUM is the number of pixels summed along the axis.  i.e., if 2x2 
	summing is used, then the image size would be 512 x 512.  If 4x2 
	summing were used, then the image size would be 256 x 512.

	IF BIAS keyword is set, output image values are corrected for summing 
	and offset bias. LEBSUM and SUM header values are changed to reflect output. 

 EXAMPLE:

	To obtain the default 512 x 512 image:

		Output = REDUCE_STD_SIZE(Img,Hdr)

	To obtain a 1024 x 1024 image:

		Output = REDUCE_STD_SIZE(Img,Hdr,/full)

	To obtain an image sized by the summing:

		Output = REDUCE_STD_SIZE(Img,Hdr,/no_rebin)

 MODIFICATION HISTORY:		Written, RA Howard, NRL
    VERSION 1   rah    29 Aug 1996
    VERSION 1.1 sep    29 Sep 1996	added /FULL keyword, and ability to
					handle header structures
    VERSION 1.2 rah    22 Oct 1996	Added /no_rebin keyword
    VERSION 1.3 rah    17 Jul 1997	Corrected handling of image sizes >1024
    VERSION 1.4 nbr	11 Dec 1998	Corrected handling of summed images with sizes > 512
    VERSION 1.5 nbr    11 Feb 1999	Modify R[1,2][row,col] in header (returned)
   		 nbr	12 Feb 1999	Divide by lebxsum*lebysum if binned image
		 nbr	17 Feb 1999	See notes below
		 nbr	18 Feb 1999	Do not divide by lebxsum*lebysum if %P or PB image
		 nbr	23 Mar 1999	Modify NAXIS[1,2] in header
		 nbr 	23 Apr 1999	Added telescope check
		nbr	 7 Dec 1999	Replace stc_flag with LASCO_FITSHDR2STRUCT; fix
					problem with unsummed, rebinned images
		nbr,  1 Aug 2000 - Modify for MK4 images
	nbr, 30 Jan 01 - Add BIAS keyword and streamline program
	nbr, 15 Jun 01 - Remove conditional on REBIN
	nbr, 19 Nov 01 - Handle zero-size images
	nbr, 14 Mar 03 - Correct binning correction again; add /SAVEHDR
	nbr,  5 May 04 - Update crpix values in header if subfield
       rah, 27 Feb 06 - Add the capability to use the bias value input to the program

 
 02/27/06 @(#)reduce_std_size.pro	1.16 :NRL Solar Physics


This page was created by IDL lasco_mk_html_help.pro on Fri Jan 12 09:28:47 2007.