F_ATAN $SSW/gen/idl/util/f_atan.pro
[Previous] [Next]

 NAME:
	F_ATAN

 PURPOSE:
	Shell around IDL's ATAN function to prevent the NaN's in the returned value.  NaN's are set to 0.

 PROJECT:
	HESSI

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	ang = f_atan(x)  or  ang = f_atan(y,x)

 INPUTS:
   X - The tangent of the desired angle.
   Y - An optional argument. If this argument is supplied, ATAN returns the angle
      whose tangent is equal to Y/X. If both arguments are zero, the result is 0.

 CALLED BY:
	HSI_XY2ANNSEC_INDEX
 EXAMPLE:
   IDL> print,f_atan(1.) * !radeg
      45.0000
   IDL> print,f_atan(.3,.6)
      0.463648

 CALLS:
	Function returns the angle (in radians) whose tangent is x, OUTPUT:, atan
	or y/x
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
  none

 MODIFICATION HISTORY:
	Written: 29-May-2002, kim.tolbert@gsfc.nasa.gov


F_ATIME [1] $SSW/gen/idl/time/f_atime.pro
[Previous] [Next]
 NAME: 
	F_ATIME
 PURPOSE:
	Changes time info from numbers into formatted strings
       restricted to no more than 256 separate times.
	For ATIME, put date information, Year, Month, Day, Hour, Minute, Sec
	into ATIME format YY/MM/DD, HHMM:SS.XXX

 CALLING SEQUENCE:
	RESULT = F_ATIME(yr, month, dom, h, m, s [,/pub,/yohkoh])
	       = F_ATIME(tarr=tarr [,/pub,/yohkoh])
 INPUTS:
	YR - Year
	MONTH - 1 to 12
	DOM - Day of Month
	H - hour
	M - minute
	S - second
 OPTIONAL INPUTS:
	TARR - 7xn array of time as integers, 
              The "standard" Yohkoh 7 element external representation
              of time (HH,MM,SS,MSEC,DD,MM,YY)
	/PUB - Publication format = "YY/MM/DD, HH:MM:SS.XXX"
       /Yohkoh
	     - Yohkoh string format, e.g. '07-Mar-93 21:05:30.461'
	/Y2K - If set, then the four digit year format is preserved.

 CALLS: ***
	gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 MODIFICATION HISTORY:
	Written by Richard Schwartz for IDL Version 2, July 1992
	Optional Yohkoh format, and tarr, April 1993
	07-Feb-2002, William Thompson, added keyword Y2K


F_CROSSP $SSW/gen/idl/fund_lib/sdac/f_crossp.pro
[Previous] [Next]
 PROJECT:
       SDAC
 NAME:
       F_CROSSP

 PURPOSE:
       This function returns  the Vector (Cross) product of vectors v1 and v2. 

 CATEGORY:
	MATH, UTILITY, GEOMETRY

 CALLING SEQUENCE:
	Result = F_CROSSP(v1,v2)

 CALLED BY:
	BATSE_POINTING, DET_POINT, GRO_POINT, ORBIT_FILL
 EXAMPLES:
	        yc=f_crossp(zc,xc)

 INPUTS:
	v1 = 3 element vector or n vector arrays, 3 x n format.
	v2 = 3 element vector or n vector arrays, 3 x n format.

 OUTPUTS:
	Result = 3 element floating vector or 3 x n array.

 RESTRICTIONS:
	Vectors must have 3 elements or arrays must be 3 x n

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

 MODIFICATION HISTORY:
	Written, DMS, Aug, 1983;
       Mod. 06/22/95 by AES - renamed to f_crossp
	Mod. 05/09/96 by RCJ. Added documentation.
 CONTACT:
	richard.schwartz@gsfc.nasa.gov


F_DIV $SSW/gen/idl/util/f_div.pro
[Previous] [Next]
 PROJECT:
       SDAC
 NAME:
	F_DIV

 PURPOSE:
	THIS FUNCTION RETURNS THE QUOTIENT WITH ZERO CHECKING.

 CATEGORY:
	MATH, NUMERICAL ANALYSIS, UTILITY

 CALLING SEQUENCE:
	Result = F_DIV( Numerator, Denominator)

 CALLED BY:
	AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], Accum [1], Accum [2], Array_Despike
	BATSE_DEADTM, BATSE_FLARES_WEEK, BATSE_LAD_DRM, BATSE_SPEC_DRM, CLEAN_GOES
	CNTRATE, COMPARE_SHUTTERS, CURVFIT [1], CURVFIT [2], DECOMPOSE_BATSE_DRM
	DESPIKE_1D, DISCSC_PL, DISCSP_BANDS, EVAL_LINE_COMPLEX, Energy_res [1]
	Energy_res [2], FGAUSSINT_FUNCT, FILTER_ATTEN, FIT_BACKGRND, FIX_CONT, FIX_CONT2
	FIX_DISCSP, FIX_DISCSP2, F_LINE, F_NLINE, F_NUCLEAR, F_POW, GAUSSINTFIT, GAUSS_INTG
	GET_HXRBS_FITS, GE_WINDOW [1], GOES_DEGLITCH, GRS_RESP
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI FRAMEWORK TEMPLATE CLASS [2], HESSI FRAMEWORK TEMPLATE CLASS [3]
	HESSI HSI_PILEUP CLASS, HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3]
	HSI_ANNSEC_BPROJ_WEIGHT [1], HSI_ANNSEC_BPROJ_WEIGHT [2]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
	HSI_CALIBEVENT_PROFILE [1], HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_DRM_MOD CLASS, HSI_DRM_MOD_CONTROL__DEFINE
	HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_GET_DATA, HSI_GSMOOTH, HSI_HIST_GROUP
	HSI_IMAGE_ERROR, HSI_MEM_SATO [1], HSI_MODUL_PATTERN_BPROJ, HSI_SCORE_BPROJ
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, HSI_SPECTROGRAM_REDISTRIBUTE
	HSI_SPECTRUM__DEFINE, HXFITS, HXRBS_DEGLITCH, HXT_CAL_DRM [1], HXT_CAL_DRM [2]
	HXT_CAL_FIX [1], HXT_CAL_FIX [2], INTERPOL8, Load_sher, MAP_DISCLA2CONT
	MAP_MATRIX, MCURVEFIT, MELD_DISCSP [1], MK_MER_CONT, NEAR_PC_RESP [1]
	NEAR_PC_RESP [2], NEAR_PIN_RESP [1], NEAR_PIN_RESP [2], OCC_AVG, PARA_LIVETIME
	PLOT_OCC_ONDAY, PULSE_SPREAD, RD_NEAR_PIN [1], RD_NEAR_PIN [2]
	READ_HXRS_4_SPEX [1], READ_HXRS_4_SPEX [2], READ_HXRS_4_SPEX [3]
	RUN_CURVEFIT [1], RUN_CURVEFIT [2], SPECTROGRAM CLASS DEFINITION
	SPECTRUM CLASS DEFINITION, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
	SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_DATA_GENX [1], SPEX_DATA_GENX [2]
	SPEX_DRM__DEFINE, SPEX_FITALG_GEN__DEFINE, SPEX_GEN__DEFINE
	SPEX_PLOT_SAVED [1], SPEX_PLOT_SAVED [2], SPEX_PROC [1], SPEX_PROC [2]
	SPEX_SAVE_DATA [1], SPEX_SAVE_DATA [2], SPEX_THISTORY [1], SPEX_THISTORY [2]
	SPEX__DEFINE, SSW_REBIN, Shers_load [1], TGRS_LIVETIME [1], TGRS_LIVETIME [2]
	countsmod_plot [1], countsmod_plot [2], deriv_lud, drm_4_spex [1]
	drm_4_spex [2], edge_products, energy_res class, f_pder [1], f_pder [2]
	filter_cmpnd, get_conversion [1], get_conversion [2], help_merge [1]
	help_merge [2], hsi_calib_ev2vis, hsi_ls_amp_pha_ctr, hsi_ls_sin_cos
	hsi_phz_stacker, hsi_pixon_residuals, hsi_rm_interp_fit
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1], mark_intervals
	plotman_zoom, rd_wbs_pha [1], rd_wbs_pha [2], read_batse_4_spex [1]
	read_batse_4_spex [2], read_hessi_4_spex [1], read_hessi_4_spex [2]
	read_hessi_fits_4_spex [1], read_hessi_fits_4_spex [2]
	read_hirex_4_spex [1], read_hirex_4_spex [2], read_smm_4_spex [1]
	read_smm_4_spex [2], read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
	spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4], spectral_ratio [1]
	spectral_ratio [2], spex_bk__define, spex_delete [1], spex_delete [2]
	spex_hessi_image__define, spex_hold [1], spex_hold [2], spex_intervals [1]
	spex_intervals [2], spex_merge [1], spex_merge [2], spex_source [1]
	spex_source [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
	spex_spec_plot [4], ssw_rebin_assign, ssw_rebinner
 EXAMPLES:
	count_sec = f_div( total(counts,1) , delta_t )
	count_sec_prm = f_div( count_sec , 1.- f_div(dead_channel # counts,delta_t) )

 INPUTS:
	NUMERATOR - dividend in a quotient
	DENOMINATOR - divisor in a quotient

 KEYWORDS:
	DEFAULT - if DENOMINATOR is zero, value is set to 0.0 or to DEFAULT. (INPUT)

 PROCEDURE:
	The divisor is scanned for zeroes which are excluded from the quotient.
	The value for those elements is 0.0 or the DEFAULT.
 RESTRICTIONS:
 	Real numbers only.

 CALLS: ***
	EXIST
 COMMON BLOCKS:
	None.
 MODIFICATION HISTORY:

	mod, 22-dec-93, ras, returns vector if numerator or denominator are vectors and other scalar
	ras, 17-jun-94 renamed div to f_div
	ras, 14-oct-94, liberal use of temporary
	Version 4, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation
	Version 5, richard.schwartz@gsfc.nasa.gov, 26-jul-2002, made the division work like
		IDL's division operator.  The size of the quotient follows the size of the normal
		division operator.  Previously, the size of the quotient was the same as the size of
		the denominator.
	22-jan-2003, richard.schwartz@gsfc.nasa.gov, return DENOMINATOR to original values
		if changed.


F_FORMAT $SSW/gen/idl_libs/astron/misc/f_format.pro
[Previous] [Next]
 NAME:
	F_FORMAT
 PURPOSE:
	Choose a nice floating format for displaying an array of REAL data.
 EXPLANATION:
	Called by TVLIST, IMLIST.

 CALLING SEQUENCE:
	fmt = F_FORMAT( minval, maxval, factor, [ length ] )

 INPUTS:
	MINVAL - REAL scalar giving the minimum value of an array of numbers
		for which one desires a nice format.
	MAXVAL - REAL scalar giving maximum value in array of numbers

 OPTIONAL INPUT:
	LENGTH - length of the output F format (default = 5)
		must be an integer scalar > 2

 OUTPUT:
	FMT - an F or I format string, e.g. 'F5.1'
	FACTOR - factor of 10 by which to multiply array of numbers to achieve
		a pretty display using format FMT.

 CALLED BY:
	IMLIST
 EXAMPLE:
	Find a nice format to print an array of numbers with a minimum of 5.2e-3
	and a maximum  of 4.2e-2.

		IDL> fmt = F_FORMAT( 5.2e-3, 4.2e-2, factor )
         
	yields fmt = '(F5.2)' and factor = .01, i.e. the array can be displayed
	with a F5.2 format after multiplication by 100.

 REVISION HISTORY:
	Written W. Landsman              December 1988
	Deal with factors < 1.           August 1991
	Deal with factors < 1. *and* a large range    October 1992
	Now returns In format rather than Fn.0    February, 1994
	Converted to IDL V5.0   W. Landsman   September 1997


F_GAUSS_INTG [1] $SSW/gen/idl/util/f_gauss_intg.pro
[Previous] [Next]
 PROJECT:
       SDAC
 NAME:
	F_GAUSS_INTG

 PURPOSE:
	This function returns the sum of a Gaussian and 2nd order polynomial.      

 CATEGORY:
	E2 - CURVE AND SURFACE FITTING.
 CALLS: ***
	GAUSS_INTG
 CALLING SEQUENCE:
	out = F_GAUSS_INTG(X,A)
 CALLED BY:
	BATSE_SPEC_DRM, F_LINE, F_NLINE
 EXAMPLES:
        if a(4+i*3) ne 0.0 then line(0) =line + $
         f_gauss_intg( x, [ f_div( a(4+i*3)/sqrt(2*!pi), a(6+i*3)),  a(5+i*3+ w2 )] )  

 INPUTS:
	X = VALUES OF INDEPENDENT VARIABLE, 2 X N, LO AND HI EDGES
	A = PARAMETERS OF EQUATION DESCRIBED BELOW.
 OUTPUTS:
	None.


 OPTIONAL OUTPUT PARAMETERS:

 COMMON BLOCKS:
	NONE.
 SIDE EFFECTS:
	NONE.
 RESTRICTIONS:
	NONE.
 PROCEDURE:
	THIS GAUSSIAN IS EVALUATED BY INTEGRATING A GAUSSIAN OVER
	AN INTERVAL AND DIVIDING BY THE INTERVAL WIDTH.
	IT USES THE FUNCTION GAUSSINT TO INTEGRATE THE GAUSSIAN.
	F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
	Z = (X-A(1))/A(2)
	F IS INTEGRATED FROM X_LO TO X_HI 
 MODIFICATION HISTORY:
	changed gaussian to integrating gaussian over an interval
	RAS, 21-MAR-95
 CONTACT:
	richard.schwartz@gsfc.nasa.gov


f_pder [1] $SSW/gen/idl/fund_lib/sdac/f_pder.pro
[Previous] [Next]
 PROJECT:
       SDAC
 	
 NAME: f_pder
	
 PURPOSE:
	This function returns the partial derivative of a function. 
	
 CALLING SEQUENCE:  result = f_pder( funct=function_name, param=a, data=x, npar=n )
	
 CALLED BY:
	DECOMPOSE_BATSE_DRM, FGAUSSINT_FUNCT, GAUSSINTFIT, GAUSS_INTG, funct1 [1]
	funct1 [2]
 EXAMPLES:
	pder(*,i)=f_pder(funct=function_name, par=a(0:*), data=x, n=i)
	pder(*,i)= f_pder(funct=f_model, par=a, data=x, n=free(i))
	pder(*,1) = f_pder( funct='f_gauss_intg',param=a,data=xin,npar=1)

 KEYWORD INPUTS:
	funct - function name, string
	parameters - A vector of parameter values required by the function.
	data_points - input to the function, defined on points (M values)
		or edges (2xM values low and high)
	npar - differentiate with respect to  PARAMETERS(NPAR)
 OPTIONAL INPUTS:
	
 OUTPUTS:
	function returns the computed partial derivative at each data point
 OPTIONAL OUTPUTS:

 PROCEDURE:
	uses call_function to generate functional values + and - .1% of parameter
	then calculates this partial derivative arithmetically
 CALLS: ***
	F_DIV
 COMMON BLOCKS:

 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras, 23-mar-95, added documentation	
 CONTACT:
	richard.schwartz@gsfc.nasa.gov


f_pder [2] $SSW/gen/idl/util/f_pder.pro
[Previous] [Next]
 PROJECT:
       SDAC
 	
 NAME: f_pder
	
 PURPOSE:
	This function returns the partial derivative of a function. 
	
 CALLING SEQUENCE:  result = f_pder( funct=function_name, param=a, data=x, npar=n )
	
 CALLED BY:
	DECOMPOSE_BATSE_DRM, FGAUSSINT_FUNCT, GAUSSINTFIT, GAUSS_INTG, funct1 [1]
	funct1 [2]
 EXAMPLES:
	pder(*,i)=f_pder(funct=function_name, par=a(0:*), data=x, n=i)
	pder(*,i)= f_pder(funct=f_model, par=a, data=x, n=free(i))
	pder(*,1) = f_pder( funct='f_gauss_intg',param=a,data=xin,npar=1)

 KEYWORD INPUTS:
	funct - function name, string
	parameters - A vector of parameter values required by the function.
	data_points - input to the function, defined on points (M values)
		or edges (2xM values low and high)
	npar - differentiate with respect to  PARAMETERS(NPAR)
 OPTIONAL INPUTS:
	
 OUTPUTS:
	function returns the computed partial derivative at each data point
 OPTIONAL OUTPUTS:

 PROCEDURE:
	uses call_function to generate functional values + and - .1% of parameter
	then calculates this partial derivative arithmetically
 CALLS: ***
	F_DIV
 COMMON BLOCKS:

 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras, 23-mar-95, added documentation	
 CONTACT:
	richard.schwartz@gsfc.nasa.gov


F_USE_WIDGET $SSW/gen/idl/fund_lib/sdac/f_use_widget.pro
[Previous] [Next]
 PROJECT:
       SDAC
 	

 NAME: F_USE_WIDGET


 PURPOSE: This function provides global control over allowed use of widget interfaces.

 CATEGORY: WIDGETS


 CALLING SEQUENCE:
	res =f_use_widget()
	res =f_use_widget(0, /use)	;enables widgets if possible
	res =f_use_widget(0, /nouse)    ;disables widgets, f_use_widget will return 0
	res =f_use_widget(0, /test)     ;returns 1 if widgets available, 0 otherwise
 KEYWORD INPUTS:
	USE- If set,enables widgets if possible.
	NOUSE- If set,disables widgets, f_use_widget will return 0.
	TEST- If set,function returns 1 if widgets available, 0 otherwise.
	CONTINUE- If set, allow continue on widget use error.
 Outputs:
	None
	Function returns 1 if widgets can be used, 0 otherwise.

 CALLS: ***
	FCHECK, HAVE_WINDOWS [1], HAVE_WINDOWS [2]
 CALLED BY:
	CAL_SHER, FILE_SEARCHER [1], FILE_SEARCHER [2], Model_components [1]
	Model_components [2], POINT [1], SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
	SPEX_SAVE_DATA [1], SPEX_SAVE_DATA [2], point [2], setup_spex [1]
	setup_spex [2], spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4]
	spex_intervals [1], spex_intervals [2], spex_merge_control [1]
	spex_merge_control [2], spex_spec_plot [1], spex_spec_plot [2]
	spex_spec_plot [3], spex_spec_plot [4]
 COMMON BLOCKS:
	f_use_widg_com

 MODIFICATION HISTORY:
	ras, 10-jun-94

 CONTACT:
	richard.schwartz@gsfc.nasa.gov
	Version 2, richard.schwartz@gsfc.nasa.gov, utilize have_windows()


FACTOR $SSW/gen/idl_libs/astron/jhuapl/factor.pro
[Previous] [Next]
 NAME:
       FACTOR
 PURPOSE:
       Find prime factors of a given number.
 CATEGORY:
 CALLING SEQUENCE:
       factor, x, p, n
 INPUTS:
       x = Number to factor (>1).       in
 KEYWORD PARAMETERS:
       Keywords:
         /QUIET  means do not print factors.
         /DEBUG  Means list steps as they happen.
         /TRY    Go beyond 20000 primes.
 OUTPUTS:
       p = Array of prime numbers.      out
       n = Count of each element of p.  out
 CALLS: ***
	PRIME, PRINT_FACT, SPC
 CALLED BY:
	FILTER_IMAGE
 COMMON BLOCKS:
 NOTES:
       Note: see also prime, numfactors, print_fact.
 MODIFICATION HISTORY:
       R. Sterner.  4 Oct, 1988.
       RES 25 Oct, 1990 --- converted to IDL V2.
       R. Sterner, 1999 Jun 30 --- Improved (faster, bigger).
       R. Sterner, 1999 Jul  7 --- Bigger values (used unsigned).
       R. Sterner, 1999 Jul  9 --- Tried to make backward compatable.
       R. Sterner, 2000 Jan 06 --- Fixed to ignore non-positive numbers.
       Johns Hopkins University Applied Physics Laboratory.

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


FAKE_POINT_STC $SSW/gen/idl/image_tool/fake_point_stc.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       FAKE_POINT_STC()

 PURPOSE:
       Create a fake pointing structure for IMAGE_TOOL to use

 EXPLANATION:

 CALLING SEQUENCE:
       Result = fake_point_stc()

 INPUTS:
       None required.

 OPTIONAL INPUTS:
       P_MODE - Pointing mode; valid values are -1, 0, and 1. Default: 0

 OUTPUTS:
       RESULT - Pointing structure suitable for use by IMAGE_TOOL. It has the
                following tags:

          INSTRUME   - Code specifying the instrument; e.g., 'C' for CDS
          G_LABEL    - Generic label for the pointing; e.g., 'RASTER'
          X_LABEL    - Label for X coordinate of pointing; e.g., 'INS_X'
          Y_LABEL    - Label for Y coordinate of pointing; e.g., 'INS_Y'
          DATE_OBS   - Date/time of beginning of observation, in TAI format
          DO_POINTING- An integer of value 0 or 1 indicating whether pointing
                       should be handled at the planning level (i.e., by
                       IMAGE_TOOL); default is set to 1.
          N_POINTINGS- Number of pointings to be performed by IMAGE_TOOL
          POINTINGS  - A structure array (with N_POINTINGS elements) of type
                       "DETAIL_POINT" to be handled by IMAGE_TOOL. It has
                       the following tags:

                       POINT_ID - A string scalar for pointing ID
                       INS_X    - X coordinate of pointing area center in arcs
                       INS_Y    - Y coordinate of pointing area center in arcs
                       WIDTH    - Area width (E/W extent)  in arcsec
                       HEIGHT   - Area height (N/S extent) in arcsec
                       OFF_LIMB - An interger with value 1 or 0 indicating
                                  whether or not the pointing area should
                                  be off limb

          N_RASTERS  - Number of rasters for each pointing (this is
                       irrelevant to the SUMER)
          RASTERS    - A structure array (N_RASTERS-element) of type
                       "RASTER_POINT" that contains raster size and pointing
                       information (this is irrelevant to the SUMER). It has
                       the following tags:

                       POINTING - Pointing handling code; valis
                                  values are: 1, 0, and -1
                       INS_X    - Together with INS_Y, the pointing to use
                                  when user-supplied values are not
                                  allowed.  Only valid when POINTING=0
                                  (absolute) or POINTING=-1 (relative to
                                  1st raster).
                       INS_Y    - ...
                       WIDTH    - Width (E/W extent) of the raster, in arcs
                       HEIGHT   - Height (N/S extent) of the raster, in arcs

      Note: For the case of CDS, pointings.width, pointings.height,
            pointings.ins_x, and pointings.ins_y should match the first
            raster's rasters.width, rasters.height, rasters.ins_x, and
            rasters.ins_y, respectively.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       N_POINTINGS - Number of pointing areas; default: 4
       N_RASTERS   - Number of rasters in each pointing area; default: 6

 CALLS: ***
	DPRINT, GET_UTC, MK_POINT_STC, UTC2TAI
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 PREVIOUS HISTORY:
       Written March 27, 1995, Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, NASA/GSFC, March 27, 1995

 VERSION:
       Version 1, March 27, 1995


FASTFIT $SSW/gen/idl/fitting/fastfit.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FASTFIT

 Purpose     :	Least-squares fit of linear function without error analysis

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

		This routine differs from FITTER in that no error analysis is
		performed, and the correlation matrix is not calculated.

 Use         :	FASTFIT, X, Y, FDER, PARAM

 Inputs      :	X	= Positions.
		Y	= Data values.
		FDER	= Array of partial derivatives of fitted function.
			  This array will have the dimensions: FDER(
			  N_ELEMENTS(X) , N_ELEMENTS(PARAM) )

 Opt. Inputs :	None.

 Outputs     :	PARAM	= Returned parameters of fit.

 Opt. Outputs:	None.

 Keywords :	POISSON	= If set, then a Poisson error distribution is assumed,
			  and the weights are set accordingly to 1/Y.
		ERROR	= Array of errors.  The weights are set accordingly to
			  1/ERROR^2.  Overrides POISSON.
		WEIGHT	= Array of weights to use in fitting.  Overrides
			  POISSON and ERROR.

 Calls       : ***
	TRIM
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utilities, Curve_Fitting

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

 Written     :	William Thompson, GSFC, June 1991

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library

 Version     :	Version 1, 9 January 1995


FBLUE $SSW/gen/idl/fitting/fblue.pro
[Previous] [Next]
 Project     : YOHKOH-BCS
    
 Name        : FBLUE

 Purpose     : Compute 2 component gaussian where one is blueshifted

 Explanation : Gaussian is sum of 2 gaussians in which
               width of blueshifted component is proportional to blueshift
               velocity. 

 Category    : fitting

 Syntax      : f=fblue(x,a,pder)

 Inputs      : x = dependent variable
         	a = background + gaussian coefficients such that,
               f = a(0)+a(1)*x+a(2)*x^2+a(3)*exp -[(x-a(4))/a(5)]^2 +
                   a(6)*exp -[(x-a(4)+a(7))/fac*a(7)]^2

 Outputs     : f = 2 component gaussian

 Opt Outputs : pder = partial derivatives wrt 'a'

 Keywords    : extra = extra optional variable in which user can return
               miscellaneous information.

 Common      : FBLUE - contains proportionality constant between
               Doppler width of blueshifted component and blueshift velocity
               --> width=fac*blueshift

 Restrictions: None.

 Side effects: None.

 History     : Version 1,  17-July-1993,  D M Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FBLUE_FIT $SSW/gen/idl/fitting/fblue_fit.pro
[Previous] [Next]
 Project     :  YOHKOH-BCS

 Name	      :  FBLUE_FIT

 Purpose     :  Fit double gaussian + quadratic using a blueshift model

 Explanation:

 Category    : fitting

 Syntax      : yfit = fblue_fit(x,y,a,fac=fac)

 Inputs      : y = data to fit
               x = bin or wavelength

 Outputs     : yfit, a = fitted function + parameters
               yfit = a(0)+a(1)*x+a(2)*x^2+a(3)*exp -[(x-a(4))/a(5)]^2 +
                      a(6)*exp -[(x-a(4)+a(7))/f*a(7)]^2

 Opt. Outputs: sigmaa = sigma errors

 Keywords    : weights = data weights
               nfree  = number of free parameters
               chi2   = chi^2
               last   = set to use input 'a' values as starting values
               fixp   = indicies of parameters to fix
               fac    = doppler broadening = fac * blueshift [def=1]

 CALLED BY:
	FIT_SPEC
 Restrictions: Input spectrum must at least look asymmetric

 CALLS: ***
	FUNCT_FIT, GUESS_FIT_PAR
 Side effects: None

 History     : Version 1,  17-July-1993,  D M Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FCHECK $SSW/gen/idl/util/fcheck.pro
[Previous] [Next]
 Project     : SDAC    
                   
 Name        : FCHECK
               
 Purpose     : This functions checks sets a non-existent variable
		to its default values.
               
 Category    : GEN
               
 Explanation : The variable is checked to see if it is defined,
		if it's not defined it is set to the given
		default.  The ultimate default value is 0.
               
 Use         : 
    
 Inputs      : P1 - The variable to be checked for existence.
		If P1 does not exist, then it is set to
		to P2 or 0 if P2 does not exist.
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls       : None
 CALLED BY:
	ANYTIM_REPORT, AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], BATSE_CRAB_RESP
	BATSE_FLARES_WEEK, BATSE_LAD_DRM, BATSE_ON, BATSE_SPEC_DRM, BAT_MERGE
	CALIBRATE [1], CH_SCALE, CLEAN_GOES, CONVERT_2_STREAM, Create_update_tar, DATPLOT
	DECOMPOSE_BATSE_DRM, DEFAULTS, DELTA_CONTROL, DIFF_DRM, DISCLA_EDGES, DISCP_RESP
	FAST_RATIO, FCOLOR [1], FDBREAD, FIT_BACKGRND, FLARE_XRAY_MODEL, FLUORESCENCE, FSOC
	F_BPOW, F_USE_WIDGET, Fits_spectra [1], Fits_spectra [2], GD, GET_DISCSP511
	GET_GDFILE, GET_OCC_ONDAY, GET_SPEC_GAIN, GE_WINDOW [1], GOES_CHIANTI_TEM
	GOES_MEWE_TEM, GOES_TF, GOES_TF_COEFF, GOES_TRANSFER, GRS_EXTRACT, GRS_SPEFF
	HESSI BINNED EVENTLIST CLASS DEFINITION
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HESSI Packet to EventList
	HESSI_ATTENUATOR_SPECTRA, HESSI_FILTERS, HSI_ANNSEC_BPROJ [1]
	HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_BPROJ_WEIGHT_MAP [1]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [2], HSI_APP100_UNPACK, HSI_APP100_UNPACK_TIME
	HSI_CSPECTRUM_DIST, HSI_HIST_GROUP, HSI_LOC_FILE, HSI_MAP2GAUSSIANS
	HSI_MK_PACKETHEADER, HSI_RD_PACKET_TIMES, HSI_SCORE2FILE
	HSI_SPECTROGRAMACCBIN [5], HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
	HSI_SPECTRUM__DEFINE, HSI_SRM__DEFINE, HXT_CAL_FIX [1], HXT_CAL_FIX [2]
	LAD_PHA_EDGES, LAD_RESP, LOCAL_DIFFS, MERGE_DISCSP_HKG_OCC, MK_DISCSP_CAL
	Model_components [1], Model_components [2], NEAR_PIN_RESP [1]
	NEAR_PIN_RESP [2], NOFILL_ARE, OCC_AVG, OPLOT_DIFF, OP_COM [1], OP_COM [2]
	OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], PLOTBATSE, PLOTBATSE_QL, PLOT_DIFF
	PLOT_FLARE, PLOT_GRSPCH, PLOT_GRSPCL, PLOT_GRSPHH, PLOT_GRSPHL, PLOT_HXSPC
	PLOT_HXSPH, PLOT_OCCS, PLOT_OCCS_RES, PLOT_OCC_ONDAY, PL_SCALE, POINT [1], READQUAL
	READ_DISCLA, READ_DISCLA_FITS, READ_STTE, RESOLVE_NEW_OBS, RESTORE_OVERFLOW
	ROUTINE_NAME [1], RUN_CURVEFIT [1], RUN_CURVEFIT [2], SETUP_BATSE
	SETUP_BATSE_ARRAYS, SET_FUNCTION_COM, SET_PENDLETON, SET_UTPLOT [1]
	SET_UTPLOT [2], SLED, SNU, SPECTRA2FITS, SPECTROGRAM CLASS DEFINITION
	SPECTRUM CLASS DEFINITION, SPEC_SENSITIVITY, SPEX_COMMONS [2]
	SPEX_COMMONS [4], SPEX_DATA_GENX [1], SPEX_DATA_GENX [2], SPEX_ENV [2]
	SPEX_ENV [4], SPEX_ENV [5], SPEX_HANDLES [1], SPEX_HANDLES [2]
	SPEX_PLOT_SAVED [1], SPEX_PLOT_SAVED [2], SPEX_PROC [1], SPEX_PROC [2]
	SPEX_RUN_CURVEFIT [1], SPEX_RUN_CURVEFIT [2], SPEX_THISTORY [1]
	SPEX_THISTORY [2], SPFDPLOT_GRS, SPFDPLOT_HXS, SPPLOT_GRS, SPPLOT_HXS
	Shers_load [1], TEST_CAL, TIMESTAMP, USERLABEL, UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], Vlth, WRITE_FDB, XDEVICE, XR_RD_ABUNDANCE
	batse_file_search [1], batse_file_search [2]
	ch_scale scale xyoutsxyouts xcorr  xcorr, drm_4_spex [1], drm_4_spex [2]
	drm_correct_albedo, fcolor [2], fcount_rate [1], fcount_rate [2], fit_comp_kw
	function_counts2photons, get_slider, help_merge [1], help_merge [2]
	hessi_build_srm, hessi_correct_pileup [1], hessi_display_diag
	hessi_display_srm, hessi_drm_4image, hsi_chan_ranges, hsi_default_resolutions
	hsi_default_tailfracs, hsi_find_pli, hsi_get_e_edges [1], hsi_lambda_vs_t
	hsi_livecorr_event, hsi_matmult, hsi_remake_gains, hsi_remake_lambda
	hsi_remake_resol, hsi_remake_tailfrac, hsi_rm_interp_calc, hsi_rm_interp_rows
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
	hsi_spectrum__filewrite, hsi_subdivide_bins, hxrbs_response
	inv_counts2electrons, inv_counts2photons, make_goes_chianti_response [1]
	make_goes_chianti_response [2], make_goes_chianti_response [3]
	make_goes_chianti_response [4], option_changer [1], option_changer [2]
	option_toggle [1], option_toggle [2], other_filters [1], other_filters [2]
	out_spectra_4_designer, pl_scale d xcorr  xcorr ycorrycorr, plotman
	plott_hi_sum, plott_low_sum, plott_med1_sum, plott_med2_sum, point [2], popup_menu
	printx [1], printx [2], rd_wbs_pha [1], rd_wbs_pha [2], read_4_spex [1]
	read_4_spex [2], read_batse_4_spex [1], read_batse_4_spex [2]
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], select_widg, set_field
	setup_spex [1], setup_spex [2], spec_plot [1], spec_plot [2], spec_plot [3]
	spec_plot [4], spex_batse_preview [1], spex_batse_preview [2]
	spex_current [1], spex_current [2], spex_delete [1], spex_delete [2]
	spex_evnt [1], spex_evnt [2], spex_hold [1], spex_hold [2], spex_intervals [1]
	spex_intervals [2], spex_merge [1], spex_merge [2], spex_merge_control [1]
	spex_merge_control [2], spex_source [1], spex_source [2], spex_spec_plot [1]
	spex_spec_plot [2], spex_spec_plot [3], spex_spec_plot [4], t_utplot [1]
	t_utplot [2], wbs_response [1], wbs_response [2], where_are [1], where_are [2]
	wrt_rate_ext
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :
		First written by RAS, 1987

 Modified    : 
		Version 2, RAS, 16-Nov-1989
		Version 3, RAS, 5-Feb-1997


FCOLOR [1] $SSW/gen/idl/fund_lib/sdac/fcolor.pro
[Previous] [Next]
 PROJECT:
       SDAC
 	
 NAME:
	FCOLOR
 PURPOSE: 
	This function is used with LINECOLORS.PRO for defaults if the device does
	not support colors.
	
 CALLING SEQUENCE
 	color = fcolor(icolor)

 CALLED BY:
	CAL_SHER, FS_ARCHIVE_DRAW, QL_DAY_PLOT, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
	SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_FLASH [1], SPEX_FLASH [2]
	SPEX_PROC [1], SPEX_PROC [2], SPEX_THISTORY [1], SPEX_THISTORY [2], TIMESTAMP
	USERLABEL, VERT_LINE, countsmod_plot [1], countsmod_plot [2], rd_sxs_pha [1]
	rd_sxs_pha [2], read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], spec_plot [1]
	spec_plot [2], spec_plot [3], spec_plot [4], spex_intervals [1]
	spex_intervals [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
	spex_spec_plot [4]
 EXAMPLES:
	oplot, archive_sec, yy, psym=10, color=fcolor(5)
	xyouts, nx1lab, ylab, 'N', /normal, chars = ch_scale(.8,/xy), col=fcolor(9)
 CALLS: ***
	CHECKVAR [1], FCHECK, checkvar [2]
 INPUTS:	
	icolor - the linecolor index, i.e. 5 is yellow

 COMMON BLOCKS:
 	common fcolor_ps, pscolor - used to communicate ps color state
		    with ps.pro
 HISTORY:
       Written by:	RAS, ~1991.
 CONTACT:
	richard.schwartz@gsfc.nasa.gov


FDECOMP [1] $SSW/gen/idl/system/fdecomp.pro
[Previous] [Next]
 NAME:
     FDECOMP
 PURPOSE:
     Routine to decompose file name(s) for any operating system. V5.3 or later

 CALLING SEQUENCE:
     FDECOMP, filename, disk, dir, name, qual, version, [OSFamily = ]

 INPUT:
     filename - string file name(s), scalar or vector

 OUTPUTS:
     All the output parameters will have the same number of elements as 
       input filename 

       disk - disk name, always '' on a Unix machine, scalar or vector string
       dir - directory name, scalar or vector string
       name - file name, scalar or vector string 
       qual - qualifier, set equal to the characters beyond the last "."
       version - version number, always '' on a non-VMS machine, scalar string

 OPTIONAL INPUT KEYWORD:
     OSFamily - one of the four scalar strings specifying the operating 
             system:  'vms','Windows','MacOS' or 'unix'.    If not supplied,
             then !VERSION.OS_FAMILY is used to determine the OS.
 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
 CALLED BY:
	CONCAT4DOS [1], CONCAT4DOS [2], CREATE_STRUCT [1], CREATE_STRUCT [2], DBHELP [1]
	DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], FCS, FINDPRO, FITSDIR
	FLAG_LONG_NAMES [1], FLAG_LONG_NAMES [2], FXTPIO_WRITE, GETPRO, IRAFDIR, IRAFRD
	SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], SXHWRITE, TAB_READ, TVLASER, WFPC2_READ
 EXAMPLES:
     Consider the following file names 

     unix:    file = '/rsi/idl40/avg.pro' 
     vms:     file = '$1$dua5:[rsi.idl40]avg.pro;3
     MacOS:   file = 'Macintosh HD:Programs:avg.pro'
     Windows: file =  'd:\rsi\idl40\avg.pro'
       
     then IDL> FDECOMP,  file, disk, dir, name, qual, version
       will return the following

                 Disk             Dir          Name        Qual     Version
       Unix:      ''            '/rsi/idl40/'  'avg'       'pro'       ''
       VMS:     '$1$dua5'       '[RSI.IDL40]'  'avg'       'pro'       '3'
       Mac:     'Macintosh HD'  ':Programs:'   'avg'       'pro'       ''
       Windows:    'd:'         \rsi\idl40\    'avg'       'pro'       ''

 NOTES:
     (1) All tokens are removed between
           1) name and qual  (i.e period is removed)
           2) qual and ver   (i.e. VMS semicolon is removed)
     (2) On VMS the filenames "MOTD" and "MOTD." are distinguished by the 
         fact that qual = '' for the former and qual = ' ' for the latter.

 ROUTINES CALLED:
     None.
 HISTORY
     version 1  D. Lindler  Oct 1986
     Include VMS DECNET machine name in disk    W. Landsman  HSTX  Feb. 94
     Converted to Mac IDL, I. Freedman HSTX March 1994          
     Converted to IDL V5.0   W. Landsman   September 1997
     Major rewrite to accept vector filenames V5.3   W. Landsman June 2000
     Fix cases where disk name not always present  W. Landsman  Sep. 2000
     Make sure version defined for Windows  W. Landsman April 2004


FDECOMP [2] $SSW/gen/idl_libs/astron/misc/fdecomp.pro
[Previous] [Next]
 NAME:
     FDECOMP
 PURPOSE:
     Routine to decompose file name(s) for any operating system.

 CALLING SEQUENCE:
     FDECOMP, filename, disk, dir, name, qual, [OSFamily = ]

 INPUT:
     filename - string file name(s), scalar or vector

 OUTPUTS:
     All the output parameters will have the same number of elements as 
       input filename 

       disk - disk name, always '' on a Unix machine, scalar or vector string
       dir - directory name, scalar or vector string
       name - file name, scalar or vector string 
       qual - qualifier, set equal to the characters beyond the last "."
       version - obsolete (was for VMS) always ''

 OPTIONAL INPUT KEYWORD:
     OSFamily - one of the four scalar strings specifying the operating 
             system:  'Windows','MacOS' or 'unix'.    If not supplied,
             then !VERSION.OS_FAMILY is used to determine the OS.
 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
 CALLED BY:
	CONCAT4DOS [1], CONCAT4DOS [2], CREATE_STRUCT [1], CREATE_STRUCT [2], DBHELP [1]
	DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], FCS, FINDPRO, FITSDIR
	FLAG_LONG_NAMES [1], FLAG_LONG_NAMES [2], FXTPIO_WRITE, GETPRO, IRAFDIR, IRAFRD
	SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], SXHWRITE, TAB_READ, TVLASER, WFPC2_READ
 EXAMPLES:
     Consider the following file names 

     unix:    file = '/rsi/idl63/avg.pro' 
     MacOS:   file = 'Macintosh HD:Programs:avg.pro'
     Windows: file =  'd:\rsi\idl63\avg.pro'
       
     then IDL> FDECOMP,  file, disk, dir, name, qual, version
       will return the following

                 Disk             Dir          Name        Qual    
       Unix:      ''            '/rsi/idl63/'  'avg'       'pro'   
;       Mac:     'Macintosh HD'  ':Programs:'   'avg'      'pro'  
       Windows:    'd:'         \rsi\idl63\    'avg'       'pro'   

 NOTES:
     All tokens are removed between the name and qualifier
          (i.e period is removed)

 ROUTINES CALLED:
     None.
 HISTORY
     version 1  D. Lindler  Oct 1986
     Include VMS DECNET machine name in disk    W. Landsman  HSTX  Feb. 94
     Converted to Mac IDL, I. Freedman HSTX March 1994          
     Converted to IDL V5.0   W. Landsman   September 1997
     Major rewrite to accept vector filenames V5.3   W. Landsman June 2000
     Fix cases where disk name not always present  W. Landsman  Sep. 2000
     Make sure version defined for Windows  W. Landsman April 2004
     Include final delimiter in directory under Windows as advertised
                W. Landsman   May 2006
     Remove VMS support, W. Landsman    September 2006


fft_crosscorr $SSW/gen/idl/image/fft_crosscorr.pro
[Previous] [Next]
 NAME: fft_crosscorr

 PURPOSE
 Computes the cross correlation of two real arrays A and B (same size)

 INPUTS:
  A, B = floating point arrays (1-D or 2-D) of equal size

 OUTPUTS:
  cc = cross correlation of (A,B) -- a complex array, size of A & B

 CALLS: ***
	MEAN
 CALLED BY:
	hsi_bproj2size
 EXAMPLE:
  a=shift(dist(256),128,128) & b=a
  c=crosscorr(a,b)
  tvscl,shift(c,128,128)

 VERSION HISTORY
  schmahl@hessi.gsfc.nasa.gov 2002


fid2ex [1] $SSW/gen/idl/genutil/fid2ex.pro
[Previous] [Next]
NAME:
	fid2ex
PURPOSE:
	Given a fileID, generate the 7-element time array
CALLING SEQUENCE:
	tarr = fid2ex(fid) 
INPUT:
	fid 
 CALLED BY:
	BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], BCS_CREATE_CAT, JITTER_HTML, OBS_PLOT
	SELECT_24HR, WOBS_PLOT, bcs_path, check_oldprocess [1], check_oldprocess [2]
	check_oldprocess [3], check_oldprocess [4], delete_week [1], delete_week [2]
	disp_sci5k, edac_summary, fidrange [1], fidrange [2], find_dbo_dir, gbo_pfi
	gen_file_id [1], gen_file_id [2], get1gbo, get_afile_size [1]
	get_afile_size [2], get_gbo_pfi, get_hk_info [1], get_hk_info [2], get_mk3 [1]
	get_mk3 [2], get_seq_tab, getwid, goes3sec_copy, gtab_summary, mk_gif_mag_index
	mk_gsn_obs_s1, mk_gx, mk_hst_summary, mk_pnt, mk_sdmi, mk_week_file [1]
	mk_week_file [2], mo_check, nearest_fid [1], nearest_fid [2], new_disp_sci5k [1]
	new_disp_sci5k [2], new_edac_summary, nts_copy [1], nts_copy [2], pfi_dominant
	rd_hk [1], rd_hk [2], rd_selsisi, read_msok_jpg, read_spartan, ref_day_plot
	sel_fileinfo, sel_filetimes [1], sel_filetimes [2], tim2dbase, wfile, xspr [1]
	xspr [2], yoyo_man2
HISTORY:
	Written 11-Dec-91 by M.Morrison
	24-Aug-92 (MDM) - Modified to accept an array of FIDs
	 5-Jan-93 (MDM) - Modified to handle case where there are blank
			  spaces in funny places


FID2TIME $SSW/gen/idl/time/fid2time.pro
[Previous] [Next]
 Project     : SOHO - SUMER

 Name        : FID2TIME

 Purpose     : Infer file time from file ID name with "_yymmdd_hhmmss"

 Category    : I/O

 Explanation : Same as EXTRACT_FID, but sets missing elements to 0

 Syntax      : IDL> times=fid2time(files)

 Inputs      : FILES = file names (e.g. sum_961020_201023.fits)

 Opt. Inputs : None

 Outputs     : TIMES = string times (e.g. 20-Oct-96 20:10:23)

 Opt. Outputs: None

 Keywords    : DELIM = time delimiter (def= '_')
               TAI = return time in TAI format
               YMD = return yymmdd
               COUNT= number of files processed
               DATE_ONLY = return date only
               NO_MIN = exclude MIN and SEC
               NO_SEC = exclude sec
               ;
 CALLS: ***
	ANYTIM2TAI, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], DPRINT, GET_MONTH, PR_SYNTAX, TRIM2, break_file [4]
	is_number [1], is_number [2]
 CALLED BY:
	FILE2FID, ITOOL_GETFILE, MK_SUMER_DBASE
 History     : Version 1,  20-May-1998, Zarro (SM&A) - written
               Version 2,  1-Feb-1999, Zarro - made Y2K compliant

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FID__DEFINE $SSW/gen/idl/objects/fid__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FID__DEFINE

 Purpose     : Define a FID (file id) object

 Category    : objects

 CALLS: ***
	ANYTIM2TAI, DATATYPE [1], DATATYPE [2], DATATYPE [3], DPRINT, FID::CLEANUP
	FID::EXTRACT_TIME, FID::FILE2TIME, FID::INIT, FID::PARSE_TIME, FID::Y2KFIX
	GET_MONTH, TRIM, is_number [1], is_number [2]
 History     : Written 3 April 2001, D. Zarro, EIT/GSFC

 Contact     : dzarro@solar.stanford.edu


FIFO__DEFINE $SSW/gen/idl/objects/fifo__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FIFO__DEFINE

 Purpose     : Define a FIFO object

 Category    : Objects

 Explanation : A first in first out FIFO object to store anything

 Syntax      : IDL> new=obj_new('fifo')
              
 Inputs    :   MAX_SIZE = max # of elements to cache [def=10]. Once
               exceeded, initial data will be overwritten.

 Methods     : ->SET,ID,INPUT                           ; store input
               INPUT = any data type
               ID = unique string identifier for INPUT

               ->GET,ID,OUTPUT                        ; retrieve input   
             
               ->EMPTY   ;-- empty fifo
               ->SHOW    ;-- show fifo contents

 CALLS: ***
	DPRINT, EXIST, FIFO::CLEANUP, FIFO::CREATE, FIFO::DELETE, FIFO::EMPTY, FIFO::GET
	FIFO::GET, FIFO::GET_POS, FIFO::INIT, FIFO::SET, FIFO::SHOW, IPRINT, IS_STRING
	PTR_EXIST, TRIM, is_number [1], is_number [2]
 History     : Version 1,  6-DEC-1999,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FIG_CLOSE $SSW/gen/idl/display/fig_close.pro
[Previous] [Next]
 Name        : FIG_CLOSE 

 Purpose     : Finish a plot in a postscript-file of a figure

 Category    : Graphics, Utility 

 Explanation : Draws figure label, closes postscript file, and
		choses a suitable plotfilename 

 Syntax      : IDL> fig_close,io,fignr,ref,plotname,plotfile

 CALLED BY:
	FWD_DISPLAY, STEREO_LOOP
 Examples    : IDL> io	 =1	;creates postscript file 
		IDL> form=0	;landscape format
               IDL> char=0.8	;smaller character size 
		IDL> fignr='1'  ;figure number
               IDL> plotname='f'
		IDL> ref=' (Aschwanden et al. 1998)'  ;label at bottom of Fig.	
		IDL> plotname='f'
               IDL> fig_open,io,form,char,fignr,plotname
               IDL> plot,randomu(seed,100)
		IDL> fig_close,io,fignr,ref
		IDL> $lpr plotfile

 Inputs      : io	-  selection of plot option
			   io=0 	screen (X-window)
			   io=1		postscript file *.ps
			   io=2		encapsulated postscript file
			   io=3		color postscript file

		fignr	-  string concatenated with name of plotfile 

		ref	-  text string going into figure label

		plotname - string for plotfile name 

 Outputs     : plotfile - full name of plotfile 

 History     : 1998-Oct-09, written. aschwand@sag.lmsal.com
		2000-Jan-24, common fig_open_setplot,original_device -> set_plot,original_device
		2000-Jan-26, filenaming is moved to routine FIG_OPEN (device-independent)
               31-Jul-2000  setting original_device disabled if ps-file was produced previously


FIG_MULTI_POS $SSW/gen/idl/display/fig_multi_pos.pro
[Previous] [Next]
 Project     : YOHKOH/SXT,HXT - SOHO/EIT,CDS - TRACE 

 Name        : FIG_MULTI_POS()

 Purpose     : multi-plot !p.positions maintaining correct aspect ratio of 
		x- and y-axis 

 Category    : Graphics, Utility 

 Explanation : A mutli-plot configuration containing N columns and M rows of 
		plot frames is arranged. The aspect ratio of the images 
		(!y.range/!x.range) is correctly scaled, regardless of the 
		aspect ratio of the device window (!d.y_vsize y_device/x_device).

 Syntax      : IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position 

 CALLED BY:
	STEREO_LOOP
 Example     : IDL> window,0,xsize=640,ysize=512 
 		IDL> x_range	=[0,1]
		IDL> y_range	=[0,1]
		IDL> ncol	=3
		IDL> nrow	=3
		IDL> qgap	=0.1
 		IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position 
		IDL> phi=findgen(361)/float(360)
		IDL> for i=0,ncol*nrow-1 do
		IDL>  !p.position=p_position(*,i)	
		IDL>  plot,cos(phi),sin(phi)
		IDL> endfor
		(This example draws a 3x3 multi-plots of circles with correct 
		ascpect ratios. Note that !p.multi=[0,3,3,0,0] would turn 
		circles into ellipses)

 Inputs      : x_range - !x.range of individual plots
               y_range - !y.range of individual plots
		ncol	- number of columns in mutli-plot arrangement
		nrow	- number of rows    in mutli-plot arrangement
		qgap	- gap between plots, measured with respect to 
		individual plot size 

 Outputs     : p_position - fltarr(4,n) of indiviudal plot positions
		      e.g. place plot_i by !p.position=p_position(*,i)  

 Side effects: Window size has to be defined before calling FIG_MULTI_POS, 
		because it uses device parameters !d.y_vsize and !d.x_vsize

 History     : 9-Oct-1998, Written. aschwanden@sag.lmsal.com


FIG_MULTI_TV $SSW/gen/idl/display/fig_multi_tv.pro
[Previous] [Next]
 Name        : FIG_MULTI_TV()

 Purpose     : multi-plot of images in grey-scale representation

 Category    : Graphics, Utility 

 Explanation : A multi-plot configuration containing N columns and M rows of 
		grey-scale plots, placed at plot positions p_position(*,i)
		within x-ranges(*,i) and y-ranges(*,i), i=0,...,N*M-1

 Syntax      : fig_multi_tv,index,data,x_range,y_range,z_range,p_position,$
			ncol,nrow,io,x_label,y_label,grid

 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], COORD_HELIO_SPHERE
 CALLED BY:
	STEREO_LOOP
 Example     : IDL> window,0,xsize=640,ysize=512 
 		IDL> x_range	=[0,1]
		IDL> y_range	=[0,1]
		IDL> ncol	=2
		IDL> nrow	=2
		IDL> qgap	=0.1
 		IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position 
               IDL> fig_multi_tv,index,data,x_range,y_range,z_range,$
			p_position,x_label,y_label,ncol,nrow,io,grid

 Inputs      : index   - strarr(n) 	n structures
		data	- fltarr(*,*,n) n images 
               x_range - fltarr(2,n)   !x.range of n plotframes
               y_range - fltarr(2,n)   !y.range of n plotframes
		z_range	- fltarr(2,n)	!z.range clipping of data 
		p_position - fltarr(4,n) !p.position of n plotframes
		x_label - string for title on x-axis
		y_label - string for title on y-axis
		ncol	- number of columns in mutli-plot arrangement
		nrow	- number of rows    in mutli-plot arrangement
		io	- io=1 X-window screen
			  io=1 postscript files
		grid	- spacing of heliographic coordinate grid
			  (if grid > 0)

 History     : 9-Oct-1998, Written. aschwand@lmsal.com


FIG_OPEN $SSW/gen/idl/display/fig_open.pro
[Previous] [Next]
 Name        : FIG_OPEN

 Purpose     : Set device parameters to start a display or postscript-file
		of a Figure

 Explanation : Controls setting of plot parameters regarding window size,
		format, fonts, so that identical displays are produced
		on the screen and in postscript files.

 Syntax      : IDL> fig_open,io,form,char 

 CALLS: ***
	EXIST, clearplot [1], clearplot [2], next_window [1], next_window [2]
 CALLED BY:
	FWD_DISPLAY, STEREO_LOOP
 Examples    : IDL> io	 =1	;creates postscript file 
		IDL> form=0	;landscape format
               IDL> char=0.8	;smaller character size 
		IDL> fignr='1'  ;figure number
		IDL> plotname='f'
		IDL> ref=' (Aschwanden et al. 1998)'  ;label at bottom of Fig.	
               IDL> fig_open,io,form,char,fignr,plotname 
               IDL> plot,randomu(seed,100)
		IDL> fig_close,io,fignr,ref

 Inputs      : io	-  selection of plot option
			   io=0 	screen (X-window)
			   io=1		postscript file *.ps
			   io=2		encapsulated postscript file
			   io=3		color postscript file

		form	-  plot format 
			   form=0	landscape format
			   form=1	portrait format

		char	-  character size = !p.charsize

               plotname - string for plotfile name

 History     : 1990, written
		 9-OCT-1998, contribution to STEREO package, aschwand@lmsal.com
		21-Jan-2000, devicename=!d.name, set_plot,devicename 
		24-Jan-2000, common fig_open_setplot,original_device --> fig_close 
			     set_plot='X' in unix, set_plot='WIN' for microsoft windows
			     original_devicename is reset after producing ps-file in fig_close.pro
		26-Jan-2000, add plotfilename as keyword to device 
			     no device-dependent renaming required after creating idl.ps
		31-Jul-2000  setting original_device disabled if ps-file was produced previously
		26-Jan-2001  use free window unit   window,0-->window,/free


FIG_TV $SSW/gen/idl/display/fig_tv.pro
[Previous] [Next]
 Name        : FIG_TV()

 Purpose     : plot of image in grey-scale representation
		at predifined location in plot

 Inputs	image	- fltarr(*,*)   image
               x_range - fltarr(2)     !x.range of n plotframes
               y_range - fltarr(2)     !y.range of n plotframes
		z_range	- fltarr(2)	!z.range clipping of data 
		p_position - fltarr(4)  !p.position of n plotframes
		x_label - string for title on x-axis
		y_label - string for title on y-axis
		io	- io=1 X-window screen
			  io=1 postscript files
		ct      - color table
			  invert if negative 

 Contact     : aschwanden@sag.lmsal.com
 CALLS:


FILE2FID $SSW/gen/idl/time/file2fid.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FILE2FID

 Purpose     : move files from a directory into another based on file 
               date/time               

 Category    : planning

 Explanation : looks at files encoded with "_yyyymmdd_hhmm"
               and moves them into appropriate directory
               e.g. out_dir/yymmdd

 Syntax      : file2fid,files,out_dir

 Inputs      : FILES = array of filenames, complete with path
               OUT_DIR = target directory for files
;
 Keywords    : COPY = copy files instead of move
               NOCLOBBER = don't clobber existing files 
               OUT_FILES = renamed output files

 CALLS: ***
	APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	ESPAWN, FID2TIME, IS_BLANK, IS_DIR, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MK_DIR
	OS_FAMILY, PR_SYNTAX, TEST_DIR, break_file [4], concat_dir [4], curdir [1]
	curdir [2], delvarx [5]
 CALLED BY:
	FTP_SYNOP
 Restrictions: Unix only 

 History     : Written 1 Feb 1999 D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


FILE_ACC [1] $SSW/gen/idl/system/file_acc.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FILE_ACC

 Purpose     : Determine existence, type and access of file on UNIX system.

 Explanation :
	This routine is intended to supplement the IDL findfile function.
	For a given unix path name, e.g '/disk2/bowen/adas/file', this
	routine returns certain information.
		1.	Whether the path exists.
		2.	Whether the user has read permission.
		3.	Whether the user has write permission.
		4.	Whether the user has execute permission.
		5.	What the file type is i.e file, directory etc.
	The routine works by spawning various UNIX commands and
	interpreting the information returned.  A directory listing
	command is used to get basic file information; on ULTRIX 'ls -ld',
	which establishes whether the file exists and also returns the
	file type, access and ownership information.  The 'd' parameter
	ensures that directory information is listed rather than the
	contents of a directory.
	
	Before the access information can be interpreted the current user
	is found by spawning the 'whoami' UNIX command.  If the user is not
	the owner of the file the UNIX 'groups' command is used to determine
	whether or not the owner and the user are in the same group.
	Using all of this information the correct read, write and execute
	permissions are derived from the owner, group or world access 
	codes given in the directory listing information.

	This processing is performed in a group of four routines which
	are all incorporated in the file_acc.pro file.

	Note: the syntax of the UNIX commands and the output which is
	returned may vary from one operating system to another.  The
	operating system is checked and specific code executed for that
	system.  Currently the routine has specific code for;
	
	****	File listing command:    ****
	ULTRIX:	Command 'ls -ld /.../file.dat'
		Output  '-rw-r--r--  1 bowen        5688 May 27 17:15 file.dat'

	OSF:	(Same command as ULTRIX but different output, difference
		doesn't matter though, only first three fields used.)
		Output  '-rw-r--r--  1 bowen  user  5688 May 27 17:15 file.dat'

	SUNOS:	(Same command and output as ULTRIX)

	All others: (same as ULTRIX code)


	****	Groups identification:    ****
	ULTRIX:	Command 'groups root'
		Output	'system daemon tty'

	OSF:	(Same command and output as ULTRIX)

	SUNOS:	(Same command but, importantly, different output)
		Command 'groups root'
		Output	'system daemon tty'

	All others: (Same as ULTRIX code)


	****	User identification:	****
	ULTRIX, OSF and SUNOS: Command 'whoami'
			       Output  'name'

 Use         :
	Example of file_acc usage;

		file = '/disk2/fred/data'
		file_acc, file, exist, read, write, execute, filetype
		if exist eq 1 then begin
		  print,'Permissions for file ',file,' are;'
		  if read eq 1 print,'read'
		  if write eq 1 print,'write'
		  if execute eq 1 print,'execute'
		  print,'The file type is ',filetype
		end else begin
		  print,file,' does not exist'
		end

 Inputs      :
	FILE	- The UNIX system name of the file. For example
		  'file.dat' refers to the current directory and
		  '/disk2/fred/data' is a full path name.

 Opt. inputs :
	None

 Outputs     :
	EXIST	- Integer, 1 if the file exists, 0 if it does not.

	READ	- Integer, 1 if the user has read permission 0 if not.

	WRITE	- Integer, 1 if the user has write permission 0 if not.

	EXECUTE	- Integer, 1 if the user has execute permission 0 if not.

	FILETYPE- String, the file description character from the
		  directory listing output. e.g for ULTRIX '-' indicates
		  a file and 'd' indicates a directory file.

 Opt. outputs:
	None

 Keywords    :
	None

 Calls: ***
	FILE_ACC_DET, FILE_ACC_GRP, FILE_ACC_SPLIT
 Restrictions: None

 Sise effects:
	A number of UNIX commands are spawned.

 Category:
	UNIX system IDL utility.

 Prev. Hist. : None

 Written: 
       Andrew Bowen, Tessella Support Services plc, 29-Apr-1993

 Modified:  Version 2, Header format updated, C D Pike, 7-Oct-93
 Modified:  Version 2.1,  Added /SH flag to spawn command to get rid of errors 07/07/97, S.Paswaters
	     Version 2.2   Use "/bin/ls -ld" in file_acc_det, N B Rich, 01 Dec 1998
	Version 2.3	The assumed output of 'groups' was incorrect for sunos; corrected pro file_acc_grp

 Version: Version 2.2       12-Nov-1998


file_append [1] $SSW/gen/idl/system/file_append.pro
[Previous] [Next]
   Name: file_append

   Purpose: append text to text file - optionally, only append uniq text

   Input Parameters:
      file   - file name	- if no such file exists, open new file
      text   - text to append  - string or string array
  
   Keyword Parameters:
      uniq    - if set, only append uniq lines of text
      nlines  - number of new appended lines (same as n_elements(text) if 
		 uniq is not set 
      loud    - if sent, print informational messages
      newfile - if set, open use a new file (on unix, deletes existing)

   Calling Sequence:
      file_append, file, text [,/uniq, nlines=nlines, /newfile, /loud]

 CALLS: ***
	rd_tfile [1], rd_tfile [2]
 CALLED BY:
	ADD_METHOD, DISPLOI_MON5K, JSMOVIE, JSMOVIE2, MDI_SUMMARY, UNIX_SPAWN, WIN_SPAWN
	check_compile [1], check_compile [2], check_oldprocess [1]
	check_oldprocess [2], check_oldprocess [3], check_oldprocess [4]
	check_process [1], check_process [2], daily_forecast [2], dbase2disk
	disp_sci160k [1], disp_sci160k [2], dpc_summary, eit_mirror, eit_proton_summary
	fl_mktext, flares2disk, ftp_copy [1], ftp_copy [2], ftp_copy_new, ftp_defprompt
	genx2html [1], genx2html [2], go_batch [1], go_batch [2], go_mk_cd
	go_sxt_sss2secondary, go_yo_prod_batch, goes2str, goes_gaps, html_basics, html_doc
	html_form_addtime [1], html_form_addtime [2], html_form_addtime [3]
	html_linklist, html_remove_template, image2movie, is_bestnode [1]
	is_bestnode [2], laststat [1], laststat [2], mail [1], mail [2], make_mirror
	map_env2dir, mk_bad_pix_map_load, mk_cd [1], mk_cd [2], mk_hst_summary
	mk_lasteit_movie, mk_pix [1], mk_pix [2], mk_pubydb, mk_sfc [1], mk_sfc [2]
	mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_ssc_batch [1], mk_ssc_batch [2]
	mk_ydb_list, mk_ydbtab, mk_ydbtape [1], mk_ydbtape [2], mo_check, mo_job0, mo_job1
	mo_patch, mobad_summ, modvolume_inf [1], modvolume_inf [2], monitor_center [1]
	mostrip, multi_hda2hxi, new_dpath [1], new_dpath [2], pr_tr_header, pref_super
	rd_ydbtap, ref_term [2], search_obs, sfc_check, soon_catstat, soon_com2html
	soon_search [1], soon_search [3], soon_search_www, special_movie, ssw_conflicts
	ssw_findstuff2html, ssw_install [1], ssw_install [2], ssw_move
	ssw_start_rpcserver, ssw_strfind, ssw_swmap_bestof, ssw_swmap_info
	ssw_swmap_uniqinfo, ssw_track_demo, ssw_unspike_cube, ssw_upgrade [1]
	ssw_upgrade [2], sswdb_info, sswdb_install, sw2tree [1], sw2tree [2], sxt2mpeg
	sxt_html, sxt_ssn2fits [1], term_times, tim2dbase, tim2tfss, timeline, topsdb [1]
	topsdb [2], trace_cat2cosmic, trace_cosmic2hist_accum, trace_do_data_requests
	trace_get1www_image, trace_last_movie [1], trace_last_movie [2]
	trace_last_movie [3], trace_movie_index [1], trace_movie_index [2]
	trace_recent_movie_summary, trace_request_summary, trace_special_movie [1]
	trace_special_movie [2], trace_special_movie [3], trace_special_movie2
	trace_submit_request, trace_success_file, trace_unspike_time, ucon_check
	web_seq, write_access [1], write_access [2], wwwidl_server_check
	wwwidl_watchdog [1], wwwidl_watchdog [2], xdisp_fits, xdisp_trace [1]
	xdisp_trace2, xdisp_trace3, xhkplot, xset_chain [1], xset_chain [2], xso_search
	xsw2tree, xsw2tree_event, xswlist [2], xwrite_hist, ycopy, ydb_install [1]
	ydb_install [2], ydump
   History:
      slf, 10-mar-1993
      slf,  4-May-1993 	; added newfile option
      slf,  3-mar-1995 	; add flush (for fast machines)
      slf,  8-mar-1995		; quiet failure, add ERROR


file_compress [1] $SSW/gen/idl/system/file_compress.pro
[Previous] [Next]
   Name: file_compress

   Purpose: provide IDL interface to gzip and Unix compress utility

   Input Paramters:
      inname - file name or vector of file names to compress

   Output Parameters:
      outname - compressed file names (same dimension as inname)
		 (usually, = inname.Z, if type_comp=2 is set, then = inname.gz
                 null if problem w/input or compress)


   Optional Keyword Parameters
	noreplace - (input) - switch, if set, don't replace inname with outname 
	newname   - (input)   NOT IMPLEMENTED specify outname
       type_comp - (input) - values: none, 1: use Unix compress; 2: use gzip 

   Calling Sequence:
	file_compress, inname [, outname ,/noreplace]

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4]
	file_exist [1], file_exist [3], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	data_compress [1], data_compress [2], data_compress [3], do_ads, mk_sdm
	rd_week_file [1], rd_week_file [3], rd_week_file [4]
   History: 30-Jun-93 (SLF)
	     11-Jul-93 (SLF) Added dirs keyword and function
	     15-Mar-93 (SLF) enclose in quotes (embedded meta-characters)
            11-apr-95 (SLF) made the default quiet - use /loud to override
            09-Dec-97 (PGS) Added type_comp = 2 cause compression with gzip


FILE_CONTENT $SSW/gen/idl/system/file_content.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FILE_CONTENT

 Purpose     : Determine file content (access time, size in bytes, etc)

 Category    : utility system 
                   
 Inputs      : FILE = scalar or array of file names

 Outputs     : VALUE depending upon keyword

 Keywords    : /SIZE = return byte size
             : /TIME = return creation time
             : /TAI  = time in TAI
             :  ERR  = string error

 CALLS: ***
	ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], EXIST, IS_BLANK
 CALLED BY:
	FILE_SINCE
 History     : 22-Feb-2002,  D.M. Zarro (EITI/GSFC)  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FILE_COPY2 $SSW/gen/idl/system/file_copy2.pro
[Previous] [Next]
 Project     : HESSI                                            
                                                                
 Name        : FILE_COPY2                                       
                                                                
 Purpose     : Wrapper around FILE_COPY that works for IDL < 5.6
                                                                
 Category    : system utility                                   
                                                                
 Syntax      : IDL> file_copy2,infile,outfile                   
                                                                
 Inputs      : INFILE = input filenames to copy                 
                                                                
 Outputs     : OUTFILE = output filenames                       
                                                                
 Keywords    : See FILE_COPY                                    
                                                                
 CALLS: ***
	ESPAWN, IS_BLANK, OS_FAMILY, SINCE_VERSION [1], SINCE_VERSION [2]
 History     : 30 March 2006,  D.M. Zarro (L-3Com/GSFC)  Written
                                                                
 Contact     : DZARRO@SOLAR.STANFORD.EDU                        


file_delete [1] $SSW/gen/idl/system/file_delete.pro
[Previous] [Next]
   Name: file_delete

   Purpose: system/shell independent file delete

   Input Parameters:
      files - scaler string or vector string array of filenames to delete

   Output Paramters:
      status - sucess  1 -> deleted or not there to begin with
			0 -> couldnt delete (it's still there)
			     (scaler or vector depending on files)

		*** NOTE: This parameter is obsolete! ***

   Keyword Parameters:
      quiet - if set, dont print message on failures

   Calling Sequence:
      file_delete, files [,status , /quiet]

   History:
      slf, 8-feb-1993		
	12-May-2003, William Thompson, added obsolete warning
      Zarro, 15-May-2003 - added _EXTRA to catch stray keywords

 CALLS: ***
	FILE_EXIST [2], file_exist [1], file_exist [3]
   Restrictions: must have write priviledge to requested files

			    *** IMPORTANT NOTE ***

	This routine conflicts with an IDL built-in routine of the same name,
	introduced in version 5.4.  The syntax is very similar, except that the
	built-in routine does not support the STATUS parameter.  If one wishes
	to use the procedure rather than the built-in routine, use
	SSW_FILE_DELETE instead.


file_delete [2] $SSW/gen/idl/system/ssw_file_delete.pro
[Previous] [Next]
   Name: file_delete

   Purpose: system/shell independent file delete

   Input Parameters:
      files - scaler string or vector string array of filenames to delete

   Output Paramters:
      status - sucess  1 -> deleted or not there to begin with
			0 -> couldnt delete (it's still there)
			     (scaler or vector depending on files)
   Keyword Parameters:
      quiet - if set, dont print message on failures

   Calling Sequence:
      file_delete, files [,status , /quiet]

   History:
      slf, 8-feb-1993		
      S.L.Freeland - made 'ssw_file_delete' from 'file_delete'
                     since RSI screwed me

 CALLS: ***
	FILE_EXIST [2], SSW_FILE_DELETE, file_exist [1], file_exist [3]
   Restrictions: must have write priviledge to requested files


file_diff $SSW/gen/idl/system/file_diff.pro
[Previous] [Next]
   Name: file_diff

   Purpose: check for ascii file difference (boolean)

   Input Parameters:
      f1, f2 - ascii file names

   Calling Sequence:
      truth=file_diff(file1, file2 [/idlpro] )
	truth = file_diff(file1, file2, /binary, ssmask=indgen(2800))

   Keyword Parameters:
      idlpro - if set, check for header/code differences (";"=comment)
      mess   - output summary string
      status - 0=nodiff, >0=diff, [/idlpro only: 2=header , 3=code]
		[/binary only: 10=file size difference, 11=data difference]
		-1=files don't exist
      binary - If set, then do a binary difference
      ssmask - Optional subscripts of the data portion to ignore (byte positions)
      
 CALLS: ***
	FILE_DIFF_S1, FILE_EXIST [2], file_exist [1], file_exist [3], rd_tfile [1]
	rd_tfile [2]
 CALLED BY:
	CMP_FILES, LOCAL_DIFFS, ssw_check_contrib, ssw_conflicts, ssw_move, tr_reformat
   History:
      29-Aug-1996 S.L.Freeland (extracted code from chk_conflict.pro)
	13-Jul-1998 M.D.Morrison - Added /BINARY option
	22-Jul-1998 M.D.Morrison - Changed code slightly to make it not
				   such a memory hog for large files
	21-Aug-1998 M.D.Morrison - Mod to do large files with piece-meal
				   reads.


file_exist [1] $SSW/gen/idl/system/file_exist.pro
[Previous] [Next]
   Name: file_exist

   Purpose: returns true(1) if any files match pattern=file
	     false(0) if no files found

   Input Parameters:
      file - file, pathname or file filter to check

   Optional Keyword Parameters
      direct - set if want full check (slower) - use if might be an
		empty directory you are looking for

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], Bell, FILE_STAT [1], FILE_STAT [2]
	STR_LASTPOS [1], break_file [4], file_stat [3], str_lastpos [2]
 CALLED BY:
	ANDRIL_SXT, BCS_COMP, BUILD_SSX, CATEGORY, CAT_DIRECTORY, CAT_RAW, CDS_AR_OBS
	CDS_VEL_SLICE [2], CDS_WAVE_CAT, CDS_WAVE_FILES, CFITSLIST, CHIANTI_DEM
	CH_LINE_LIST, CH_SYNTHETIC, CW_LOADCT, EIS_LOAD_IMAGE [1], EIS_LOAD_IMAGE [2]
	EIT_MKMOVIE, EMISS_CALC, FB_RAD_LOSS, FIRST_LIGHT [1], FIRST_LIGHT [2]
	FLUSH_CATALOG, Files_Handling [1], Files_Handling [2], GETBKGIMG, GET_CACHE
	GET_ORBIT_CDF2, GHOST_AMOUNT, GOES_TF, GOES_TF_COEFF, GT_EXPTIME [2], GT_MIRRPOS
	GT_NUMEXP, GT_NUMWIN, GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL
	GT_WLIMITS, GT_WNUM, HEADCAT, HESSI, HESSI_DATA_PATHS [1], HESSI_SHUTTERS
	HESSI_SPEX [1], HESSI_SPEX [2], HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4]
	HSI_SPECTRUM_FITSPASTE, HXTPIXON, HXT_QLOOK, IDL5TO4, IMAGE_TOOL, IMAGE_TOOL_EVENT
	ISOTHERMAL, ITOOL_EIT_DEGRID, ITOOL_LOAD_IMAGE, ITOOL_OVERLAYER, ITOOL_RD_GIF
	LOCK_DATABASE, MAKE_CHIANTI_SPEC, MAKE_DAILY_IMAGE, MKMOVIE
	MKMOVIE0 obsolete version of mkmoviepro, MK_RASTER, NET_DIR_DIFF
	OVSA_EXPLORER formerly OVSA_PRESUB, Open Packet File, Open Score File
	PICKFITS, PICK_CAN_PRELIM, PLOT_CHIANTI_NE, PLOT_CHIANTI_TE, PLOT_DELTAT
	PLOT_SPEC [2], PRG_DETAIL, PRG_PLAN, PURPOSE, RATIO_PLOTTER [1], RD_IMAGE_GIF
	READCDSFITS, READ_ANALIST, READ_PS2, REDUCE_LEVEL_1, RFITS2 [1], RFITS2 [2], RTMOVIE
	RTMVI [1], SFITSLIST, SHOW_FITS_HDR, SHOW_POPS, SPEX_READ_FIT_RESULTS
	SSW_LOCAL_PATH, STUDY_BRIEF, ST_SUMER, SUMER_DISTORT_COR, SUMER_FILE
	SUMER_SEARCH_PD_EVENT, SUMER_SERIAL, TP_GET_DUMDATA, TR_FLAT_SUB, TV_SYNOP
	USE_CHIANTI, WIN_DUMP, WRT_GEN [1], WRT_GEN [2], WRUNMOVIEM, WR_MOVIE, XCOR_CDS
	ZETA_0, add_pro [1], add_pro [2], ads_into_att, break_doc [1], break_doc [2]
	break_doc [3], ccd_hdr_info, ccd_sunc [1], ccd_sunc [2], cdrom_files [2], ch_ss
	check_compile [1], check_compile [2], check_log [1], check_log [2]
	check_process [1], check_process [2], check_ql_after_lz, chk_pointing
	color_copy, configure_http, cont2time [1], cont2time [2], ctraj2orbit
	daily_forecast [2], data_sum2fits, dbase2disk, delete_week [1], delete_week [2]
	disk2_mo [1], disk2_mo [2], disp_synop, disp_therm_rs232, do_ads, do_demo [1]
	do_demo [2], do_i0_dps_reformat, do_reg_backup, do_tr_inventory, doc_summ [1]
	doc_summ [2], dps_proc_lev0_hk, dps_proc_mem_dump, dsn_check [1], dsn_check [2]
	dsp_menu, eit_eff_area, eit_file2path, eit_files, eit_fulldiskdb
	eit_proton_summary, eitoversxt, extract_val, file__define, file_compress [1]
	file_compress [2], file_delete [1], file_delete [2], file_delete [3], file_diff
	file_list2, file_path [1], file_path [2], file_uncompress [1]
	file_uncompress [2], fits2time [1], fits2time [2], fits2time [3]
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], fl_summary [1]
	fl_summary [2], fl_summary [3], fl_suntoday [1], fl_suntoday [2]
	fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2], fort2hxi [1], fort2hxi [2]
	freebound_ion, ft_mng_hm, ftp_copy [1], ftp_copy [2], ftp_copy2sites, ftp_copy_new
	genx2html [1], genx2html [2], get1doc [1], get1doc [2], get_ads [1], get_daily [1]
	get_daily [2], get_gevloc_data, get_hk_info [1], get_hk_info [2]
	get_ksc_holiday, get_mk3 [1], get_mk3 [2], get_selsis, get_sirius_yr
	get_solar_indices, get_tty_type [1], get_tty_type [2], get_uvxsections
	go_batch [1], go_batch [2], go_ssw_batch, go_yo_prod_batch, goes_log
	goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
	gt_exptime [1], hessi_version, hsi_flare_position_image [1]
	hsi_flare_position_image [2], hsi_full_sun_image [1], hsi_full_sun_image [2]
	hsi_locate_flare [1], hsi_locate_flare [3], html_basics, html_doc
	html_form_addtime [1], html_form_addtime [2], html_form_addtime [3]
	html_get_files, html_linklist, html_remove_template, hxt_impulsivness
	hxt_multimg, hxt_sources, idl_server_command, idl_server_control, image2movie
	ip_que_dmpver, is_alive [1], is_alive [2], keyword_db, ksc_commands, lapalma_cat
	lapalma_files, lasteit, lastsfd [1], lastsfd [2], laststat [1], laststat [2]
	mail [1], mail [2], make_goes_chianti_response [1]
	make_goes_chianti_response [2], make_goes_chianti_response [3]
	make_goes_chianti_response [4], make_ssw_mirror, map_env2dir, mdi_cat, mdi_files
	mdi_write_genxcat, mdimrot, mdipdist, mdiprot, mk_att [1], mk_att [2]
	mk_bad_pix_map_load, mk_dpc_image, mk_gsn_obs, mk_gsn_obs_s1, mk_gx
	mk_hst_summary, mk_imgsum_html, mk_mo_disk, mk_mo_disk2, mk_mo_log, mk_obs
	mk_orbit [1], mk_orbit [2], mk_pix [1], mk_pix [2], mk_pnt, mk_query [1]
	mk_query [2], mk_query_genx, mk_sdcs, mk_sdm, mk_sfc [1], mk_sfc [2], mk_sft [1]
	mk_sft [2], mk_spd, mk_ssc [1], mk_ssc [2], mk_ssc_batch [1], mk_ssc_batch [2]
	mk_sumer_dbase_ff, mk_sxh, mk_syn_sfc [1], mk_syn_sfc [2], mk_trace_i0
	mk_week_file [1], mk_week_file [2], mo_patch, mo_tap_dump, mon_health [1]
	mon_health [2], mreadfits_header, msok_copy_jpg, msok_poi_copy [1]
	msok_poi_copy [2], mwritefits, nobeyama_update, obs_summary, op_get_special
	op_rd_special, password_info, phoenix_spg_get, ratio_plotter [2]
	raw_list2pixmap, rd_atodat [1], rd_atodat [2], rd_bsc, rd_ccdh_fil, rd_dpc_table
	rd_egse_hk_txt, rd_gbl_raw [1], rd_gbl_raw [2], rd_goes_fits, rd_goesp_ascii
	rd_goesx_ascii, rd_gsn, rd_hk [1], rd_hk [2], rd_ionbal [1], rd_ionbal [2]
	rd_old_obs, rd_pkt_head [1], rd_pkt_head [2], rd_rasm, rd_roadmap [1], rd_sdl
	rd_selsis, rd_selsisi_dir, rd_sld, rd_sls, rd_sot, rd_srspas, rd_ssl, rd_sumer_genx
	rd_sxa, rd_sxc, rd_sxl, rd_therm_rs232, rd_tr_seq_head, rd_week_file [2], rd_ydbtap
	read_genxcat, read_lapalma, read_mdi, read_sooncheck, read_spartan, ref_term [2]
	reslot, restgenx, restore_idl_routines, save_idl_routines, savegenx, search [1]
	search [2], search_obs, secchi_time2files, selsis_copy [1], selsis_copy [2]
	selsisi2fits, setup_spex [1], setup_spex [2], sfc_check, show_pix [1]
	show_pix [2], soon_catstat, soon_com2html, special_movie, ssw_bin
	ssw_check_contrib, ssw_colors, ssw_conflicts, ssw_contrib_info
	ssw_contrib_monitor, ssw_fs_cat2db, ssw_get_sources, ssw_getapplet
	ssw_install [2], ssw_install_explinkages, ssw_instr_info, ssw_javamovie
	ssw_jsulr2data, ssw_sec_aktxt2struct, ssw_set_chianti, ssw_setsswdb_gen
	ssw_start_rpcserver, ssw_swmap_uniqinfo, ssw_time2paths, ssw_upgrade [1]
	ssw_upgrade [2], ssw_upgrade_backup, ssw_url2data, ssw_whereis_perl
	sswdb_upgrade, strpair2struct, struct_where, sum_FField, sun_today [1]
	sun_today [2], sun_today [3], sw2tree [1], sw2tree [2], sxl_analysis, sxt2eit
	sxt2file, sxt2mpeg, sxt_etemp, sxt_files, sxt_html, sxt_mornint, sxt_patch_att
	sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_ssc2sss, sxt_ssn2fits [1]
	sxt_summary, sxt_uvf_info [1], sxt_uvf_info [3], sxt_where, synop_movie
	table2struct, term_times, tfr_summary, tfr_summary2, tim2dbase, timeline
	timeline2html, topsdb [1], topsdb [2], tr_build_img [1], tr_head_info
	tr_inventory_telem, tr_lut_conv, tr_reformat, tr_summary_head, tr_tab_head
	trace_cat, trace_cat2data, trace_decode_idl PLEASE USE trace_jpeg_decomp
	trace_dph2struct [1], trace_euv_resp [1], trace_file2path, trace_files
	trace_get1www_image, trace_get_vignette, trace_jpeg_decomp
	trace_last_movie_queue, trace_make_tma, trace_make_tmr [1], trace_make_tmr [2]
	trace_movie_index [1], trace_movie_index [2], trace_movies_prioritize [1]
	trace_movies_prioritize [2], trace_newmoviedata, trace_rd_jpeg
	trace_recent_movie_summary, trace_request_summary, trace_special_movie [1]
	trace_special_movie [2], trace_special_movie [3], trace_special_movie2
	trace_success_file, trace_uv_resp, trace_where, ucon_path, url_decode, web_seq
	weekid [2], write_access [1], write_access [2], write_trace
	wrt_fits_bin_exten [2], wrt_sci160k_img, wrtwkdat, wwwidl_server_check
	wwwidl_watchdog [1], wwwidl_watchdog [2], xcheckip, xdisp_fits, xdisp_sci5k
	xdisp_tfr, xdisp_trace [1], xdisp_trace2, xdisp_trace3, xhkplot, xset_chain [1]
	xset_chain [2], xspr [1], xspr [2], xsw2tree, xsw2tree_event, xswlist [2]
	ydb_exist [1], ydb_exist [2], ydb_exist [3], ydb_exist [4], ydb_install [1]
	ydb_install [2], ydb_use, yo_mkos1_dbase, yo_xda2legacy, yohkoh_legacy_files [1]
	yohkoh_legacy_files [2], yopos [1], yopos [2], ys_contrib [1], ys_contrib [2]
   History: written by slf, 11/30/91
	4-Sep-92 (MDM) - Modified to handle an array of input files
      23-sep-93 (slf) - make sure null file returns false
			 (findfile count=1! when null requested)
      17-Mar-94 (SLF) - use file_stat(/exist) for non wild card cases
      April Fools'94 (DMZ) -- added check for :: in file name
                              (file_stat doesn't work across DECNET)
      31-May-94 (DMZ)      -- added check for VMS directory name input
                              (file_stat doesn't seem to work on VMS
                               dir names like '[ys.atest.soft]')
      16-Aug-94 (DMZ)      -- added another VMS patch to handle
                              case when user enters  a VMS subdirectory name
                              without a file name.
      6-Aug-97 (Zarro/GSFC) -- added check for nonstring input
      30-may-99 (rdb)      -- stop use of file_stat with WINDOWS
                              cause access violation - for wildcard search
      8-Jan-1999 - S.L.Freeland - put in IDL version check since 5.3/IRIX
                   (at least) not backwardly compatible (must use findfile)
     10-Jan-1999 - S.L.Freeland - extended 8-jan mod to all UNIX 5.3
     15-Feb-2000 - S.L.Freeland - removed 5.3 changes (moved fix to file_stat)
     10-Feb-2005 - Kim Tolbert - changed '/' to get_delim()


file_info [1] $SSW/gen/idl/genutil/file_info.pro
[Previous] [Next]
NAME:
	file_info
PURPSOSE:
	To return information about the file that is not included
	in the FSTAT return
CALLING SEQUENCE:
	nfil = file_info(infil, finfo)
INPUT:
	infil	- The input file to find the information for.  It
		  can be a wild card since 'findfile' will be used
OUTPUT:
	returns	- Number of files found
	finfo	- A structure with the information in the file.
			.SIZE
			.REC_LEN
			.FILENAME
			.DIRECTORY
			.DATE
			.TIME
			.PROTECTION
			.OWNER
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], MAKE_STR [1], MAKE_STR [2]
	STR2ARR [1], STR2ARR [2], break_file [4]
HISTORY:
	Written 14-Nov-91
	 1-Mar-92 (MDM) - Updated the header information
	18-Apr-92 (MDM) - Adjusted to accept an array of file name


file_info2 [1] $SSW/gen/idl/genutil/file_info2.pro
[Previous] [Next]
NAME:
	file_info2
PURPSOSE:
	To return information about the file from "ls -l" output
CALLING SEQUENCE:
	nfil = file_info2(infil, finfo)
	nfil = file_info2(dummy, finfo, ls=ls)
INPUT:
	infil	- The input file to find the information for.  It
		  can contain a wild card.  It needs to be a scalar if
		  wild cards are being used.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], STR2ARR [1], STR2ARR [2]
	anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], break_file [4]
	fmt_tim [1], fmt_tim [2], int2secarr [1], int2secarr [2]
 CALLED BY:
	FIND_CAT, FIND_PROC, NET_DIR_DIFF, disp_sci160k [1], disp_sci160k [2], mk_mo_log
	mk_sfc [1], mk_sfc [2], mk_ydb_list, new_dpath [1], new_dpath [2], rd_dpc_table
	rd_goes3sec [1], rd_goes3sec [2], rd_hist_dbase [1], rd_hist_dbase [2]
	ssw_check_contrib
OPTIONAL KEYWORD INPUT:
	ls	- The "ls -l" results can be passed directly to 
		  this routine.  
OUTPUT:
	returns	- Number of files found
	finfo	- A structure with the information in the file.
			.SIZE
			.FILENAME
			.DIRECTORY
			.DATE
			.DAY
			.TIME
			.PROTECTION
			.OWNER
HISTORY:
	Written by M.Morrison 7-Aug-92 taking file_info.pro as a start
	 7-Oct-92 (MDM) - Added QDEBUG
			- Fixed problem with recognizing dates from last year
	20-Oct-92 (MDM) - Minor mod
	22-Oct-92 (MDM) - Modification to the way that year is recognized
	12-May-93 (MDM) - Modification to work on the SGI machine
	19-May-93 (MDM) - Added " around ls spawn to work on ADS file
	28-Jul-93 (DMZ) - Alpha OSF fix (ls command)
	27-Jun-94 (MDM) - Changed how routine figured out if "ls" was performed
			  on SGI or OSF machine. (not based on !version.os)
	 1-Aug-95 (MDM) - Patched a bug where infil could come in AND ls
			  is passed in.
	 3-Jan-96 (MDM) - Added patch to handle the case where the file size is
			  over 10 megabytes (the filename was being corrupted)
	 5-Feb-97 (MDM) - Corrected to work with years over 2000
	 7-May-97 (MDM) - Modified to use /NOSHELL on the spawn command if
			  the input has no wildcards
			- Added some workaround for file not found (kinda
			  bogus, but at least it won't crash internally)


file_list [1] $SSW/gen/idl/system/file_list.pro
[Previous] [Next]
NAME:
	file_list
PURPOSE:
	Given a set of directories (and optionally a partial
	filename with a wildcard), generage a list of file
	names/directories
CALLING SEQUENCE:
	infil = file_list(data_paths())
	infil = file_list(data_paths(), 'spr*')
	infil = file_list(data_paths(), 'spr*', /cd)
	infil = file_list(data_paths(), /interactive)
INPUTS:
	dirs	- The directories to search
		  If not present, it uses the default directory
	str	- The wildcard partial filename to search for.  Be careful
		  when using wildcards when searching a directory which has
		  subdirectories, because it will not work properly.  For
 CALLED BY:
	BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], BCS_CAT, BCS_COMPARE, BCS_CREATE_CAT
	BCS_FREE_DATA, FINDFILE_LIST, HKG_DBASE, HXT_AUTOIMG, JITTER_HTML, LASTSFD_DIFF
	LOCAL_DIFFS, MK_LIBRARY_HELP, NORH_PR_EVX [1], NORH_PR_EVX [2], NORH_PR_INFO [1]
	NORH_PR_INFO [2], NORH_PR_REP [1], NORH_PR_REP [2], NORH_RD_TCX [1]
	NORH_RD_TCX [2], NORH_RD_TSX [1], NORH_RD_TSX [2], NORH_SYNTH_BYF [1]
	NORH_SYNTH_BYF [2], NORP_RD_AVG [1], NORP_RD_AVG [2], NORP_RD_DAILY [1]
	NORP_RD_DAILY [2], NORP_RD_DAT, QUICKDARK [2], QUICK_DPE, READ_MERGED_DSN
	RTMVIPLAY [2], RdTap [1], RdTap [2], RdTap [3], SEL_AR, TERM_FIDS, TERM_QUICK
	TERM_REVIEW, TOK_RD_DAILY, TR_DARK_SUB, TYKW_RD_DAILY, TYKW_RD_DAT, ace_files
	ads2att, allpks_html, att_exst, bcs_unpack, calc_mtm_therm, cdrom_files [2]
	cfl_summary [1], cfl_summary [2], check_oldprocess [1], check_oldprocess [2]
	check_oldprocess [3], check_oldprocess [4], check_ql_after_lz, chk_flares [1]
	chk_flares [2], cp_fns [1], cp_fns [2], daily_forecast [2], dbase2disk
	delete_week [1], delete_week [2], disp_sci5k, do_demo [1], do_demo [2]
	do_disp_month, doc1liners, doc_summ [1], doc_summ [2], dps_proc_lev0_hk
	edac_summary, eit_files, emi_plot [1], emi_summary, file_menu [1], file_menu [2]
	file_purge_sizes, flares2disk, fort2hxi [1], fort2hxi [2], full_graph_gif, get1gbo
	get_daily [1], get_daily [2], get_dc_warm, get_dirtree, get_gevloc_data
	get_hist_dbase_fil, get_hk_info [1], get_hk_info [2], get_last_tfr, get_mk3 [1]
	get_mk3 [2], get_seq_tab, get_sfm, get_tf_rec fname filnum recnum [1]
	go_hxt_hk_temps, go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs4
	go_nvs5, go_rdtap [1], go_rdtap [2], go_sxt_sss2secondary, goes3sec_copy
	gtab_summary, hist_count, hist_summary, hsi_pixon_smooth_patterns
	jitter_gif_xyimg, lastgbo, lastgki, mdi_write_genxcat, merge_genxcat, mk_fem [1]
	mk_fem [2], mk_gev [1], mk_gev [2], mk_gif_mag_index, mk_gx, mk_hst_summary
	mk_imgsum_html, mk_mapfile [1], mk_mapfile [2], mk_mdi_iap, mk_mo_log
	mk_orbit [1], mk_orbit [2], mk_pix [1], mk_pix [2], mk_sd2, mk_sdc [2], mk_sdc [3]
	mk_sdc [4], mk_sdcs, mk_sdl, mk_sdm, mk_sdmi, mk_sfc [1], mk_sfc [2], mk_sft [1]
	mk_sft [2], mk_sl [1], mk_sl [2], mk_sot, mk_ssl, mk_tfi, mk_week_file [1]
	mk_week_file [2], mo_filelist, mo_job0, mo_job1, mobad_summ, mon_health [1]
	mon_health [2], month_sfd_fits [1], month_sfd_fits [2], mostrip
	msok_poi_copy [1], msok_poi_copy [2], new_disp_sci5k [1], new_disp_sci5k [2]
	new_edac_summary, new_mon_health [1], new_mon_health [2], new_version [1]
	new_version [2], newfiles [1], newfiles [2], newfiles [3], newsfd, nts_copy [1]
	nts_copy [2], pnt_exst, pr_sfc, pref_deldir, pro_list [1], pro_list [2], rd_dt_genx
	rd_old_obs, rd_raw_station_plan, rd_so_at_ftr, rd_week_file [1]
	rd_week_file [2], rd_week_file [3], rd_week_file [4], rd_xda_same, read_genxcat
	read_mdi, read_msok_jpg, read_spartan, run_dsnfil, sea, sel_dc_image [1]
	sel_dc_image [2], sel_dc_image [3], sel_filetimes [1], sel_filetimes [2]
	sel_leak_image [1], sel_leak_image [3], sel_leak_image [4], set_sci160k_dir
	sfc_check, sfc_prep [1], sfc_prep [2], sft2sfc, show_pix [1], show_pix [2]
	show_pixf, soon_com2html, ssw_check_contrib, ssw_findstuff2html, ssw_fs_cat2db
	ssw_getapplet, ssw_install [2], ssw_start_rpcserver, ssw_swmap_bestof
	ssw_time2paths, sswdb_files, stt_plot, sxt_eff_area, sxt_files, sxt_his2dbase
	sxt_ssn2fits [1], tap_wrt_chk, timeline, timeline2html, topsdb [1], topsdb [2]
	tr_lut_conv, tr_mk_seq_alph, tr_rd_index, tr_rd_inventory, tr_scan_images
	tr_summary_head, trace_do_data_requests, trace_euv_resp [1], trace_files
	trace_get_vignette, trace_last_movie_queue, trace_movie_index [1]
	trace_movie_index [2], trace_recent_movie_summary, trace_uv_resp, uniq_fid [1]
	uniq_fid [2], verify_gui, web_seq, weekid [2], wrt_fits_bin_exten [2], xanal_emi
	xcheckip, xdisp_fits, xdisp_sci5k, xdisp_tfr, xdisp_trace [1], xdisp_trace [2]
	xdisp_trace2, xdisp_trace3, xrd_trace, xset_chain [1], xset_chain [2], xspr [1]
	xspr [2], ydb_exist [2], yo_file_check [1], yo_file_check [2], yo_mkos1_dbase
	yohkoh_files, yoyo_man2, ys_file_check [1], ys_file_check [2]
		  example:  file_list('~', '*') will not give the proper
		  answer, but it will if the /CD option is used.  This
		  is an artifact of how the IDL routine FINDFILE works.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], break_file [4], concat_dir [4], str_replace [1], str_replace [2]
	wc_where [1], wc_where [2]
OPTIONAL KEYWORD INPUT:
	interactive - If set, ask the user to type in the partial
		  filename to search for
	cd	- If set, then set default to the directory first
		  and then do the listing.  This technique is
		  needed because of "argument overflow" errors duing
		  "ls" type commands when there are too many files in
		  a directory.  This happens on the SGI much sooner
		  than Suns or DECs.
       nocd    - if set, override /CD default for UNIX 
	bydate	- If set, then list the files by date, with the oldest
		  file in the beginning of the array, and the newest file
		  as the last element in the array.  ONLY WORKS ON UNIX.
OUTPUTS:
	RETURNS: The file list (including the path).
OPTIONAL KEYWORD OUTPUT:
	files	- Just the file names of the filenames
	fdirs	- Just the directory portion of the filenames
HISTORY:
	Written 11-Dec-91 by M.Morrison
	 8-Mar-93 (MDM) - Modified to optioncally set default to the directory
			  and then to do the listing
			- Modified to accept an array of input file names
	16-Mar-93 (MDM) - Modified to set default back to the starting directory
			  and not leave you in the last directory when using
			  the /CD option.
	12-Aug-93 (MDM) - Changed how the /CD option works (doesn't actually
			  do a cd now)
			- Added translation of ~ if passed in
       27-Oct-93 (AKT) - If wildcard search spec doesn't include .something
			  then append .*.  In VMS, findfile needs the .*.
	 7-Dec-93 (MDM) - Removed the 27-Oct-93 patch unless the system is
			  VMS.  It causes problems in Unix (show hidden
			  . (dot) files)
	22-Dec-93 (MDM) - Made /CD the default when running on SGI
	 3-Apr-95 (MDM) - Added /BYDATE
	28-Feb-96 (MDM) - Added defining output variable FILES
			- Also changed the keyword from FILE to FILES
	 4-Feb-97 (MDM) - Made the FOR loop a long interger
       18-Feb-97 (SLF) - Merged SLF change 7-Nov-96 to protect ultrix/IDL 4.01
	30-May-99 (RDB) - Prohibit use of /cd with WINDOWS - doesn't work...
        3-Jun-99 (SLF) - make /CD default for UNIX family, add /NOCD override
                         made 'cd' logic -> case instead of bunch of 'ifs'
       10-Aug-00 (DMZ) - added /QUIET and call to chklog(dir)


file_list2 $SSW/gen/idl/genutil/file_list2.pro
[Previous] [Next]
NAME:
	file_list2
PURPOSE:
	Given a set of directories and a list of filenames, return
	the full filenames where they exist.  No wildcards are
	permitted in "dirs" or "str"
CALLING SEQUENCE:
	infil = file_list2(dirs, str)
	infil = file_list2(data_paths())
	infil = file_list2(data_paths(), 'spr*')
INPUTS:
	dirs	- The directories to search
		  If not present, it uses the default directory
	str	- The file names to find
OUTPUTS:
	RETURNS: The file list (including the path).
OPTIONAL KEYWORD OUTPUT:
	files	- Just the file names of the filenames
	fdirs	- Just the directory portion of the filenames
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], break_file [4], concat_dir [4], file_exist [1]
	file_exist [3]
HISTORY:
	Written 13-Jan-98 by M.Morrison


file_menu [1] $SSW/gen/idl/system/file_menu.pro
[Previous] [Next]
NAME:
	file_menu
PURPOSE:
	Given a set of directories (and optionally a partial
	filename with a wildcard), display a menu to allow the
	user to select the file he wants.
INPUTS:
	dirs	- The directories to search
		  If not present, it uses the default directory
	str	- The wildcard partial filename to search for
	interactive - If set, ask the user to type in the partial
		  filename to search for
OUTPUTS:
	RETURNS: The file name (including the path).  If quit/exit
		 is selected, then a null string is returned.
LIMITATIONS:
	For a filename that is 32 characters long (for example:
	/0d0/ops/reformat/ada910903.0046), the routine will only
	handle 365 of those files.   BEWARE.  If the number is too
	large, it will bomb.
 CALLS: ***
	file_list [1], file_list [2], wmenu_sel [1], wmenu_sel [2]
 CALLED BY:
	BCS2SXSPC, rd_sda_flare, sun_grid
HISTORY:
	Written 21-Oct-91 by M.Morrison
	18-Mar-92 (MDM) - Changed to use "file_list" and "wmenu_sel"


FILE_NAME $SSW/gen/idl/system/file_break.pro
[Previous] [Next]
 Project     : HESSI
                  
 Name        : FILE_NAME
               
 Purpose     : new improved BREAK_FILE that uses STREGEX and no loops
                             
 Category    : system utility string
               
 Syntax      : IDL> name=file_break(file,[/name,/path,/ext,/drive])

 Inputs:     : FILE = file names (scalar or array) 

 Outputs     : Name part of file (default or if /name)

 Keywords    : /PATH = return path part of file 
               /EXTENSION  = return extension part of file
               /DRIVE = return drive part [Windows or VMS only]
               /EXPAND = expand environment variables in name
               /NO_EXTENSION = don't include extension in returned filename
               
 Restrictions: Needs IDL version > 5.3

 CALLS: ***
	CHKLOG [1], CHKLOG [2], COMDIM2, FILE_BREAK
 Side Effects: Input file names are trimmed of redundant spaces
               
 History     : Written, 11-Nov-2002, Zarro (EER/GSFC)

 Contact     : dzarro@solar.stanford.edu


FILE_OR_STRING $SSW/gen/idl/string/file_or_string.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : FILE_OR_STRING

 Purpose     : check if a valid filename or string datatype is being input

 Category    : utility

 Explanation : useful when ASCII input to a program can come from an file
               or a string variable

 Syntax      : IDL> file_or_string,file,string,err=err

 CALLED BY:
	SEND_MAIL, SEND_PRINT, XMAIL
 Example:    : send_printer,'test.doc',que='soho-laser1',qual='h'

 Inputs      : See keywords

 Opt. Inputs : None

 Outputs     : None

 Opt. Outputs: None

 Keywords    : ERR - error message (blank if no error found)
               FILE = filename to check
               STRING = string variable to check

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  4-Mar-1996,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


file_path [1] $SSW/gen/idl/genutil/file_path.pro
[Previous] [Next]
 
   Name: file_path

   Purpose: find file in tree (recursive version of RSI filepath.pro)

   Input Parameters:
      file   - file name to find
      topdir - top directory for tree search  (default is $IDL_DIR)

   Calling Sequence:
      filename=file_path(file [,treetop])

   Calling Examples:
      colorfile=file_path('colors1.tbl')	; find file under $IDL_DIR

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4]
	file_exist [1], file_exist [3], get_logenv [1], get_logenv [2], get_subdirs [1]
	get_subdirs [2]
   History:
      23-jun-1995 (SLF) 


file_purge [1] $SSW/gen/idl/system/file_purge.pro
[Previous] [Next]
  NAME:
    file_purge
  PURPOSE:
    Purge files that have similar file names.  Purge is based on 
    file name (alphabetical listing) or by reverse creation date.
  CALLING SEQUENCE:
    file_purge, infil [,/interactive,/bydate,keep=keep]
    file_purge, infil [,/interactive,/byname,keep=keep]
    file_purge, path=path [pattern='filepattern'] 		 
							
  INPUTS:
    infil	= A file name or a vector of file names (wild cards O.K.)
  OPTIONAL KEYWORD INPUTS:
    interactive = If set, prompt the user before deleting.
    keep        = The number to keep.  Values less than 1 will cause no
		   action to be taken.  Default = 1.
    bydate	 = Delete the oldest files.
    byname	 = Delete the alphabetically. (file ab is deleted before ac).
		   Specify /bydate or /byname but not both (/byname = default).
    directory   = if set, do a directory listing (no infil passed)
    path        = synonym for directory
    pattern     = only used with DIR keyword - if set, only match this pattern
    filter      = synonym for PATTERN

  OUTPUTS:
    None.
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], STR2ARR [1], STR2ARR [2]
	concat_dir [4], prstr [1], prstr [2], str_replace [1], str_replace [2], yesnox [1]
	yesnox [2]
 CALLED BY:
	check_oldprocess [1], check_oldprocess [3], daily_forecast [2]
  RESTRICTIONS:
    For unix only.
  MDDIFICATION HISTORY:
    Written, 19-sep-92, J. R. Lemen, LPARL.
	 7-Dec-92 (MDM) - Made the delete command use "-f" option
	27-Apr-93 (MDM) - Modification to work even when the input list is
			  a long list of filenames
        7-Aug-93 (SLF) - use file_delete.pro (bypass shell speed/alias probs)
			  add dir keyword
        2-oct-95 (SLF) - add FILTER,PATTERN, and PATH keywords 
			  


file_purge_sizes $SSW/gen/idl/system/file_purge_sizes.pro
[Previous] [Next]
   Name: file_purge_sizes

   Purpose: purge files > -OR- < some file size threshold

   Input Parameters:
      files - the file list to consider (may alternately use PATH and PATTERN)

   Keyword Parameters:
      PATH - path to 'look' in
      PATTERN - file pattern to look for
      KEEP - number of matching files to keep around
      ABOVE_SIZE - only consider purging files > than this size
      BELOW_SIZE - only consider purging files < than this size  
      LOGS - if set, set PATH=>$SSW_SITE_LOGS
      TESTING - show what it WOULD have purged without actually doing it
  
   Calling Sequence:
      file_purge_sizes, files, keep=nn, below_size=XXX
      file_purge_sizes, pattern=xxx, path=zzz, keep=nn, above_size=XXX
  
 CALLS: ***
	BOX_MESSAGE, data_chk [1], data_chk [2], file_list [1], file_list [2]
	file_size [1], file_size [2], get_logenv [1], get_logenv [2]
   History:
      18-November-1998 - S.L.Freeland - initially for log file maint.
                         Example - want to keep all "interesting" logs from
                         a high cadence cron job where "interesting" is
                         larger than some threshold size but limit
                         accumulation of "uninteresting" logs 
                    



FILE_SINCE $SSW/gen/idl/system/file_since.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FILE_SINCE

 Purpose     : LOCATE files older/newer than a specified time

 Category    : utility system 
                   
 Inputs      : See keywords

 Outputs     : FILES = located files

 Keywords    : OLDER = find files older than this interval 
               NEWER  = files newer than this interval
               DAYS = interval units in days [def]
               HOURS = interval units in hours
               ERR= string error
               TIME_REF = time to reference against [def= current]
               COUNT = # of files found

 CALLS: ***
	ANYTIM2TAI, EXIST, FILE_CONTENT, IS_BLANK, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	VALID_TIME, is_number [1], is_number [2]
 CALLED BY:
	EIT__DEFINE, GOES__DEFINE, RD_GOES_SDAC
 History     : 24-Feb-2002,  D.M. Zarro (EITI/GSFC)  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


file_size [1] $SSW/gen/idl/genutil/file_size.pro
[Previous] [Next]
   Name: file_size

   Purpose: return file sizes - optionally as string with units

   Keyword Parameters:
      string - if set, output is string
      auto   - if set, auto-scale (ex: Kb, Mb, ....)  
      total  - if set, total all file sizes before string/auto applied
               (example, display total transfer for NN files)  
  
 CALLS: ***
	FILE_STAT [1], FILE_STAT [2], file_stat [3]
 CALLED BY:
	HTTP__DEFINE, SOCK_SAME, comp_sfr_arch, eit_genx_cat, file_purge_sizes
	genx2html [1], genx2html [2], get_dirtree, go_mk_cd, image2movie, is_ps, prep_gendat
	sswdb_install, tap_wrt_chk, thumbnail_table_html, tr_inventory_telem
	trace_do_data_requests, trace_get1www_image, trace_request_summary
   Restrictions:
      auto and string not yet vecorized 

   History:
      8-Feb-1995 S.L.Freeland 
     15-jul-1997 (SLF) - add TOTAL keyword and function
     20-aug-2003 (SLF) - change 'string' -> 'fstring' (handle > 1024)


FILE_STAT [1] $SSW/gen/idl/system/file_stat.pro
[Previous] [Next]
 Project     :	SOHO - SSW

 Name        :	FILE_STAT()

 Purpose     :	Vector version of FSTAT

 Category    :	Utility, Operating_system

 Explanation :	Vector version of FSTAT

 Syntax      :	Result = FILE_STAT( FILES )

 CALLED BY:
	EIT_PREP, FILE_EXIST [2], GET_CACHE, LASCO_READFITS [1], UNIX_CMD [1]
	UNIX_CMD [2], XDIFF, archive_ck [1], archive_ck [2], data_compress [1]
	data_compress [2], data_compress [3], delete_week [1], delete_week [2]
	file_exist [1], file_exist [3], file_size [1], file_size [2], fl_mktext
	hessi_version, mk_orbit [1], mk_orbit [2], mo_check, mo_patch, monitor_scratch [1]
	monitor_scratch [2], rd_hk [1], rd_hk [2], yo_file_check [1], yo_file_check [2]
	ys_file_check [1], ys_file_check [2]
 Examples    :	

 Inputs      :	FILES	= List of files to check.

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    :	EXIST	= If set, then the returned values are whether the
			  files exist or not.  This is the default behavior.
		SIZE	= If set, then the returned values are the sizes of the
			  files.
               FSTAT_ALL = If set, return vector of 'fstat' structures.  This
                         keyword is only compatible with files less than about
                         2 GB each in size.

 Calls       : ***
	data_chk [1], data_chk [2]
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	11-Mar-1994 (SLF) Wanted faster file_exist function

 History     :	Version 1, 11-Mar-1994, S. Freeland
               Version 1.1 05-Jun-1998, J. Newmark changed loop to long
               Version 1.2 15-Feb-2000, S.L.Freeland - work around RSI
                 Version 5.3 non-backwardly compatible change....
               Version 1.3 10-Mar-2000, S.L.Freeland - fix 5.3 /SIZE bug
               Version 1.4 14-Jun-2002, S.L.Freeland - add FSTAT_ALL
               Version 2, 1-Mar-2005, W.T. Thompson - Add support for files
                                                      greater than 2 GB
  
 Contact     :	SFREELAND
 Restrictions:
   file size returned for directories under +5.3 is not valid


file_uncompress [1] $SSW/gen/idl/system/file_uncompress.pro
[Previous] [Next]
   Name: file_uncompress

   Purpose: provide IDL interface to standard unix uncompress & gzip utility

   Input Paramaters:
      inname - file name or vector of file names to gunzip or uncompress

   Output Parameters:
      outname - uncompressed file names (same dimension as inname)
		 (usually, inname without .gz or .Z extension, null if problem)

   Optional Keyword Parameters
	noreplace - (input) - switch, if set, don't replace inname with outname 
	newname   - (input)   NOT IMPLEMENTED specify outname
       outdir    - (input)   specify output directory (only if /noreplace)
       loud      - (input)   if set, include Verbose switch on unix call

   Calling Sequence:
	file_compress, inname [, outname ,/noreplace , outdir=outdir ]

 CALLED BY:
	RFITS2 [1], RFITS2 [2], data_compress [1], data_compress [2], data_compress [3]
	mk_sdm, rd_week_file [1], rd_week_file [3], rd_week_file [4], selsisi_copy
   History:  1-Jul-93 (SLF)
	      7-Oct-93 (SLF) Added OUTDIR keyword parameter
	     14-Mar-94 (SLF) enclose file names in quotes (embedded meta-char)
            11-apr-95 (SLF) make quiet the default, use /loud to override
            09-Dec-97 (PGS) added test for .gz extensions and gunzip call
            29-Dec-01 (TAK) can now uncompress a combination of .gz and .Z files

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], break_file [4], concat_dir [4], file_exist [1]
	file_exist [3], str_replace [1], str_replace [2], tbeep [1], tbeep [2], tbeep [3]
   Restrictions: UNIX only 


files2data $SSW/gen/idl/http/files2data.pro
[Previous] [Next]
   Name: files2data

   Purpose: read multiple files->3D cube w/optional congrid

   Input Parameters:
      files - vector of gif file names

   Output:
      function returns 3D data (1 image per <files>)
 
   Output Parameters:
     r,g,b - R,G,B (taken from last file read) - only valid for 
             verified formats

   Keyword Parameters:
     outsize - optional 1 or 2 element vector - desired [NX,NY] output
     diffsize - (switch) - if set, size NX,NY from larges image 
     [default size is relative to first image in list]
     eightbit=eightbit - set if true colors -> 8 bit desired
   
   Calling Sequence:
      IDL> cube=files2data(files [,outsize=[nx,ny] ] [,/DIFFSIZE ]

 CALLS: ***
	BOX_MESSAGE, CONGRID [1], CONGRID [2], CONGRID [3], data_chk [1], data_chk [2]
	is_member [1], is_member [2], ssw_strsplit
 CALLED BY:
	ssw_jsulr2data
   History:
      17-Feb-2000 - S.L.Freeland - probably done before...
      Circa 1-Jan-2003 - add eightbit, use read_trueimage if applicable
      20-May-2003 - S.L.Freeland - merge W.Thompson 8-May mod w/above mod
                                   (strsplit -> ssw_strsplit)

       4-apr-2006 - S.L.Freeland - fix typo in read_image piece
   Method:
      GIF and TIFF are only "verified" readers for now.
      This uses execute statement for automatic extension to 
      other 'read_xxx' readers but "user beware" for those.


files_search [1] $SSW/gen/idl/genutil/files_search.pro
[Previous] [Next]
NAME:
	files_search
PURPOSE:
	Search all files in a set of Unix sub-directories for an input string
CALLING SEQUENCE:
	files_search
	files_search, indir, instr, outfil, fil_spec=fil_spec
	files_search, '/ys', 'makvec'
	files_search, '/ys', 'hel2pix', 'dum.dum', fil_spec='*.pro'
INPUT:
	indir	- The top directory to search.  All directories under it will
		  be searched
	instr	- The string to search all files in the subdirectories for
OPTIONAL INPUT:
	outfil	- The name of the file to write the results to.  Default is
		  "FILES_SEARCH.TXT"
OPTIONAL KEYWORD INPUT:
	fil_spec- The file specification to search for ('*' for example)
		  Default is "*.pro"
HISTORY:
	Written Nov-91 by M.Morrison
	20-Oct-92 (MDM) - Added document header
			- Added FIL_SPEC
	27-Oct-92 (MDM) - Renamed from SEA.PRO to FILES_SEARCH.PRO


files_since [1] $SSW/gen/idl/system/files_newer.pro
[Previous] [Next]
   Name: files_since

   Purpose: return files in <directory>  newer than <reference> file

   Input Parameters:
      directory - directory to start search (recursive if tree)
      reference - reference file (ex: a dbase file)
                  OR integer number of days old
  
   Output Parameters:
      count - number files found newer than reference  

   Calling Sequence:
     IDL> newfiles=files_newer(directory, reference [,count])
  
   Calling Example:
      IDL> nf=files_newer('$INPUT_DIRECTOR','$DBASE_FILE')
           (returns files in $INPUT_DIRECTOR which have been updated
            since last update to $DBASE_FILE_
  
   Usage: updating dbase files if any potential input files
          have been updated since last dbase update
  
   History:
      6-March-1998 - S.L.Freeland - various ssw/dbase management uses
  
 CALLS: ***
	BOX_MESSAGE, FILES_NEWER, OS_FAMILY, STR2ARR [1], STR2ARR [2], data_chk [1]
	data_chk [2], get_logenv [1], get_logenv [2]
   Restrictions:
      UNIX only


filetimes [1] $SSW/gen/idl/genutil/filetimes.pro
[Previous] [Next]
   Name: filetimes

   Purpose: return start and stop times in Yohkoh reformatted files

   Input Parameters:
      files - array of reformatted file names 

   Ouput Paramters:
	startt - start time of file in external format (7,n)
       stopt  - stop time of files in external format (7,n)

   Optional Keyword Parameters:
	string - if set, return time is converted to string strarr(n)

   Method : calls rd_fheader and converts start and stop times

 CALLS: ***
	Int2Ex [1], Int2Ex [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], gt_day [1]
	gt_day [2], gt_time [1], gt_time [2]
 CALLED BY:
	chk_flares [1], chk_flares [2]
   History: slf, 3-August-1992


FILL_BOX $SSW/gen/idl/display/fill_box.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FILL_BOX
               
 Purpose     : To fill a plot box with one of a selection of patterns.
               
 Explanation : In a line plot fill column from x-bin/2 to x+bin/2 and 
               from y=0 to y with the selected pattern.
               
 Use         : IDL> fill_box,x,y,bin [,patt, /border, ymin=ymin, /bstyle]
    
               
 Inputs      : x    -  the x-axis location of the box
               y    -  the maximum y-axis extent of the box
               bin  -  the width of the box on x-axis

 Opt. Inputs : patt -      0:  solid (default)
                           1:  hatch backward
                           2:  hatch forward
                           3:  vertical
                           4:  horizontal
                           5:  grid
                           6:  cross hatch
                           7:  empty
                     

 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : border  - if present a border is drawn around the filled box.
               ymin    - if present the box is filled from ymin to y otherwise
                         from 0 to y.
               bstyle  - sets line style for border or if requested

 Calls       : None
 CALLED BY:
	DISPLAY_GIS_WIN, PLOT_DEX, PLOT_WINDOWS, TP_PLOT_DEW
 Restrictions: Plot must have been performed before call to this routine.
               
 Side effects: None
               
 Category    : Utilities, Plotting
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 10-May-1993
               
 Modified    : Added ymin keyword.  CDP 21-Apr-94
               Add empty possibility, add bstyle/outline keywords. 
                                    CDP 14-Jul-94
               Temporarily suspend X-windows mode.  CDP, 18-Jul-94
               (It was crashing my Alpha)

 Version     : Version 3, 14-Jul-94


FILL_CATEGORY $SSW/gen/idl/help/fill_category.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FILL_CATEGORY
               
 Purpose     : Load save file with current categories 
               
 Explanation : Uses the CATEGORY routine to create a list of
               relevant names and categories and then stores then in
               $CDS_INFO/categories.save for later retrieval by TFTD with
               the CAT keyword.
               
 Use         : IDL>  fill_category [,/prog]
    
 Inputs      : None 
               
 Opt. Inputs : None
               
 Outputs     : Save file created in /cs
               
 Opt. Outputs: None
               
 Keywords    : PROG - if present fill tables for 'programmers' routines.

 Calls       : ***
	Bell, CATEGORY, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, help
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 20-Sep-94 
               
 Modified    : Use write version of env. variable. CDP, 20-Oct-95

 Version     : Version 2, 20-Oct-95


FILL_MISSING $SSW/gen/idl/util/fill_missing.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FILL_MISSING

 Purpose     :	Fill in missing pixels in a data array

 Category    :	Class3, Analysis, Interpolation

 Explanation :	Uses bilinear interpolation to fill in missing pixels in a data
		array

 Syntax      :	FILL_MISSING, ARRAY, MISSING  [, DIMENSION ]

 CALLED BY:
	CDS_CLEAN, CDS_CLEAN_IMAGE, CDS_FILL_MISSING, CDS_MOSAIC, CDS_QUASI_FIT
	GET_VDS_BIAS, NIS_CALIB, NIS_QUICKLOOK, NIS_ROTATE
 Examples    :	

 Inputs      :	ARRAY	= Array containing missing pixels to fill in.
		MISSING = Value flagging missing pixels.

 Opt. Inputs :	DIMENSION = When ARRAY is multi-dimensional, then the dimension
			  to use

 Outputs     :	ARRAY	= The input array is modified to fill in missing pixels
			  with interpolated values.

 Opt. Outputs:	None.

 Keywords    :	EXTRAPOLATE = If set, the extrapolation is used at the ends of
			      the array.  Otherwise, the nearest good value is
			      extended to the end of the array.

 Calls       : ***
	TRIM, WHERE_MISSING
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	None.

 History     :	Version 1, 26-Mar-1996, William Thompson, GSFC
		Version 2, 02-Apr-1996, William Thompson, GSFC
			Corrected bug when several pixels are missing at end of
			array.
		Version 3, 25-Apr-1996, William Thompson, GSFC
			Corrected bug when array contains only one good pixel.
		Version 4, 07-Jun-1996, William Thompson, GSFC
			Fix bug where interpolation goes to missing value.
		Version 5, 08-Aug-1997, William Thompson, GSFC
			Change so that ends are extended rather than
			extrapolated by default.  Added /EXTRAPOLATE keyword.
               Version 6, 11-May-2005, William Thompson, GSFC
                       Handle NaN values

 Contact     :	WTHOMPSON


FILL_TFTD $SSW/gen/idl/help/fill_tftd.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FILL_TFTD
               
 Purpose     : Load save file with current one-liners 
               
 Explanation : Uses the PURPOSE routine to create a list of
               relevant one-liners and then stores then in
               $CDS_INFO/1liners.save for later retrieval by TFTD.
               
 Use         : IDL>  fill_tftd [,/prog]
    
 Inputs      : None 
               
 Opt. Inputs : None
               
 Outputs     : Save file created in /cs
               
 Opt. Outputs: None
               
 Keywords    : PROG - if present fill tables for 'programmers' routines.

 Calls       : ***
	Bell, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], PURPOSE, concat_dir [4]
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, help
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 13-May-94 
               
 Modified    : Change storage directory of save file, CDP, 20-May-1994
               To include list of intrinsic routines. CDP, 25-May-95
               Add PROG keyword.  CDP, 13-Jun-94
               Take account of new directory structure. CDP, 21-Jun-94
               Add database directories.  CDP, 22-Jul-94
               Add ql_disp directory to user lists. CDP, 14-Sep-94
               Added specific routines in the planning
               directories.   CDP, 11-Jan-95
               Add wavelength calibration routines.  CDP, 30-Jan-95
               Add user telemetry calibration programs.  CDP, 3-Feb-95
               Add /xdr to save file.  CDP, 3-Apr-95
               Add further telemetry programs.  CDP, 18-Jun-95
               Add Dere spectral synthesis.  CDP, 14-Jul-95
               Use write version of env. variable.  CDP, 20-Oct-95
               Added /cs/update directory.  CDP, 28-Jun-96
               Added demo engineering directory.  CDP, 26-Jul-96
               Added intensity calib directory.   CDP, 22-Aug-96
               Added all CHIANTI directory routines.  CDP, 10-Jun-97

 Version     : Version 18, 10-Jun-97


film_thumbnail [1] $SSW/gen/idl/http/film_thumbnail.pro
[Previous] [Next]
   Name: film_thumbnail

   Purpose: embed thumbnail image in "film" (make www logos/thumbnails)

   Input Parameters:
      thumbnail - image to enclose in film
   
   Output:
      function returns thumbnail embedded in "film" bitmap (always byte)

   mag - if set, film "thickness" (default is auto scale)
   pad - if set, increase the size of the surrounding pad (default auto scale)
   sample - if set, rebin called with /sample (sharp edge film "holes")
   frame_size - if set, draw frame borders (assume equal-width)
   nframes - if set, draw frame borders (in lieu of frame_size, equal-width)
   fcolor - if set, use this color for frame borders (default is bright)

   Calling Sequence:
      thumbnail_logo=film_thumbnail(thumbnail [,mag=mag, pad=pad, /sample, $
 				frame_size=nn, nframes=nn, fcolor=cn])

 CALLED BY:
	mkthumb
   History:
      26-oct-1995 (S.L.Freeland) - SXT/YPOP/EIT (etc) WWW movie icons


FILT_DATA $SSW/gen/idl/image/filt_data.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FILT_DATA

 Purpose     : filter data according to specified criteria

 Category    : utility

 Syntax      : ij=filt_data(data)

 Inputs      : DATA = data array

 Outputs     : IJ = indicies of filtered data

 Keywords    : MIN = filter out data below DMIN
               MAX = filter out data above DMAX
               MISSING = filter out data values that equal MISSING
               POSITIVE = filter out negative or zero data
               INVERSE = return indicies of unfiltered data
               COUNT = # of filtered data values
               EXCLUDE = filter out these indicies
               NAN = check for NaNs

 CALLS: ***
	EXIST, PR_SYNTAX
 CALLED BY:
	DSCALE
 History     : Written 16 Feb 1999, D. Zarro, SM&A/GSFC
               Modified 31 October 2003, Zarro (L-3/GSFC) - added check for NaNs

 Contact     : dzarro@solar.stanford.edu


FILT_EVENTS $SSW/gen/idl/synoptic/filt_events.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FILT_EVENTS

 Purpose     : filter times based on proximity to flare event

 Category    : synoptic gbo

 Syntax      : IDL> ftimes=filt_events(times,dur,count=count)

 Inputs      : TIMES = input times to filter (TAI format)

 Optional Inp: DUR = duration for each time (secs)
               PREFLARE = minutes of preflare event time
               to consider [def=0]

 Outputs     : FTIMES = times that overlap event start/stop times

 Keywords    : COUNT = # of overlapping times

 CALLS: ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST
	RD_GEV, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], decode_gev
	get_uniq, is_number [1], is_number [2]
 CALLED BY:
	SITE__DEFINE
 History     : Written 18 Jul 2001, D. Zarro, EITI/GSFC

 Contact     : dzarro@solar.stanford.edu


FILTER_IMAGE $SSW/gen/idl_libs/astron/image/filter_image.pro
[Previous] [Next]
 NAME:
       FILTER_IMAGE

 PURPOSE:
       Identical to MEDIAN or SMOOTH but handle edges and allow iterations.
 EXPLANATION:
       Computes the average and/or median of pixels in moving box,
       replacing center pixel with the computed average and/or median,
       (using the IDL SMOOTH() or MEDIAN() functions).
       The main reason for using this function is the options to
       also process the pixels at edges and corners of image, and,
       to apply iterative smoothing simulating convolution with Gaussian,
       and/or to convolve image with a Gaussian kernel.

 CALLING SEQUENCE:
       Result = filter_image( image, SMOOTH=width, MEDIAN = width, /ALL_PIXELS
                               /ITERATE, FWHM =,  /NO_FT_CONVOL)

 INPUT:
       image = 2-D array (matrix)

 OPTIONAL INPUT KEYWORDS:
       SMOOTH = scalar (odd) integer specifying the width of a square box 
               for moving average, in # pixels.  /SMOOTH  means use box 
               width = 3 pixels for smoothing.

        MEDIAN = scalar (usually odd) integer specifying the width of square 
               moving box for median filter, in # pixels.   /MEDIAN  means use
               box width = 3 pixels for median filter.
   
       /ALL_PIXELS causes the edges of image to be filtered as well.   This
               is accomplished by reflecting pixels adjacent to edges outward
               (similar to the /EDGE_WRAP keyword in CONVOL).
               Note that this is a different algorithm from the /EDGE_TRUCATE 
               keyword to SMOOTH or CONVOL, which duplicates the nearest pixel.   

       /ITERATE means apply smooth(image,3) iteratively for a count of
               (box_width-1)/2 times (=radius), when box_width >= 5.
               This is equivalent to convolution with a Gaussian PSF
               of FWHM = 2 * sqrt( radius ) as radius gets large.
               Note that /ALL_PIXELS is automatically applied,
               giving better results in the iteration limit.
               (also, MEDIAN keyword is ignored when /ITER is specified).

       FWHM_GAUSSIAN = Full-width half-max of Gaussian to convolve with image. 
                       FWHM can be a single number (circular beam),
                       or 2 numbers giving axes of elliptical beam.

       /NO_FT_CONVOL causes the convolution to be computed directly,
               with intrinsic IDL CONVOL function.   The default is to use 
               FFT when factors of size are all LE 13.   Note that 
               external function convolve.pro handles both cases)

 OPTIONAL INPUT/OUTPUT KEYWORD:
     PSF = Array containing the PSF used during the convolution.   This 
           keyword is only active if the FWHM_GAUSSIAN keyword is also 
           specified.     If PSF is undefined on input, then upon output it
           contains the Gaussian convolution specified by the FWHM_GAUSSIAN
           keyword.    If the PSF array is defined on input then it is used 
           as the convolution kernel,  the value of the  FWHM_GAUSSIAN keyword
           is ignored.      Typically, on a first call set PSF to an undefined
           variable, which can be reused for subsequent calls to prevent 
           recalculation of the Gaussian PSF.
 RESULT:
       Function returns the smoothed, median filtered, or convolved image.
       If both SMOOTH and MEDIAN are specified, median filter is applied first.

 CALLS: ***
	CONVOLVE, FACTOR, PSF_GAUSSIAN [1], PSF_GAUSSIAN [2]
 CALLED BY:
	REMOVE_CR, SIGMA_FILTER, point_filter, sigma_mask
 EXAMPLES:
       To apply 3x3 moving median filter and
       then 3x3 moving average, both applied to all pixels:

               Result = filter_image( image, /SMOOTH, /MEDIAN, /ALL )

       To iteratively apply 3x3 moving average filter for 4 = (9-1)/2 times,
       thus approximating convolution with Gaussian of FWHM = 2*sqrt(4) = 4 :

               Result = filter_image( image, SMOOTH=9, /ITER )

       To convolve all pixels with Gaussian of FWHM = 3.7 x 5.2 pixels:

               Result = filter_image( image, FWHM=[3.7,5.2], /ALL )

 EXTERNAL CALLS:
       function psf_gaussian
       function convolve
       pro factor
       function prime          ;all these called only if FWHM is specified

 PROCEDURE:
       If both /ALL_PIXELS (or /ITERATE)  keywords are set then
       create a larger image by reflecting the edges outward, then call the 
       IDL MEDIAN() or SMOOTH() function on the larger image, and just return 
       the central part (the original size image).

       NAN values are recognized during calls to MEDIAN() or SMOOTH(), but 
       not for convolution with a Gaussian (FWHM keyword supplied). 
 HISTORY:
       Written, 1991, Frank Varosi, NASA/GSFC.
       FV, 1992, added /ITERATE option.
       FV, 1993, added FWHM_GAUSSIAN= option.
       Converted to IDL V5.0   W. Landsman   September 1997
       Use /EVEN call to median, recognize NAN values in SMOOTH 
                  W. Landsman   June 2001
       Added PSF keyword,   Bjorn Heijligers/WL, September 2001


FIND $SSW/gen/idl_libs/astron/idlphot/find.pro
[Previous] [Next]
 NAME:
	FIND
 PURPOSE:
	Find positive brightness perturbations (i.e stars) in an image 
 EXPLANATION:
	Also returns centroids and shape parameters (roundness & sharpness).
	Adapted from 1986 STSDAS version of DAOPHOT.

 CALLING SEQUENCE:
	FIND, image, [ x, y, flux, sharp, round, hmin, fwhm, roundlim, sharplim 
		PRINT= , /SILENT ]

 INPUTS:
	image - 2 dimensional image array (integer or real) for which one
		wishes to identify the stars present

 OPTIONAL INPUTS:
	FIND will prompt for these parameters if not supplied

	hmin -  Threshold intensity for a point source - should generally 
		be 3 or 4 sigma above background
	fwhm  - FWHM to be used in the convolve filter
	sharplim - 2 element vector giving low and high cutoff for the
		sharpness statistic (Default: [0.2,1.0] ).   Change this
		default only if the stars have significantly larger or 
		or smaller concentration than a Gaussian
	roundlim - 2 element vector giving low and high cutoff for the
		roundness statistic (Default: [-1.0,1.0] ).   Change this 
		default only if the stars are significantly elongated.

 OPTIONAL INPUT KEYWORDS:
	/SILENT - Normally, FIND will write out each star that meets all
		selection criteria.   If the SILENT keyword is set and 
		non-zero, then this printout is suppressed.
	PRINT - if set and non-zero then FIND will also write its results to
		a file find.prt.   Also one can specify a different output file 
		name by setting PRINT = 'filename'.

 OPTIONAL OUTPUTS:
	x - vector containing x position of all stars identified by FIND
	y-  vector containing y position of all stars identified by FIND
	flux - vector containing flux of identified stars as determined
		by a Gaussian fit.  Fluxes are NOT converted to magnitudes.
	sharp - vector containing sharpness statistic for identified stars
	round - vector containing roundness statistic for identified stars

 NOTES:
	(1) The sharpness statistic compares the central pixel to the mean of 
       the surrounding pixels.   If this difference is greater than the 
       originally estimated height of the Gaussian or less than 0.2 the height of the
	Gaussian (for the default values of SHARPLIM) then the star will be
	rejected. 

       (2) More recent versions of FIND in DAOPHOT allow the possibility of
       ignoring bad pixels.    Unfortunately, to implement this in IDL
       would preclude the vectorization made possible with the CONVOL function
       and would run extremely slowly.
 PROCEDURE CALLS:
	GETOPT()
 REVISION HISTORY:
	Written W. Landsman, STX  February, 1987
	ROUND now an internal function in V3.1   W. Landsman July 1993
	Change variable name DERIV to DERIVAT    W. Landsman Feb. 1996
	Use /PRINT keyword instead of TEXTOUT    W. Landsman May  1996
	Changed loop indices to type LONG       W. Landsman Aug. 1997
	Converted to IDL V5.0   W. Landsman   September 1997
       Replace DATATYPE() with size(/TNAME)   W. Landsman Nov. 2001
       Fix problem when PRINT= filename   W. Landsman   October 2002
       Fix problems with >32767 stars   D. Schlegel/W. Landsman Sep. 2004
 CALLS:
 CALLED BY
	T_FIND


FIND_ALL_DIR [1] $SSW/gen/idl/system/find_all_dir.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FIND_ALL_DIR()

 Purpose     :	Finds all directories under a specified directory.

 Explanation :	This routines finds all the directories in a directory tree
		when the root of the tree is specified.  This provides the same
		functionality as having a directory with a plus in front of it
		in the environment variable IDL_PATH.

 Use         :	Result = FIND_ALL_DIR( PATH )

		PATHS = FIND_ALL_DIR('+mypath', /PATH_FORMAT)
		PATHS = FIND_ALL_DIR('+mypath1:+mypath2')

 Inputs      :	PATH	= The path specification for the top directory in the
			  tree.  Optionally this may begin with the '+'
			  character but the action is the same unless the
			  PLUS_REQUIRED keyword is set.

			  One can also path a series of directories separated
			  by the correct character ("," for VMS, ":" for Unix)

 Opt. Inputs :	None.

 Outputs     :	The result of the function is a list of directories starting
		from the top directory passed and working downward from there.
		Normally, this will be a string array with one directory per
		array element, but if the PATH_FORMAT keyword is set, then a
		single string will be returned, in the correct format to be
		incorporated into !PATH.

 Opt. Outputs:	None.

 Keywords    :	PATH_FORMAT	= If set, then a single string is returned, in
				  the format of !PATH.

		PLUS_REQUIRED	= If set, then a leading plus sign is required
				  in order to expand out a directory tree.
				  This is especially useful if the input is a
				  series of directories, where some components
				  should be expanded, but others shouldn't.

		RESET	= Often FIND_ALL_DIR is used with logical names.  It
			  can be rather slow to search through these
			  subdirectories.  The /RESET keyword can be used to
			  redefine an environment variable so that subsequent
			  calls don't need to look for the subdirectories.

			  To use /RESET, the PATH parameter must contain the
			  name of a *single* environment variable.  For example

				setenv,'FITS_DATA=+/datadisk/fits'
				dir = find_all_dir('FITS_DATA',/reset,/plus)

			  The /RESET keyword is usually combined with
			  /PLUS_REQUIRED.

 Calls       : ***
	BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], FIND_WITH_DEF [1]
	FIND_WITH_DEF [2], FIND_WITH_DEF [3]
 CALLED BY:
	CHECK_INTEG, CMP_LIBS, CMP_TREES, FIND_FILES, FIX_ZDBASE, HESSI_DATA_PATHS [1]
	HESSI_DATA_PATHS [2], IDL5TO4, MK_RASTER, MK_SUMER_DBASE, QZDBASE, SET_CDS_SDB
	SHOW_DATAWIN, SHOW_LINELIST, SHOW_RASTER, SHOW_STUDY, hessi_grid_trans
 Common      :	None.

 Restrictions:	PATH must point to a directory that actually exists.

		On VMS computers this routine calls a command file,
		FIND_ALL_DIR.COM, to find the directories.  This command file
		must be in one of the directories in IDL's standard search
		path, !PATH.

		This procedure does not yet work in MacOS.  However, some
		routines may call this routine anyway with the /PLUS_REQUIRED
		keyword.  This should be safe to do.

 Side effects:	None.

 Category    :	Utilities, Operating_system.

 Prev. Hist. :	None.

 Written     :	William Thompson, GSFC, 3 May 1993.

 Modified    :	Version 1, William Thompson, GSFC, 3 May 1993.
		Version 2, William Thompson, GSFC, 6 July 1993.
			Added sort to spawned command under Unix.
		Version 3, William Thompson, GSFC, 16 May 1995
			Modified to support multiple directories.
			Added keyword PLUS_REQUIRED
		Version 4, William Thompson, GSFC, 6 August 1996
			Added keyword RESET
			Fixed bug that caused routine to not work right with
			environment variables that started with "+"
		Version 5, William Thompson, GSFC, 9 August 1996
			Try to trap errors where invalid environment names are
			passed.
		Version 6, William Thompson, GSFC, 20 August 1996
			Fixed bug when trying to reset environment variable
			that only points to a single directory.
		Version 7, William Thompson, GSFC, 13 February 1998
			Include Windows and MacOS seperators.
		Version 8, William Thompson, GSFC, 8 June 1998
			Include call to FIND_WIND_DIR.  This gives complete
			functionality under Windows.
		Version 9, William Thompson, GSFC, 30-Nov-1999
			Include call to IS_DIR
		Version 10, William Thompson, GSFC, 03-Dec-1999
			Don't use IS_DIR output in Unix--possible problem with
			automount on some systems.
               Version 11, Zarro (SM&A/GSFC), 23-March-00
                       Removed all calls to IS_DIR
		Version 12, William Thompson, GSFC, 02-Feb-2001
			In Windows, use built-in expand_path if able.
		Version 13, William Thompson, GSFC, 23-Apr-2002
			Follow logical links in Unix
			(Suggested by Pascal Saint-Hilaire)
		Version 14, Zarro (EER/GSFC), 26-Oct-2002
			Saved/restored current directory to protect against
                       often mysterious directory changes caused by 
                       spawning FIND in Unix
               Version 15, William Thompson, GSFC, 9-Feb-2004
                       Resolve environment variables in Windows.

 Version     :	Version 15


FIND_ALL_DIR [2] $SSW/gen/idl_libs/astron/misc/find_all_dir.pro
[Previous] [Next]
 NAME:
       FIND_ALL_DIR()
 PURPOSE:
       Finds all directories under a specified directory.
 EXPLANATION:
       This routine finds all the directories in a directory tree when the
       root of the tree is specified.  This provides the same functionality as
       having a directory with a plus in front of it in the environment
       variable IDL_PATH.

 CALLING SEQUENCE:
       Result = FIND_ALL_DIR( PATH )

               PATHS = FIND_ALL_DIR('+mypath', /PATH_FORMAT)
               PATHS = FIND_ALL_DIR('+mypath1:+mypath2')

 INPUTS:
       PATH    = The path specification for the top directory in the tree.
               Optionally this may begin with the '+' character but the action
               is the same unless the PLUS_REQUIRED keyword is set.

               One can also path a series of directories separated
               by the correct character ("," for VMS, ":" for Unix)

 OUTPUTS:
       The result of the function is a list of directories starting from the
       top directory passed and working downward from there.   Normally, this
       will be a string array with one directory per array element, but if
       the PATH_FORMAT keyword is set, then a single string will be returned,
       in the correct format to be incorporated into !PATH.

 OPTIONAL INPUT KEYWORDS:
       PATH_FORMAT     = If set, then a single string is returned, in
                                 the format of !PATH.

       PLUS_REQUIRED   = If set, then a leading plus sign is required
                       in order to expand out a directory tree.
                       This is especially useful if the input is a
                       series of directories, where some components
                       should be expanded, but others shouldn't.

       RESET   = Often FIND_ALL_DIR is used with logical names.  It
               can be rather slow to search through these subdirectories.
               The /RESET keyword can be used to redefine an environment
               variable so that subsequent calls don't need to look for the
               subdirectories.

               To use /RESET, the PATH parameter must contain the name of a
               *single* environment variable.  For example

                               setenv,'FITS_DATA=+/datadisk/fits'
                               dir = find_all_dir('FITS_DATA',/reset,/plus)

               The /RESET keyword is usually combined with /PLUS_REQUIRED.

 PROCEDURE CALLS:
       DEF_DIRLIST, FIND_WITH_DEF(), BREAK_PATH()

 CALLS: ***
	BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], FIND_WITH_DEF [1]
	FIND_WITH_DEF [2], FIND_WITH_DEF [3]
 CALLED BY:
	CHECK_INTEG, CMP_LIBS, CMP_TREES, FIND_FILES, FIX_ZDBASE, HESSI_DATA_PATHS [1]
	HESSI_DATA_PATHS [2], IDL5TO4, MK_RASTER, MK_SUMER_DBASE, QZDBASE, SET_CDS_SDB
	SHOW_DATAWIN, SHOW_LINELIST, SHOW_RASTER, SHOW_STUDY, hessi_grid_trans
 RESTRICTIONS:
       PATH must point to a directory that actually exists.

 REVISION HISTORY:
               Version 11, Zarro (SM&A/GSFC), 23-March-00
                       Removed all calls to IS_DIR
               Version 12, William Thompson, GSFC, 02-Feb-2001
                       In Windows, use built-in expand_path if able.
               Version 13, William Thompson, GSFC, 23-Apr-2002
                       Follow logical links in Unix
                       (Suggested by Pascal Saint-Hilaire)
               Version 14, Zarro (EER/GSFC), 26-Oct-2002
                       Saved/restored current directory to protect against
                       often mysterious directory changes caused by 
                       spawning FIND in Unix
               Version 15, William Thompson, GSFC, 9-Feb-2004
                       Resolve environment variables in Windows.

 Version     : Version 16 W. Landsman GSFC Sep 2006
                        Remove VMS support


FIND_CAT $SSW/gen/idl/help/find_cat.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : FIND_CAT

 Category    : Utility

 Purpose     : Find and list routines matching input category string

 Explanation : Used in WWW category search engine

 Syntax      : IDL> find_cat,category

 Inputs      : CATEGORY = category name (e.g. widgets)

 Opt. Inputs : None

 Outputs     : ITEMS = listing of matching routines

 Opt. Outputs: None

 Keywords    : FILE = output file for listing (otherwise goes to screen)
               RESET = force reading of SSW databases
               COUNT = number of hits
               GEN = only search GEN branches
               BEST = search BESTOF database
               CLEAN = name of temporary files to delete 
               PURPOSE = append purpose to listing
               MINCHAR = min chars required for input category name
               NAME = set to search by name
               EXACT = set for exact match
               SITE = search SITE specific info databases
               UPDATE = update memory copy of DBASE if disk copy changed

 CALLS: ***
	ANYTIM2TAI, APPEND_ARR, ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2]
	BREAK_FILE [3], CACHE_DATA, CHKLOG [1], CHKLOG [2], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], ESPAWN, EXIST, NINT [1], NINT [2], PR_SYNTAX, RM_FILE, STR2ARR [1]
	STR2ARR [2], STREP [1], STREP [2], STREP [3], STREP [4], STREP [5], STRIP_WILD, TRIM
	break_file [4], file_info2 [1], file_info2 [2], rd_tfile [1], rd_tfile [2]
	str_replace [1], str_replace [2]
 History     : Version 1,  1-Oct-1998,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


find_changes $SSW/gen/idl/util/find_changes.pro
[Previous] [Next]
 Project     : HESSI

 Name        : find_changes

 Purpose     : Procedure to find changes of value in an array.

 Category    : Utility

 Syntax      : IDL> find_changes, inarray, index, state [, count=count]

 Explanation : Output are two arrays:  an array of indices into inarray where the value of
               the array changes, and an array of the value of inarray at each change. Note
               that the start of the array is considered a change, so element 0, and starting
               value will always be included in the output arrays.  If you just want changes
               in the array, ignore the first element in the output arrays.

 Inputs      : inarray - input vector

 Opt. Input Keywords : None

 Outputs     : index - vector of indices into array where value changes
               state - vector of values at beginning of each value change

 Opt. Output Keywords: count - number of changes found

 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION, XDIFF
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
 Examples:
 IDL> inarray = [0,0,2,2,3,3,3,0,0,2]
 IDL> find_changes, inarray, index, state
 IDL> print,index
           0   2  4  7  9
 IDL> print,state
           0  2  3  0  2

 Common      : None

 Restrictions: None

 Side effects: None

 History     : 28-Jan-2002, Kim Tolbert

 Contact     : kim.tolbert@gsfc.nasa.gov


FIND_COMMON $SSW/gen/idl/util/find_common.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_COMMON()
               
 Purpose     : Find which elements are common to the input vectors.
               
 Explanation : Returns the indices of the elements in second vector which
               are also present in the first vector.
               
 Use         : IDL> c = find_common(first, second)
    
 Inputs      : first  -  vector to be searched
               second -  search vector
               
 Opt. Inputs : None
               
 Outputs     : Function returns indices of elements in second vector which
               are common to first and second vectors
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	REM_DUP [1], REM_DUP [2], REM_DUP [3]
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 9-Nov-94
               
 Modified    : Make loop variable LONG.  CDP, 1-Oct-97

 Version     : Version 2, 1-Oct-97


FIND_COMPRESSED $SSW/gen/idl/system/find_compressed.pro
[Previous] [Next]
 Project     : SOHO-SUMER

 Name        : FIND_COMPRESSED

 Purpose     : find compressed version of a file

 Category    : utility,i/o

 Explanation : looks for an input file. If not found, looks for a 
               compressed version (.Z, and .gz), decompresses it 
               into a temporary directory and returns full path to it.

 Syntax      : dfile=find_compressed(file)

 Inputs      : FILE = file to locate

 Opt. Inputs : None

 Outputs     : DFILE = decompressed file (path+name)

 Keywords    : ERR = error message
               STATUS = 1 if decompressed version returned
               TEMP_DIR = name of temporary directory in which
                         decompressed files are saved ($HOME/.decompressed)
               USE_DIR = user specified directory for decompressed files
               LOOK_ONLY = look only, but don't uncompress
               LIMIT = number of decompressed files to keep in temporary
                       directory

 CALLED BY:
	EIS_GET_HDR [1], EIS_GET_HDR [2], EIT__DEFINE, FITS__DEFINE, GET_SUMER_FLAT
	HXRS__DEFINE, ITOOL_RD_FITS, MRD_HEAD, READ_EIT_FILE
	Radiospectrogram FITS File reader [1], XCAT, rd_sumer [1], rd_sumer [2]
	rd_week_file [2], weekid [2], ydb_exist [2]
 Restrictions: Unix/Windows only

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DPRINT, EXIST, GET_TEMP_DIR, GREP, IS_BLANK, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], PR_SYNTAX, TRIM, WRITE_DIR, break_file [4]
	concat_dir [4], is_number [1], is_number [2], str_replace [1], str_replace [2]
	uncompress
 Side effects: TEMP_DIR is created

 History     : Written 10 Jan 1999, D. Zarro (SMA/GSFC)
               Modified 15 Feb 2000, Zarro (SM&A/GSFC) -- check
                for directory creation 
               Modified 15 April 2000, Zarro (SM&A/GSFC) -- made Windows
                compatible
               Modified 31 May 2002, Zarro (LAC/GSFC) - added check
                for invalid USE_DIR
               Modified 10 Feb 2004, Zarro (L-3Com/GSFC) - added LIMIT
               Modified 17 Sep 2005, Zarro (L-3Com/GSFC) - replaced TEST_DIR
                by WRITE_DIR.

 Contact     : dzarro@solar.stanford.edu


find_contig [1] $SSW/gen/idl/util/find_contig.pro
[Previous] [Next]
NAME:
	find_contig
PURPOSE:
	Find the contiguous subscripts.  Used for finding
	unique peaks.
METHOD:
	Return the first subscript

	a = [4,5,6,  10,  21,22]  returns [4,10,21]
	a = [1,    10,    30]     returns [1,10,30]
	a = [1,2,3,4]		  returns [1]
	a = 10			  returns 10
 CALLS: ***
	deriv_arr [1], deriv_arr [2]
 CALLED BY:
	SPEX__DEFINE, get_pks
HISTORY:
   Written 29-Jul-97 by M.Morrison
   22-Jun-2004, Kim Tolbert.  Added ss_sel_2d argument to return 2-d array of
     start,end indices for contiguous ranges. If a=[4,5,6,  10,  21,22], then
     ss_sel_2d is [3,2] and equals [ [0,3,4], [2,3,5] ].  If a=[4,5,6] then
     ss_sel_2d equals [0,2]


find_contig_ranges $SSW/gen/idl/util/find_contig_ranges.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  find_contig_ranges

 PURPOSE:  Compress a set of ranges to leave only the non-contiguous ranges.
 CALLED BY:
	SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPEX__DEFINE, XDIFF, XYPLOT__DEFINE
	Example:  If vals equals the following intarr(2,3):
	[2,4]
	[4,8]
	[10,12]
	[12,14]
	then result=find_contig_ranges(vals) would return:
	[2,8]
	[10,14]

 CATEGORY: UTIL

 CALLING SEQUENCE:  result = find_contig_ranges(vals)

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
	EPSILON - If end of interval is within epsilon of start of next interval,
	  they're considered contiguous.


 OUTPUTS:  2xn array of noncontiguous ranges.  If input array is not (2,n) then
	returns -1.

 OPTIONAL OUTPUTS:  None

 Calls: ***
	CHECKVAR [1], checkvar [2]
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: Assumes vals array is monotonically increasing

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, 30-Apr-2001
	Modifications:
	29-Jul-2003, Added epsilon keyword.
	15-Mar-2006, Correct epsilon check - difference should be divided by magnitude of numbers
	  and changed epsilon default to 1.e-7
	16-Mar-2006, Kim.  Correct again.  For integers just check difference, for non-integers,
	  check difference divided by magnitude.


FIND_DATA_RUNS $SSW/gen/idl/util/find_data_runs.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_DATA_RUNS()
               
 Purpose     : Detect runs of data in an array and return their boundaries.
               
 Explanation : This function finds valid data windows in a data array. 
               Valid windows are those containing data not having a value 
               equal to the 'invalid' flag and having at least 'min_data_win' 
               valid data points in them. Groups with less than this number 
               of data points are ignored. A break in the data window is 
               also considered to have occurred if the time interval between 
               successive valid data points is greater than 'max_time_int'
               units. 
               
 Use         : IDL> limits = find_data_runs(x, y, invalid, min_data_win, $
                                            max_time_int [,maxrun=maxrun])
    
 Inputs      : x        -  input data array 'time' values

               y        -  input data array data values

               invalid  -  value of datum to be ignored

               min_wind_size  -  chosen data runs must contain at least this 
                                 many data points otherwise they are ignored.

               max_time_step  -  maximum 'time' step which is considered 
                                 legitimate within a window. If two 
                                 consecutive data points in the x array are 
                                 separated in value by more than this then a 
                                 new data window is started.

               
 Opt. Inputs : None
               
 Outputs     : Function returns start and stop indices (in input arrays) of
               runs of valid data as a 2-d array. eg:
                  dw = find_data_runs(x,y.......)
               then dw(0,0) will be the start index of the first run
                    dx(0,1) the stop index of the first run
                    dx(1,0) the start index of the second run etc etc

               Example:
                          y = [0,0,1,1,1,0,0,0,1,1,0,1,1]
                          dw = find_data_runs(indgen(13),y,0,0,1)
                          print, dw  will give
                           2  8  11
                           4  9  12

               An array [-1,-1] is returned if no valid data runs are found.
               
 Opt. Outputs: None
               
 Keywords    : maxrun - max number of data points in a run.  A new run
                        is started when this limit is reached.

 Calls       : None
 Restrictions: x and y array inputsmust be of the same size.
               
 Side effects: None
               
 Category    : Util, misc
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 16-Nov-93
               
 Modified    : Add maxrun keyword.  CDP, 1-Nov-94

 Version     : Version 2, 1-Nov-94


FIND_DRAW_WIDGET $SSW/gen/idl/widgets/find_draw_widget.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_DRAW_WIDGET()
               
 Purpose     : Find the widget ID corresponding to a draw window.
               
 Explanation : To use the WIDGET_EVENT routine instead of the CURSOR
               procedure one needs to be able to find out whether a draw
               window is actually a WIDGET_DRAW window, if this is not known
               a priori.

               This routine simplifies the rewrites necessary to convert
               CURSOR-dependent routines into widget-driven
               routines. FIND_DRAW_WIDGET() finds and returns the WIDGET_DRAW
               ID of the window (if it exists) by performing a search through
               possible widget IDs. If the corresponding widget ID is not
               found, -1L is returned.

               The routine assumes that widgets are given ever-increasing ID
               numbers, starting from 0L (or higher).

               The routine is also a lot faster than one would expect for
               such an exhaustive search - partially because of a cache
               system keeping track of which widgets have been searched.

 Use         : WIDGET = FIND_DRAW_WIDGET(WINDOW)
    
 Inputs      : WINDOW : The window number (as in WSET,WINDOW)
 
 Opt. Inputs : None.
               
 Outputs     : Returns the WIDGET_DRAW ID corresponding to the draw window,
               or -1L if none is found (this means the draw window is *not* a
               widget window).
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : None.
 CALLED BY:
	BOX_CURSOR, BOX_CURSOR2, ITOOL_ZOOM, TVPROFILE, XCROP_CUBE
 Common      : None.
               
 Restrictions: Assumes widgets are given ever-increasing ID numbers starting
               from zero (or higher).
               
 Side effects: None.
               
 Category    : Display, Widgets
               
 Prev. Hist. : None.

 Written     : Stein Vidar H. Haugan, UiO, 15 May 1997
               
 Modified    : Not yet.

 Version     : 1, 15 May 1997


FIND_DUP $SSW/gen/idl/util/find_dup.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_DUP()
               
 Purpose     : Function to identify duplicate values in a vector. 
               
 Explanation : The function returns a vector pointing to duplicated values
               in the input array such that
                         print,a(find_dup(a))
               will print a list of duplicate values. But beware that the
               function returns a value -1 if no duplicates are found.
               
 Use         : result = find_dup(vector)  

 Inputs      : vector - vector of values from which duplicates are to be found
               
 Opt. Inputs : None
               
 Outputs     : A vector of subscripts in 'vector' is returned.  Each subscript
               points to a duplicated value. If no duplicates are found, a
               value -1 is returned.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	BSORT [1], BSORT [2], BSORT [3], BSORT [4]
 CALLED BY:
	CHECK_CONFLICT, extract_val, hsi_params_write_pro, ospex_params_write_pro
	url_decode
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, misc
               
 Prev. Hist. : Based on REM_DUP by D. Lindler  Mar. 87

 Written     : CDS version by C D Pike, RAL, 12-Nov-93
               
 Modified    : Use BSORT to maintain order.  CDP, 9-Nov-94
		Version 3, 22-May-1997, William Thompson, GSFC
			Changed so that loop variable is a long integer
		Version 4, 27-May-1997, William Thompson, GSFC
			Changed so that NDUP is also long

 Version     : Version 4, 27-May-1997


FIND_EDGE_INTERCEPT $SSW/gen/idl/display/find_edge_intercept.pro
[Previous] [Next]
 NAME:
	FIND_EDGE_INTERCEPT

 PURPOSE:
	Finds where the line defined by xline,yline hits the edges of the current plot box
 	Results returned in xedge, yedge

 CATEGORY: HESSI, Graphics

 CALLING SEQUENCE:
	FIND_EDGE_INTERCEPT, xline, yline, xedge, yedge

 INPUTS:
	xline - 2-element array of x coordinates of endpoints of line
	yline - 2-element array of y coordinates of endpoints of line

 OUTPUTS:
	xedge - 2-element array of x coordinates of where line crosses plot boundary
	yedge - 2-element array of y coordinates of where line crosses plot boundary

 CALLS: ***
	CRANGE, REVERSE, xy_dist
 CALLED BY:
	PROFILES2
 EXAMPLE:
	plot,findgen(20)+5, findgen(20)+30, /xlog,/ylog
	xline=[14,15]
	yline=[40,45]
	find_edge_intercept, xline, yline, xedge, yedge
	plots,xline,yline
	plots,xedge,yedge
	print,xedge,yedge
	      23.9456      6.21533
	      100.000      10.0000

 Kim Tolbert, March 2002.  Extracted from profiles2.
 Modifications:
	22-Jun-2005, Kim.  Do calcs in double so we don't lose anything if inputs were double


FIND_FID $SSW/gen/idl/time/find_fid.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FIND_FID

 Purpose     : find files based on encoded fid names (yymmdd_hhmm)

 Category    : HESSI, GBO, utility

 Explanation : 

 Syntax      : IDL> find_fid,tstart,tend,files

 Inputs      : TSTART = search start time
               TEND   = search end time

 Opt. Inputs : None

 Outputs     : FILES = found files (rounded to nearest day)

 Opt. Outputs: None

 Keywords    : EXT = extension to search for (def = '.gif')
               INDIR = root directory name to search
               COUNT = # of files found
               PATTERN = special pattern to search for (def = '*')

 CALLS: ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATE_CODE, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	GET_UTC, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PR_SYNTAX, concat_dir [4]
	curdir [1], curdir [2], data_chk [1], data_chk [2], delvarx [5]
 CALLED BY:
	REBIN_FID
 Common      : None

 Restrictions: Unix systems only.
               Assumes files are stored in subdirs encoded with "ext/yymmdd".

 Side effects: None

 History     : Version 1,  14-April-1999,  D.M. Zarro (SM&A/GSFC),  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FIND_FILE $SSW/gen/idl/system/find_file.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_FILE()
               
 Purpose     : Fixing builtin FINDFILE() problem
               
 Explanation : The builtin FINDFILE() function has problems on some unixes
               whenever *a lot* of files are matching the file
               specification. This is due to the fact that filename expansion
               is done by the shell *before* interpreting a command. Too many
               files cause too long commands, which are not accepted.  This
               causes FINDFILE() to return an empty list of candidates.

               FIND_FILE tries the builtin function first, and whenever the
               returned list of files is empty, it tries to recheck through
               spawning a "find" command.

               Since FINDFILE doesn't discriminate between directories, links
               and files, this function will not do this either.

               Under unix, however, calls like FINDFILE("*") returns the
               unfiltered output of the shell commmand "ls *", including
               colon-terminated lines for each subdirectory matching the
               specification and empty lines separating each subdirectory
               listing. Such silly effects are not implemented in the "find"
               version. Be warned, however, that these effects are present
               when the builtin function does not "fail" due to a too long
               file list.

               It is possible (under unix) to use the "find" method as
               default by setting the keyword /USEFIND (no effect under other
               operating systems).
               
 Use         : files = find_file(file_specification)
    
 Inputs      : file_specification : A scalar string used to find
                                    files. See FINDFILE()
               
 Opt. Inputs : None.
               
 Outputs     : Returns a list of files or a blank string if none found.
               
 Opt. Outputs: 
               
 Keywords    : COUNT : Returns the number of files

               USEFIND : Always use a spawned "find" command under unix.
                         No effect under other operating systems.

		NODOT : Apply a filter to the results from find to prevent
			finding the directory itself in a large file expansion.
			eg 'find_file,"foo/*"' returns ("foo/","foo/a",...)
			but 'find_file,"foo/*",/nodot' returns
			("foo/a","foo/b",...) without the leading "foo/".
			This behavior is closer to the behavior of findfile()
			without the long-directory braindamage.  It is
			*not* the default so as not to break heritage
			code that uses find_file().

 Calls       : ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], OS_FAMILY, break_file [4]
 CALLED BY:
	CAT_DIRECTORY, CDSPICKFILE, CF_GIS1A, CF_GIS1B, CF_GIS1C, CF_GIS2A [1], CF_GIS4A
	CF_GIS4B, CF_GIS4C, EIT_DISPLAY, FIND_FILES, GIS_CALIB_FF_LTGD, GIS_ERROR
	GIS_HV_CAL, IDL5TO4, OVSA_EXPLORER formerly OVSA_PRESUB, REGEN_SYNOP
	UPDATE_SXT_CO_INDEX, drm_4_spex [1], drm_4_spex [2], fix_decon_pits
	op_term_score
 Common      : None
               
 Restrictions: As for FINDFILE
               
 Side effects: None, hopefully
               
 Category    : Utilities, Operating_system
               
 Prev. Hist. : Lots of problems with FINDFILE is hopefully history.

 Written     : S.V.H. Haugan, UiO, 12 April 1996
               
 Modified    : Version 2, SVHH, 10 June 1996
                       Moved the CD,curr_path command to avoid
                       returns without resetting path.
               Version 3, SVHH, 26 June 1996
                       Took away the -type f argument to find, added
                       /USEFIND keyword.
 	      : Added /nodot keyword C. DeForest 9-August-1998

 Version     : 3, 26 June 1996


FIND_FILES $SSW/gen/idl/system/find_files.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_FILES
               
 Purpose     : Find multiple files in a multiple path
               
 Explanation : FIND_FILES splits the supplied PATHS string by calling
               FIND_ALL_DIR and then loops over all paths calling FIND_FILE()
               with each path plus the file specification, returning the full
               list of matching files. The supplied file specification may
               contain standard wildcard characters.
               
 Use         : filelist = FIND_FILES(FILE_SPEC,PATHS)
    
 Inputs      : FILE_SPEC: File specification, e.g., "s*r00.fits". Should
                          *not* contain any path. Scalar string.
               
               PATHS: Scalar string containing one or more default paths to
                      search for files matching the file specification. See
                      FIND_ALL_DIR for a more detailed description. The
                      current directory is NOT searched.

 Opt. Inputs : None.
               
 Outputs     : Returns a string array with full path names of each file
               matching the file specification. If no files are found
               an empty string is returned.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FIND_ALL_DIR [1]
	FIND_ALL_DIR [2], FIND_ALL_DIR [3], FIND_FILE, PARCHECK, TYP, concat_dir [4]
 CALLED BY:
	CAT_DURATION, CAT_FITS, CDS_MOSAIC, CFITSLIST, FIND_DURATION, HSI_CHK_DUPLICATE
	IDL5TO4, LIST_FITS, MK_HEAD_CAT, SFITSLIST, hsi_params_write_pro
	ospex_params_write_pro
 Common      : None.
               
 Restrictions: Mmmm?
               
 Side effects: None known.
               
 Category    : Utilities, Operating_system
               
 Prev. Hist. : Multi-path CDS_FITS_DATA created a need for it.

 Written     : SVH Haugan, UiO, 23 April 1996
               
 Modified    : Version 2, 6 August 1996
                       Using find_all_dir for +/dir expansion, and using
                       concat_dir in an attempt to be portable.
               16 May 2006, Zarro (L-3Com/GSFC) - added temporary()


find_fits_bad $SSW/gen/idl/goes/find_fits_bad.pro
[Previous] [Next]
 Finds the element numbers in tarray and yarray that have bad points that
 need to be eliminated and interpolated over.  Bad points means any of the
 following are true:
   1. flux value is -99999.
   2. the moon is eclipsing the Sun
   3. the detector is off
   4. the detector is being calibrated
   5. the channel is going through a gain change
 The bad elements numbers are returned for channels 0 and 1 in bad0 and bad1.

 Kim Tolbert 7/13/93
 Modifications:
 9-Dec-2005 - stop printing the whoops message if no times match status times. With
   new goes obj, could have status from a large time interval, but tarray from a subset.

 CALLED BY
	CLEAN_GOES


find_fits_ext $SSW/gen/idl/fits/find_fits_ext.pro
[Previous] [Next]
 NAME:
  find_fits_ext

 PURPOSE:
  Find extension numbers of FITS files with given EXTNAME parameter

 CATEGORY: FITS, UTIL

 CALLING SEQUENCE:
  ; Find the second 'rate' extension in the file 'some_fits_file.fits.'
  find_fits_ext, file='some_fits_file.fits', setno=2, extname='rate'

 INPUTS:
  FILE - name of FITS file to search in.
  EXTNAME - name of extension to search for in FILE.

 OPTIONAL INPUT KEYWORDS:
  EXTNO - number of extension to read.  Useful to see if extension N
          has extname NAME.
  SETNO - Set this to number of the extensions with EXTNAME to
          read; i.e., read the third 'RATE' extension in FILE
  SILENT - set to deactivate printing error messages.

 OPTIONAL OUTPUT KEYWORDS:
  EXTNUMREAD - actual extension to read
  SETNUMREAD - actual number of extension read within subset of
               extensions with EXTNAME. 
  ERR_CODE - set to [ 0 / 1 ] if an error [ did not / did ] occur
  ERR_MSG - string containing error message.  Null string if no
            errors occurred.

 CALLS: ***
	FITS_OPEN, TRIM, wc_where [1], wc_where [2]
 CALLED BY
	FITSFILE__DEFINE [1], rd_fits_ext, xsm_rd_fits_ext


FIND_IX $SSW/gen/idl/util/find_ix.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : FIND_IX
               
 Purpose     : This function finds the nearest neighbor index in the 
		primary array for the values in the secondary array
               
 Category    : UTIL
               
 Explanation : This is a routine needed as the first step in all 1-d
	interpolations on irregular grid positions.  This routine is
	fast because it uses the sort and where functions to find
	indices where alternate routines use loops or double loops.
               
 Use         : 
    
 Inputs      : X - The primary array, must be monotonic.
               U   - The secondary array for which indices are needed for X.
 Opt. Inputs : None
               
 Outputs     : The function returns the index, I,  in X for every value
		of U corresponding the the element of X such that
		X(I(j)) < U(j) < X(I(j)+1) for X increasing
		and
		X(I(j)) < U(j) < X(I(j)-1) for X decreasing.
		Returns (top+1) or (bottom-1) of range of indices for U out of range.

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      : ***
	BSORT [1], BSORT [2], BSORT [3], BSORT [4], MINMAX [1], MINMAX [2], REVERSE
 CALLED BY:
	FS_ARCHIVE_RW, GE_WINDOW [1], HESSI_PHA, HSI_EVENTLIST_SELECT_BY_TIME [2]
	HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_LIVETIME_SIM, HSI_LOCATE_FLARE [2]
	HSI_LOCATE_FLARE [4], HSI_SCORE2FASTRATE_SUBPACKET, INTERP2INTEG, INTERPOL8
	MAP_DISCLA2CONT, RESTORE_FLARE, SPEX_DATA_GENX [1], SPEX_DATA_GENX [2]
	WRITE_MONTH_CAT, hessi_pileup_sim, hsi_badpak_test, hsi_chan_ranges
	hsi_flare_position_image [1], hsi_flare_position_image [2]
	hsi_full_sun_image [1], hsi_full_sun_image [2], hsi_locate_flare [1]
	hsi_locate_flare [3], hsi_obs_summ_flag__define, plotman_draw_event
	trace_movie_index [1], trace_movie_index [2]
 Common      : None
               
 Restrictions: Supports real numbers.
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : RAS, 6-May-1997, Version 1, written to support INTERPOL.
		RAS, 21-May-1997, Version 2, changed do loop to while loop
		to support extremely large x arrays.  Could be rewritten
		to put singles into final array w/o loop.  


FIND_LIMB2 $SSW/gen/idl/image_tool/find_limb2.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
	FIND_LIMB2

 PURPOSE:
       Find the solar coordinates from an aspect camera image.

 EXPLANATION:
	Uses the IDL function SOBEL to differentiate, then fits to circle.
	Return sun center coordinates, solar radius, error estimate,
	and oblateness estimate determined from the Fourier spectrum
	of the limb location. Outputs are in (real) pixel units.

 CALLING SEQUENCE:
	find_limb, img, 	$
	   [x0, y0, r0, r_err, oblateness, ob_angle, bias, $
	   brightness, sig_bright,/sxt,qtest=qtest]

 INPUTS:
	img 	= input image 

 OUTPUTS:
	x0	= pixel location of sun center, x (1st harmonic of radius)
	y0	= pixel location of sun center, y
	r0	= radius in pixel units
	r_err	= uncertainty in r0 determination from scatter
	oblateness 	= second harmonic of radius
	ob_angle	= phase of 2nd harmonic
	bias		= distortion of limb due higher harmonics
	brightness 	= most probable signal at x0,y0
	sig_bright	= sigma of brightness

 OPTIONAL INPUT PARAMETERS:
	qtest	= 1 for messages+pause, = 2 for messages+plots+pause,
		= 3 for messages+plots (no pause)

 KEYWORD PARAMETERS:
	SXT -- If set, results will be in units of SXT 1x1 pixels, otherwise
	       results are in units of pixels of the input image 

 CALLS: ***
	GAUSS_FUNCT2 [1], GAUSS_FUNCT2 [2], POLY_FIT, STDEV, fit_circle [1]
	fit_circle [2]
 CALLED BY:
	LIMB_INFO
 RESTRICTIONS:
	1. The input image is assumed to have an oblateness that is < 5%.
	2. Missing data in the middle of the image will cause large values
	   in the derivative which are not compensated for.
	3. The data is assumed to be ge 0.  (Values less than zero will not
	   be handled correctly by the histogram function).
	4. In determining summation mode for SXT=1, uses n_elements(img(*,0)).
	5. To compute brightness, uses a box that is 1/3 * r0 centered at x0,y0.
	   The image must contain this box (i.e., small crescents may be 
	    be absent, but a large portion missing at the middle of the
	    image will cause problems).
		
 SIDE EFFECTS:
	None

 CATEGORY :

 COMMON BLOCKS:
	None

 MODIFICATION HISTORY:
	HSH written in IDL version 1, Feb. 1991
	HSH updated with V.2 on real orbital data, Sep. 1991
	19-Nov-91 MDM - Added a correction factor for changing the
			resolution back to 1x1 (because of un-summed columns)
	19-aug-92 JRL+HSH  V3.0 Numerous changes to fix/improve algorithm.
				Much more robust for SAA data.
				Brightness is now most probable signal at x0,y0.
	 1-sep-92 JRL	V3.1	Brightness calculation taken from mean of 
				histogram
        Liyun Wang, GSFC/ARC, October 7, 1994
           Incorporated into the CDS library
           Made it to return a flag (!err=-1) if it fails to yield good result

 VERSION:
       Version 1, October 7, 1994


find_pixel_intersects $SSW/gen/idl/image/find_pixel_intersects.pro
[Previous] [Next]
 Name: find_pixel_intersects

 Purpose: Finds pixel element numbers in image intersected by a line

 Project:  HESSI

 Calling Sequence:
	xy = find_pixel_intersects (xedge, yedge, xaxis, yaxis, image_size, ylog=ylog, $
   	dist=dist, xvals=xvals, yvals=yvals

 Method:
	Divide the line into twice as many pixels as there are on the diagonal (to make sure at least
	one point falls in any pixel the line passes through) and calculate the x, y coords at each length
	along the line.   Calculate the edges of the pixels xpix, ypix, and use find_ix to find the
	element number of the image that each x,y falls in. Then return all the unique x,y element pairs.

 Input arguments:
	xedge, yedge - 2-element arrays of x and y coordinates where start and end of line crosses edges of
		image shown (can be zoomed in) in data coordinates
	xaxis - edges of x axis bins of full image (non-zoomed) in data coordinates
	yaxis - edges of y axis bins of full image (non-zoomed) in data coordinates
	image_size - 2-element array of number of pixels in x and y direction (if zoomed in, this
		is the zoomed-in size of the image)

 Input Keywords:
	ylog - If set, y axis is log scale

 Output Optional keywords:
	xvals, yvals - x,y data coordinates of the center of each image element returned by the function
	dist - distance along the line to each xvals,yvals pair

 Written: Kim Tolbert, 18-Mar-2002
 Modifications:
	29-Mar-2005, Kim:  Deleted x0_full,y0_full,dpixel_size input arguments.  Instead pass in
		xaxis,yaxis.  This allows for the possibility of uneven bins (as in spectrograms).  Also
		added ylog keyword (also for spectrograms)
	22-Apr-2005, Kim.  Corrected if ylog -> if keyword_set(ylog)
	9-May-2005, Kim.  Corrected bug - was getting but not using unique pairs (xinter,yinter)

 CALLS:
 CALLED BY
	PROFILES2


FIND_PROC $SSW/gen/idl/help/find_proc.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : FIND_PROC

 Category    : Utility, help

 Purpose     : Find routine in SSW tree

 Explanation : Used in WWW search engine

 Syntax      : IDL> find_proc,proc

 Inputs      : PROC = procedure name (e.g. xdoc, or *xdoc, or xdoc*)

 Opt. Inputs : None

 Outputs     : STDOUT listing of found procedures

 Opt. Outputs: None

 Keywords    : FILE = output file for listing (otherwise goes to screen)
               RESET = force reading of SSW databases
               COUNT = number of hits
               CLEAN = name of temporary files to delete 

 CALLS: ***
	ANYTIM2TAI, APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CACHE_DATA
	CHKLOG [1], CHKLOG [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], ESPAWN, EXIST
	PR_SYNTAX, RM_FILE, STRIP_WILD, TRIM2, break_file [4], file_info2 [1]
	file_info2 [2], rd_tfile [1], rd_tfile [2]
 History     : Version 1,  2-Oct-1998,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FIND_VALUE $SSW/gen/idl/util/find_value.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FIND_VALUE()

 Purpose     :	Finds where an array is equal to a value.

 Category    :	Class4, Numerical

 Explanation :	This procedure finds the index of the point closest to the
		specified value, and then performs a bilinear interpolation.

 Syntax      :	Result = FIND_VALUE( Y, VALUE )
		Result = FIND_VALUE( X, Y, VALUE )

 Examples    :	X = 0.1*FINDGEN(100) + 2
		Y = X^2
		PRINT, FIND_VALUE(X, Y, 10)

 Inputs      :	Y     = The array to search for VALUE within.  Must be
			monotonically increasing or decreasing.

		VALUE = The value to search for.

 Opt. Inputs :	X     = An array of positions for the Y data values.  If not
			passed, then the indices (0,1,2,...) are used instead.

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

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       :	None.
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	Taken from the routine FIND in the SERTS library.

 History     :	Version 1, 21-Aug-1996, William Thompson, GSFC

 Contact     :	WTHOMPSON


FIND_WIND_DIR $SSW/gen/idl/system/find_wind_dir.pro
[Previous] [Next]
 Project     :	HESSI

 Name        :	FIND_WIND_DIR()

 Purpose     :	Finds all directories under a specified directory under windows.

 Explanation :	This routines finds all the directories in a directory tree
		when the root of the tree is specified.  This provides the same
		functionality as having a directory with a plus in front of it
		in the environment variable IDL_PATH.

 Use         :	Result = FIND_WITH_DIR( PATH )

		PATHS = FIND_WITH_DIR('+mypath')

 Inputs      :	PATH	= The path specification for the top directory in the
			  tree.  Optionally this may begin with the '+'
			  character but the action is the same.


 Opt. Inputs : None

 Outputs     :	The result of the function is a list of directories starting
		from the top directory passed and working downward from there.
		This will be a string array with one directory per
		array element.

 Opt. Outputs:	None.

 Keywords    :	SPAWN - use win_spawn command.

 Calls       : ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], WIN_SPAWN, concat_dir [4]
 Common      :	None.

 Restrictions:	PATH must point to a directory that actually exists.



 Side effects:	None.

 Category    :	Utilities, Operating_system.

 Prev. Hist. :	None.

 Written     :	Richard.Schwartz@gsfc.nasa.gov 27-May-1998.

 Modified    :	Version 1, Richard.Schwartz@gsfc.nasa.gov 27-May-1998.
		Version 2, Richard.Schwartz,
		Improved the speed by extracting last position characters
		using byte arrays.

 Version     :	Version 1, 17 May 1998
				Version 2, 17 Aug 1998


FIND_WITH_DEF [1] $SSW/gen/idl/system/find_with_def.pro
[Previous] [Next]
 NAME: 
     FIND_WITH_DEF()
 PURPOSE: 
     Searches for files with a default path and extension.
 EXPLANATION:
     Finds files using default paths and extensions, similar to using the
     DEFAULT keyword with the OPEN statement in VMS.  Using this routine
     together with environment variables allows an OS-independent approach
     to finding files.
 CALLING SEQUENCE: 
     Result = FIND_WITH_DEF( FILENAME, PATHS  [, EXTENSIONS ] )

 INPUTS: 
     FILENAME   = Name of file to be searched for.  It may either be a
                    complete filename, or the path or extension could be left
                    off, in which case the routine will attempt to find the
                    file using the default paths and extensions.

     PATHS      = One or more default paths to use in the search in case
                    FILENAME does not contain a path itself.  The individual
                    paths are separated by commas, although in UNIX, colons
                    can also be used.  In other words, PATHS has the same
                    format as !PATH, except that commas can be used as a
                    separator regardless of operating system.  The current
                    directory is always searched first, unless the keyword
                    NOCURRENT is set.

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

 OPTIONAL INPUTS: 
     EXTENSIONS = One or more extensions to append to end of filename if the
                    filename does not contain one (e.g. ".dat").  The period
                    is optional.  Multiple extensions can be separated by
                    commas or colons.
 OUTPUTS: 
     The result of the function is the name of the file if successful, or
     the null string if unsuccessful.
 OPTIONAL INPUT KEYWORDS: 
     NOCURRENT = If set, then the current directory is not searched.

      RESET      = The FIND_WITH_DEF routine supports paths which are
                    preceeded with the plus sign to signal that all
                    subdirectories should also be searched.  Often this is
                    used with logical names.  It can be rather slow to search
                    through these subdirectories.  The /RESET keyword can be
                    used to redefine an environment variable so that
                    subsequent calls don't need to look for the
                    subdirectories.

                    To use /RESET, the PATHS parameter must contain the name
                    of a *single* environment variable.  For example

                     setenv,'FITS_DATA=+/datadisk/fits'
                     file = find_with_def('test.fits','FITS_DATA',/reset)

 CALLS: ***
	BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], STR_SEP
 CALLED BY:
	APPLY_CDS_ADEF, BARYVEL, CAT_DURATION, CDSHEADFITS, CDSLOGO, CDS_COMPRESS
	CDS_ENG_N1_AN, CDS_ENG_N4_AN, CDS_FILES, CDS_SLIT6_BURNIN, CHECK_ANOMALY
	CHECK_INTEG, CMP_ALL_PRO, CMP_LIBS, DBCOMPRESS, DBCREATE [1], DBCREATE [2]
	DBCREATE [3], DBHELP [1], DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3]
	DBPRINT [1], DBPRINT [2], DBPRINT [3], DB_TITLES [1], DB_TITLES [2], DB_TITLES [3]
	DISPLAY_CDS_BURNIN, EIS_CHECK_DATABASE [1], EIS_CHECK_DATABASE [2]
	EIS_GET_HDR [1], EIS_GET_HDR [2], FIND_ALL_DIR [1], FIND_ALL_DIR [2]
	FIND_ALL_DIR [3], FIND_DATFILE, FIND_FILE_DUR, FIND_ZDBASE, FIX_CATALOG
	FLUSH_CATALOG, GET_DETAIL, GET_EXPER, GET_NIMCP, GET_OBS_DATE, GET_PLAN
	GET_SC_POINT, GET_UTC, GET_WIDTH_CORR, GET_ZDBASE, GT_CDS_QL, GT_SOLAR_XY
	IMPORT_PLAN, IMPORT_STUDY, ITOOL_GET_TIME, JPLEPHTEST, JSMOVIE, JSMOVIE2
	LIST_DETAIL, LIST_EXPER, LIST_PLAN, LOCAL_DIFF, LOCK_DATABASE, MK_CDS_DBASE
	MK_CDS_FITS, MK_CDS_GIF, MK_HELP_STC, MK_RASTER, MK_STUDY, MK_SYNOPTIC, MOD_EXPER
	NIS_AVG_SPECT_DEMO, NIS_CALIB, OPEN_KAP, OPEN_MSP_FILE, PICKFITS, PLANET_COORDS
	PRG_DETAIL, PRG_PLAN, PRIV_ZDBASE, READCDSFITS, READSUM2CDS, READ_NIMCP_CAL
	SUBMIT_CAP, SUBMIT_IAP, SUM_GET_LINELIST, TILT_NIS1_DEMO, TILT_NIS2_DEMO
	TP_RASDUR, TP_READ_HELP, UPDATE_KAP, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
	VDS_READ_FLAT, VDS_ROTATE, WFPC2_READ, WIDG_HELP, XCAT, XCDS_COSMIC, XDIFF, XSPECT
	db_read_linelist_all [1], db_read_linelist_all [2]
	db_read_linelist_entry [1], db_read_linelist_entry [2]
	db_read_raster_all [1], db_read_raster_all [2], db_read_raster_entry [1]
	db_read_raster_entry [2], db_read_study_all [1], db_read_study_all [2]
	db_save_linelist_entry_create [1], db_save_linelist_entry_create [2]
	db_save_linelist_entry_update [1], db_save_linelist_entry_update [2]
	db_save_raster_entry_create [1], db_save_raster_entry_create [2]
	db_save_raster_entry_update [1], db_save_raster_entry_update [2]
	db_save_study_entry_create [1], db_save_study_entry_create [2]
	db_save_study_entry_create [3], db_save_study_entry_create [4]
	db_save_study_entry_update [1], db_save_study_entry_update [2]
	eis_delete_timeline_entry [1], eis_delete_timeline_entry [2]
	eis_get_timeline_entries [1], eis_get_timeline_entries [2]
	eis_import_study_gui, eis_linelist_gui [1], eis_linelist_gui [2]
	eis_open_db [1], eis_open_db [2], eis_raster_gui [1], eis_raster_gui [2]
	eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
	eis_study_gui [2], eis_update_timeline_entry [1]
	eis_update_timeline_entry [2], eis_update_timeline_science_entry [1]
	eis_update_timeline_science_entry [2]
	eis_write_science_component_database_table [1]
	eis_write_science_component_database_table [2]
 EXAMPLE:

       FILENAME = ''
       READ, 'File to open: ', FILENAME
       FILE = FIND_WITH_DEF( FILENAME, 'SERTS_DATA', '.fix' )
       IF FILE NE '' THEN ...


 PROCEDURE CALLS: 
       BREAK_PATH(), FIND_ALL_DIR()
 REVISION HISTORY: 
       Version 1, William Thompson, GSFC, 3 May 1993.
               Removed trailing / and : characters.
               Fixed bugs
               Allow for commas within values of logical names.
               Added keyword NOCURRENT.
               Changed to call BREAK_PATH
       Version 2, William Thompson, GSFC, 3 November 1994
               Made EXTENSIONS optional.
       Version 3, William Thompson, GSFC, 30 April 1996
               Call FIND_ALL_DIR to resolve any plus signs.
       Version 4, S.V. Haugan, UiO, 5 June 1996
               Using OPENR,..,ERROR=ERROR to avoid an IDL 3.6
               internal nesting error.
       Version 5, R.A. Schwartz, GSFC, 11 July 1996
               Use SPEC_DIR to interpret PATH under VMS
       Version 6, William Thompson, GSFC, 5 August 1996
               Took out call to SPEC_DIR (i.e., reverted to version 4).  The
               use of SPEC_DIR was required to support logical names defined
               via SETLOG,/CONFINE.  However, it conflicted with the ability
               to use logical names with multiple values.  Removing the
               /CONFINE made it unnecessary to call SPEC_DIR in this routine.
       Version 7, William Thompson, GSFC, 6 August 1996
               Added keyword RESET
       Converted to IDL V5.0   W. Landsman   October 1997
       Use STRTRIM instead of TRIM,   W. Landsman   November 1998
       Use STRSPLIT instead of STR_SEP(), V5.3 or later W.L.   July 2002


FIND_WITH_DEF [2] $SSW/gen/idl_libs/astron/misc/find_with_def.pro
[Previous] [Next]
 NAME: 
     FIND_WITH_DEF()    
 PURPOSE: 
     Searches for files with a default path and extension. 
 EXPLANATION:
     Finds files using default paths and extensions,   Using this routine
     together with environment variables allows an OS-independent approach
     to finding files.
 CALLING SEQUENCE: 
     Result = FIND_WITH_DEF( FILENAME, PATHS  [, EXTENSIONS ] )

 INPUTS: 
     FILENAME   = Name of file to be searched for.  It may either be a
                    complete filename, or the path or extension could be left
                    off, in which case the routine will attempt to find the
                    file using the default paths and extensions.

     PATHS      = One or more default paths to use in the search in case
                    FILENAME does not contain a path itself.  The individual
                    paths are separated by commas, although in UNIX, colons
                    can also be used.  In other words, PATHS has the same
                    format as !PATH, except that commas can be used as a
                    separator regardless of operating system.  The current
                    directory is always searched first, unless the keyword
                    NOCURRENT is set.

                    A leading $ can be used in any path to signal that what
                    follows is an environmental variable, but the $ is not
                    necessary.  Environmental variables can themselves contain
                    multiple paths.

 OPTIONAL INPUTS: 
     EXTENSIONS = Scalar string giving one or more extensions to append to 
                  end of filename if the filename does not contain one (e.g. 
                   ".dat").  The period is optional.  Multiple extensions can 
                   be separated by commas or colons.
 OUTPUTS: 
     The result of the function is the name of the file if successful, or
     the null string if unsuccessful.
 OPTIONAL INPUT KEYWORDS: 
     NOCURRENT = If set, then the current directory is not searched.

      RESET      = The FIND_WITH_DEF routine supports paths which are
                    preceeded with the plus sign to signal that all
                    subdirectories should also be searched.  Often this is
                    used with logical names.  It can be rather slow to search
                    through these subdirectories.  The /RESET keyword can be
                    used to redefine an environment variable so that
                    subsequent calls don't need to look for the
                    subdirectories.

                    To use /RESET, the PATHS parameter must contain the name
                    of a *single* environment variable.  For example

                     setenv,'FITS_DATA=+/datadisk/fits'
                     file = find_with_def('test.fits','FITS_DATA',/reset)

 CALLS: ***
	BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], STR_SEP
 CALLED BY:
	APPLY_CDS_ADEF, BARYVEL, CAT_DURATION, CDSHEADFITS, CDSLOGO, CDS_COMPRESS
	CDS_ENG_N1_AN, CDS_ENG_N4_AN, CDS_FILES, CDS_SLIT6_BURNIN, CHECK_ANOMALY
	CHECK_INTEG, CMP_ALL_PRO, CMP_LIBS, DBCOMPRESS, DBCREATE [1], DBCREATE [2]
	DBCREATE [3], DBHELP [1], DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3]
	DBPRINT [1], DBPRINT [2], DBPRINT [3], DB_TITLES [1], DB_TITLES [2], DB_TITLES [3]
	DISPLAY_CDS_BURNIN, EIS_CHECK_DATABASE [1], EIS_CHECK_DATABASE [2]
	EIS_GET_HDR [1], EIS_GET_HDR [2], FIND_ALL_DIR [1], FIND_ALL_DIR [2]
	FIND_ALL_DIR [3], FIND_DATFILE, FIND_FILE_DUR, FIND_ZDBASE, FIX_CATALOG
	FLUSH_CATALOG, GET_DETAIL, GET_EXPER, GET_NIMCP, GET_OBS_DATE, GET_PLAN
	GET_SC_POINT, GET_UTC, GET_WIDTH_CORR, GET_ZDBASE, GT_CDS_QL, GT_SOLAR_XY
	IMPORT_PLAN, IMPORT_STUDY, ITOOL_GET_TIME, JPLEPHTEST, JSMOVIE, JSMOVIE2
	LIST_DETAIL, LIST_EXPER, LIST_PLAN, LOCAL_DIFF, LOCK_DATABASE, MK_CDS_DBASE
	MK_CDS_FITS, MK_CDS_GIF, MK_HELP_STC, MK_RASTER, MK_STUDY, MK_SYNOPTIC, MOD_EXPER
	NIS_AVG_SPECT_DEMO, NIS_CALIB, OPEN_KAP, OPEN_MSP_FILE, PICKFITS, PLANET_COORDS
	PRG_DETAIL, PRG_PLAN, PRIV_ZDBASE, READCDSFITS, READSUM2CDS, READ_NIMCP_CAL
	SUBMIT_CAP, SUBMIT_IAP, SUM_GET_LINELIST, TILT_NIS1_DEMO, TILT_NIS2_DEMO
	TP_RASDUR, TP_READ_HELP, UPDATE_KAP, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
	VDS_READ_FLAT, VDS_ROTATE, WFPC2_READ, WIDG_HELP, XCAT, XCDS_COSMIC, XDIFF, XSPECT
	db_read_linelist_all [1], db_read_linelist_all [2]
	db_read_linelist_entry [1], db_read_linelist_entry [2]
	db_read_raster_all [1], db_read_raster_all [2], db_read_raster_entry [1]
	db_read_raster_entry [2], db_read_study_all [1], db_read_study_all [2]
	db_save_linelist_entry_create [1], db_save_linelist_entry_create [2]
	db_save_linelist_entry_update [1], db_save_linelist_entry_update [2]
	db_save_raster_entry_create [1], db_save_raster_entry_create [2]
	db_save_raster_entry_update [1], db_save_raster_entry_update [2]
	db_save_study_entry_create [1], db_save_study_entry_create [2]
	db_save_study_entry_create [3], db_save_study_entry_create [4]
	db_save_study_entry_update [1], db_save_study_entry_update [2]
	eis_delete_timeline_entry [1], eis_delete_timeline_entry [2]
	eis_get_timeline_entries [1], eis_get_timeline_entries [2]
	eis_import_study_gui, eis_linelist_gui [1], eis_linelist_gui [2]
	eis_open_db [1], eis_open_db [2], eis_raster_gui [1], eis_raster_gui [2]
	eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
	eis_study_gui [2], eis_update_timeline_entry [1]
	eis_update_timeline_entry [2], eis_update_timeline_science_entry [1]
	eis_update_timeline_science_entry [2]
	eis_write_science_component_database_table [1]
	eis_write_science_component_database_table [2]
 EXAMPLE:

       FILENAME = ''
       READ, 'File to open: ', FILENAME
       FILE = FIND_WITH_DEF( FILENAME, 'SERTS_DATA', '.fix' )
       IF FILE NE '' THEN ...


 PROCEDURE CALLS: 
       BREAK_PATH(), FIND_ALL_DIR(), STR_SEP()
 REVISION HISTORY: 
       Version 1, William Thompson, GSFC, 3 May 1993.
               Removed trailing / and : characters.
               Fixed bugs
               Allow for commas within values of logical names.
               Added keyword NOCURRENT.
               Changed to call BREAK_PATH
       Version 2, William Thompson, GSFC, 3 November 1994
               Made EXTENSIONS optional.
       Version 3, William Thompson, GSFC, 30 April 1996
               Call FIND_ALL_DIR to resolve any plus signs.
       Version 4, S.V. Haugan, UiO, 5 June 1996
               Using OPENR,..,ERROR=ERROR to avoid an IDL 3.6
               internal nesting error.
       Version 5, R.A. Schwartz, GSFC, 11 July 1996
               Use SPEC_DIR to interpret PATH under VMS
       Version 6, William Thompson, GSFC, 5 August 1996
               Took out call to SPEC_DIR (i.e., reverted to version 4).  The
               use of SPEC_DIR was required to support logical names defined
               via SETLOG,/CONFINE.  However, it conflicted with the ability
               to use logical names with multiple values.  Removing the
               /CONFINE made it unnecessary to call SPEC_DIR in this routine.
       Version 7, William Thompson, GSFC, 6 August 1996
               Added keyword RESET
       Converted to IDL V5.0   W. Landsman   October 1997
       Use STRTRIM instead of TRIM,   W. Landsman   November 1998
       Use STRSPLIT instead of STR_SEP  W. Landsman  July 2002


FIND_ZDBASE $SSW/gen/idl/database/find_zdbase.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIND_ZDBASE
               
 Purpose     : set ZDBASE to appropriate CDS/USER/SOHO Database location
               
 Category    : Planning
               
 Explanation : Searches personal and official DB locations
               
 Syntax      : IDL> find_zdbase,type,status=status
    
 CALLED BY:
	MK_CDS_PLAN, MK_STUDY, RD_CDS_POINT, XCAT, XSTUDY
 Examples    : 

 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : TYPE = 'User', 'CDS', 'SOHO', or 'Unknown'

 Opt. Outputs: None
               
 Keywords    : STATUS = 1 if DB found, 0 if unsuccessfull
               /CAT = set to look for catalog DB
               /DEF = set to look for study definitions DB [default]
               /DAI = set to look for plan DB
               /RES = set to look for resources (e.g. campaign, etc)
               /OFF_FIRST = search official before personal DB
               FILE = full path name to DB file
               ERR  = any error string
               NORETRY = don't retry by cycling thru different DB's
               VERBOSE = echo messages

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], EXP_ZDBASE, FIND_WITH_DEF [1]
	FIND_WITH_DEF [2], FIND_WITH_DEF [3], FIX_ZDBASE, GET_ENVIRON, TRIM, WHERE_VECTOR
	WHICH_ZDBASE
 Common      : None
               
 Restrictions: None
               
 Side effects: Environment/logical ZDBASE set to first found DB location
               
 History     : Version 1,  7-September-1996,  D M Zarro.  Written
		Version 2, 11-Mar-1997, William Thompson, GSFC
			Fixed problem under VMS when logical name ZDBASE has
			multiple values.
               Version 3, 23-April-1998, Zarro (SAC/GSFC), added /VERBOSE

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FINDFILE_LIST $SSW/gen/idl/fund_lib/sdac/findfile_list.pro
[Previous] [Next]

 NAME: 
	FINDFILE_LIST

 PURPOSE:
	This procedure takes a list of files and path (!path format) and
	returns the directory or library of the first occurrence for each
	element.

 CATEGORY:
	GEN, UTIL, SYSTEM

 CALLING SEQUENCE:
	FINDFILE_LIST, Files, Path, Locs

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], BSORT [1], BSORT [2], BSORT [3]
	BSORT [4], GET_LIB, GET_MOD, break_file [4], file_list [1], file_list [2]
 INPUTS:
	Files- List of procedures including .pro extension
	Path - Path in !path format
 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Locs - The path for each file.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	EXTENSION - optional extension, e.g. '.dat' to search for
	CASE_IGNORE- For non-vms, ignore case (VMS default)
	NOCURRENT - If set, then don't search the current directory.

 CALLED BY:
	LOCAL_DIFFS
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	For each directory in turn the filenames are extracted and compared to
	the list.  As each file is located the list to find gets smaller.  The
	search is terminated when the file list or directory list is exhausted.

 MODIFICATION HISTORY:
	Richard Schwartz, 6 Sept 1996
	Version 2, richard.schwartz@gsfc.nasa.gov, 30-dec-1997.


FINDPRO $SSW/gen/idl_libs/astron/misc/findpro.pro
[Previous] [Next]
 NAME:
     FINDPRO
 PURPOSE:
     Find all locations of a procedure in the IDL !PATH
 EXPLANATION:
     FINDPRO searces for the procedure name (as a .pro or a .sav file) in all 
     IDL libraries or directories given in the !PATH system variable.    This
     differs from the intrinsic FILE_WHICH() function which only finds the 
     first occurence of the procedure name.
               
 CALLING SEQUENCE:
    FINDPRO, [ Proc_Name, /NoPrint, DirList = , ProList = ]

 OPTIONAL INPUT:
     Proc_Name - Character string giving the name of the IDL procedure or 
             function. Do not include the ".pro" extension. If Proc_Name is
             omitted, the program will prompt for PROC_NAME.  "*" wildcards
             are permitted.

 CALLS: ***
	FDECOMP [1], FDECOMP [2], FDECOMP [3], PATH_SEP, ZPARCHECK [1], ZPARCHECK [2]
	ZPARCHECK [3]
 OPTIONAL KEYWORD INPUT:
     /NoPrint - if set, then the file's path is not printed on the screen and
             absolutely no error messages are printed on the screen.  If not
             set, then - since the MESSAGE routine is used - error messages 
             will be printed but the printing of informational messages
             depends on the value of the !Quiet variable.

 OPTIONAL KEYWORD OUTPUTS:
     DirList - The directories in which the file is located are returned in
             the keyword as a string array.
             If the procedure is an intrinsic IDL procedure, then the 
             value of DirList = ['INTRINSIC'].
             If the procedure is not found, the value of DirList = [''].
     ProList - The list (full pathnames) of procedures found.  Useful if you
             are looking for the name of a procedure using wildcards.

     The order of the names in DirList and ProList is identical to the order
     in which the procedure name appears in the !PATH
 PROCEDURE:
     The system variable !PATH is parsed using EXPAND_PATH into individual 
     directories.  FILE_SEARCH() is used to search the directories for
     the procedure name.  If not found in !PATH, then the name is compared 
     with the list of intrinsic IDL procedures given by the ROUTINE_INFO()
     function. 

 EXAMPLE:
     (1) Find the procedure CURVEFIT.  Assume for this example that the user
     also has a copy of the curvefit.pro procedure in her home directory
     on a Unix machine.

       IDL> findpro, 'curvefit', DIRLIST=DirList
       Procedure curvefit.pro found in directory  /home/user/.
       Procedure curvefit.pro found in directory  /home/idl/lib/userlib 
       IDL> help, DirList
       DIRLIST         STRING    = Array(2) 
       IDL> help, DirList[0], DirList[1]
       <Expression>    STRING    = '/home/user'
       <Expression>    STRING    = '/home/idl/lib/userlib' 

     (2) Find all procedures in one's !path containing the characters "zoom" 

       IDL> findpro,'*zoom*'
 RESTRICTIONS:
       User will be unable to find a path for a native IDL function
       or procedure, or for a FORTRAN or C routine added with CALL_EXTERNAL.
       Remember that Unix is case sensitive, and most procedures will be in
       lower case.

 PROCEDURES USED:
       ZPARCHECK, FDECOMP
 REVISION HISTORY:
       Based on code extracted from the GETPRO procedure, J. Parker 1994
       Use the intrinsic EXPAND_PATH function    W. Landsman Nov. 1994
       Use ROUTINE_NAMES() to check for intrinsic procs   W. Landsman Jul 95
       Added Macintosh, WINDOWS compatibility    W. Landsman   Sep. 95
       Removed spurious first element in PROLIST  W. Landsman  March 1997
       Don't include duplicate directories  in !PATH  WL   May 1997
       Use ROUTINE_INFO instead of undocumented ROUTINE_NAMES W.L. October 1998
       Also check for save sets   W. Landsman  October 1999 
       Force lower case check for VMS  W. Landsman January 2000 
       Only return .pro or .sav files in PROLIST   W. Landsman  January 2002 
       Force lower case check for .pro and .sav    D. Swain  September 2002 
       Use FILE_SEARCH() if V5.5 or later   W. Landsman June 2006
       Assume since V55, remove VMS support W. Landsman Sep. 2006


FINDVAL $SSW/gen/idl/util/findval.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FINDVAL
               
 Purpose     : Linearly interpolates X,Y arrays for (xval,yval)
               
 Category    : Interpolation
               
 Explanation :
               Uses linear interpolation to obtain xval or yval with respect to
               input X,Y arrays. This function differs from INTERPOL
               in that if finds multi-valued cases.
               
 Syntax      : IDL> yval=findval(x,y,xval) or xval=findval(y,x,yval)
    
 CALLED BY:
	GUESS_FIT_PAR
 Examples    : 

 Inputs      : X and Y, floating arrays, e.g. wavelength & flux
               
 Opt. Inputs : None
               
 Outputs     : XVAL or YVAL are floating point arrays.
               The size of these arrays (usually 1) = no of interpolated points

 Opt. Outputs: None
               
 Keywords    : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 History     : Version 1,  17-May-1986,  D M Zarro.  Written 
               (my very first real IDL program)

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FIT2GIF $SSW/gen/idl/fits/fits2gif.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FIT2GIF

 Purpose     :	convert FITS file to a GIF image file

 Explanation :	Reads a FITS file, byte scales it, and
               then writes it to a GIF file.

 Use         :	FITS2GIF,INFILE

 Inputs      :	INFILE = fits file name

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	HEADER = fits file header

 Keywords    :	OFILE = output GIF file name [def = INFILE with .GIF extension]
               TITLE = title for image
               COLOR = color table to load [def= 0 , B/W]
               RED, GREEN, BLUE = optional color vectors to override COLOR
               FRAC  = fraction by which to increase image
                       size in Y-direction to fit title [def = 15%]
               XPOS, YPOS = normalized coordinates for title [def=.1,.9]
               ROTATE = value for rotate (see ROTATE function)
               FLIP = flip image to to bottom
               REVERSE = flip image left to right
               PREVIEW = preview image before writing
               SIG  = select significant range of image

 Calls       : ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FITS2GIF
	FXREAD [1], FXREAD [2], LOADCT, SELECT_WINDOWS, SIGRANGE [1], SIGRANGE [2]
	SSW_WRITE_GIF, TEST_OPEN, break_file [4], delvarx [5]
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Plotting.

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)

 Modified    : Version 2, William Thompson, GSFC, 8 April 1998
			Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
               Version 3, 13-Aug-2003, William Thompson
                       Use SSW_WRITE_GIF instead of WRITE_GIF

 Version     : Version 3, 13-Aug-2003


FIT_BACKGRND $SSW/gen/idl/fitting/fit_backgrnd.pro
[Previous] [Next]
Name:
	FIT_BACKGRND
Call:
       Background_rate=FIT_BACKGND( t_d, rate, erate, order, trange1, trange2, sigma=sigma, $
	selected=selected, ltime=ltime)

PURPOSE:
	This function fits the count rate, RATE, to a polynomial of order, ORDER, over
	the background intervals specified by the limits in TRANGE1 and TRANGE2.
	Return the value of the fit over the time range, T_D.
Calls: ***
	AVG [1], AVG [2], CHECKVAR [1], EXIST, FCHECK, F_DIV, POLY, POLYFITW, checkvar [2]
Inputs:

	t_d - time array, n  or (2 x n) where n is the number of time bins.
		if t_d is dimensioned 2xn, then the first column is the
		start times and the second column is the end times.
		if t_d is dimensioned n, then intervals are uniform and
		t_d is the center of each interval. t_d is monotonic.

	rate - count rate vector, n elements.
	erate - uncertainties on rate
	ltime - livetime of each interval in rate, used for weighting

	selected - indices of selected points in t_d and rate to use in fit
	or
	trange1 - 2 points on the range covered by t_d.  Should be prior
		to the event (flare).
	trange2 - 2 points after the event along t_d.

	order - polynomial to fit over the ranges specified by
		trange1 and trange2
If it is
Keyword SIGMA is the average standard deviation in the fit

Default ORDER =1
Uses POLY and POLY_FIT
 CALLED BY:
	GOES__DEFINE, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2], spex_bk__define
History:
RAS, 92/1/27
17-oct-93, modified to take time arrays with start and stop edges
21-apr-94, fixed bug in use of order (degree of fit)
	    also allows order 0, straight average
30-aug-95, fixed sigma calculation
23-aug-96, fixed basic sigma calculation
09-sep-2004, Kim.  Fixed sigma again - previously er^2*lt, now (er*lt)^2
09-Aug-2005, Kim.  Changed keyword_set(selected) to exist(selected)
11-Jan-2006, Kim.  Fixed bug in computing xedges (changed + to - for last point)


fit_circle [1] $SSW/gen/idl/genutil/fit_circle.pro
[Previous] [Next]
 NAME:
    fit_circle
 PURPOSE:
    Fit a circle to vector of points.
 CALLING SEQUENCE:
    Result_vector = fit_circle(x,y,a,radius_fix=radius_fix,tolerance=tolerance)
 INPUTS:
    x = Vector of x values
    y = Vector of y values
 RETURNED:
    Result_vector = [x1,y1,r1] result of coordinates (x1,y1) and radius (r1).
 OPTIONAL INPUTS:
    a = Vector of [x0,y0,r0]  = First guesses for the circle (x0,y0,radius)
        If a is not supplied, x0 and y0 are the averages and and r0 is 
	 taken to be the average distance of each (x,y) point to (x0,y0).
 OPTIONAL INPUT KEYWORDS:
    radius_fix = If set, will not vary the radius in the fit.
    tolerance  = If present and > 0, fit_circle will recursively call itself
		  until abs(r1-r0)/r0 < tolerance.
                 For example, setting tolerance = 0.01 will cause the 
		  calculation to continue until the solution for the radius
  		  does not vary between iterations by more than 1%.
		  If radius_fix is set, tolerance will have no effect.
    limit_iter	= Set the upper limit to the number of times to iterate.
		  (e.g., limit_iter=10 will limit the number of iterations
		   to 10 or less.)
 OPTIONAL OUTPUT KEYWORDS:
    num_iter	= Number of iterations
 CALLS: ***
	POLY_FIT
 CALLED BY:
	CLICKLIMB, FIND_LIMB, FIND_LIMB2, FIND_LIMB_GEN, SHOW_REGNS, fit_limb, get_xyrad
 MODIFICATION HISTORY:
  17 Oct 1991, J. R. Lemen, Written (based on routine in HSH's find_limb)
  26 Feb 1992, J. R. Lemen, Added tolerance keyword
  24-jan-94, JRL, Added limit_iter keyword
  19-oct-94, T. Metcalf and K. Shibasaki, Improved initial guess.  Works
             with partial circles now.


FIT_GAUSS $SSW/gen/idl/fitting/fit_gauss.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FIT_GAUSS

 Purpose     :	Fits a gaussian plus a quadratic to data points

 Explanation :	Fit Y=F(X) where:
	 	F(X) = A0*EXP(-Z^2/2) + A3 + A4*X + A5*X^2
 			and Z=(X-A1)/A2
		A0 = height of exp, A1 = center of exp, A2 = Gaussian width,
		A3 = constant term, A4 = linear term, A5 = quadratic term.
	 	Estimate the parameters A0,A1,A2,A3 and then call LSTSQR.

		If the (max-avg) of Y is larger than (avg-min) then it is
		assumed the line is an emission line, otherwise it is assumed
		there is an absorbtion line.  The estimated center is the max
		or min element.  The height is (max-avg) or (avg-min)
		respectively.  The width is foun by searching out from the
		extrem until a point is found < the 1/e value.

 Use         :	YFIT = FIT_GAUSS( X, Y  [, A  [, ASIG  [, CHISQR ]]] )

 Inputs      :	X = independent variable, must be a vector.
		Y = dependent variable, must have the same number of points
		    as X.

 Opt. Inputs :	None.

 Outputs     :	YFIT = fitted function.

 Opt. Outputs:	A    = Coefficients -- a six element vector as described above.
		ASIG = Estimated errors in A.

 Keywords    :	
	ACCURACY = Accuracy to cut off at.  Defaults to 1E-5.
	MAX_ITER = Maximum number of reiterations.  Defaults to 20.
	POISSON	 = If set, then a Poisson error distribution is assumed, and
		   the weights are set accordingly to 1/Y.
	ERROR	 = Array of errors.  The weights are set accordingly to
		   1/ERROR^2.  Overrides POISSON.
	WEIGHT	 = Array of weights to use in fitting.  Overrides POISSON and
		   ERROR.
	LAMBDA	 = Initial value of LAMBDA.  Defaults to 1E-2.
	NOPRINT	 = If set, then no printout is generated.
	CHISQR	 = Returned value of chi-squared.  Only relevant if ERROR
		   passed explicitly.
	N_ITER	 = Number of iterations used.
	CMATRIX	 = Correlation matrix.

 Calls       : ***
	LSTSQR, POLY_FIT
 Common      :	None.

 Restrictions:	The peak or minimum of the gaussian must be the largest or
		respectively the smallest point in the Y vector.

 Side effects:	None.

 Category    :	Utilities, Curve_Fitting

 Prev. Hist. :	
	DMS, RSI, Dec, 1983.
	Modified to use LSTSQR, William Thompson, Feb. 1990.
	William Thompson, June 1991, modified to use keywords.

 Written     :	David M. Stern, RSI, December 1983

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library

 Version     :	Version 1, 9 January 1995


FIT_SPEC $SSW/gen/idl/fitting/fit_spec.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FIT_SPEC
               
 Purpose     : fit spectra
               
 Category    : Analysis
               
 Explanation : 
               
 Syntax      : IDL> fit_spec,x,y
    
 CALLED BY:
	BCS, FCS, WBSC_SPC_EV [1], WBSC_SPC_EV [2]
 Examples    : 

 Inputs      : y = data to fit
               x = independent array
               
 Opt. Inputs : None
               
 Outputs     : fx,fz = fitted results array
               a = fitted parameters
               e = error in a

 Opt. Outputs: None
               
 Keywords    : fit_funct = string name of fit_function to fit
                           limited to 'GAUSS','FBLUE','VOIGT', and 'DVOIGT'
               fixp = parameter indicies to fix (e.g. [0,1] to fix first and second)
               flabels = string array of fit characteristics
               damp  = damping width (A) for Voigt fit
               disp  = dispersion (dw/dx) 
               weights = weights for fitting
               include = range of additional region to include in fit (e.g. background)
               err = 1 (fail) / 0 (success)
               fxrange = range within which to restrict fit
               chi2 = reduced chi squared 
               /wave = flags 'x' array as wavelength units (A)
               /flux = flags 'y' array as flux units (photons s-1 cm-2 A-1)
               /last = use latest 'a' values as input to new iteration
               /instrumental = use instrumental weighting
               

 CALLS: ***
	DVOIGT_FIT, FBLUE_FIT, GAUSS_FIT, REVERSE, UNIQ [1], UNIQ [2], UNIQ [3], VOIGT_FIT
 Common      : None.
               
 Restrictions: Limited to Gaussians and Voigt functions.
               
 Side effects: None.
               
 History     : Version 1,  17-July-1996,  D M Zarro.  Written
               Version 2, 13-Sept-1999, Zarro (SM&A/GSFC), added BGAUSS
               20-Sept-1999, Zarro (SM&A/GSFC), added /INSTRUMENTAL

 Contact     : DZARRO@SOLAR.STANFORD.EDU


FITEXY $SSW/gen/idl_libs/astron/math/fitexy.pro
[Previous] [Next]
 NAME:
       FITEXY
 PURPOSE:
       Best straight-line fit to data with errors in both coordinates
 EXPLANATION:
       Linear Least-squares approximation in one-dimension (y = a + b*x),
               when both x and y data have errors

 CALLING EXAMPLE:
       FITEXY, x, y, A, B, X_SIG= , Y_SIG= , [sigma_A_B, chi_sq, q, TOL=]

 INPUTS:
       x = array of values for independent variable.
       y = array of data values assumed to be linearly dependent on x.

 REQUIRED INPUT KEYWORDS:
       X_SIGMA = scalar or array specifying the standard deviation of x data.
       Y_SIGMA = scalar or array specifying the standard deviation of y data.

 OPTIONAL INPUT KEYWORD:
       TOLERANCE = desired accuracy of minimum & zero location, default=1.e-3.

 OUTPUTS:
       A_intercept = constant parameter result of linear fit,
       B_slope = slope parameter, so that:
                       ( A_intercept + B_slope * x ) approximates the y data.
 OPTIONAL OUTPUT:
       sigma_A_B = two element array giving standard deviation of 
                A_intercept and B_slope parameters, respectively.
                The standard deviations are not meaningful if (i) the
                fit is poor (see parameter q), or (ii) b is so large that
                the data are consistent with a vertical (infinite b) line.
                If the data are consistent with *all* values of b, then
                sigma_A_B = [1e33,e33]  
       chi_sq = resulting minimum Chi-Square of Linear fit, scalar
       q - chi-sq probability, scalar (0-1) giving the probability that
              a correct model would give a value equal or larger than the
              observed chi squared.   A small value of q indicates a poor
              fit, perhaps because the errors are underestimated.   As 
              discussed by Tremaine et al. (2002, ApJ, 574, 740) an 
              underestimate of the errors (e.g. due to an intrinsic dispersion)
              can lead to a bias in the derived slope, and it may be worth
              enlarging the error bars to get a reduced chi_sq ~ 1

 CALLS: ***
	CHISQR_PDF, CHISQ_FITEXY, MINF_BRACKET, MINF_PARABOLIC, MOMENT, ZBRENT [1]
	ZBRENT [2]
 COMMON:
       common fitexy, communicates the data for computation of chi-square.

 PROCEDURE CALLS:
       CHISQ_FITEXY()            ;Included in this file
       MINF_BRACKET, MINF_PARABOLIC, ZBRENT    ;In IDL Astronomy Library 
       MOMENT(), CHISQR_PDF()     ;In standard IDL distribution

 PROCEDURE:
       From "Numerical Recipes" column by Press and Teukolsky: 
       in "Computer in Physics",  May, 1992 Vol.6 No.3
       Also see the 2nd edition of the book "Numerical Recipes" by Press et al.

       In order to avoid  problems with data sets where X and Y are of very 
       different order of magnitude the data are normalized before the fitting
       process is started.     The following normalization is used:
       xx = (x - xm) / xs    and    sigx = x_sigma / xs    
                             where xm = MEAN(x) and xs = STDDEV(x)
       yy = (y - ym) / ys    and    sigy = y_sigma / ys    
                             where ym = MEAN(y) and ys = STDDEV(y)


 MODIFICATION HISTORY:
       Written, Frank Varosi NASA/GSFC  September 1992.
       Now returns q rather than 1-q   W. Landsman  December 1992
       Use CHISQR_PDF, MOMENT instead of STDEV,CHI_SQR1 W. Landsman April 1998
       Fixed typo for initial guess of slope, this error was nearly
             always insignificant          W. Landsman   March 2000
       Normalize X,Y before calculation (from F. Holland) W. Landsman Nov 2006


FITS2MAP [1] $SSW/gen/idl/fits/fits2map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FITS2MAP

 Purpose     : Make an image map from a FITS file

 Category    : imaging

 Syntax      : fits2map,file,map

 Inputs      : FILE = FITS file name (or FITS data + HEADER)

 Outputs     : MAP = map structure

 Keywords    : SUB = [x1,x2,y1,y2] = indicies of subarray to extract
               SOHO = designate as SOHO-viewed
               OUTSIZE = image dimensions of map
               HEADER = FITS header (output of last file read)
               OLD_WAY = use old read method
               OBJECT = return list of map objects
               APPEND = append map objects to existing list

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
	DELVARX [4], EXIST, HAVE_TAG, INDEX2MAP, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	MERGE_STRUCT, MRDFITS [1], MRDFITS [2], PR_SYNTAX, ROT_FITS_HEAD, delvarx [5]
	fitshead2struct
 CALLED BY:
	COALIGN_FITS, OVSA2MAP, PLOT_CDS_POINT [1], PLOT_CDS_POINT [2]
 History     : Written 22 January 1998, D. Zarro, SAC/GSFC
               Modified, 22 April 2000, Zarro (SM&A/GSFC)
               Modified, 1 April 2005, Zarro (L-3Com/GSFC) 
                - accounted for 180 degree roll

 Contact     : dzarro@solar.stanford.edu


FITS2MAP [2] $SSW/gen/idl/mapping/fits2map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FITS2MAP

 Purpose     : Make an image map from a FITS file

 Category    : imaging

 Syntax      : fits2map,file,map

 Inputs      : FILE = FITS file name (or FITS data + HEADER)

 Outputs     : MAP = map structure

 Keywords    : SUB = [x1,x2,y1,y2] = indicies of subarray to extract
               SOHO = designate as SOHO-viewed
               OUTSIZE = image dimensions of map
               HEADER = FITS header (output of last file read)
               OLD_WAY = use old read method
               OBJECT = return list of map objects
               APPEND = append map objects to existing list

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
	DELVARX [4], EXIST, HAVE_TAG, INDEX2MAP, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	MERGE_STRUCT, MRDFITS [1], MRDFITS [2], PR_SYNTAX, ROT_FITS_HEAD, delvarx [5]
	fitshead2struct
 CALLED BY:
	COALIGN_FITS, OVSA2MAP, PLOT_CDS_POINT [1], PLOT_CDS_POINT [2]
 History     : Written 22 January 1998, D. Zarro, SAC/GSFC
               Modified, 22 April 2000, Zarro (SM&A/GSFC)
               Modified, 1 April 2005, Zarro (L-3Com/GSFC) 
                - accounted for 180 degree roll

 Contact     : dzarro@solar.stanford.edu


fits2rm $SSW/gen/idl/fits/fits2rm.pro
[Previous] [Next]
 Name: fits2rm

 Category: HESSI, UTIL

 Purpose: Read a response matrix from a FITS file.  Optionally read EBOUNDS
 extension information.

 Calling sequence:
 fits2rm, 'file.fits', RM=rm, EBINS=ph_edges, DETBINS=ct_edges

 Inputs:
 file - name of FITS file to read from.

 Output keywords:
 RM - response matrix, dimensioned n_detector_channels x n_input_energy_bins
 EBINS - energy boundaries for input energy bins
 DETBINS - energy boundaries for detector channels
 PRIMARY_HEADER - first header from FITS file.
 EXT_HEADER - header from SPECRESP extension.
 EBOUNDS_HEADER - header from EBOUNDS extension.
 ERR_MSG = error message.  Null if no error occurred.
 ERR_CODE - 0/1 if [ no error / an error ] occurred during execution.

 Calls: ***
	CHECKVAR [1], EXIST, FITS_OPEN, FXPAR [1], FXPAR [2], MRDFITS [1], MRDFITS [2]
	N_DIMENSIONS, STR2ARR [1], STR2ARR [2], TRIM, VALID_NUM [1], VALID_NUM [2]
	VALID_NUM [3], checkvar [2], required_tags
 CALLED BY:
	hessi_fits2drm [1], hessi_fits2drm [2], hessi_fits2drm [3]
	spex_hessi_fits2drm, spex_xsm_fits2drm
 Modification History:
 9-aug-2002, Paul Bilodeau - added support for 3-d arrays.
 19-Feb-2004, Kim Tolbert - added check that file is an rm file by looking for type*matrix
 20-Jul-2004, Kim - call fits_info and mrdfits with /silent
 11-Oct-2005, Kim - use fits_open instead of fits_info.  fits_info can't handle long headers -
   doesn't read the whole header, so if a keyword is near bottom of header, can't find it.


fits2spectrum $SSW/gen/idl/fits/fits2spectrum.pro
[Previous] [Next]
 Name: fits2spectrum

 Category: HESSI, UTIL, FITS

 Purpose: Read spectral rate data from a FITS file, including the ENEBAND
 extension, if any.

 Calling sequence:

 Inputs:
 file - FITS file to read.
 Extnumber - extension number to find Rate or Flux

 Outputs:

 Input keywords:
 EXTNAME - keyword passed to rd_fits_ext.  Trapped.
  The next three keywords control which extension(s) are read.  If
  none of these are set, then all three of the primary, rate, and
  eneband data extensions are read.
 READ_PRIMARY - Set to read primary header.
 READ_RATE - Set to read rate extension data.
 READ_ENEBAND - set to read eneband extension data.
 EXTNO - extension number to read.  Trapped.
 SETNO - number of extension with given extension type to read in
         file.  Set this to 1 if you want the second rate extension
         and its corresponding eneband extension.
 SILENT - Set this to suppress printing of error messages.

 Output keywords:
 PRIMARY_HEADER - primary FITS header
 EXT_HEADER - header for the RATE extension, with any necessary
 	       keywords.
 EXT_DATA - data from the RATE / Flux extension.
 EXT_STATUS - status from mrdfits call to read rate extension.
 ENEBAND_HEADER - header from the ENEBAND extension, if any.
 ENEBAND_DATA - data from the ENEBAND extension, if any.
 ENEBAND_STATUS - status from mrdfits call to read eneband extension.
 ERR_MSG - error message.  Null if no error occurred.
 ERR_CODE - 0/1 if [ no error / an error ] occurred during execution.

 Calls: ***
	FITS_INFO [1], FITS_INFO [2], HEADFITS [1], HEADFITS [2], HEADFITS [3]
	MRDFITS [1], MRDFITS [2], SSW_PICKFILE, rd_fits_ext
 CALLED BY:
	HSI_RD_FITS_SPECTRUM, hsi_spectrum_fitsread, read_hessi_4_ospex
	read_hessi_4_spex [1], read_hessi_4_spex [2]
 Modification History:
   9-aug-2002, Paul BIlodeau - rewrote to use rd_fits_ext, headfits,
     and ssw_pickfile.  Added SILENT kewyord.
 19-Feb-2004, Kim Tolbert - added check that file is a rate file by looking for type*rate


FITS2TIFF $SSW/gen/idl/fits/fits2tiff.pro
[Previous] [Next]
 Project     :	Solar-B

 Name        :	FITS2TIFF

 Purpose     :	convert FITS file to TIFF file

 Explanation :	Reads a FITS file, byte scales it, and
               then writes it to TIFF file

 Use         :	FITS2TIFF,INFILE,OUTFILE

 Inputs      :	IFILE = input FITS file name
               OFILE = output TIFF file name 
                       [def = same as IFILE with .tiff extension]
               OUTSIZE = rescale to size [dim1,dim2]
               COLORS = load color table
               LOG    = log scale image
               NOCLOBBER = do not clobber existing files

 Written     :	2-May-2006, Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu
 CALLS:


fits2time [1] $SSW/gen/idl/genutil/fits2time.pro
[Previous] [Next]
   Name: fits2time

   Purpose: convert fits header times to Yohkoh convention

   Input Parameters:
      header - fits header or fits file name array

   Keyword Parameters:
      soho - switch, if set, fits header is SOHO time convention
        kp - switch, if set, fits uses KittPeak time convention

 CALLS: ***
	FILE_EXIST [2], FXPAR [1], FXPAR [2], MESAGE, RFITS2 [1], RFITS2 [2], anytim2ex [1]
	anytim2ex [2], ex2fid [1], ex2fid [2], file_exist [1], file_exist [3], fmt_tim [1]
	fmt_tim [2], is_member [1], is_member [2]
 CALLED BY:
	ALIGN1BIGGRAM
   History:
      25-oct-1994 (SLF) Proto written
       8-Feb-1995 (SLF) update KP option#2
      25-sep-1995 (SLF) MSO-like option


FITS__DEFINE $SSW/gen/idl/objects/fits__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FITS__DEFINE

 Purpose     : Define a FITS map object

 Category    : imaging maps objects
               
 Syntax      : This procedure is invoked when a new FITS object is
               created via:

               IDL> new=obj_new('fits')

 CALLS: ***
	DPRINT, EXIST, FIND_COMPRESSED, FITS::CLEANUP, FITS::INDEX2FITS, FITS::INIT
	FITS::MREADFITS, FITS::READ, FITS::READFITS, HAVE_PROC, IS_BLANK, IS_COMPRESSED
	MERGE_STRUCT, MRDFITS [1], MRDFITS [2], MRD_HEAD, OS_FAMILY, SINCE_VERSION [1]
	SINCE_VERSION [2], TRIM, fitshead2struct, is_number [1], is_number [2], is_struct
	mreadfits
 History     : Written 19 May 1998, D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


FITS_ADD_CHECKSUM $SSW/gen/idl_libs/astron/fits/fits_add_checksum.pro
[Previous] [Next]
 NAME:
    FITS_ADD_CHECKSUM
 PURPOSE:
    Add or update the CHECKSUM and DATASUM keywords in a FITS header
 EXPLANATION: 
     Follows the 23 May 2002 version of the FITS checksum proposal at 
     http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
 CALLING SEQUENCE:
     FITS_ADD_CHECKSUM, Hdr, [ Data, /No_TIMESTAMP, /FROM_IEEE ]
 INPUT-OUTPUT:
     Hdr - FITS header (string array), it will be updated with new 
           (or modfied) CHECKSUM and DATASUM keywords 
 OPTIONAL INPUT:
     Data - data array associated with the FITS header.   If not supplied, or
           set to a scalar, then the program checks whether there is a 
           DATASUM keyword already in the FITS header containing the 32bit
           checksum for the data.   if there is no such keyword then ther 
           assumed to be no data array 
           associated with the FITS header.
 OPTIONAL INPUT KEYWORDS:
    /FROM_IEEE - If this keyword is set, then the input is assumed to be in 
             big endian format (e.g. an untranslated FITS array).    This 
             keyword only has an effect on little endian machines (e.g. 
             a Linux box).
    /No_TIMESTAMP - If set, then a time stamp is not included in the comment
             field of the CHECKSUM and DATASUM keywords.   Unless the 
             /No_TIMESTAMP keyword is set, repeated calls to FITS_ADD_CHECKSUM
             with the same header and data will yield different values of 
             CHECKSUM (as the date stamp always changes).   However, use of the
             date stamp is recommended in the checksum proposal. 
 PROCEDURES USED:
     CHECKSUM32, FITS_ASCII_ENCODE(), GET_DATE, SXADDPAR, SXPAR()
 REVISION HISTORY:
     W. Landsman    SSAI    December 2002
 CALLS:
 CALLED BY
	MODFITS, WRITEFITS [1], WRITEFITS [2]


FITS_ASCII_ENCODE $SSW/gen/idl_libs/astron/fits/fits_ascii_encode.pro
[Previous] [Next]
 NAME:
    FITS_ASCII_ENCODE()
 PURPOSE:
    Encode an unsigned longword as an ASCII string to insert in a FITS header
 EXPLANATION:
     Follows the 23 May 2002 version of the FITS checksum proposal at 
     http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
 CALLING SEQUENCE:
     result = FITS_ASCII_ENCODE( sum32)
 INPUTS:
     sum32 - 32bit *unsigned longword* (e.g. as returned by CHECKSUM32)
 RESULT:
     A 16 character scalar string suitable for the CHECKSUM keyword
 CALLED BY:
	FITS_ADD_CHECKSUM, FITS_TEST_CHECKSUM [1], FITS_TEST_CHECKSUM [2]
 EXAMPLE:
      A FITS header/data unit has a checksum of 868229149.  Encode the 
      complement of this value (3426738146) into an ASCII string

      IDL> print,FITS_ASCII_ENCODE(3426738146U)
           ===> "hcHjjc9ghcEghc9g"

 METHOD:
      The 32bit value is interpreted as a sequence of 4 unsigned 8 bit 
      integers, and divided by 4.    Add an offset of 48b (ASCII '0'). 
      Remove non-alphanumeric ASCII characters (byte values 58-64 and 91-96)
      by simultaneously incrementing and decrementing the values in pairs.
      Cyclicly shift the string one place to the right.
                  
 REVISION HISTORY:
     Written  W. Landsman  SSAI              December 2002


FITS_CD_FIX $SSW/gen/idl_libs/astron/astrom/fits_cd_fix.pro
[Previous] [Next]
 NAME:
    FITS_CD_FIX

 PURPOSE:
    Update obsolete representations of the CD matrix in a FITS header   

 EXPLANATION:
    According the paper, "Representations of Celestial Coordinates in FITS"
    by Calabretta & Greisen (2002, A&A, 395, 1077, available at 
    http://www.aoc.nrao.edu/~egreisen/ )the rotation of an image from
    standard coordinates is represented by a coordinate description (CD) 
    matrix.    The standard representation of the CD matrix are PCn_m 
    keywords, but CDn_m keywords (which include the scale factors) are
    also allowed.    However, earliers drafts of the standard allowed the
    keywords forms CD00n00m and PC00n00m.      This procedure will convert
    FITS CD matrix keywords containing zeros into the standard forms 
    CDn_m and PCn_m containing only underscores.

 CALLING SEQUENCE:
    FITS_CD_FIX, Hdr

 INPUT-OUTPUT: 
       HDR - FITS header, 80 x N string array.   If the header does not
           contain 'CD00n00m' or 'PC00n00m' keywords then it is left 
           unmodified.  Otherwise, the keywords containing integers are
           replaced with those containing underscores.
   
 OPTIONAL KEYWORD INPUT
      /REVERSE - this keyword does nothing, but is kept for compatiblity with
            earlier versions.
 PROCEDURES USED:
    SXADDPAR, SXDELPAR, SXPAR()
 REVISION HISTORY:
    Written   W. Landsman             Feb 1990
    Major rewrite                     Feb 1994
    Converted to IDL V5.0   W. Landsman   September 1997
    Use double precision formatting of CD matrix   W. Landsman  April 2000
    Major rewrite to convert only to forms recognized by the Greisen
       & Calabretta standard   W. Landsman   July 2003
 CALLS:


FITS_CLOSE $SSW/gen/idl_libs/astron/fits/fits_close.pro
[Previous] [Next]
 NAME:
      FITS_CLOSE

*PURPOSE:
       Close a FITS data file

*CATEGORY:
       INPUT/OUTPUT

*CALLING SEQUENCE:
       FITS_CLOSE,fcb

*INPUTS:
       FCB: FITS control block returned by FITS_OPEN.

*KEYWORD PARAMETERS:
       /NO_ABORT: Set to return to calling program instead of a RETALL
               when an I/O error is encountered.  If set, the routine will
               return  a non-null string (containing the error message) in the
               keyword MESSAGE.   If /NO_ABORT not set, then FITS_CLOSE will 
               print the message and issue a RETALL
       MESSAGE = value: Output error message
       
*EXAMPLES:
       Open a FITS file, read some data, and close it with FITS_CLOSE

               FITS_OPEN,'infile',fcb
               FITS_READ,fcb,data
               FITS_READ,fcb,moredata
               FITS_CLOSE,fcb

*HISTORY:
       Written by:     D. Lindler      August, 1995
       Converted to IDL V5.0   W. Landsman   September 1997
       Do nothing if fcb an invalid structure D. Schlegel/W. Landsman Oct. 2000
       Return Message='' for to signal normal operation W. Landsman Nov. 2000
 CALLED BY
	FITS_HELP, FITS_READ, FITS_WRITE, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT
	MODFITS, RDFITS_STRUCT, WFPC2_READ, get_fits_extno


FITS_DATATYPE $SSW/gen/idl/fits/fits_datatype.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       FITS_DATATYPE()

 PURPOSE: 
       Return datatype of FITS data for the given BITPIX value

 CATEGORY:
       Utility
 
 SYNTAX: 
       Result = fits_datatype(bitpix)

 INPUTS:
       BITPIX - Integer, value of keyword BITPIX in FITS header

 OPTIONAL INPUTS: 
       FLAG   - Integer flag for output format described below
                (consistent with the one used in DATATYPE); default to 0 

 OUTPUTS:
       RESULT - Either a string or integer of the data type specified
                by BITPIX. Depending on the value of FLAG, the result
                will be one of the values from the following table:

                FLAG = 0       FLAG = 1           FLAG = 2       FLAG = 3

                UND            Undefined          0              UND
                BYT            Byte               1              BYT
                INT            Integer            2              INT
                LON            Long               3              LON
                FLO            Float              4              FLT
                DOU            Double             5              DBL

                For invalid value of BITPIX, datatype is assumed undefined.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       ERROR - Named variable containing error message. If no error
               occurs, the null string is returned.

 CALLED BY:
	ITOOL_MODIFY_FH, ITOOL_WRITE_FITS
 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 HISTORY:
       Version 1, August 14, 1997, Liyun Wang, NASA/GSFC. Written

 CONTACT:
       Liyun Wang, NASA/GSFC (Liyun.Wang.1@gsfc.nasa.gov)


fits_disp_month [1] $SSW/gen/idl/genutil/fits_disp_month.pro
[Previous] [Next]
NAME:
	fits_disp_month
PURPOSE:
	To display a single image per day for a single month
CALLING SEQUENCE:
	fits_disp_month, files, -50, 50
	fits_disp_month, file_list('/data14/mdi_summary/daily/maglc', 'smdi_maglc_fd_199611*')
METHOD:
	The date of the first image defines which month is to be displayed
	"DATEOBS" fits keyword must be in the header.
	If smin/smax are not passed, then the first image defines the
	image scaling min and max
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], RFITS [1], RFITS [2], RFITS [3], SXPAR [1]
	SXPAR [2], SXPAR [3], anytim2ex [1], anytim2ex [2], anytim2ints [1]
	anytim2ints [2], ex2dow [1], ex2dow [2], fmt_tim [1], fmt_tim [2], gt_day [1]
	gt_day [2], tv2 [1], tv2 [2], zbuff2file [1], zbuff2file [2]
 CALLED BY:
	do_disp_month
HISTORY:
	Written 27-Nov-96 by M.Morrison (taking SXT disp_month.pro)
	19-May-97 (MDM) - Added writing boarder lines (because of MDI HR)
	20-May-97 (MDM) - Added output of HTML map file (mappre and mapfil options)
	30-May-97 (MDM) - Modified to work with EIT FITS files (no header
			  tag "DATEOBS") so got DATE-OBS and TIME-OBS
			- Added img_scale option
	16-Jun-97 (MDM) - Corrected error if image for first of the month
			  is missing.


FITS_HELP $SSW/gen/idl_libs/astron/fits/fits_help.pro
[Previous] [Next]
 NAME:
       FITS_HELP

 PURPOSE:
       To print a summary of the primary data units and extensions in a
       FITS file.
;
 CALLING SEQUENCE:
       FITS_HELP,filename_or_fcb

 INPUTS:
       FILENAME_OR_FCB - name of the fits file or the FITS Control Block (FCB)
               returned by FITS_OPEN.     For versions since V5.3, the 
               file name is allowed to be gzip compressed (with a .gz 
               extension)

 OUTPUTS:
       a summary of the fits file is printed.  

 CALLS: ***
	FITS_CLOSE, FITS_OPEN
 EXAMPLES:
       FITS_HELP,'myfile.fits'

       FITS_OPEN,'anotherfile.fits',fcb
       FITS_HELP,fcb

 PROCEDURES USED:
       FITS_OPEN, FITS_CLOSE
 HISTORY:
       Written by:     D. Lindler      August, 1995
       Converted to IDL V5.0   W. Landsman   September 1997
       Don't truncate EXTNAME values at 10 chars  W. Landsman Feb. 2005


FITS_INFO [1] $SSW/gen/idl/fits/fits_info.pro
[Previous] [Next]
 NAME:
     FITS_INFO
 PURPOSE:
     Provide information about the contents of a FITS file
 EXPLANATION:
     Information includes number of header records and size of data array.
     Applies to primary header and all extensions.    Information can be 
     printed at the terminal and/or stored in a common block

     This routine is mostly obsolete, and better results can be usually be
     performed with FITS_HELP (for display) or FITS_OPEN (to read FITS 
     information into a structure)

 CALLING SEQUENCE:
     FITS_INFO, Filename, [ /SILENT , TEXTOUT = , N_ext = ]

 INPUT:
     Filename - Scalar string giving the name of the FITS file(s)
               Can include wildcards such as '*.fits'.   In IDL V5.5 one can
               use the regular expressions allowed by the FILE_SEARCH()
               function.     One can also search gzip compressed 
               FITS files.
 OPTIONAL INPUT KEYWORDS:
     /SILENT - If set, then the display of the file description on the 
                terminal will be suppressed

      TEXTOUT - specifies output device.
               textout=1        TERMINAL using /more option
               textout=2        TERMINAL without /more option
               textout=3        <program>.prt
               textout=4        laser.tmp
               textout=5        user must open file, see TEXTOPEN
               textout=7       append to existing <program.prt> file
               textout = filename (default extension of .prt)

               If TEXTOUT is not supplied, then !TEXTOUT is used
 OPTIONAL OUTPUT KEYWORD:
       N_ext - Returns an integer scalar giving the number of extensions in
               the FITS file

 COMMON BLOCKS
       DESCRIPTOR =  File descriptor string of the form N_hdrrec Naxis IDL_type
               Naxis1 Naxis2 ... Naxisn [N_hdrrec table_type Naxis
               IDL_type Naxis1 ... Naxisn] (repeated for each extension) 
               For example, the following descriptor 
                    167 2 4 3839 4 55 BINTABLE 2 1 89 5
 
               indicates that the  primary header containing 167 lines, and 
               the primary (2D) floating point image (IDL type 4) 
               is of size 3839 x 4.    The first extension header contains
               55 lines, and the  byte (IDL type 1) table array is of size
               89 x 5.

               The DESCRIPTOR is *only* computed if /SILENT is set.
 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], MRD_SKIP [1], MRD_SKIP [2], STRN [1]
	STRN [2], STRN [3], SXPAR [1], SXPAR [2], SXPAR [3], TEXTCLOSE [1], TEXTCLOSE [2]
	TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3]
 CALLED BY:
	ATV, GET_FITS_INSTR, SUMER_FITS, fits2spectrum, slog_headinfo, spex_hessi_fits2drm
	xsm_fits2spectrum
 EXAMPLE:
       Display info about all FITS files of the form '*.fit' in the current
               directory

               IDL> fits_info, '*.fit'

       Any time a *.fit file is found which is *not* in FITS format, an error 
       message is displayed at the terminal and the program continues

 PROCEDURES USED:
       GETTOK(), MRD_SKIP, STRN(), SXPAR(), TEXTOPEN, TEXTCLOSE 

 SYSTEM VARIABLES:
       The non-standard system variables !TEXTOUT and !TEXTUNIT will be  
       created by FITS_INFO if they are not previously defined.   

       DEFSYSV,'!TEXTOUT',1
       DEFSYSV,'!TEXTUNIT',0

       See TEXTOPEN.PRO for more info
 MODIFICATION HISTORY:
       Written, K. Venkatakrishna, Hughes STX, May 1992
       Added N_ext keyword, and table_name info, G. Reichert
       Work on *very* large FITS files   October 92
       More checks to recognize corrupted FITS files     February, 1993
       Proper check for END keyword    December 1994
       Correctly size variable length binary tables  WBL December 1994
       EXTNAME keyword can be anywhere in extension header WBL  January 1998
       Correctly skip past extensions with no data   WBL   April 1998
       Converted to IDL V5.0, W. Landsman, April 1998
       No need for !TEXTOUT if /SILENT D.Finkbeiner   February 2002
       Define !TEXTOUT if needed.  R. Sterner, 2002 Aug 27
       Work on gzip compressed files for V5.3 or later  W. Landsman 2003 Jan
       Improve speed by only reading first 36 lines of header 
       Count headers with more than 32767 lines         W. Landsman Feb. 2003
       Assume since V5.3 (OPENR,/COMPRESS)   W. Landsman Feb 2004
       EXTNAME keyword can be anywhere in extension header again 
                         WBL/S. Bansal Dec 2004


FITS_INFO [2] $SSW/gen/idl_libs/astron/fits/fits_info.pro
[Previous] [Next]
 NAME:
     FITS_INFO
 PURPOSE:
     Provide information about the contents of a FITS file
 EXPLANATION:
     Information includes number of header records and size of data array.
     Applies to primary header and all extensions.    Information can be 
     printed at the terminal and/or stored in a common block

     This routine is mostly obsolete, and better results can be usually be
     performed with FITS_HELP (for display) or FITS_OPEN (to read FITS 
     information into a structure)

 CALLING SEQUENCE:
     FITS_INFO, Filename, [ /SILENT , TEXTOUT = , N_ext = ]

 INPUT:
     Filename - Scalar string giving the name of the FITS file(s)
               Can include wildcards such as '*.fits', or regular expressions 
               allowed by the FILE_SEARCH() function.     One can also search 
               gzip compressed  FITS files.
 OPTIONAL INPUT KEYWORDS:
     /SILENT - If set, then the display of the file description on the 
                terminal will be suppressed

      TEXTOUT - specifies output device.
               textout=1        TERMINAL using /more option
               textout=2        TERMINAL without /more option
               textout=3        <program>.prt
               textout=4        laser.tmp
               textout=5        user must open file, see TEXTOPEN
               textout=7       append to existing <program.prt> file
               textout = filename (default extension of .prt)

               If TEXTOUT is not supplied, then !TEXTOUT is used
 OPTIONAL OUTPUT KEYWORD:
       N_ext - Returns an integer scalar giving the number of extensions in
               the FITS file

 COMMON BLOCKS
       DESCRIPTOR =  File descriptor string of the form N_hdrrec Naxis IDL_type
               Naxis1 Naxis2 ... Naxisn [N_hdrrec table_type Naxis
               IDL_type Naxis1 ... Naxisn] (repeated for each extension) 
               For example, the following descriptor 
                    167 2 4 3839 4 55 BINTABLE 2 1 89 5
 
               indicates that the  primary header containing 167 lines, and 
               the primary (2D) floating point image (IDL type 4) 
               is of size 3839 x 4.    The first extension header contains
               55 lines, and the  byte (IDL type 1) table array is of size
               89 x 5.

               The DESCRIPTOR is *only* computed if /SILENT is set.
 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], MRD_SKIP [1], MRD_SKIP [2], STRN [1]
	STRN [2], STRN [3], SXPAR [1], SXPAR [2], SXPAR [3], TEXTCLOSE [1], TEXTCLOSE [2]
	TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3]
 CALLED BY:
	ATV, GET_FITS_INSTR, SUMER_FITS, fits2spectrum, slog_headinfo, spex_hessi_fits2drm
	xsm_fits2spectrum
 EXAMPLE:
       Display info about all FITS files of the form '*.fit' in the current
               directory

               IDL> fits_info, '*.fit'

       Any time a *.fit file is found which is *not* in FITS format, an error 
       message is displayed at the terminal and the program continues

 PROCEDURES USED:
       GETTOK(), MRD_SKIP, STRN(), SXPAR(), TEXTOPEN, TEXTCLOSE 

 SYSTEM VARIABLES:
       The non-standard system variables !TEXTOUT and !TEXTUNIT will be  
       created by FITS_INFO if they are not previously defined.   

       DEFSYSV,'!TEXTOUT',1
       DEFSYSV,'!TEXTUNIT',0

       See TEXTOPEN.PRO for more info
 MODIFICATION HISTORY:
       Written, K. Venkatakrishna, Hughes STX, May 1992
       Added N_ext keyword, and table_name info, G. Reichert
       Work on *very* large FITS files   October 92
       More checks to recognize corrupted FITS files     February, 1993
       Proper check for END keyword    December 1994
       Correctly size variable length binary tables  WBL December 1994
       EXTNAME keyword can be anywhere in extension header WBL  January 1998
       Correctly skip past extensions with no data   WBL   April 1998
       Converted to IDL V5.0, W. Landsman, April 1998
       No need for !TEXTOUT if /SILENT D.Finkbeiner   February 2002
       Define !TEXTOUT if needed.  R. Sterner, 2002 Aug 27
       Work on gzip compressed files for V5.3 or later  W. Landsman 2003 Jan
       Improve speed by only reading first 36 lines of header 
       Count headers with more than 32767 lines         W. Landsman Feb. 2003
       Assume since V5.3 (OPENR,/COMPRESS)   W. Landsman Feb 2004
       EXTNAME keyword can be anywhere in extension header again 
                         WBL/S. Bansal Dec 2004
       Read more than 200 extensions  WBL   March 2005
       Work for FITS files with SIMPLE=F   WBL July 2005
       Assume since V5.4, fstat.compress available WBL April 2006


fits_interp $SSW/gen/idl/genutil/fits_interp.pro
[Previous] [Next]

 Interprets a FITS header and returns a structure with the
	tagnames matching the FITS keywords and tag values 
	equal to the keyword values.


PRO fits_interp, header, result, $
	inname=inname, instruc=instruc, ishort=ishort, fshort=fshort, $
	DASH2UNDERSCORE=dash2underscore
	
 INPUT PARAMETERS:
	header = FITS header, string array.

 OUTPUT PARAMETERS:
	result = structure with values.

 OPTIONAL INPUT KEYWORDS:
	inname = name of structure to be created, string.  Ignored
		if /INSTRUC is passed.  Default, generate a name
		based on the current date and time UT.
	instruc = structure to use for interpreting header.
		Default, create a structure based on the header
		and the values it contains.
	ishort - If set, use Integer type rather than Long.
		Ignored if INSTRUC is provided.
	fshort - If set, use Float type rather than Double.
		Ignored if INSTRUC is provided
	(See Restrictions)
	DASH2UNDERSCORE - If set, replace all instances of '-' with '_'
		instead of the default '_D$' (Unnecessary if INSTRUC is provide)

 USAGE:
	The header string array for a given FITS file can be read
	either with
		image = READFITS( 'FITS.filename', header )
	or
		header = HEADFITS( 'FITS.filename' ).
	The initial call to FITS_INTERP will define the
	structure with datatypes based on the values in the
	header.  It is good practice to use the /INNAME
	keyword to avoid structure definition conflicts.

	Subsequent calls to FITS_INTERP for the
	same kind of image files should use the INSTRUC keyword
	to enforce compatibility of the output structures.
	It is not possible to redefine the contents of a structure
	with a given name.

 CALLS: ***
	CREATE_STRUCT [1], CREATE_STRUCT [2], GETTOK [1], GETTOK [2], GETTOK [3]
	GETTOK [4], REPCHR [1], REPCHR [2], REPCHR [3], STRNUMBER [1], STRNUMBER [2]
	STRNUMBER [3], STRNUMBER [4], STR_SEP, TAG_EXIST [1], TAG_EXIST [2], id_esc
	str_replace [1], str_replace [2]
 CALLED BY:
	READ_NRH, mreadfits
 RESTRICTIONS:
	All byte, integer, and long values are interpreted as long;
	all float, double and E format values are interpreted as real*8.
	These conventions insure that if the range of values in the
	current header is small, there is still room for later, large
	data values.  The keywords ISHORT and FSHORT can be set
	to save storage if the data value ranges are KNOWN to be small.
	Remember, you cannot redefine the structure with a different
	choice for ISHORT or FSHORT.

	Blank fields may be interpreted with incorrect data types.

	Multiple Comment and History lines in the header are gathered into
	single .COMMENT and .HISTORY tags as string arrays.


 HISTORY:
	Written  September 30, 1994  Barry LaBonte
	Bug fix for structure name  October 6, 1994  BJL
	Separate comment and history tags  October 10, 1994  BJL
	Fix structure name case, order  October 14, 1994  BJL
	Better logic to identify value field  October 25, 1994 BJL
	Verify the END line in header  March 3, 1995   BJL
       4-April-1996 (S.L.Freeland)  - fixed (kluged?) problem with COMMENT
       11-April-1997 (S.L.Freeland) - same with HISTORY problem
       13-april-1997 (Craig DeForest) - protection if no comments
	5-August-1997 (Craig DeForest) - Fixed bug that prevented
		finding multiple {comment|header} lines with a structure 
		template.  Now you find up to the number of strings that
		are allocated in the structure template.
       21-August-1997 (S.L.Freeland) - implement Barry LaBonte suggestion
                                       (systime instead of ut_time)
       20-June-1998 (Zarro, SAC/GSFC) - changed REPCHR call to STR_REPLACE
	25-Jan-1999 (Craig DeForest) - Diked out use of the vascii array;
		replaced it with ID_ESC call.
       18-Jan-2006 (A. Vourlidas, W.T.Thompson)  - expanded typecode list to
                                     include UINT (SECCHI images)
	20-Jul-2006 (N.Rich) - Add DASH2UNDERSCORE keyword
   	18-Sep-2006 (N.Rich) - Fix(?) DASH2UNDERSCORE; initialize HEADER and
		COMMENT in result because was getting incorrect values in line 313


FITS_OPEN $SSW/gen/idl_libs/astron/fits/fits_open.pro
[Previous] [Next]
 NAME:
       FITS_OPEN

 PURPOSE:
       Opens a FITS (Flexible Image Transport System) data file.

 EXPLANATION:
       FITS_OPEN was modified in Sep 2006 to open with /SWAP_IF_LITTLE_ENDIAN
       It must be used with post-Sep 2006 versions of FITS_READ, FITS_WRITE
       and MODFITS.
*CATEGORY:
       INPUT/OUTPUT

*CALLING SEQUENCE:
       FITS_OPEN, filename, fcb

*INPUTS:
       filename : name of the FITS file to open, scalar string
                  FITS_OPEN can also open gzip compressed (.gz) file *for 
                  reading only*, although there is a performance penalty 
*OUTPUTS:
       fcb : (FITS Control Block) a IDL structure containing information
               concerning the file.  It is an input to FITS_READ, FITS_WRITE
               and FITS_CLOSE

 INPUT KEYWORD PARAMETERS:
       /APPEND: Set to append to an existing file.
       /HPRINT - print headers with routine HPRINT as they are read.
               (useful for debugging a strange file)
       /NO_ABORT: Set to return to calling program instead of a RETALL
               when an I/O error is encountered.  If set, the routine will
               return  a non-null string (containing the error message) in the
               keyword MESSAGE.    (For backward compatibility, the obsolete 
               system variable !ERR is also set to -1 in case of an error.)   
               If /NO_ABORT not set, then FITS_OPEN will print the message and
               issue a RETALL
       /UPDATE Set this keyword to open an existing file for update
       /WRITE: Set this keyword to open a new file for writing. 

 OUTPUT KEYWORD PARAMETERS:
       MESSAGE = value: Output error message.    If the FITS file was opened
               successfully, then message = ''.
       
*NOTES:
       The output FCB should be passed to the other FITS routines (FITS_OPEN,
       FITS_READ, FITS_HELP, and FITS_WRITE).  It has the following structure
       when FITS_OPEN is called without /WRITE or /APPEND keywords set.

           FCB.FILENAME - name of the input file
               .UNIT - unit number the file is opened to
               .NEXTEND - number of extensions in the file.
               .XTENSION - string array giving the extension type for each
                       extension.
               .EXTNAME - string array giving the extension name for each
                       extension. (null string if not defined the extension)
               .EXTVER - vector of extension version numbers (0 if not
                       defined)
               .EXTLEVEL - vector of extension levels (0 if not defined)
               .GCOUNT - vector with the number of groups in each extension.
               .PCOUNT - vector with parameter count for each group
               .BITPIX - BITPIX for each extension with values
                                  8    byte data
                                16     short word integers
                                32     long word integers
                               -32     IEEE floating point
                               -64     IEEE double precision floating point
               .NAXIS - number of axes for each extension.  (0 for null data
                       units)
               .AXIS - 2-D array where axis(*,N) gives the size of each axes
                       for extension N
               .START_HEADER - vector giving the starting byte in the file
                               where each extension header begins
               .START_DATA - vector giving the starting byte in the file
                               where the data for each extension begins

               .HMAIN - keyword parameters (less standard required FITS
                               keywords) for the primary data unit.
               .OPEN_FOR_WRITE - flag (0= open for read, 1=open for write, 
                                                2=open for update)
               .LAST_EXTENSION - last extension number read.
               .RANDOM_GROUPS - 1 if the PDU is random groups format,
                               0 otherwise
               .NBYTES - total number of (uncompressed) bytes in the FITS file

       When FITS open is called with the /WRITE or /APPEND option, FCB
       contains:

           FCB.FILENAME - name of the input file
               .UNIT - unit number the file is opened to
               .NEXTEND - number of extensions in the file.
               .OPEN_FOR_WRITE - flag (1=open for write, 2=open for append
                                       3=open for update)


*EXAMPLES:
       Open a FITS file for reading:
               FITS_OPEN,'myfile.fits',fcb

       Open a new FITS file for output:
               FITS_OPEN,'newfile.fits',fcb,/write
 PROCEDURES USED:
       HPRINT, SXDELPAR, SXPAR()
*HISTORY:
       Written by:     D. Lindler      August, 1995
       July, 1996      NICMOS  Modified to allow open for overwrite
                               to allow primary header to be modified
       DJL Oct. 15, 1996   corrected to properly extend AXIS when more
                       than 100 extensions present
       Converted to IDL V5.0   W. Landsman   September 1997
       Use Message = '' rather than !ERR =1 as preferred signal of normal
           operation   W. Landsman  November 2000
     	Lindler, Dec, 2001, Modified to use 64 bit words for storing byte
             positions within the file to allow support for very large
             files 
       Work with gzip compressed files W. Landsman    January 2003
       Fix gzip compress for V5.4 and earlier  W.Landsman/M.Fitzgerald Dec 2003 
       Assume since V5.3 (STRSPLIT, OPENR,/COMPRESS) W. Landsman Feb 2004
       Treat FTZ extension as gzip compressed W. Landsman Sep 2004
       Assume since V5.4 fstat.compress available W. Landsman Apr 2006
       FCB.Filename  now expands any wildcards W. Landsman July 2006
       Make ndata 64bit for very large files B. Garwood/W. Landsman Sep 2006
       Open with /SWAP_IF_LITTLE_ENDIAN, remove obsolete keywords to OPEN
                W. Landsman  Sep 2006
 CALLS:
 CALLED BY
	FITS_HELP, FITS_READ, FITS_WRITE, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT
	MODFITS, RDFITS_STRUCT, WFPC2_READ, find_fits_ext, fits2rm, get_fits_extno


FITS_READ $SSW/gen/idl_libs/astron/fits/fits_read.pro
[Previous] [Next]
 NAME:
       FITS_READ
 PURPOSE:
       To read a FITS file.

 EXPLANATION:
       ***NOTE** This version of FITS_READ must be used with a post Sep 2006
          version of FITS_OPEN.
 CALLING SEQUENCE:
       FITS_READ, filename_or_fcb, data [,header, group_par]

 INPUTS:
       FILENAME_OR_FCB - this parameter can be the FITS Control Block (FCB)
               returned by FITS_OPEN or the file name of the FITS file.  If
               a file name is supplied, FITS_READ will open the file with
               FITS_OPEN and close the file with FITS_CLOSE before exiting.
               When multiple extensions are to be read from the file, it is
               more efficient for the user to call FITS_OPEN and leave the
               file open until all extensions are read.

 OUTPUTS:
       DATA - data array.  If /NOSCALE is specified, BSCALE and BZERO
               (if present in the header) will not be used to scale the data.
               If Keywords FIRST and LAST are used to read a portion of the
               data or the heap portion of an extension, no scaling is done
               and data is returned as a 1-D vector. The user can use the IDL
               function REFORM to convert the data to the correct dimensions
               if desired.  If /DATA_ONLY is specified, no scaling is done.
       HEADER - FITS Header.  If an extension is read, and the /NO_PDU keyword
               parameter is not supplied, the primary data unit header
               and the extension header will be combined.  The header will have
               the form:

                       <required keywords for the extension: XTENSION, BITPIX,
                               NAXIS, ...>
                       BEGIN MAIN HEADER --------------------------------
                       <PDU header keyword and history less required keywords:
                               SIMPLE, BITPIX, NAXIS, ...>
                       BEGIN EXTENSION HEADER ---------------------------
                       <extension header less required keywords that were
                               placed at the beginning of the header.
                       END
               
               The structure of the header is such that if a keyword is
               duplicated in both the PDU and extension headers, routine
               SXPAR will print a warning and return the extension value of
               the keyword. SXADDPAR and SXADDHIST will add new keywords and
               history to the extension portion of the header unless the
               parameter /PDU is supplied in the calling sequence.

       GROUP_PAR - Group parameter block for FITS random groups format files
               or the heap area for variable length binary tables.
               Any scale factors in the header (PSCALn and PZEROn) are not
               applied to the group parameters.

 INPUT KEYWORD PARAMETERS:

       /NOSCALE: Set to return the FITS data without applying the scale
               factors BZERO and BSCALE.
       /HEADER_ONLY: set to read the header only.
       /DATA_ONLY: set to read the data only.  If set, if any scale factors
               are present (BSCALE or BZERO), they will not be applied.
       /NO_PDU: Set to not add the primary data unit header keywords to the
               output header.
       /NO_ABORT: Set to return to calling program instead of a RETALL
               when an I/O error is encountered.  If set, the routine will
               return  a non-null string (containing the error message) in the
               keyword MESSAGE.    (For backward compatibility, the obsolete 
               system variable !ERR is also set to -1 in case of an error.)   
               If /NO_ABORT not set, then FITS_READ will print the message and
               issue a RETALL
       /NO_UNSIGNED - By default, if  the header indicates an unsigned integer
              (BITPIX = 16, BZERO=2^15, BSCALE=1) then FITS_READ will output 
               an IDL unsigned integer data type (UINT).   But if /NO_UNSIGNED
               is set, then the data is converted to type LONG.  
       EXTEN_NO - extension number to read.  If not set, the next extension
               in the file is read.  Set to 0 to read the primary data unit.
       XTENSION - string name of the xtension to read
       EXTNAME - string name of the extname to read
       EXTVER - integer version number to read
       EXTLEVEL - integer extension level to read
       FIRST - set this keyword to only read a portion of the data.  It gives
               the first word of the data to read
       LAST - set this keyword to only read a portion of the data.  It gives
               the last word number of the data to read
       GROUP - group number to read for GCOUNT>1.  (Default=0, the first group)
       
 OUTPUT KEYWORD PARAMETERS:
       ENUM - Output extension number that was read.  
       MESSAGE = value: Output error message

 NOTES:
       Determination or which extension to read.
               case 1: EXTEN_NO specified. EXTEN_NO will give the number of the
                       extension to read.  The primary data unit is refered
                       to as extension 0. If EXTEN_NO is specified, XTENSION,
                       EXTNAME, EXTVER, and EXTLEVEL parameters are ignored.
               case 2: if EXTEN_NO is not specified, the first extension
                       with the specified XTENSION, EXTNAME, EXTVER, and
                       EXTLEVEL will be read.  If any of the 4 parameters
                       are not specified, they will not be used in the search.
                       Setting EXTLEVEL=0, EXTVER=0, EXTNAME='', or
                       XTENSION='' is the same as not supplying them.
               case 3: if none of the keyword parameters, EXTEN_NO, XTENSION,
                       EXTNAME, EXTVER, or EXTLEVEL are supplied.  FITS_READ
                       will read the next extension in the file.  If the
                       primary data unit (PDU), extension 0, is null, the
                       first call to FITS_READ will read the first extension
                       of the file.

               The only way to read a null PDU is to use EXTEN_NO = 0.

       If FIRST and LAST are specified, the data is returned without applying
       any scale factors (BSCALE and BZERO) and the data is returned in a
       1-D vector.  This will allow you to read any portion of a multiple
       dimension data set.  Once returned, the IDL function REFORM can be
       used to place the correct dimensions on the data.

       IMPLICIT IMAGES: FITS_READ will construct an implicit image
               for cases where NAXIS=0 and the NPIX1, NPIX2, and PIXVALUE
               keywords are present.  The output image will be:
                       image = replicate(PIXVALUE,NPIX1,NPIX2)

 CALLS: ***
	FITS_CLOSE, FITS_OPEN, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXDELPAR [1]
	SXDELPAR [2], SXDELPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
 CALLED BY:
	ATV, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT, MODFITS, RDFITS_STRUCT, WFPC2_READ
 EXAMPLES:
       Read the primary data unit of a FITS file, if it is null read the
       first extension:
               FITS_READ, 'myfile.fits', data, header

       Read the first two extensions of a FITS file and the extension with
       EXTNAME = 'FLUX' and EXTVER = 4
               FITS_OPEN, 'myfile.fits', fcb
               FITS_READ, fcb,data1, header2, exten_no = 1
               FITS_READ, fcb,data1, header2, exten_no = 2
               FITS_READ, fcb,data3, header3, extname='flux', extver=4
               FITS_CLOSE, fcb
       
       Read the sixth image in a data cube for the fourth extension.

               FITS_OPEN, 'myfile.fits', fcb
               image_number = 6
               ns = fcb.axis(0,4)
               nl = fcb.axis(1,4)
               i1 = (ns*nl)*(image_number-1)
               i2 = i2 + ns*nl-1
               FITS_READ,fcb,image,header,first=i1,last=i2
               image = reform(image,ns,nl,/overwrite)
               FITS_CLOSE

 PROCEDURES USED:
       FITS_CLOSE, FITS_OPEN
       SXADDPAR, SXDELPAR, SXPAR()
 WARNINGS:
       In Sep 2006, FITS_OPEN was modified to open FITS files using the
       /SWAP_IF_LITTLE_ENDIAN keyword to OPEN, so that subsequent routines 
       (FITS_READ, FITS_WRITE) did not require any byte swapping.    An error
       may result if an pre-Sep 2006 version of FITS_OPEN is used with a 
       post Sep 2006 version of FITS_READ, FITS_WRITE or MODFITS.
 HISTORY:
       Written by:     D. Lindler, August 1995
       Converted to IDL V5.0   W. Landsman   September 1997
       Avoid use of !ERR       W. Landsman   August 1999
       Read unsigned datatypes, added /no_unsigned   W. Landsman December 1999
       Don't call FITS_CLOSE unless fcb is defined   W. Landsman January 2000
       Set BZERO = 0 for unsigned integer data   W. Landsman  January 2000
       Only call IEEE_TO_HOST if needed          W. Landsman February 2000
       Ensure EXTEND keyword in primary header   W. Landsman April 2001
       Don't erase ERROR message when closing file  W. Landsman April 2002
       Assume at least V5.1 remove NANValue keyword  W. Landsman November 2002
       Work with compress files (read file size from fcb),
       requires updated (Jan 2003) version of FITS_OPEN W. Landsman Jan 2003
       Do not modify BSCALE/BZERO for  unsigned integers W. Landsman April 2006
       Asuume FITS_OPEN has opened the file with /SWAP_IF_LITTLE_ENDIAN
                         W. Landsman   September 2006
       Fix problem with /DATA_ONLY keyword  M.Buie/W.Landsman  October 2006


FITS_TEST_CHECKSUM [1] $SSW/gen/idl/fits/fits_test_checksum.pro
[Previous] [Next]
 NAME:
    FITS_TEST_CHECKSUM()
 PURPOSE:
    Verify the values of the CHECKSUM and DATASUM keywords in a FITS header 
 EXPLANATION: 
     Follows the 23 May 2002 version of the FITS checksum proposal at 
     http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
 
 CALLING SEQUENCE:
    result = FITS_TEST_CHECKSUM(HDR, [ DATA, ERRMSG=, /FROM_IEEE ])
 INPUTS:
    HDR - FITS header (vector string)
 OPTIONAL DATA:
    DATA - data array associated with the FITS header.   If not supplied, or
           set to a scalar, then there is assumed to be no data array 
           associated with the FITS header.
 RESULT:
     An integer -1, 0 or 1 indicating the following conditions:
           1 - CHECKSUM (and DATASUM) keywords are present with correct values
           0 - CHECKSUM keyword is not present
          -1 - CHECKSUM or DATASUM keyword does not have the correct value
               indicating possible data corruption.
 OPTIONAL INPUT KEYWORD:
    /FROM_IEEE - If this keyword is set, then the input is assumed to be in 
             big endian format (e.g. an untranslated FITS array).    This 
             keyword only has an effect on little endian machines (e.g. 
             a Linux box).
 OPTIONAL OUTPUT KEYWORD:
     ERRMSG - will contain a scalar string giving the error condition.   If
              RESULT = 1 then ERRMSG will be an empty string.   If this 
              output keyword is not supplied, then the error message will be
              printed at the terminal.
 NOTES:
     The header and data must be *exactly* as originally written in the FITS 
     file.  By default, some FITS readers may alter keyword values (e.g. 
     BSCALE) or append information (e.g. HISTORY or an inherited primary 
     header) and this will alter the checksum value.           
 PROCEDURES USED:
    CHECKSUM32, FITS_ASCII_ENCODE(), SXPAR()
 CALLS: ***
	CHECKSUM32, FITS_ASCII_ENCODE, SXPAR [1], SXPAR [2], SXPAR [3]
 EXAMPLE:
     Verify the CHECKSUM keywords in the primary header/data unit of a FITS 
     file 'test.fits'

     FITS_READ,'test.fits',data,hdr,/no_PDU,/NoSCALE
     print,FITS_TEST_CHECKSUM(hdr,data)

     Note the use of the /No_PDU and /NoSCALE keywords to avoid any alteration 
     of the FITS header
 REVISION HISTORY:
     W. Landsman  SSAI               December 2002
     Return quietly if CHECKSUM keywords not found W. Landsman May 2003


FITS_TEST_CHECKSUM [2] $SSW/gen/idl_libs/astron/fits/fits_test_checksum.pro
[Previous] [Next]
 NAME:
    FITS_TEST_CHECKSUM()
 PURPOSE:
    Verify the values of the CHECKSUM and DATASUM keywords in a FITS header 
 EXPLANATION: 
     Follows the 23 May 2002 version of the FITS checksum proposal at 
     http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
 
 CALLING SEQUENCE:
    result = FITS_TEST_CHECKSUM(HDR, [ DATA, ERRMSG=, /FROM_IEEE ])
 INPUTS:
    HDR - FITS header (vector string)
 OPTIONAL DATA:
    DATA - data array associated with the FITS header.   If not supplied, or
           set to a scalar, then there is assumed to be no data array 
           associated with the FITS header.
 RESULT:
     An integer -1, 0 or 1 indicating the following conditions:
           1 - CHECKSUM (and DATASUM) keywords are present with correct values
           0 - CHECKSUM keyword is not present
          -1 - CHECKSUM or DATASUM keyword does not have the correct value
               indicating possible data corruption.
 OPTIONAL INPUT KEYWORD:
    /FROM_IEEE - If this keyword is set, then the input is assumed to be in 
             big endian format (e.g. an untranslated FITS array).    This 
             keyword only has an effect on little endian machines (e.g. 
             a Linux box).
 OPTIONAL OUTPUT KEYWORD:
     ERRMSG - will contain a scalar string giving the error condition.   If
              RESULT = 1 then ERRMSG will be an empty string.   If this 
              output keyword is not supplied, then the error message will be
              printed at the terminal.
 NOTES:
     The header and data must be *exactly* as originally written in the FITS 
     file.  By default, some FITS readers may alter keyword values (e.g. 
     BSCALE) or append information (e.g. HISTORY or an inherited primary 
     header) and this will alter the checksum value.           
 PROCEDURES USED:
    CHECKSUM32, FITS_ASCII_ENCODE(), SXPAR()
 CALLS: ***
	CHECKSUM32, FITS_ASCII_ENCODE, SXPAR [1], SXPAR [2], SXPAR [3]
 EXAMPLE:
     Verify the CHECKSUM keywords in the primary header/data unit of a FITS 
     file 'test.fits'

     FITS_READ,'test.fits',data,hdr,/no_PDU,/NoSCALE
     print,FITS_TEST_CHECKSUM(hdr,data)

     Note the use of the /No_PDU and /NoSCALE keywords to avoid any alteration 
     of the FITS header
 REVISION HISTORY:
     W. Landsman  SSAI               December 2002
     Return quietly if CHECKSUM keywords not found W. Landsman May 2003
     Add /NOSAVE to CHECKSUM32 calls when possible W. Landsman Sep 2004


FITS_WRITE $SSW/gen/idl_libs/astron/fits/fits_write.pro
[Previous] [Next]
 NAME:
	FITS_WRITE

 PURPOSE:
	To write a FITS primary data unit or extension.

 EXPLANATION:
       ***NOTE** This version of FITS_READ must be used with a post Sep 2006
          version of FITS_OPEN.

 CALLING SEQUENCE:
	FITS_WRITE, filename_or_fcb, data, [header_in]

 INPUTS:
	FILENAME_OR_FCB: name of the output data file or the FITS control
		block returned by FITS_OPEN (called with the /WRITE or
		/APPEND) parameters.

 OPTIONAL INPUTS:
	DATA: data array to write.  If not supplied or set to a scalar, a
		null image is written.
	HEADER_IN: FITS header keyword.  If not supplied, a minimal basic
		header will be created.  Required FITS keywords, SIMPLE,
		BITPIX, XTENSION, NAXIS, ... are added by FITS_WRITE and
		do not need to be supplied with the header.  If supplied,
		their values will be updated as necessary to reflect DATA.

 INPUT KEYWORD PARAMETERS:

	XTENSION: type of extension to write (Default="IMAGE"). If not
		supplied, it will be taken from HEADER_IN.  If not in either
		place, the default is "IMAGE".  This parameter is ignored
		when writing the primary data unit.     Note that binary and
               and ASCII table extensions already have a properly formatted
               header (e.g. with TTYPE* keywords) and byte array data. 
	EXTNAME: EXTNAME for the extension.  If not supplied, it will be taken
		from HEADER_IN.  If not supplied and not in HEADER_IN, no
		EXTNAME will be written into the output extension.
	EXTVER: EXTVER for the extension.  If not supplied, it will be taken
               from HEADER_IN.  If not supplied and not in HEADER_IN, no
               EXTVER will be written into the output extension.
	EXTLEVEL: EXTLEVEL for the extension.  If not supplied, it will be taken
               from HEADER_IN.  If not supplied and not in HEADER_IN, no
               EXTLEVEL will be written into the output extension.
       /NO_ABORT: Set to return to calling program instead of a RETALL
               when an I/O error is encountered.  If set, the routine will
               return  a non-null string (containing the error message) in the
               keyword MESSAGE.   If /NO_ABORT not set, then FITS_WRITE will 
               print the message and issue a RETALL
	/NO_DATA: Set if you only want FITS_WRITE to write a header.  The
		header supplied will be written without modification and
		the user is expected to write the data using WRITEU to unit
		FCB.UNIT. When FITS_WRITE is called with /NO_DATA, the user is
		responsible for the validity of the header, and must write
		the correct amount and format of the data.  When FITS_WRITE
		is used in this fashion, it will pad the data from a previously
		written extension to 2880 blocks before writting the header.

 OUTPUT KEYWORD PARAMETERS:
       MESSAGE: value of the error message for use with /NO_ABORT
	HEADER: actual output header written to the FITS file.

 NOTES:
	If the first call to FITS_WRITE is an extension, FITS_WRITE will
	automatically write a null image as the primary data unit.

	Keywords and history in the input header will be properly separated
	into the primary data unit and extension portions when constructing
	the output header (See FITS_READ for information on the internal
	Header format which separates the extension and PDU header portions).
	
 CALLS: ***
	FITS_CLOSE, FITS_OPEN, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXDELPAR [1]
	SXDELPAR [2], SXDELPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
 CALLED BY:
	FTAB_DELROW
 EXAMPLES:
	Write an IDL variable to a FITS file with the minimal required header.
		FITS_WRITE,'newfile.fits',ARRAY

	Write the same array as an image extension, with a null Primary data
	unit.
		FITS_WRITE,'newfile.fits',ARRAY,xtension='IMAGE'

	Write 4 additional image extensions to the same file.
		FITS_OPEN,'newfile.fits',fcb
		FITS_WRITE,fcb,data1,extname='FLUX',extver=1
		FITS_WRITE,fcb,err1,extname'ERR',extver=1
		FITS_WRITE,fcb,data2,extname='FLUX',extver=2
		FITS_WRITE,fcb,err2,extname='ERR',extver=2
		FITS_CLOSE,FCB
		
 PROCEDURES USED:
	FITS_OPEN, SXADDPAR, SXDELPAR, SXPAR()
 HISTORY:
	Written by:	D. Lindler	August, 1995
	Work for variable length extensions  W. Landsman   August 1997
	Converted to IDL V5.0   W. Landsman   September 1997
	PCOUNT and GCOUNT added for IMAGE extensions   J. Graham  October 1999
       Write unsigned data types      W. Landsman   December 1999
       Pad data area with zeros not blanks  W. McCann/W. Landsman October 2000
       Return Message='' to signal normal operation W. Landsman Nov. 2000
       Ensure that required extension table keywords are in proper order
             W.V. Dixon/W. Landsman          March 2001
       Assume since V5.1, remove NaNValue keyword   W. Landsman Nov. 2002
       Removed obsolete !ERR system variable  W. Landsman Feb 2004
       Check that byte array supplied with table extension W. Landsman Mar 2004
       Make number of bytes 64bit to avoid possible overflow W.L  Apr 2006
       Asuume FITS_OPEN has opened the file with /SWAP_IF_LITTLE_ENDIAN
                         W. Landsman   September 2006


FITSDIR $SSW/gen/idl_libs/astron/fits/fitsdir.pro
[Previous] [Next]
 NAME:
     FITSDIR 
 PURPOSE:
     Display selected FITS keywords from the headers of FITS files.   
 EXPLANATION:

     The values of either user-specified or default FITS keywords are 
     displayed in either the primary header and/or the first extension header.
     Unless the /NOSIZE keyword is set, the data size is also displayed.
     The default keywords are as follows (with keywords in 2nd row used if
     those in the first row not found, and the 3rd row if neither the keywords
     in the first or second rows found:)

     DATE-OBS     TELESCOP   OBJECT    EXPTIME       
     TDATEOBS     TELNAME    TARGNAME  INTEG        ;First Alternative
     DATE         OBSERVAT             EXPOSURE     ;Second Alternative
                  INSTRUME             EXPTIM       ;Third Alternative

      FITSDIR will also recognize gzip compressed files (must have a .gz 
      or FTZ extension).
 CALLING SEQUENCE:
     FITSDIR , [ directory, TEXTOUT =, EXTEN=, KEYWORDS=, /NOSIZE, /NoTELESCOPE
                            ALT1_KEYWORDS= ,ALT2_KEYWORDS = ,ALT3_KEYWORDS =  

 OPTIONAL INPUT PARAMETERS:
     DIRECTORY - Scalar string giving file name, disk or directory to be 
             searched.   Wildcard file names are allowed.    Examples of 
             valid names include 'iraf/*.fits' (Unix), d:\myfiles\f*.fits',
             (Windows) or 'Macintosh HD:Files:*c0f.fits' (Macintosh).  
            
 OPTIONAL KEYWORD INPUT PARAMETER
      KEYWORDS - FITS keywords to display, as either a vector of strings or as
                 a comma delimited scalar string, e.g.'testname,dewar,filter'
                 If not supplied, then the default keywords are 'DATE-OBS',
                 'TELESCOP','OBJECT','EXPTIME'
      ALT1_KEYWORDS - A list (either a vector of strings or a comma delimited
                 strings of alternative keywords to use if the default 
                 KEYWORDS cannot be found.   By default, 'TDATEOBS', is the 
                 alternative to DATE-OBS, 'TELNAME' for 'TELESCOP','TARGNAME'
                 for 'OBJECT', and 'INTEG' for EXPTIME
      ALT2_KEYWORDS - A list (either a vector of strings or a comma delimited
                 strings of alternative keywords to use if neither KEYWORDS 
                 nor ALT1_KEYWORDS can be found.    
      ALT3_KEYWORDS - A list (either a vector of strings or a comma delimited
                 strings of alternative keywords to use if neither KEYWORDS 
                 nor ALT1_KEYWORDS nor ALT2_KEYWORDS can be found.    
      /NOSIZE - if set then information about the image size is not displayed  
      TEXTOUT - Controls output device as described in TEXTOPEN procedure
               textout=1       TERMINAL using /more option
               textout=2       TERMINAL without /more option
               textout=3       <program>.prt
               textout=4       laser.tmp
               textout=5       user must open file
               textout=7       Append to existing <program>.prt file
               textout = filename (default extension of .prt)
       EXTEN - Specifies an extension number (/EXTEN works for first extension)
               which is  checked for the  desired keywords.    
       /NOTELESCOPE - If set, then if the default keywords are used, then the
                TELESCOPE (or TELNAME, OBSERVAT, INSTRUME) keywords are omitted
                to give more room for display other keywords.   The /NOTELESCOP
                 keyword has no effect if the default keywords are not used.
 OUTPUT PARAMETERS:
       None.

 CALLS: ***
	FDECOMP [1], FDECOMP [2], FDECOMP [3], FXMOVE [1], FXMOVE [2], GETTOK [1]
	GETTOK [2], GETTOK [3], GETTOK [4], MRD_HREAD [1], MRD_HREAD [2], REMCHAR [1]
	REMCHAR [2], REMCHAR [3], SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], TEXTCLOSE [1]
	TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3], strsplit
 EXAMPLES:  
  (1) Print info on all'*.fits' files in the current  directory using default
          keywords.   Include information from the extension header     
       IDL> fitsdir,/exten

  (2) Write a driver program to display selected keywords in HST/ACS drizzled
       (*drz) images
         pro acsdir
        keywords = 'date-obs,targname,detector,filter1,filter2,exptime'
        fitsdir,'*drz.fits',key=keywords,/exten
        return & end

   (3)  Write info on all *.fits files in the Unix directory /usr2/smith, to a 
       file 'smith.txt' using the default keywords, but don't display the value
        of the TELESCOPE keyword

       IDL> fitsdir ,'/usr2/smith/*.fits',t='smith.txt', /NoTel 

 PROCEDURE:
       FILE_SEARCH()  is used to find the specified FITS files.   The 
       header of each file is read, and the selected keywords are extracted.
       The formatting is adjusted so that no value is truncated on display.        

 SYSTEM VARIABLES:
       TEXTOPEN (called by FITSDIR) will automatically define the following 
       non-standard system variables if they are not previously defined:

       DEFSYSV,'!TEXTOUT',1
       DEFSYSV,'!TEXTUNIT',0

 PROCEDURES USED:
       FDECOMP, FXMOVE, MRD_HREAD, REMCHAR
       TEXTOPEN, TEXTCLOSE
 MODIFICATION HISTORY:
       Written, W. Landsman,  HSTX    February, 1993
       Search alternate keyword names    W.Landsman    October 1998
       Avoid integer truncation for NAXISi >32767  W. Landsman  July 2000
       Don't leave open unit    W. Landsman  July 2000 
       Added EXTEN keyword, work with compressed files, additional alternate
       keywords W. Landsman     December 2000
       Don't assume floating pt. exposure time W. Landsman   September 2001
       Major rewrite, KEYWORD & ALT*_KEYWORDS keywords, no truncation, 
             /NOSIZE keyword     W. Landsman,  SSAI   August 2002
       Assume V5.3 or later W. Landsman November 2002
       Fix case where no keywords supplied  W. Landsman January 2003
       NAXIS* values must be integers W. Landsman SSAI  June 2003
       Trim spaces off of input KEYWORD values W. Landsman March 2004
       Treat .FTZ extension as gzip compressed  W. Landsman September 2004
       Assume since V5.5, file_search() available W. Landsman Aug 2006


fitshead2struct $SSW/gen/idl/fits/fitshead2struct.pro
[Previous] [Next]
   Name: fitshead2struct

   Purpose: convert FITS header->struct, optionally add useful standard TAGS

   Input Parameters:
      head - FITs header array (ex: output from <headfits>)
      template - use this template structure (after first call, for example)
     
   Keyword Parameters:
      ncomment - set maximum number of COMMENT records expected
      nhistory - set maxinum number of HISTORY records expected 
                 (default for ncomment and nhistory is acutal# X padding)
      add_standard - if switch, add some standard tags, including 
                         TIME, DAY,  MJD fields (if not present)
                     if add_struct is a STRUCTURE, add these fields
      wcs      - If set, add WCS structure

      Also takes any keywords accepted by FITSHEAD2WCS.

   Calling Sequence:
      struct=fitshead2struct(header)
      struct=fitshead2struct(header, /add_standard) ; include SSW standards

 CALLED BY:
	DO_EIT_MAP, DO_EIT_SCALING, EIT__DEFINE, FF_SUMMARY, FITS2MAP [1], FITS2MAP [2]
	FITSFILE__DEFINE [2], FITSHEAD2WCS, FITS__DEFINE, HFITS__DEFINE, ITOOL_RD_FITS
	ITOOL_TRACE_SCALE, MAKE_BKGD, OPEN_ANACUBE, Radio Spectrogram FITS File reader
	Radiospectrogram FITS File reader [1]
	Radiospectrogram FITS File reader [2], SXIG12_PREP, SXIG12_READ [1]
	SXIG12_READ [2], SXIG12_READ_ONE [1], SXIG12_READ_ONE [2], WCS2FITSHEAD
	WCS_FIND_SYSTEM, datify, fitsgen, hsi_image_fitsread, lasco_time2file, mdialign
	mreadfits, mreadfits_urls, read_soon, sxi_arcs2pix, sxi_hel2arcs, sxi_parv2pix
	sxi_pix2arcs, sxi_pix2hel, update_history, zcheck_hdr, zstructify
   History:
      24-feb-1997 - S.L.Freeland - based upon some other SSW routines...
                    (inspired by fits_interp.pro by Barry Labonte)
      27-feb-1997 - improve ADD_STANDARD logic (use <sswfits_struct> tags)
                    increased protection against malformed headers
       9-apr-1997 - Allow user specified structure for ADD_STANDARD 
      19-Jan-1998 - Added id_esc to the tagname conversion -- CED
      14-Jun-1998 - Added check for error-causing non-numeric structure fields (Zarro, SAC/GSFC)
       2-Mar-1999 - Use 'id_unesc' in fxpar calls 
      19-mar-1999 - per DMZ, assure predefined tags expand to fit input
      10-Dec-1999 - S.L.Freeland, per Barry Labonte - fixed logic bug
                    which would 'miss' keywords 1 character in length
      09-May-2003, William Thompson - Use ssw_strsplit instead of strsplit
      10-Jul-2003, William Thompson - Treat CROTA1/CROTA2 correctly
               Use DATE-OBS/TIME-OBS as substitute for DATE_OBS
      3-Nov-2003, Zarro (L-3/GSFC) - fixed string to integer conversion errors
      14-Apr-2006, William Thompson, GSFC, Added /WCS keyword
 
   Motivation:
      use by mreadfits if no structure template is passed 
      (to permit vectorized FITS file header operations)

   Routines Called:
      fxpar, fxaddpar, make_str, data_chk, ssw_strsplit, str_replace, 
      strjustify, fmt_tag, uniq, rem_elem, prstr, id_esc, fitshead2wcs

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], ANYTIM2UTC [1], ANYTIM2UTC [2], ARR2STR [1], Arr2Str [2]
	BOOST_TAG, DATATYPE [1], DATATYPE [2], DATATYPE [3], FITSHEAD2WCS, FMT_TAG [1]
	FMT_TAG [2], FXADDPAR [1], FXADDPAR [2], FXKVALUE, FXPAR [1], FXPAR [2], IS_STRING
	MAKE_STR [1], MAKE_STR [2], TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2]
	UNIQ [3], data_chk [1], data_chk [2], id_esc, id_unesc, is_number [1], is_number [2]
	prstr [1], prstr [2], rem_elem [1], rem_elem [2], ssw_strsplit, sswfits_struct [1]
	sswfits_struct [2], str_replace [1], str_replace [2], strarrcompress, strjustify
	strspecial [1], strspecial [2], tag_index [1], tag_index [2]
   Restrictions:
      NEED TO RESOLVE DATE-OBS/DATE_OBS mapping
      (scheduled for 28-feb-1997) (Done, CED 19-Jan-1998)


FITSHEAD2WCS $SSW/gen/idl/wcs/fitshead2wcs.pro
[Previous] [Next]
 Project     :	STEREO

 Name        :	FITSHEAD2WCS()

 Purpose     :	Extract WCS data from FITS header

 Category    :	FITS, Coordinates, WCS

 Explanation :	This procedure examines the FITS header (or index structure),
               and extracts the embedded World Coordinate System information.

 Syntax      :	WCS = FITSHEAD2WCS( HEADER )

 CALLED BY:
	INDEX2MAP, WCS_FIND_PIXEL_LIST, fitshead2struct, mreadfits
 Examples    :	FXREAD, FILENAME, DATA, HEADER
               WCS = FITSHEAD2WCS( HEADER )

 Inputs      :	HEADER = Either a FITS header, or an index structure from
                        FITSHEAD2STRUCT.

 Opt. Inputs :	None.

 Outputs     :	WCS = Structure containing World Coordinate System
                     information, including the following tags:

                   COORD_TYPE= The type of coordinate system, which is one of
                               the following:

                               Helioprojective-Cartesian (default if angular)
                               Heliocentric-Cartesian (if not angular)
                               Helioprojective-Radial
                               Stonyhurst-Heliographic
                               Carrington-Heliographic

                               Celestial-Equatorial
                               Celestial-Galactic
                               Celestial-Ecliptic
                               Celestial-Helioecliptic
                               Celestial-Supergalactic

                   WCSNAME   = The WCSNAME keyword from the FITS header.  If
                               not found, then will be the same as COORD_TYPE.
                   VARIATION = Either 'PC', 'CD', or 'CROTA'
                   COMPLIANT = True if all required WCS keywords found.
                               Having COMPLIANT=0 doesn't mean that the
                               returned WCS structure is wrong, but it does
                               mean that some of the information was inferred,
                               rather than read directly.
                   PROJECTION= The coordinate projection.  Default is 'TAN'
                               for angular coordinates, blank otherwise.
                   NAXIS     = The array dimensions.
                   IX        = IDL index for the longitude (X) dimension.
                               Note that the IDL index is 1 less than the FITS
                               index.  For example, if the header had the
                               keyword "CTYPE1='HPLN-TAN'", then IX=0.
                   IY        = IDL index for the latitude (Y) dimension.
                               The default is IX=0, IY=1.
                   CRPIX     = Reference pixels.  Note that these are in FITS
                               notation, which is 1 higher than IDL notation.
                               The reference pixel may also be fractional,
                               e.g. 10.5, and may be outside the array bounds.
                   CRVAL     = Reference values.
                   CTYPE     = Axis type, e.g. 'HPLN-TAN'
                   CNAME     = Character string describing axis, free form.
                   CUNIT     = Axis units, e.g. 'arcsec'
                   SIMPLE    = True if the WCS can be described as simple.
                               See wcs_simple.pro for details.

                     The presence of the following keywords depends on whether
                     the header uses the PC, CD, or CROTA variation.

                   CDELT     = Axis scale.  May be omitted if VARIATION='CD'.
                   PC        = Transformation matrix (CD or CROTA).
                   CD        = Alternate transformation matrix (CD only).
                   ROLL_ANGLE= Coordinate rotation angle.  Always present for
                               CROTA cases.  May also be present if PC or CD
                               matrix can be decomposed into a rotation angle.

                     The following keywords may be present, depending on the
                     FITS header.

                   PROJ_NAMES  = Names of additional keywords associated with
                                 the projection, e.g. LONPOLE, PV2_1.  The
                                 SYSTEM character, if any, is stripped off.
                   PROJ_VALUES = Array of values associated with PROJ_NAMES.

                     The structure may also contain the following
                     substructures for TIME and POSITION information.

                   TIME        = Substructure of time values.  See
                                 wcs_find_time.pro for more information.
                   POSITION    = Substructure of position values.  See
                                 wcs_find_position.pro for more information.

 Opt. Outputs:	None.

 Keywords    :	SYSTEM  = Selects which alternate coordinate system should be
                         used.  See wcs_find_system.pro for more information.

               MINIMAL = If set, then only a minimal WCS is generated, to save
                         processing time.  Used by INDEX2MAP.

               COLUMN  = Binary table column name or number.

               FILENAME= Used with headers containing the -TAB projection, so
                         that the lookup tables can be read.

               LUNFXB  = The logical unit number returned by FXBOPEN,
                         pointing to the binary table that the header
                         refers to.  Usage of this keyword allows
                         implementation of the "Greenbank Convention",
                         where keywords can be replaced with columns of
                         the same name.  It's also needed for tables
                         containing "iVn_Xa" or "iPVn_Xa" columns, and for
                         tables containing pixel lists.

               ROWFXB  = Used in conjunction with LUNFXB, to give the
                         row number in the table.  Default is 1.

               PIXEL_LIST = If set, then look for pixel list information in
                            the binary table.  Used in conjunction with
                            LUNFXB, but does not require ROWFXB.

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

				ERRMSG = ''
				WCS = FITSHEAD2WCS( HEADER, ERRMSG=ERRMSG, ...)
				IF ERRMSG NE '' THEN ...

               The following keywords are passed to WCS_DECOMP_ANGLE.

               PRECISION = Precision to be used when determining if the angle
                           can be successfully derived, and if there are any
                           significant cross terms involving non-spatial
                           dimensions.  The default is 1E-4, i.e. the results
                           should be correct to about 4 significant figures.

               NOXTERMS  = If set, then success is dependent on not having any
                           cross terms involving non-spatial dimensions.

 Calls       : ***
	BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FXBFIND [1]
	FXBFIND [2], FXBHEADER [1], FXBHEADER [2], FXBISOPEN [1], FXBISOPEN [2]
	FXBREAD [1], FXBREAD [2], FXBREAD [3], FXBTDIM [1], FXBTDIM [2], FXBTFORM [1]
	FXBTFORM [2], GET_FITS_PAR, IS_STRING, NTRIM, TAG_EXIST [1], TAG_EXIST [2]
	VALID_NUM [1], VALID_NUM [2], VALID_NUM [3], WCS_DECOMP_ANGLE, WCS_FIND_KEYWORD
	WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_SYSTEM
	WCS_FIND_TABLE, WCS_FIND_TIME, WCS_SIMPLE, delvarx [5], fitshead2struct
	struct2fitshead
 Common      :	None.

 Restrictions:	Currently only supports one FITS header at a time.  Binary
               tables are not yet supported.

 Notes       : The PC and CD matrices are ordered by row and column.  The
               following examples show how they are applied.

                       IJ = [I,J]      ;IDL Pixel coordinates
                       XY = CDELT * (PC # (IJ + 1 - CRPIX)) + CRVAL

               or

                       XY = (CD # (IJ + 1 - CRPIX)) + CRVAL

               Note that the +1 in the equations above takes care of the
               one-pixel offset between the IDL and FITS pixel notations.

               With spherical map projections, CRVAL is applied as part of the
               projection, rather than added in as above.

 Side effects:	If the FITS file doesn't contain CTYPE keywords, then either
               HPLN-TAN/HPLT-TAN (angles) or SOLX/SOLY (distances) are assumed
               for the first two axes.

 Prev. Hist. :	None.

 History     :	Version 1, 22-Apr-2005, William Thompson, GSFC
               Version 2, 25-Apr-2005, William Thompson, GSFC
                       Handle case where header doesn't have NAXIS.
               Version 3, 26-Apr-2005, William Thompson, GSFC
                       Add keyword ERRMSG -- use when no NAXIS
                       Roll angle doesn't need to be present if zero
               Version 4, 03-Jun-2005, William Thompson, GSFC
                       Improved logic of what assumptions to make
               Version 5, 08-Jun-2005, William Thompson, GSFC
                       Add call to WCS_FIND_SPECTRUM
                       Add CNAME, Add PS keywords
               Version 6, 14-Jun-2005, William Thompson, GSFC
                       Add support for the lookup table projection
               Version 7, 23-Jun-2005, William Thompson, GSFC
                       Add support for binary tables
                       Fixed bug with calculation of PC from CROTA
               Version 8, 06-Feb-2006, William Thompson, GSFC
                       Fixed bug reading PC,CD matrices for alternate systems
               Version 9, 1-Mar-2006, William Thompson, GSFC
                       Exit gracefully if no axes found.
               Version 9, 15-Mar-2006, William Thompson, GSFC
                       Fix some common units strings errors
               Version 10, 12-Mar-2006, William Thompson, GSFC
                       Added keyword PIXEL_LIST

 Contact     :	WTHOMPSON


FITSRGB_to_TIFF $SSW/gen/idl_libs/astron/fits/fitsrgb_to_tiff.pro
[Previous] [Next]
 NAME:
       FITSRGB_to_TIFF
 PURPOSE:
       Combine separate red, green, and blue FITS images into TIFF format
 EXPLANATION:
       The output TIFF (class R) file can have colors interleaved either
       by pixel or image.  The colour mix is also adjustable.

 CALLING SEQUENCE:
       FITSRGB_to_TIFF, path, rgb_files, tiff_name [,/BY_PIXEL, /PREVIEW,
                         RED= , GREEN =, BLUE =]

 INPUTS:
       path = file system directory path to the RGB files required.
       rgb_files = string array with three components - the red FITS file
                   filename, the blue FITS file filename and the green FITS
                   file filename

 OUTPUTS:
       tiff_name = string containing name of tiff file to be produced

 OPTIONAL OUTPUT:
       Header = String array containing the header from the FITS file.

 OPTIONAL INPUT KEYWORDS:
       BY_PIXEL = This causes TIFF file RGB to be interleaved by pixel
                  rather than the default of by image.
       PREVIEW  = Allows a 24 bit image to be displayed on the screen
                  to check the colour mix.
       RED = Real number containing the fractional mix of red
       GREEN = Real number containing the fractional mix of green
       BLUE = Real number containing the fractional mix of blue

 EXAMPLE:
       Read three FITS files, 'red.fits', 'blue.fits' and 'green.fits' from
       the directory '/data/images/space' and output a TIFF file named
       'colour.tiff'

               IDL> FITSRGB_to_TIFF, '/data/images/space', ['red.fits', $
                    'blue.fits', 'green.fits'], 'colour.tiff'

       Read three FITS files, 'red.fits', 'blue.fits' and 'green.fits' from
       the current directory and output a TIFF file named '/images/out.tiff'
       In this case, the red image is twice as strong as the green and the
       blue is a third more intense.  A preview on screen is also wanted.

               IDL> FITSRGB_to_TIFF, '.', ['red.fits', $
                    'blue.fits', 'green.fits'], '/images/out.tiff', $
                    /PREVIEW, RED=0.5, GREEN=1.0, BLUE=0.666


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], READFITS [1], READFITS [2]
	READFITS [3], concat_dir [4]
 RESTRICTIONS:
       (1) Limited to the ability of the routine READFITS

 NOTES:
       None

 PROCEDURES USED:
     Functions:   READFITS, CONCAT_DIR
     Procedures:  WRITE_TIFF

 MODIFICATION HISTORY:
     16th January 1995 - Written by Carl Shaw, Queen's University Belfast
	27 Jan 1995 - W. Landsman, Add CONCAT_DIR for VMS, Windows compatibility
	Converted to IDL V5.0   W. Landsman   September 1997
    Use WRITE_TIFF instead of obsolete TIFF_WRITE  W. Landsman  December 1998
    Cosmetic changes  W. Landsman    February 2000


FITSTAPE $SSW/gen/idl/fits/fitstape.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : 
	FITSTAPE()
 Purpose     : 
	Function to perform FITS tape I/O.
 Explanation : 
	Function to perform FITS tape I/O.  Called by FITSREAD.   
	FOR VMS IDL ONLY!
 Use         : 
	status=fitstape(command,unit,bitpix,data)
 Inputs      : 
	command - string command from the following choices
             'init' - initialization (must be first call to fitstape)
             'read' - get next 2880 byte data buffer
             'eof'  - check for end of tape file
             'write'- write 2880 byte data buffer
             'woef' - empty buffer and write end-of-file
	unit -   tape unit number
	bitpix - bits/per data element (used to control byte swapping)
            (required for 'read' and 'write')
            (for 'init' command this parameter gives
             the blocking factor, number of 2880 byte
             records per tape record. if not supplied 1 is
             assumed)
	data - 2880 byte data array if 'write' command
 Opt. Inputs : 
	None.
 Outputs     : 
	data - 2880 byte data array if 'read' command
	status is returned as the function value
	with the following meanings.
		'init' = 1
		'read' = !err returned by taprd
		'write' = 1
		'eof'  = 1 if at end of file
			 0 if not at end of file
		'weof' = 1
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : ***
	SKIPF [1], SKIPF [2], TAPRD [1], TAPRD [2], TAPWRT [1], TAPWRT [2], WEOF [1], WEOF [2]
 CALLED BY:
	FXTAPEREAD, FXTAPEWRITE, FXTPIO_READ, FXTPIO_WRITE
 Common      : 
	QFITSTAPE
 Restrictions: 
	None.
 Side effects: 
	None.
 Category    : 
	Data Handling, I/O, FITS, Generic.
 Prev. Hist. : 
	Version 1  D. Lindler  Nov 1986
	Converted to IDL Version 2.  M. Greason, STX, June 1990.
	Recognize BITPIX = -32 and BITPIX = -64   W. Landsman April 1992
 Written     : 
	Don Lindler, GSFC/HRS November 1986.
 Modified    : 
	Version 1, William Thompson, GSFC, 12 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 12 April 1993.


FITTER $SSW/gen/idl/fitting/fitter.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	FITTER

 Purpose     : Least-squares fit of linear function

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

 Use         :	FITTER, X, Y, FDER, PARAM  [, PERR ]

 Inputs      :	X	= Positions.
		Y	= Data values.
		ERR	= Errors in Y.
		FDER	= Array of partial derivatives of fitted function.
			  This array will have the dimensions: FDER(
			  N_ELEMENTS(X) , N_ELEMENTS(PARAM) )

 Opt. Inputs :	None.

 Outputs     :	PARAM	= Returned parameters of fit.

 Opt. Outputs:	PERR	= Errors in PARAM.

 Keywords :	POISSON	= If set, then a Poisson error distribution is assumed,
			  and the weights are set accordingly to 1/Y.
		ERROR	= Array of errors.  The weights are set accordingly to
			  1/ERROR^2.  Overrides POISSON.
		WEIGHT	= Array of weights to use in fitting.  Overrides
			  POISSON and ERROR.
		YZERO	= Amount to subtract from Y (only for use with
			  REGRESS).
		CHISQR	= Returned value of chi-squared.  Only relevant if
			  ERROR passed explicitly.
		CMATRIX	= Correlation matrix.

 Calls       : ***
	TRIM
 CALLED BY:
	REGRESS_FIT
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utilities, Curve_Fitting

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

 Written     :	William Thompson, GSFC, June 1991

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated in CDS library

 Version     :	Version 1, 9 January 1995


FIX_DATE $SSW/gen/idl/time/fix_date.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FIX_DATE

 Purpose     : Fix date that uses digit month into one with a string month

 Category    : utility

 Syntax      : fdate=fix_date(date)

 Inputs      : DATE = string date to fix (e.g. '10/02/98')
                                       
 Outputs     : FDATE = fixed date (e.g. '10-feb-98')

 Keywords    : EUROPEAN = interpret middle entry as month

 CALLS: ***
	ARR2STR [1], Arr2Str [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_MONTH
	STR2ARR [1], STR2ARR [2], TRIM2, is_number [1], is_number [2], str_replace [1]
	str_replace [2]
 History     : Written 26 August 1998, D. Zarro, SAC/GSFC

 Contact     : dzarro@solar.stanford.edu


FIX_DIR_NAME $SSW/gen/idl/system/fix_dir_name.pro
[Previous] [Next]
 Project     : HINODE/EIS

 Name        : FIX_DIR_NAME

 Purpose     : Fix directory name

 CALLS: ***
	CHKLOG [1], CHKLOG [2], IS_BLANK
 CALLED BY:
	SHOW_SYNOP__DEFINE
 Example     :

             IDL> f='/Users/zarro/.decompressed/..'
             IDL> print,fix_dir_name(f)
                  /Users/zarro

 Inputs      : DIR  = directory name to fix

 Outputs     : OUT = fixed directory name

 Keywords    : ERR = string error message

 Version     : Written 4-Dec-2006, Zarro (ADNET/GSFC)

 Contact     : dzarro@solar.stanford.edu


FIX_EXTRA $SSW/gen/idl/struct/fix_extra.pro
[Previous] [Next]
 Project     : HESSI

 Name        : FIX_EXTRA

 Purpose     : When using keyword inheritance, the tag name in _extra may be abbreviated
               relative to the full name. For example, using /log when one really
               means /log_scale may cause setting /log_scale to fail if one is
               really looking for the full name /log_scale.

 CALLS: ***
	IS_BLANK, IS_STRING, REP_TAG_NAME, is_struct
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, MAP__DEFINE, PLOT_MAP_DEFINE
	SPECTROGRAM CLASS DEFINITION, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 Example     : IDL> help,/st,extra
                     GRID            INT              1
                     LIMB            INT              1
                     LOG             INT              1

               IDL> help,/st,template
                     LOG_SCALE       BYTE         0
                     GRID_SPACING    FLOAT           0.00000
                     LIMB_PLOT       BYTE         0

               IDL> help,fix_extra(extra,template),/st
                     LOG_SCALE       INT              1
                     GRID_SPACING    INT              1
                     LIMB_PLOT       INT              1


 Category    : string structure utility
                   
 Inputs      : EXTRA = structure produced by _extra 
               TEMPLATE = structure of actual full keyword names or list
                          of tag names

 Outputs     : Same as EXTRA, but abbreviated names are expanded to match template

 Keywords    : None

 History     : 23-Nov-2002, Zarro (EER/GSFC)

 Contact     : DZARRO@SOLAR.STANFORD.EDU


fix_path $SSW/gen/idl/system/fix_path.pro
[Previous] [Next]
 Project     : Solar-B/EIS

 Name        : fix_path

 Purpose     : Fix IDL path names by expanding environment
               variables and removing extraneous delimiters.

 Category    : utility string

 Syntax      : IDL> new=fix_path(path)

 Inputs      : PATH = IDL path name

 Outputs     : NEW  = fixed path name

 Keywords    : ERR = error string

 CALLS: ***
	CHKLOG [1], CHKLOG [2], GET_DELIM, GET_PATH_DELIM, IS_BLANK, IS_STRING, LOCAL_NAME
	STR2ARR [1], STR2ARR [2], STR_TRAIL, str_replace [1], str_replace [2]
 History     : 30-May-2006, Zarro (L-3Com/GSFC) - written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


fix_slash $SSW/gen/idl/string/fix_slash.pro
[Previous] [Next]
   Name: fix_slash

   Purpose: return string with slashes corrected for OS

   Input Parameters:
      source - source string

 Category    :
	Utilities, Strings

 CALLS: ***
	GET_DELIM, str_replace [1], str_replace [2]
 CALLED BY:
	HESSI_DATA_PATHS [1], HSI_LOC_FILE, hessi_var, hessi_version
   History: Kim Tolbert, 26-Jul-2001


FIX_STRLEN $SSW/gen/idl/string/fix_strlen.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       FIX_STRLEN()

 PURPOSE:
       Make a string have a fixed length by appending spaces.

 EXPLANATION:

 CALLING SEQUENCE:
       Result = fix_strlen(str, length=length)

 INPUTS:
       STR    - String to be padded
       LENGTH - Desired length of resulting str

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       PREFIX - Padding spaces in front of the given string if set

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 PREVIOUS HISTORY:
       Written January 25, 1995, Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, NASA/GSFC, January 25, 1995

 VERSION:
       Version 1, January 25, 1995


FIX_STRLEN_ARR $SSW/gen/idl/string/fix_strlen_arr.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       FIX_STRLEN_ARR()

 PURPOSE:
       Make a string have a fixed length by appending spaces.

 EXPLANATION:

 CALLING SEQUENCE:
       Result = fix_strlen_arr(str, length)

 INPUTS:
       STR    - String to be padded (may be an array of strings)
       LENGTH - Desired length of resulting str (must be scalar)

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       PREFIX - Padding spaces in front of the given string if set
       CENTER - If set, center text, pad with spaces before and after

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	hsi_format_flare
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 PREVIOUS HISTORY:
       Written January 25, 1995, Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, NASA/GSFC, January 25, 1995
       Kim Tolbert, 11/26/2000 - Modified fix_strlen to handle input
          string arrays and renamed to fix_strlen_arr.
       Kim Tolbert, 27-Jan-2002, Added center keyword


FIX_ZDBASE $SSW/gen/idl/database/fix_zdbase.pro
[Previous] [Next]
 Project     :	SOHO - CDS     

 Name        :	FIX_ZDBASE()

 Purpose     :	To control the value of env. var. ZDBASE.

 Explanation :	The environment variable ZDBASE controls access to the
		databases.  The user may have access to either a private
		set of data bases or the 'official' CDS set.  This function
		allows the uset to set the ZDBASE variable to be the
		equivalent of either ZDBASE_CDS or ZDBASE_USER depending
		on the database access required.  These latter two variables
		must be defined before this routine is called.  The original
		definition of ZDBASE is stored in common and can be restored to
		that variable by use of the /ORIGINAL keyword.

 Use         :	IDL> status = fix_zdbase(/user, errmsg=errmsg)

		first time used so record the current value of ZDBASE and set
		its current value to be that of ZDBASE_USER

		IDL> status = fix_zdbase(/cds, errmsg=errmsg)

		if not the first time used then just set current ZDBASE
		definition to that of ZDBASE_CDS

		IDL> status = fix_zdbase(/orig, errmsg=errmsg)

		all finished, so restore ZDBASE to its original value.

		Note that this routine is more likely to be used within other
		procedures rather than at a user level as in the above
		example.

		IDL> status = fix_zdbase(/resolve, errmsg=errmsg)

		Resolve the current definition of ZDBASE, to expand any plus
		signs in the path.  This speeds up software using the ZDBASE
		environment variable.  If this is the first time that
		FIX_ZDBASE() is called, then the expanded version will be
		stored as the original.
    
 Inputs      :	None (see keywords).

 Opt. Inputs :	None

 Outputs     :	Function returns 1 for success, 0 for error.
		(Values in common may change, and see ERRMSG keyword)

 Opt. Outputs:	None

 Keywords    :	The following keywords are used to select the appropriate
		database.

		USER      -   switch ZDBASE to value of ZDBASE_USER
		CDS       -   switch ZDBASE to value of ZDBASE_CDS
		SOHO	  -   switch ZDBASE to value of ZDBASE_SOHO
		EIS	  -   switch ZDBASE to value of ZDBASE_EIS
		ORIGINAL  -   restore original value of ZDBASE
		RESOLVE   -   optimize the current value of ZDBASE

		Additional keywords.

		ERRMSG    -   if defined on entry any error messages
			      will be returned in it.
               INIT      -  initialise common block

 Calls       : ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FIND_ALL_DIR [1]
	FIND_ALL_DIR [2], FIND_ALL_DIR [3], GET_ENVIRON, delvarx [5]
 CALLED BY:
	CDS_FILES, EIS_CAT [1], EIS_CAT [2], EIS_CHECK_DATABASE [1]
	EIS_CHECK_DATABASE [2], EIS_DBASE, FIND_ZDBASE, MK_CDS_PLAN, MK_PLAN_FORM
	MK_RASTER, MK_SOHO_SETUP, MK_SOHO_TARGET, MK_STUDY, SET_CDS_SDB, UPDATE_IAP
	UPDATE_KAP, XCAT, XSTUDY, db_read_linelist_all [1], db_read_linelist_all [2]
	db_read_raster_all [1], db_read_raster_all [2], db_read_study_all [1]
	db_read_study_all [2], db_save_linelist_entry_create [1]
	db_save_linelist_entry_create [2], db_save_raster_entry_create [1]
	db_save_raster_entry_create [2], db_save_study_entry_create [1]
	db_save_study_entry_create [2], db_save_study_entry_create [3]
	db_save_study_entry_create [4], eis_db_save_gui [1], eis_db_save_gui [2]
	eis_linelist_gui [1], eis_linelist_gui [2], eis_mk_plan_gui [1]
	eis_mk_plan_gui [2], eis_raster_gui [1], eis_raster_gui [2]
	eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
	eis_study_gui [2], eis_write_timeline_database_tables [1]
	eis_write_timeline_database_tables [2]
 Common      :	zdbase_def

 Restrictions:	Uses common block variable to signal whether original value
		of ZDBASE has been saved or not.  Be careful of the common
		block's memory.

 Side effects:	Environment variable ZDBASE is changed.

 Category    :	Util, database

 Prev. Hist. :	None

 Written     :	C D Pike, RAL, 17-Jan-95

 Modified    :	Improve error handling.  CDP, 6-Mar-95
		Allow '+' format option in env var specification. CDP,15-May-95
		Version 4, William Thompson, GSFC, 16 May 1995
			Added keyword /PLUS_REQUIRED to FIND_ALL_DIR call.
			Allows more than one tree in input.
			Added variable ZDB_USED to common block
		Version 4.1, SVHH, UiO, 22-Sep-1995
			Altered EXECUTE command in order to avoid 
			problem with commands longer than 256 characters.
		Version 5, William Thompson, GSFC, 15 January 1996
			Added SOHO keyword.  Simplified structure.
		Version 6, William Thompson, GSFC, 6 August 1996
			Call DEF_DIRLIST instead of SETENV
		Version 7, William Thompson, GSFC, 7 August 1996
			Call get_environ instead of getenv.
		Version 8, Dominic Zarro, 15 June 2001
			Added INIT keyword to initialize common
		Version 9, William Thompson, GSFC, 14-Jan-2001
			Added keyword RESOLVE
               Version 10, William Thompson, GSFC, 16-Sep-2005
                       Added keyword EIS
                       Allow /USER, /CDS, /SOHO, and /EIS keywords to be
                       combined.  Databases are searched in that order.

 Version     :	Version 10


FLAG_LONG_NAMES [1] $SSW/gen/idl/system/flag_long_names.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	
	FLAG_LONG_NAMES
 Purpose     :	
	Flags procedure names that would appear the same under DOS
 Explanation :	
	Flags sets of IDL procedure names which have the same first eight
	characters.  These would appear to be the same file on DOS machines.
	The names of each set of .PRO files with the same first eight
	characters are printed to the screen.
 Use         :	
	CD, directory	;(go to desired directory)
	FLAG_LONG_NAMES
 Inputs      :	
	None.
 Opt. Inputs :	
	None.
 Outputs     :	
	None.
 Opt. Outputs:	
	None.
 Keywords    :	
	None.
 Calls       : ***
	FDECOMP [1], FDECOMP [2], FDECOMP [3]
 Common      :	
	None.
 Restrictions:	
	None.
 Side effects:	
	None.
 Category    :	
	Utilities, Operating_system.
 Prev. Hist. :	
	William Thompson, January 1993.
 Written     :	
	William Thompson, GSFC, January 1993.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
 Version     :	
	Version 1, 9 July 1993.


FLAG_MISSING $SSW/gen/idl/util/flag_missing.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : FLAG_MISSING

 Purpose     : Flags pixels in images as missing

 Explanation : Sets pixels in an image to a value representing missing
               pixels.  This flag value is either a specific number, given by
               the MISSING keyword, or an IEEE Not-a-Number (NaN) value.

 Use         : FLAG_MISSING, ARRAY, INDEX  [, MISSING=MISSING]

 Inputs      : ARRAY	= Array to flag missing pixels within
               INDEX   = Positions of missing pixels

 Opt. Inputs : None.

 Outputs     : The ARRAY variable is modified

 Opt. Outputs: None.

 Keywords    : MISSING = Value flagging missing pixels.

 Calls       : ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	ASMOOTH, AVERAGE, INTERP2
 Common      : None.

 Restrictions: None.

 Side effects: None.

 Category    : Utilities

 Prev. Hist. : None.

 Written     : William Thompson, GSFC, 12-May-2005

 Modified    : Version 1, William Thompson, GSFC, 12-May-2005

 Version     : Version 1, 12-May-2005


flare_hist $SSW/gen/idl/ssw_util/flare_hist.pro
[Previous] [Next]
   Name: flare_hist

   Purpose: return flare class (daily) frequencies for desired time range

   Input Paramters:
      time0,time1 - time range to consider (def=1980 -> today)

   Output Paramters:
      function returns structure vector, 1 element per day in range:
      {time:0l,day:0,nb:0,nc:0,nm:0,nx:0,ntot:0,fmax:'',fmaxt:''}

 CALLS: ***
	GET_GEV, STR2ARR [1], STR2ARR [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], decode_gev, last_nelem, reltime [1]
	reltime [2]
   History:
      20-sep-2005 - S.L.Freeland


FLASH_MSG $SSW/gen/idl/widgets/flash_msg.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : FLASH_MSG

 Purpose     : Flashes an information message in a text widget.

 Explanation : Write a text message to the specified widget, and alternates
               it with setting it blank in order to simulate a flashing
               message.

 Use         : IDL> flash_msg, widget_id, text [, other_keywords]

 Inputs      : widget_id  - the id of the text widget
               text       - the message to be flashed

 Opt. Inputs : None.

 Outputs     : None.

 Opt. Outputs: None.

 Keywords    : NUM    -- Number of flashing times; default is 4 times.
               NOBEEP -- Set this keyword to suppress the beep
               RATE   -- Flashing rate in seconds; default: 0.25 sec.
               APPEND -- Appends to widget text rather than overwriting

 Calls       : ***
	Bell
 CALLED BY:
	EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2], EIS_IMAGE_TOOL_EVENT [1]
	EIS_IMAGE_TOOL_EVENT [2], EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2]
	EIS_LOAD_IMAGE [1], EIS_LOAD_IMAGE [2], IMAGE_TOOL, IMAGE_TOOL_EVENT
	ITOOL_DISP_ROT, ITOOL_LIMBFITTER, ITOOL_LOAD_IMAGE, ITOOL_PICKFILE, ITOOL_PTOOL
	MAKE_AUTO_FIT, MAKE_MANUAL_FIT, MK_LIMBFIT_BS, MK_POINT_BASE, MK_RASTER
	TP_DISP_IEF, TP_DISP_LLIST, TP_DISP_RAST, TP_EDIT_TABLE, TP_RECALC_DEW
	TP_REDISPLAY, UPDATE_FITLIMB, XGET_SYNOPTIC, plotman, plotman_zoom
 Restrictions: Widget must be already set up.

 Side effects: Can be annoying if called frequently with beeping!

 Category    : Utilities, Help

 Prev. Hist. : None

 Written     : C D Pike, RAL, 2-Jul-1993

 Modified    : Liyun Wang, GSFC/ARC, August 25, 1994
                  Added optional keyword NUM to control number of flashing
                  times and NOBEEP to suppress the beep.

               Add append keyword,  CDP, 14-Oct-94
               Fix working of /append mode, CDP, 19-Oct-94
               Limit rewrite of old text in /append mode to 20 lines.
                                            CDP, 9-Jan-95

 Version     : Version 5, 9-Jan-95


FLASH_PLOTS $SSW/gen/idl/display/flash_plots.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       FLASH_PLOTS

 PURPOSE: 
       Make a flashing plot of a polygon

 EXPLANATION:
       
 CALLING SEQUENCE: 
       FLASH_PLOTS, xx, yy [,num=num] [,rate=rate]

 INPUTS:
       XX -- X coordinates of points to be connected.
       YY -- Y coordinates of points to be connected.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       NUM    -- Number of flashing times; default is 4 times.
       RATE   -- Flashing rate in seconds; default: 0.25 sec.
       COLOR  -- Index of color to be used; default: !d.table_size-1
       PSYSTEM -- Coordinate system used for plotting. Valid values are:
                  0 -- device coodinate system (default)
                  1 -- data coordinate system
                  2 -- normal coordinate system

 CALLS:
	None.
 CALLED BY:
	EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], ITOOL_PTOOL, MK_POINT_BASE
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written November 2, 1994, by Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
	Version 2, William Thompson, GSFC, 8 April 1998
		Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
       
 VERSION:
	Version 2, 8 April 1998


FLEGENDRE $SSW/gen/idl_libs/astron/math/flegendre.pro
[Previous] [Next]
 NAME:
        FLEGENDRE
 PURPOSE:
       Compute the first M terms in a Legendre polynomial expansion.  
 EXPLANATION:
       Meant to be used as a supplied function to SVDFIT.

       This procedure became partially obsolete in IDL V5.0 with the 
       introduction of the /LEGENDRE keyword to SVDFIT and the associated 
       SVDLEG function.    However, note that, unlike SVDLEG, FLEGENDRE works
       on vector values of X.     
 CALLING SEQUENCE:
       result = FLEGENDRE( X, M)

 INPUTS:
       X - the value of the independent variable, scalar or vector
       M - number of term of the Legendre expansion to compute, integer scalar 

 OUTPUTS:
       result - (N,M) array, where N is the number of elements in X and M
               is the order.   Contains the value of each Legendre term for
               each value of X
 EXAMPLE:
       (1) If x = 2.88 and M = 3 then 
       IDL> print, flegendre(x,3)   ==>   [1.00, 2.88, 11.9416]

       This result can be checked by explicitly computing the first 3 Legendre
       terms, 1.0, x, 0.5*( 3*x^2 -1)

       (2) Find the coefficients to an M term Legendre polynomial that gives
               the best least-squares fit to a dataset (x,y)
               IDL> coeff = SVDFIT( x,y,M,func='flegendre')
       
           The coefficients can then be supplied to the function POLYLEG to 
               compute the best YFIT values for any X. 
 METHOD:
       The recurrence relation for the Legendre polynomials is used to compute
       each term.   Compare with the function FLEG in "Numerical Recipes"
       by Press et al. (1992), p. 674

 REVISION HISTORY:
       Written     Wayne Landsman    Hughes STX      April 1995                
       Converted to IDL V5.0   W. Landsman   September 1997


FLIP_MAP $SSW/gen/idl/mapping/flip_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : FLIP_MAP

 Purpose     : Flip map to correct for 180 degree roll

 Category    : imaging

 Syntax      : fmap=flip_map(map)

 Inputs      : MAP = image map structure

 Outputs     : FMAP = flipped map

 Keywords    : None

 CALLS: ***
	COMP_FITS_CEN, COMP_FITS_CRPIX, EXIST, GET_MAP_PROP, PR_SYNTAX, VALID_MAP
 History     : Written 7 April 2005 - Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


FLOOR $SSW/gen/idl_fix/soft/old350/floor.pro
[Previous] [Next]
 ROUTINE:
  FLOOR
 PURPOSE:
   Return the closest integer less than or equal to its argument.
 CALLING SEQUENCE:
   Result = FLOOR(X)

   This is fixup for IDL versions prior to V3.1

 WRITTEN:
   29-Nov-95, R. Kano


FLUX2MAG $SSW/gen/idl_libs/astron/astro/flux2mag.pro
[Previous] [Next]
 NAME:
     FLUX2MAG
 PURPOSE:
     Convert from flux (ergs/s/cm^2/A) to magnitudes.
 EXPLANATION:
     Use MAG2FLUX() for the opposite direction.

 CALLING SEQUENCE:
     mag = flux2mag( flux, [ zero_pt, ABwave=  ] )

 INPUTS:
     flux - scalar or vector flux vector, in erg cm-2 s-1 A-1

 OPTIONAL INPUT:
     zero_pt - scalar giving the zero point level of the magnitude.
               If not supplied then zero_pt = 21.1 (Code et al 1976)
               Ignored if the ABwave keyword is supplied

 OPTIONAL KEYWORD INPUT:
     ABwave - wavelength scalar or vector in Angstroms.   If supplied, then 
           FLUX2MAG() returns Oke AB magnitudes (Oke & Gunn 1983, ApJ, 266,
           713).

 OUTPUT:
     mag - magnitude vector.   If the ABwave keyword is set then mag
           is given by the expression 
           ABMAG = -2.5*alog10(f) - 5*alog10(ABwave) - 2.406 
             
           Otherwise, mag is given by the expression  
           mag = -2.5*alog10(flux) - zero_pt
 EXAMPLE:
       Suppose one is given wavelength and flux vectors, w (in Angstroms) and 
       f (in erg cm-2 s-1 A-1).   Plot the spectrum in AB magnitudes

       IDL> plot, w, flux2mag(f,ABwave = w), /nozero

 REVISION HISTORY:
       Written    J. Hill        STX Co.       1988
       Converted to IDL V5.0   W. Landsman   September 1997
       Added ABwave keyword    W. Landsman   September 1998


FM_UNRED $SSW/gen/idl_libs/astron/astro/fm_unred.pro
[Previous] [Next]
 NAME:
     FM_UNRED
 PURPOSE:
     Deredden a flux vector using the Fitzpatrick (1999) parameterization
 EXPLANATION:
     The R-dependent Galactic extinction curve is that of Fitzpatrick & Massa 
     (Fitzpatrick, 1999, PASP, 111, 63; astro-ph/9809387 ).    
     Parameterization is valid from the IR to the far-UV (3.5 microns to 0.1 
     microns).    UV extinction curve is extrapolated down to 912 Angstroms.

 CALLING SEQUENCE:
     FM_UNRED, wave, flux, ebv, [ funred, R_V = , /LMC2, /AVGLMC, ExtCurve= 
                       gamma =, x0=, c1=, c2=, c3=, c4= ]
 INPUT:
      WAVE - wavelength vector (Angstroms)
      FLUX - calibrated flux vector, same number of elements as WAVE
               If only 3 parameters are supplied, then this vector will
               updated on output to contain the dereddened flux.
      EBV  - color excess E(B-V), scalar.  If a negative EBV is supplied,
               then fluxes will be reddened rather than dereddened.

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

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

      /AVGLMC - if set, then the default fit parameters c1,c2,c3,c4,gamma,x0 
             are set to the average values determined for reddening in the 
             general Large Magellanic Cloud (LMC) field by Misselt et al. 
            (1999, ApJ, 515, 128)
      /LMC2 - if set, then the fit parameters are set to the values determined
             for the LMC2 field (including 30 Dor) by Misselt et al.
             Note that neither /AVGLMC or /LMC2 will alter the default value 
             of R_V which is poorly known for the LMC. 
             
      The following five input keyword parameters allow the user to customize
      the adopted extinction curve.    For example, see Clayton et al. (2003,
      ApJ, 588, 871) for examples of these parameters in different interstellar
      environments.

      x0 - Centroid of 2200 A bump in microns (default = 4.596)
      gamma - Width of 2200 A bump in microns (default  =0.99)
      c3 - Strength of the 2200 A bump (default = 3.23)
      c4 - FUV curvature (default = 0.41)
      c2 - Slope of the linear UV extinction component 
           (default = -0.824 + 4.717/R)
      c1 - Intercept of the linear UV extinction component 
           (default = 2.030 - 3.007*c2
            
 OPTIONAL OUTPUT KEYWORD:
      ExtCurve - Returns the E(wave-V)/E(B-V) extinction curve, interpolated
                 onto the input wavelength vector

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

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

 NOTES:
       (1) The following comparisons between the FM curve and that of Cardelli, 
           Clayton, & Mathis (1989), (see ccm_unred.pro):
           (a) - In the UV, the FM and CCM curves are similar for R < 4.0, but
                 diverge for larger R
           (b) - In the optical region, the FM more closely matches the
                 monochromatic extinction, especially near the R band.
       (2)  Many sightlines with peculiar ultraviolet interstellar extinction 
               can be represented with the FM curve, if the proper value of 
               R(V) is supplied.
       (3) Use the 4 parameter calling sequence if you wish to save the 
               original flux vector.
 PROCEDURE CALLS:
       CSPLINE(), POLY()
 REVISION HISTORY:
       Written   W. Landsman        Raytheon  STX   October, 1998
       Based on FMRCurve by E. Fitzpatrick (Villanova)
       Added /LMC2 and /AVGLMC keywords,  W. Landsman   August 2000
       Added ExtCurve keyword, J. Wm. Parker   August 2000
       Assume since V5.4 use COMPLEMENT to WHERE  W. Landsman April 2006


FMEDIAN $SSW/gen/idl/util/fmedian.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FMEDIAN
               
 Purpose     : Median filtering w/rectangular neighbourhood & MISSING
               
 Explanation : Performs median filtering. Differs from MEDIAN in that the
               median filter extends smoothly to the edge of the array, and
               in that different widths can be set for the X and Y
               directions.
               
 Use         : Result = FMEDIAN(ARRAY  [, NW1  [, NW2 ]])
    
 Inputs      : ARRAY : Array to filter.
               
 Opt. Inputs : NW1 : Width of the median filter in the first (X)
                     direction. Default is 3.
                 
               NW2 : Width of the median filter in the second (Y) direction.
                     Default is NW1. Ignored if ARRAY has only one dimension.
               
 Outputs     : Returns an array with the same size and type as the
               input array.
               
 Opt. Outputs: None.
               
 Keywords    : MISSING : Value signifying missing data. Missing pixels will
                         not be included when calculating the median of the
                         neighbourhood. If no valid pixels are found in the
                         neighbourhood of a pixel, the corresponding median
                         value will be set to MISSING.

 Env. Vars.  :	SSW_EXTERNAL_F = Points to a sharable object file containing
			       associated Fortran software callable by
			       CALL_EXTERNAL.  If this environment variable
			       exists, then the routine uses CALL_EXTERNAL to
			       calculate the checksum.  Otherwise the checksum
			       is calculated within IDL, which is slower.

			       For backwards compatibility, the software will
			       also look for the environment variable
			       CDS_EXTERNAL if it doesn't find SSW_EXTERNAL_F

		SSW_EXTERNAL_PREFACE = On some operating systems, such as older
			       versions of SunOS, this needs to be set to the
			       underscore character "_".  Otherwise, it doesn't
			       need to be defined.

 Calls       : ***
	FMEDIAN_SLOW
 CALLED BY:
	CDS_FILL_MISSING, CLEAN_EXPOSURE, CLEAN_SPIKE, NEW_SPIKE, xdisp_fits
 Common      : None.
               
 Restrictions: ARRAY must be either one or two dimensional.  Will call
               FMEDIAN_SLOW if $SSW_EXTERNAL_F library is not found, causing a
               severe slow-down of the routine (factor of 3 - 100, depending
               on the size of the filter).
               
 Side effects: Loads call_external library pointed to by $SSW_EXTERNAL_F.  If
               this library cannot be found, an IDL version called
               FMEDIAN_SLOW is used instead.
               
 Category    : Utilities, Arrays
               
 Prev. Hist. : SERTS routine.

 Written     : William Thompson, August 1991.
               
 Modified    : Version 2, S.V.H.Haugan, UiO, 9 October 1996
                       Added MISSING keyword, added a few parameter range
                       checks. Added calll to FMEDIAN_SLOW when no
                       SSW_EXTERNAL_F library is available. Supplying
                       workspace to the fortran routine. Fortran routine
                       using a quicksort-based median finder to keep ahead
                       of IDL's fast median routine.
		Version 3, William Thompson, GSFC, 16 July 1998
			Look for SSW_EXTERNAL evar before CDS_EXTERNAL
			Check for SSW_EXTERNAL_PREFACE instead of !version.os

 Version     :	Version 3, 16 July 1998


FMEDIAN_SLOW $SSW/gen/idl/util/fmedian_slow.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : FMEDIAN_SLOW
               
 Purpose     : FMEDIAN routine without CALL_EXTERNAL 
               
 Explanation : See fmedian.pro/built-in median routine.
               
 Use         : RESULT = FMEDIAN(ARRAY, [, NW1 [, NW2]])
    
 Inputs      : See fmedian.pro
               
 Opt. Inputs : See fmedian.pro
               
 Outputs     : See fmedian.pro
               
 Opt. Outputs: See fmedian.pro
               
 Keywords    : See fmedian.pro

 Calls       : None.
 CALLED BY:
	FMEDIAN
 Common      : None.
               
 Restrictions: ARRAY must be either one or two dimensional. No parameters are
               checked, since this routine is supposed to be called only from
               within FMEDIAN().
               
 Side effects: None.
               
 Category    : Utilities, Arrays
               
 Prev. Hist. : Fortran version was a SERTS routine.

 Written     : William Thompson, August 1991 (Call_external version)
              
 Modified    : Version 1, S.V.H.Haugan, UiO, 9 October 1996
                       Added MISSING keyword, added non-call_external code.

 Version     : 1, 9 October 1996


fmt_doc [1] $SSW/gen/idl/genutil/fmt_doc.pro
[Previous] [Next]
   Name: fmt_doc

   Purpose: format output buffer containing documentation header info 

   Input Parameters:
	doc_str - document structures, as returned by get_doc.pro
		  scaler or array of structures

   Optional Keyword Paramters:
      lf - if set, 1 blank line inserted between routine documentation

   Output Parameters:
      function returns string array of formatted doc_str contents
      for scaler input, each doc_str field is included (page format) 
      for array input, a summary list format (Name Purpose) is produced

   Calling Sequence:	outarr=fmt_doc(doc_str)

   Category: gen, util, swmaint, documentation, class3

 CALLS: ***
	STR2ARR [1], STR2ARR [2]
 CALLED BY:
	doc_summ [1], doc_summ [2], get_doc [1], get_doc [2], get_doc [3]
   History: slf, 20-Jul-1992
            slf, 30-Mar-1994 (add brief, keyindent)


FMT_TAG [1] $SSW/gen/idl/struct/fmt_tag.pro
[Previous] [Next]
 NAME:
	FMT_TAG

 PURPOSE:
	Converts a data structure (as represented by the IDL SIZE
	its to string representation for dynamic structure building 

 CALLING SEQUENCE:
	user_value = FMT_TAG( SIZE (data_structure))  

 INPUTS:
	DSIZE - size vector for desired data structure 

 RETURN VALUE:
	Character string representing data structure

 CALLED BY:
	Multi_draw [1], Multi_draw [2], RD_GEN [1], RD_GEN [2], build_str [1]
	build_str [2], diskbench, extract_val, fitshead2struct, get1hk_info [1]
	get1hk_info [2], get_elemabun [1], get_elemabun [2], save_data [1], sparse [1]
	sparse [2], sparse [3], str_merge [1], str_merge [2], str_subset, struct2ms [1]
	struct2ms [2], sxt2file, sxt_uniq [1], tr_decode_head [1], tr_decode_head [2]
	trace_dph2struct [1], url_decode
 EXAMPLES:
	if user variable X was created by: FINDGEN(2,3,4,5), then 
       then FMT_TAG(SIZE(X)) returns string 'FLTARR(2, 3, 4, 5)'

 FILE I/O:
	NONE

 COMMON BLOCKS;
	NONE

 RESTRICTIONS:
	Structures not yet implemented

 MODIFICATION HISTORY:
	Version 1 - SLF, 3/5/91
	29-Jul-97 (MDM) - Changed the i6 format statement to i8
			  because it was ending up with "******"
       5-Nov-99 - Added new IDL 5.1 types, A. Csillaghy 
                  csillag@ssl.berkeley.edu
       15-Nov-2002, Paul Bilodeau - added support for unsigned and
                                    64-bit integer types.


fmt_tim [1] $SSW/gen/idl/genutil/fmt_tim.pro
[Previous] [Next]
NAME:
	fmt_tim
PURPOSE:
	Given a time (or array of times) return the formatted
	date/time string.
CALLING SEQUENCE:
	print, fmt_tim(roadmap)
	print, fmt_tim(index(i).gen)
	tim = fmt_tim(index, day_str, time_str)
INPUT:
	tim_in - Can be a structure with the .TIME and .DAY
		 fields
			(OR)
		 The "standard" 7 element external representation
		 of time (HH,MM,SS,MSEC,DD,MM,YY)
OPTIONAL INPUT:
       msec    - If present, also print the millisec in the formatted
                 output.
       nolead0 - If present, do not include a leading "0" on the hour string
                 for hours less than 10. (ie: return 9:00:00 instead of 09:00:00)
	fits	- If present, then use the FITS slash format of the type DD/MM/YY
OUTPUT:
	Returns the whole date/time string formatted in the
	form like: 12-OCT-91  23:25:10

OPTIONAL OUTPUT:
	day_str - just the date part of the string
	time_str- just the time part of the string
 CALLS: ***
	gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 CALLED