F1 $SSW/yohkoh/ucon/idl/shimizu/f1.pro
[Previous] [Next]
 NAME: 
	F1
 PURPOSE:
 	PROCEDURE F0RD
 	taken from Stu to make it easy for Jake to obtain CCD files
 CALLING SEQUENCE:
	x = f1(filename', h) 
 INPUTS:
	filename - filename specification
 OPTIONAL INPUTS:
	noprint - for no detailed information display.
	timeprint - for only date/time information display.
 OUTPUTS:
  	h - the header information array
	x - data
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4], dec2sun [1]
	dec2sun [2]
 CALLED BY:
	LP_OBSLOG, LP_VELMAP, RD_LP
 PROCEDURE:
       puts decompressed results in a temporary file,
       then reads from this file
 HISTORY:
	Jan, 1994  supplied by D.Shine, F.Zoe
	12 Mar, 1994 revised by TShimizu (Univ. of Tokyo)
		     add "noprint" option.
	23 Apr, 1994 revised /usr/tmp/decruch_tmp"
	 9 May, 1994 append \rm /usr/tmp/decruch_tmp 
	            before the execution.
	21 May, 1994 "decrunch_sun" and "decrunch_mips"
	24 May, 1994 use "decruch_tmp" under the current directory.
		     debug in the algorithm to check compressed data.
		     debug in the data handling.
		     use lun for the file handling.
	18 Jun, 1994 debug in if (hdr(4) eq 1 or hdr(4)-128 eq 1)
	18 Jun, 1994 option timeprint


f1calib procedure $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
 NAME       : f1calib (procedure)
 PURPOSE    : convert pol.deg. to mag.strength (Gauss) for T1
 CALLING SEQUENCE :
	f1calib, img, q, u, v, bx, by, bl, h=h, scatter=scatter, dwl=dwl, $
		kdpfact=kdpfact, Bl_cal=Bl_cal, Bt_cal=Bt_cal
 INPUTS :
     img	-- image
     q,u,v     -- pol. degree *10000 (q,u,v already devided by img)
 KEYWORD PARAMETERS :
     dwl       -- wave length position of Lyot filter from line center (mA)
			if dwl is not specified, -80 mA is assumed
     scatter   -- sacttered light intensity
		   if not set, scatter=imin     (imin/imax < 0.17, limb image)
				      =(1-0.7)*imin*imax/(imax-0.7*imin)
						(	   > 0.17, disk image)
     kdpfact	-- kdpfactor, default=1.05
     h		-- header structure
     		header modification
		h.value   =>   I,  Bx,  By,  Bl
		h.correct =>  101, 101, 101, 101
		h.dx	  =>  pix1*bin
		h.unit    =>  'G*10'
		h.com     =>  'f1calib1, dwl=##   Mon dd hh:mm:ss'
		h.d_parm(10)  =>  dwl
		h.d_parm(11)  =>  scatter
		h.d_parm(12)  =>  kdpfact
		h.d_parm(15)  =>  blfact*1000
     Bl_cal    -- calibration function of Bl,    p(*10000) => B(G*10)
     Bt_cal    -- calibration function of Bt,    p(*10000) => B(G*10)
 OUTPUTS :
     img	-- midified image for scatter
     bx,by,bl  -- magnetic field (transversal & long.) in Gauss*10
 
 CALLS: ***
	CFF1N, GETCALIB1, SCATTER, f1calib [1], f1calib [2], f1calib [3], f1calib [4]
	f1calib [5], f1calib [6]
 MODIFICATION HISTORY :
	K.Ichimoto, 1992/10
	K.Ichimoto, 1992/10/25	rename to f1calib
	K.Ichimoto, 1992/10/28	change order of Bl and Bx,By
	K.Ichimoto, 1992/11/20	include img, h=h
	K.Ichimoto, 1992/11/21	determine scatter
	K.Ichimoto, 1993/05/18	quv2b included here, Bl modification


f1calib [1] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> scattered light correction <<
 CALLS:
 CALLED BY
	f1calib procedure


f1calib [2] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> KDP error correction <<
 CALLS:
 CALLED BY
	f1calib procedure


f1calib [3] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> convert pol. degree to B magnitude <<
 CALLS:
 CALLED BY
	f1calib procedure


f1calib [4] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> determine the Bt direction <<
 CALLS:
 CALLED BY
	f1calib procedure


f1calib [5] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> correct the Bl magnitude <<
 CALLS:
 CALLED BY
	f1calib procedure


f1calib [6] $SSW/yohkoh/ucon/idl/naoj_mtk/f1calib.pro
[Previous] [Next]
>> set header information <<
 CALLS:
 CALLED BY
	f1calib procedure


F2I_COMPRESS $SSW/yohkoh/ucon/idl/metcalf/f2i_compress.pro
[Previous] [Next]
function f2i_compress,array,minarr,maxarr, $
                      uncompress=uncompress,power=power,long=uselong
NAME:
     F2I_COMPRESS
PURPOSE:
     Compress data array to integer data by scaling the 
     data to values between -32767 and +32767
CATEGORY:
CALLING SEQUENCE:
     compressed = f2i_compress(array,maxarr,minarr)
INPUTS:
     array = array to be compressed
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /uncompress = pass in a compressed array and get the uncompressed
                   array back.  maxarr and minarr must be passed in to
                   uncompress the array.
     /long = scale to long integers rather than short integers.  Scales
             to values bewteen -2147483647 and +2147483647.  If /long is
             set on compression, it must also be set on uncompression.
     power = if set, the array is scaled with this power (i.e. array^power)
             before the integer scaling (default = 1.0)..  If set on
             compression, it must also be set on uncompression to the 
             same value.
OUTPUTS:
     maxarr = maximum of uncompressed array
     minarr = minimum of uncompressed array
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     To uncompress the array, you must save the min and max values of
     the array (that is, the min and max values before compression).

     This algorithm will introduce more and more error as the difference
     between the min and max values gets larger and larger.  The maximum
     error is something like (min-max)/65534.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1996-dec-16
     TRM 1997-Sep-25   Added /long keyword


faceon function $SSW/yohkoh/ucon/idl/naoj_mtk/faceon.pro
[Previous] [Next]
 NAME       : faceon (function)
 PURPOSE    : Face-on Image Projection
 CALLING SEQUENCE :
	imgt=faceon(img,g_x,g_y)
 INPUTS :
     img	-- image
     g_x,g_y   -- position of the image center on solar disk (arc.sec.)
 KEYWORD PARAMETERS :
     pix1      -- size of image pixel (arc.sec.)
 OUTPUTS :
     img	-- midified image for scatter
 
 CALLS: ***
	FACEON, PIX_SIZE, POLYWARP
 MODIFICATION HISTORY :
    by Singo KAWAKAMI 
    programming start  1 Mar,1993
    image correction   8 Mar,1993
    modify(x1,y1) -> (x2,y2)   17 Apr. 1993    S.K & K.I.


faceonv procedure $SSW/yohkoh/ucon/idl/naoj_mtk/faceonv.pro
[Previous] [Next]
 NAME       : faceonv (procedure)
 PURPOSE    : Face-on vector magnetogram
 CALLING SEQUENCE :
	faceonv,img,bx,by,bl,gx=gx,gy=gy,h=h,pix1=pix1,btnoise=btnoise,flip=flip
 INPUTS :
     img	-- image
     bx,by   	-- transversal magnetic field
     bl	-- longitudinal magnetic field
 KEYWORD PARAMETERS :
     h		-- header
     gx,gy	-- central position on the solar disk (arc.sec.)
     pix1	-- size of pixel (arc.sec.)
     btnoise	-- bias of Bt by noise for subtraction (G)
     flip	-- if set, make modification of Bt direction
 OUTPUTS :
     img	-- midified image for scatter
 SIDE EFFECT :
     h.correct  -->  h.correct+100
 
 CALLS: ***
	CFF1N, FACEON, FACEONV, PIX_SIZE, RETUEN
 MODIFICATION HISTORY :
     created	'93/04/18	S.Kawakami & K.Ichimoto


facom_ftp $SSW/yohkoh/gen/idl/orbit/facom_ftp.pro
[Previous] [Next]
 NAME:
  facom_ftp
 PURPOSE:
  Transfer files to the Facom Mainframe using FTP
 CALLING SEQUENCE:
  facom_ftp,infile,outfile,host,user_password
 CALLED BY:
	op_facom_ftp
 HISTORY:
   5-may-93, JRL, Written.


factln $SSW/yohkoh/ucon/idl/mctiernan/factln.pro
[Previous] [Next]
 NAME:
      factln
 PURPOSE:
      Log of numbers factorial, uses gamma functions, for
      large numbers, or for non-integers...
 CALLING SEQUENCE:
      y = factln(j)
 HISTORY:
      28-jun-94 jmm


FAKE_PATROL $SSW/yohkoh/ucon/idl/sxt_co/fake_patrol.pro
[Previous] [Next]
 NAME:
     FAKE_PATROL
 PURPOSE:
     Draw lines on a recent SFD to show the patrol image location.
 CATEGORY:
     SXT Chief Observer
 CALLING SEQUENCE:
     IDL> fake_patrol   ; displays recent SFD with two lines drawn to 
			 ; show the current patrol image location.
     IDL> fake_patrol,80,/nodisplay
			 ; simulates patrol image location for starting
			 ; row of 80.  This allows you to try a number of
			 ; SROW values to see which is best.
			
     IDL> fake_patrol,/small   ;does the same, but forces output to 256x256
     IDL> fake_patrol,/nodisplay   ;draws the lines, but not the SFD image

 CALLS: ***
	gtab_comm, lastsfd [1], lastsfd [2]
 COMMON BLOCKS:
 SIDE EFFECTS:  None known.
 RESTRICTIONS:
     If most recent SFD is quarter-res, you WON'T get a 512x512 image.
     Live with it.
 MODIFICATION HISTORY:
     26-nov-98 (DMcK)- Written, because I'm tired of squinting.
     08-dec-98 (DMcK)- Added SROW optional input.
     12-nov-99 (PGS) - Added 'quick' keyword, + ad hoc code to convert 256^2
                       output image to 512^2.  No smoothing of image.


fastdoc [2] $SSW/yohkoh/gen/idl/util/fastdoc.pro
[Previous] [Next]
   Name: fastdoc 

   Purpose: user front end to faster idl documentation extraction/display
   
   Input Parameters: 
      module - string name (or substring) of module to locate 

   Optional Keyword Parameters:
       summ  - if set, just display procedure/function definition
	multi - if set, multiple versions are displayed

   Calling Sequence:
      fastdoc, module [,/summ, /multi]

 CALLS: ***
	MORE [1], MORE [2], doc_head [1], doc_head [2], doc_head [3], oneline [1]
	oneline [2], path_sw [1], path_sw [2]
 CALLED BY:
	SXT_PREP0, SXT_TEEM [1], SXT_TEEM [2], SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3]
	SXT_TEEM2 [1], SXT_TEEM2 [2], SXT_TEEM2 [3], ref, sxt_flux [1], sxt_flux [2]
	sxt_flux [3], sxt_mwave
   History: slf, 9-Aug-1992
	     slf, 8-feb-1993 - use rd_tfile (via doc_head)
            slf, 15-mar-1993 - minor cleanup , quieter
	     slf, 10-Jan-1994 - call oneliner if no module
	     slf, 25-Jan-1994 - add outarr, loop


FAXABLE_SFD $SSW/yohkoh/ucon/idl/lemen/faxable_sfd.pro
[Previous] [Next]
 NAME:
     FAXABLE_SFD
 PURPOSE:
     Send an SFD AlMg image to the printer 
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     faxable_sfd, index, data
 OUTPUTS:
     index, data of most recent dag image
 INPUTS:
     none
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     /levels (default levels = 15)
     /hc	- To produce hardcopy output
 OUTPUTS:
 CALLS: ***
	DAG_INDEX, SXT_GRID [1], SXT_GRID [2], SXT_GRID [3], WDEF [1], WDEF [2], fmt_tim [1]
	fmt_tim [2], get_info [1], get_info [2], get_info [3], get_info [4], gt_filtb
	lastsfd [1], lastsfd [2], ocontour [1], ocontour [2], ocontour [3], ocontour [4]
	ocontour [5], pprint [1], pprint [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
     Will re-define window 0
 RESTRICTIONS:
     There must be a half-res AlMg SFD image within the past 10 acquired.
 MODIFICATION HISTORY:
     HSH, written 3-Nov-94 for the eclipse then
   16-oct-95, JRL, Spruced up for the Oct 24, 1995 eclipse


fchisq $SSW/yohkoh/ucon/idl/mcallister/fchisq.pro
[Previous] [Next]
       NAME: fchisq

       PURPOSE: Calculates reduced chi squared

       METHOD:  

       CALLING SEQUENCE: chisq = fchisq(x,y,xfit,yfit,mode,sigmay,nfree)

       PARAMETERS:	x	data points for independent variable
			y	data points for dependent variable
			xfit 	calculated values of x
			yfit 	calculated values of y
			mode	determines weighting method
				+1 (instrumental) weight(i) = 1./sigmay(i)**2
				 0 (no wieghting) weight(i) = 1.
				-1 (statistical)  weight(i) = 1./y(i)
			sigmay	standard deviations of the y data points
			nfree	number of free parameters

			chisq	return chi square 	

 CALLED BY:
	gradls
       HISTORY: Converted from Bornmann C routine, AMcA, July 1994.


fdf10_init $SSW/yohkoh/ucon/idl/mctiernan/fdf10_init.pro
[Previous] [Next]
 NAME:
	fdf10_init
 CALLING SEQUENCE:
	fdf10_init,esc,nsc,no_pts=no_pts,t6_range=t6_range,no_t6=no_t6,t6_in=t6_in
 PURPOSE:
	Calculates photon flux for the single thermal fit, includes SXR
	line spectra, as given by Jlemen's mewe_spec.pro. Also obtains
       the derivatives with respect to T6, and puts it all in a big
       Common Block.
 INPUT:
	esc= energy in keV
       nsc= no. of elements in esc
 OUTPUT:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 KEYWORD:
       no_pts= the number of points used to calculate the flux in MEWE_SPEC,
               the default is 500
       t6_range=A temperature range in MK, the default is [1.0, 100.0], No zeros please...
       no_t6=the number of temperature grid points, the default is 121
       t6_in = a t6 array, if passed in will be used
       use_esc= use the input energies to call MEWE_SPEC
 CALLS: ***
	DERIV, INTERPU_1D, mewe_spec [1], mewe_spec [2]
 CALLED BY:
	fitspec, fsp_11, fsp_mc, fx_95_o, fx_96_o, fx_97_o, fx_98_o, fx_99_o, hxt_anycomp
	hxt_thcomp, sxt_anycomp
 HISTORY:
	Mar. 93 J.McT
       Account for Changes in MEWE_SPEC, 5-23-95, jmm
       Changed T array from 2 to 100 MK, jmm, 10-31-95
       Added t6_range, no_t6 keywords
       Added use_esc keyword, 12/5/95, jmm


fdispm $SSW/yohkoh/ucon/idl/naoj_mtk/fdispm.pro
[Previous] [Next]
bin=2		; binning factor
pause='y'


FE25_BSC_TEMP $SSW/yohkoh/ucon/idl/sterling/fe25_bsc_temp.pro
[Previous] [Next]
 NAME:
       FE25_BSC_TEMP
 PURPOSE:
       Estimate Fe25 temperatures from BSC corrected spectra.
 CALLING SEQUENCE:
       FE25_BSC_TEMP,BSC_INDEX,BSC_DATA,W,Z
 INPUTS:
       BSC_INDEX    - BSC index structures
       BSC_DATA     - BSC data structure
 KEYWORDS:

 OPTIONAL OUTPUTS:
       W            - bin or wavelength array
       Z            - counts/bin/sec values of plotted spectrum
 CALLS: ***
	BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], GAUSSFIT [1], GAUSSFIT [2], GAUSSFIT [3]
	GAUSSFIT [4], GAUSSFIT [5], PLOTSPEC, SET_XY, UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6], anytim2ints [1], anytim2ints [2], fmt_tim [1]
	fmt_tim [2], get_syn_25, lam2bin, pprint [1], pprint [2]
 PROCEDURE:
       Must have BSC_INDEX and BSC_DATA structures available.  Code first
       produces a lightcurve from which you select the time for the spectra
       you want (same as in plot_bsc.pro).  You are then asked to select the 
	resonance line from the displayed spectrum.  A gaussian is fitted to 
       determine the wavelength offset and the width of that line.  Those
       values are then used to correspondingly broaden synthetic spectra which
	are then fit to the data.  The three closest fitting synthetic spectra
       are overplotted.  This is the same as in the Fe25_temp code, excect 
       here no gs software is used.

	Hardcopies are querried for at the end of the procedure.

	The synthetic spectra were generated from the synthetic spectral code 
	of G. Dosheck.

 HISTORY:
       27 Jan 93 	A. Sterling (C. D. Pike, D. Zarro)
				Created by combining and modifying Zarro's 
				PLOT_BSC and Pike's FE25_TEMP codes.


FE25_IONFRAC $SSW/yohkoh/ucon/idl/sterling/fe25_ionfrac.pro
[Previous] [Next]
  NAME:
  	FE25_IONFRAC

  PURPOSE:
	Interpolate Arnaud & Rothenflug (1985) Fractional Ionization Balance 
 	numbers and return an array of array of fractional ionization values
	for given input temperature values as a function of time.  Temperature
	values are good for temps between 10 and 79 MK.  All temps in MK.

  CALLING SEQUENCE:
  	FE25_IONFRAC,INPUT_TEMP,INPUT_TIME,FE25_FRAC_VALUE                  

  NOTES:

  INPUTS:
        INPUT_TEMP is temperature array at which the Fe25 ion fractional 
	 values are desired.  Temps in MK.

	 INPUT_TIME is an array of times corresponding to the INPUT_TEMP 
	 array temperatures.

  OPTIONAL INPUTS:

  OPTIONAL INPUT KEYWORDS:

  OUTPUTS:
	FE25_FRAC_VALUE is array of fractional ionization values arranged in
	order of times in INPUT_TIME array.

  VERSION:
        V1.0    2-Apr-1993
 CALLS: ***
	SPLINE
  HISTORY:
        Written 2-Apr-1993, A. Sterling


fe25_temp $SSW/yohkoh/ucon/idl/pike/fe25_temp.pro
[Previous] [Next]
                             FE25_TEMP

  To overlay FeXXV data and synthetic spectra, scaled to peak of w line
  with scaling of wavelengths as necessary. You must have run the routines
  GS and GS_CUR first to set up the internal arrays and to define the data
  time window. eg.

     IDL>  .run gs
     IDL>  .run gs_cur        (to specify time window)
     IDL>  .run fe25_temp     (answer prompts)

           The raw spectrum is first displayed and the user should select
           the resonance line window.  A gaussian is fitted to determine
           the w-line position and width.  The position determines the
           wavelength offset and the width is used to determine how much
           to broaden the synthetic spectrum by.  Since the broadening is
           by convolution with a gaussian, the spectral fit is not good in
           the line wings.

           The synthetic spectra plotted are those for the 
           temperature (+/-1 MK) which is calculated from the ratio of w 
           to j line intensities.

           Hard copy can be had by running interactively first and then 
           switching to hardcopy device and rerunning.

           Note that the marked position of the j-line is used to 
           stretch/compress the scale of the synthetic spectra to match 
           the observed spectrum, and its intensity is used to calculate the 
           line ratio.  


  CDP  Updated from original t25_plot (now deleted) June 92


Fe26_temp $SSW/yohkoh/ucon/idl/pike/fe26_temp.pro
[Previous] [Next]
 NAME:                                    Fe26_temp

 PURPOSE:              Approximate temperature calibration of Lalpha1/J ratio

 CALLING SEQUENCE:     t = fe26_temp(ratio)

 INPUTS:               ratio      the intensity ratio of La1/J lines

 OPTIONAL INPUTS:      None

 OUTPUTS:              Function value returned is the temperature

 OPTIONAL OUTPUTS:     None

 RESTRICTIONS:         None

 PROCEDURE:            Uses second order fit to ratios measured from 
                       synthetic spectra calculated by AS from GAD's code

 MODIFICATION HISTORY:   Written,  Jan 93   CDP


feature_label $SSW/yohkoh/ucon/idl/hudson/feature_label.pro
[Previous] [Next]
NAME: 
	feature_label
PURPOSe:	
	To label a feature on an image with corresponding text,
	and position it for xyouts with much ease... draws
	a line between text and feature using the cursor.
CATEGORY:
	Image Display?
CALLING SEQUENCE:
	feature_label,color=color_index, thick=thick_index, size=size,
	  linestyle=linestyle,notext=notext
INPUTS:
	none
OPTIONAL INPUTS:
	color = color index, 0:255
	thick = float, for thickness of line, default = 1.0
	size = float, for character size,default = 1.0
KEYWORDS:
	color,thick,linestyle,size,notext
OUTPUTS:
	plots on the screen, and prints the coordinates
	you clicked on in normalized coordinates (for use
	with a log-file or such, and for creating
	the same image going directly to PostScript)
 CALLS: ***
	HORI_VAR
RESTRICTIONS:
	coordinate system must be pre-defined (i.e. you've
	got to have an image up there...)
HISTORY:
	written KDL Aug 93, originally 'roadmap_label.pro'
	11-Nov-93 HSH added linestyle and notext keywords
	5-Feb-94  HSH added noline keyword - we'll reinvent the Mac yet!


fem_grid [2] $SSW/yohkoh/gen/idl/util/fem_grid.pro
[Previous] [Next]
NAME:
	fem_grid
PURPOSE:
	To overplot a grid of data held in the fem_data structure 
	(days/nights/SAA) on a previously drawn utplot graph

CALLING SEQUENCE:
       fem_grid [,/fillsaa, /fillnight, /ksc, /defcolor]

CALLING EXAMPLES:
	fem_grid			; just vert lines for day/night
	fem_grid, /saa			; include saa grid points
       fem_grid, /ksc, /fillsaa, /defcolor	; fill saa, add KSC and color
   	fem_grid, yrange=[.8*max(ydata),.9*max(ydata)]
		  
OPTIONAL KEYWORD PARAMTERS:
   	yrange - 2 el. vector of yaxis grid range (def=full width=!y.crange)
	saa -	if set, saa (radition belt) grid points are included
	ksc -   if set, ksc contact time grid points are included       
       fillnight - if set, polyfill is used to fill night times
	fillsaa   - if set, polyfill is used to fill saa times
	noday - if set, turns of day/night grid points
       defcolor - make it a color plot using some default colors

 CALLS: ***
	GETUT [1], GETUT [2], anytim2ints [1], anytim2ints [2], evt_grid, get_utevent [1]
	get_utevent [2], int2secarr [1], int2secarr [2], linecolors [1], linecolors [2]
	rd_fem
 CALLED BY:
	ECLIPSE_PLOTTER, GOES_TEK [1], NOV93_ECLIPSE, NOV_ECLIPSE, OBS_PLOT, QUICKATT [1]
	QUICKATT [2], QUICK_DPE, SXT_COVERAGE, TEST_ATT, fl_goesplot [1], fl_goesplot [2]
	fl_goesplot [3], goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4]
	goes_plot [5], goes_widget, last_lc, show_contacts
HISTORY:
	Written SLFreeland, 21-Sep-1992 
	22-Nov-1993 (SLF) added ncolor and scolor
	 1-dec-1993 (JRL) Fixed the default ncolor and scolor option
			  Changed it so it doesn't bomb if requested interval
			  is less than 1 hour.
        1-nov-1994 (SLF) allow ytype=1 (log)
       10-nov-1994 (SLF) add additional check to 1-nov mod 
        2-mar-1995 (SLF) enabled KSC keyword function, add defcolor keyword

RESTRICTIONS - can get awfully cluttered for long time intervals
		looks best with intervals less than 24 hours


FEM_OLD_STRUCT $SSW/yohkoh/gen/idl/ref_access/fem_old_struct.pro
[Previous] [Next]
       NAME:
               FEM_OLD_STRUCT
       PURPOSE:
               Define the following FEM (S/C transition) specific database structures
                       * FEM_9001_Data_Rec

       CALLING SEQUENCE:
               FEM_OLD_STRUCT
 CALLED BY:
	rd_week_file [1], rd_week_file [2], rd_week_file [3], rd_week_file [4]
	weekid [2], ydb_exist [2]
       HISTORY:
               Written 22-Nov-91 by M.Morrison


FEM_STRUCT $SSW/yohkoh/gen/idl/ref_access/fem_struct.pro
[Previous] [Next]
       NAME:
               FEM_STRUCT
       PURPOSE:
               Define the following FEM (S/C transition) specific database structures
                       * FEM_Data_Rec
                       * FEM_Version_Rec

       CALLING SEQUENCE:
               FEM_STRUCT
 CALLED BY:
	mk_fem [1], mk_fem [2], mk_fem_file [1], mk_fem_file [2], rd_week_file [1]
	rd_week_file [2], rd_week_file [3], rd_week_file [4], weekid [2], ydb_exist [2]
       HISTORY:
               Written 22-Nov-91 by M.Morrison
               23-Mar-95 (MDM) - Changed the structure to hold 6 station contacts
                                 within a single orbit to handle Wallops


FFI_DATAGET1 $SSW/yohkoh/ucon/idl/shimizu/ffi_dataget1.pro
[Previous] [Next]
 NAME:
       FFI_DATAGET1
 PURPOSE:
       Read the FFI image data from the FFI image file made by the image
     generater "MKIMAGE".
       This "FFI_DATAGET1" is for reading the data file being version 1
     file format.
 CATEGORY:
       SOLAR-A/SXT Data Analysis
 CALLING SEQUENCE:
       image= FFI_DATAGET1(file, header)
 INPUTS:
       file - SOLAR-A/SXT image file name
 OUTPUTS:
       image - image data
       header - header information
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       This procedure can be used only in reading FFI version 1 file.
 PROCEDURE:
       open the file and read the header and image data. Then these     
     are returned.
 PROGRAMMER:
       Toshifumi Shimizu
           Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
       Ver 1.0  13-MAR-1991  written
       Ver 1.1  26-MAR-1991  For Ver,1.0 header layout
       Ver 2.0  13-AUG-1991  Modified as Function
       Ver 2.1  28-Aug-1991  Append routine of I/O Error
       Ver 2.2  05-Oct-1992  rotate "data"


ffi_prep $SSW/yohkoh/ucon/idl/mcallister/ffi_prep.pro
[Previous] [Next]
 NAME: ffi_prep


 PURPOSE: general data preparation for sections of FFI's, and/or FFI's


 METHOD: This procedure is designed to prep large FFI data sets all at once,
	  by reading the data in in manageble sets. You can input a long list
	  of SFR files (using wild cards), select specific images using
	  SSWHERE, and then process that desired images only. The processing
  	  is controled by keywords, and is essentially the same as for SXT_PREP.
	  With the SAVE keyword the results of this section are saved to disk.
	  The results of SATPIX and UNCERT keywords (controlling the FFI prep
	  only) are always saved if preformed.
	  There is a second section that allows you to extract a data cube 
	  covering a smaller field of view. This data set is aligned with 
	  FFI2PFI in one of two ways: 1) all frames taken with the same angular
	  location and 2) tracking a region to remove rotation. The results of 
	  this alignment along with saturated pixel maps are always saved to disk. 

	  These two operations can be performed in seguence or one at a time
	  using keywords to shut off either the preparation or the alignment.	  
    
 	  Before using you should set the environmental variable DIR_MYPREP
	  to indicate the directory to which the output files are to be
	  written, otherwise the current directory is the defualt. 


 CALLING SEQUENCE:  ffi_prep,filestr[,/uncert][,/satpix][,align='algn'][,/all]
				    [,/noprep][,/norm]....

	  For PFI's: ffi_prep,filestr,align='region',/sparse,/upper_only


       PARAMETERS:	filestr	 	path/filename, wildcards O.K. STRING.


       KEYWORDS:	all		skip the call to SSWHERE, take everything.
			noprep 		when set the data in FILESTR is read
					and durectly passed to the alignment section.
			align		For limb alignment 'limb',
					for region alignment, 'region'
				  	for no alignment, use 'no'.
			uncert		to return decomp uncertainty
			satpix		when set calculates the saturation map for 
					the FFIs as well.
			upper_only	pass-through for SXT_SATPIX
			sparse		return satpix as 'sparse' structure
			mult_str	when set do not try to create a single
					sparse structure for the PFIs.
			nodark		to suppress DARK_SUB call
			leak		to correct for light leak
			roll_do		do roll sorrection
			norm  		to call EXP_NORM, should be single filter
			save		save the processed FFI data to disk
			inc		size of batches to process, default is 10

	CAUTIONS:     * This program expects the DIR_MYPREP environmental
			variable to be defined to indicate where to put the
			output files. If it is not the default is to use the
			'current directory'.
		      * If the NOPREP keyword is set then the ALIGN keyword must
			also be set.
		      * The NORM,LEAK,NODARK keywords have no effect if NOPREP is set.
		      * For FFIs, with the SPARSE keyword SATPIX is stored in pieces 
			as it is probably too large to make into a single structure.
			That for the PFI regions is made into a single structure. Be
			careful as there may be limits to this as well! In that case 
			use MULT_STR keyword.

		****** For now best to use MULT_STR with the SPARSE option ********


  CALLS: RT_SXTDT,SXT_SATPIX,SXT_DECOMP,DARK_SUB,LEAK_SUB,EXP_NORM,GET_RECT,
	BREAKFILE, FFI2PFI, RD_XDA [1], RD_XDA [2], ar_prep, exp_file, fmt_tim [1]
	fmt_tim [2], gt_filtb, his_index, sav_sda [1], sav_sda [2], sav_sda [3], sparse [1]
	sparse [2], sparse [3], wmenu_sel [1], wmenu_sel [2]
       HISTORY: Drafted by A. McAllister, mar-93.
		 Drafted prep sections AMcA, apr-93.
		 Moved the region selection up front, and replaced RD_AR
		 with FFI2PFI. AMcA, jun-93.
		 Changed UNCERT and SATPIX to keywords & save results, 
		 allow selection of reference image, AMcA, 1-jul-93.
		 Calculate SATPIX for the region seperately, AMcA, 2-jul-93.
		 Added test for near night images, AMcA, 3-jul-93.
		 Limit ref images to large dpes, AMcA, 8-jul-93.
		 Fixed calls to FFI2PFI for no-correction, AMcA, 8-jul-93.
		 Replaced calls to FFI2PFI with calls to SXT_PREP, AMcA, 29-apr-94.
		 Corrected the some of the preparation calls and
		 removed the /NOCORRECTIONS keyword from the SXT_PREP calls, AMcA, 14-dec-94.
		 enabled reselection of region, AMcA, 4-mar-95.


fft_smooth [1] $SSW/yohkoh/gen/galileo/idl/lmsal/fft_smooth.pro
[Previous] [Next]
NAME:
	fft_smooth
SAMPLE CALLING SEQUENCE:
	out = fft_smooth(image, low = 2)
	out = fft_smooth(image, high = 250)
PURPOSE:
	To use the fast fourier transform technique to remove low or
	high frequency components of the image.
INPUT:
	image = the image to be smoothed
OUTPUTS:
	out = the smoothed image
KEYWORD INPUTS:
	low, if you want to remove low frequency components of the image
		(range of low is normally 1 to 25)
	high, if you want to remove high frequency components
		The maximum value for HIGH is set by the user library
		function DIST which is called to generate the filter.
		IDL> f = dist(xx,yy)
		IDL> print, max(f)
	      Representative values are:
		Image size   Max value for high
		64x64		 45
		128x128		 90
		256x256		181
		512x512		362
		1024x512	527
		1024x1024	724
 CALLS: ***
	DIST
RESTRICTIONS:
	Use only on a single image at a time, not an array of images.
HISTORY:
	Written by L. Acton on 2/22/94.
	10-Dec-94 (LWA) Removed obsolete parameter.
	23-May=03 Incorporated Wiener filter.


fft_smooth [2] $SSW/yohkoh/ucon/idl/acton/fft_smooth.pro
[Previous] [Next]
NAME:
	fft_smooth
SAMPLE CALLING SEQUENCE:
	out = fft_smooth(image, low = 2)
	out = fft_smooth(image, high = 250)
PURPOSE:
	To use the fast fourier transform technique to remove low or
	high frequency components of the image.
INPUT:
	image = the image to be smoothed
OUTPUTS:
	out = the smoothed image
KEYWORD INPUTS:
	low, if you want to remove low frequency components of the image
		(range of low is normally 1 to 25)
	high, if you want to remove high frequency components
		The maximum value for HIGH is set by the user library
		function DIST which is called to generate the filter.
		IDL> f = dist(xx,yy)
		IDL> print, max(f)
	      Representative values are:
		Image size   Max value for high
		64x64		 45
		128x128		 90
		256x256		181
		512x512		362
		1024x512	527
		1024x1024	724
 CALLS: ***
	DIST
RESTRICTIONS:
	Use only on a single image at a time, not an array of images.
HISTORY:
	Written by L. Acton on 2/22/94.
	10-Dec-94 (LWA) Removed obsolete parameter.
	23-May=03 Incorporated Wiener filter.


fid2mo $SSW/yohkoh/gen/idl/ys_util/fid2mo.pro
[Previous] [Next]
   Name: fid2mo

   Purpose: return mo number for input fid

   Calling Sequence:
      mos=fid2mo(fid)

   Calling Example:
      mos=fid2mo('920932.1234')

   Input Parameters:
      fid - string of form YYMMDD.HHMM

 CALLS: ***
	data_chk [1], data_chk [2], rd_modb
 CALLED BY:
	tim2dbase
   History:
       4-oct-94 (SLF) from week2mo
       5-oct-94 (SLF) allow file names as well as fids - allow arrays
       2-Dec-94 (SLF) zero pad output to 4 places


fidmap $SSW/yohkoh/gen/idl/dbase/fidmap.pro
[Previous] [Next]
	Name:
		fidmap
	Purpose:
		Create a record (map) of the observing log search
		requests and successes.
	CALLING SEQUENCE:
		FIDmap, [key=key, fid=fid, sxtp=sxtp, sxtf=sxtf,
			bcs=bcs,hxt=hxt,wbs=wbs, times=times, w=w, map=map]
	INPUT/keyword:
		key	user requested search keys
		times	user requested start and stop times
		w	Instrument selection via file prefix
		fid	file IDs data-vector
		sxtp	partial frame data-vector
		sxtf	full frame data-vector
		bcs 	bcs data-vector
		hxt	hxt data-vector
		wbs	wbs data-vector
	Output/keyword:
		map 	housekeeping data in structure form:
			search keys, input times, instrument
			selections, file Ids, and lists of 
			start and stop indices for data-vectors
			corresponding to each file id.
 CALLS: ***
	ARR2STR [1], Arr2Str [2], Int2Ex [1], Int2Ex [2], MAKE_STR [1], MAKE_STR [2]
	StEnIdx
	History:
		written 19-June-91 by GAL
		update 24-June-91
		update 15-Oct-91, to call StENidx.pro instead of 
			Timidx.pro and to use bcs, hxt and wbs instead
			of oth3...


fidrange [2] $SSW/yohkoh/gen/idl/util/fidrange.pro
[Previous] [Next]
   Name: fidrange

   Purpose: return fileid range covered by yohkoh ref files on a directory
  
   Input Parameter:
       directory - string containing path (default is current directory)

   Optional Keyword Parameters:
       filt - optional file filter (default is ada*)
	range - if set, return value is first and last elements
	days - if set, return value is uniq (yymmdd) portion of fids
	keeppre - if set, return includes file prefix (ex: ada)
	time -    if set, return  is formmatted time string

   Output Paramters:
       function returns fids matching filt on directory optionally
	modified via. keyword parameters
	
   Calling Sequence: 
	fids=fidrange([directory] [,filt=filt], [,/range] [,/days])

   Category:
	swmaint, system, dbase

 CALLS: ***
	ADDTIME [1], ADDTIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], UNIQ [1], UNIQ [2], UNIQ [3]
	break_file [4], concat_dir [4], curdir [1], curdir [2], fid2ex [1], fid2ex [2]
	fmt_tim [1], fmt_tim [2]
 CALLED BY:
	chk_flares [1], chk_flares [2]
   History: slf 30-July-1992


file_summary $SSW/yohkoh/gen/idl/dbase/file_summary.pro
[Previous] [Next]
   Name:file_summary

   Purpose: return brief text summarry of solar a reformatted file

 CALLS: ***
	Int2Ex [1], Int2Ex [2]
   History: slf, 5/91


files_since [2] $SSW/yohkoh/gen/idl/atest/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


FILL_TIMEZERO $SSW/yohkoh/ucon/idl/sakao/fill_timezero.pro
[Previous] [Next]
 NAME:
	FILL_TIMEZERO
 PURPOSE:
	To replace blank portions of a given time array by 0's.
	e.g. '92/ 4/ 2  5: 2:12.  3' is replaced by '92/04/02 05:02:12.003'.
	This program is so prepared as to properly treat time strings in HXT 
	image files (*.hxtimg). 
 CALLING SEQUENCE:
	filled_str = FILL_TIMEZERO(time_str, time=time)
 INPUT:
	time_str	- Time string. Default is to have a format of 
			  YY/MM/DD HH:MM:SS.MSC.
 CALLED BY:
	MAKE_VTRANGE
 OPTIONAL KEYWORD INPUT:
	time		- If set, then the input time_str does not have the 
			  date part, i.e., time_str should be 'HH:MM:SS.MSC'.
 OUTPUT:
	filled_str	- A time string whose blanks are filled up by 0's.
 SIDE EFFECTS:
	none.
 CATEGORY:
	Yohkoh HXT data analysis.
 HISTORY:
	version 1.0	98.05.07 (Thu)	T.Sakao written.


FILT4_SIM $SSW/yohkoh/ucon/idl/sxt_co/filt4_sim.pro
[Previous] [Next]
 NAME:
     FILT4_SIM
 PURPOSE:
     Scale an AlMg image to simulate exposures in three other filters.
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
 INPUTS:
      IMG_INDEX, IMG_DATA, the index and image to use as a base for scaling.
      The image should be AlMg; for best results pick a well-exposed one with
      no saturation.

      Program asks for DPE as input. 

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	BLEEDER, LOADCT, gt_dpe, gt_expdur [1], gt_expdur [2], input [1], input [2]
	sxt_decomp [1], sxt_decomp [2]
 COMMON BLOCKS:
 SIDE EFFECTS:  Calls BLEEDER, to simulate saturation from over-exposed images.
		 Also loads STERN SPECIAL color table.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     29-may-98, DMcK, written in ad-hoc form
     02-jun-98, DMcK, put in call to GT_DPE to convert DPE to exptim 
     05-jun-98, DMcK, adjusted Al12 and Be119 scalings -- were too bright


filter [3] $SSW/yohkoh/sxt/idl/util/image_filterer.pro
[Previous] [Next]
       NAME: filter

       PURPOSE: Return the input image filtered with either median 
		 filter (default) or average filter.  

       METHOD: Default uses a three point median filter.  The returned 
		variable is either the filter image or a vector of filtered
		values corresponding to the input "indices" of the input
		image.  An average filter is also available.

       CALLING SEQUENCE:  
		filtered_img = filter(img, [width=width, indices=indices, 
				average=average] )


       PARAMETERS: 	img		input image 

	KEYWORDS:	
			width		filter size (default is 3).
			average		use an average filter instead
					of median.
			indices		a list of "img" elements for 
					which computed filtered values are
					returned.

	CALLS: ***
	IMAGE_FILTERER, coord_v2l
 CALLED BY:
	de_spiker [1], de_spiker [2], hrts_w [1], hrts_w [2]
       HISTORY: 
		19-Apr-94, written by gal and drafted from spikes by 
		A.McAllister, following a B.Labonte algorythm, 10-jun-93.
               10-nov-96 - S.L.Freeland renamed to <image_filterer> 
                           from filter.pro
                           (avoid collision with common variable names)


filter_combo $SSW/yohkoh/ucon/idl/sxt_co/filter_combo.pro
[Previous] [Next]
 NAME:
	filter_combo
 PURPOSE
	To return indices of A/B filter combinations.
 INPUT
	struct - structure from GET_POINTS
	A      - number of filter A
  		  1   Open       Op
  		  2   NaBan      NB
  		  3   Quart      Qz
  		  4   Diffu      Df
  		  5   WdBan      WB
  		  6   NuDen      ND
	B      - number of filter B
		  1   Open       Op
		  2   Al.1       A1
		  3   AlMg       AM
		  4   Be119      Be
		  5   Al12       A2
		  6   Mg3        Mg
 RESTRICTIONS
	Applicable only to GET_POINTS structures.
 HISTORY
	25-May-95  LWA
 CALLED BY
	term_score2


filter_os1 $SSW/yohkoh/ucon/idl/freeland/filter_os1.pro
[Previous] [Next]
   Name: filter_os1 

   Purpose: extract and return filter info from OS1
 CALLS:


FIND_CAL [1] $SSW/yohkoh/bcs/idl/atest/find_cal.pro
[Previous] [Next]
 NAME:
	FIND_CAL
 PURPOSE:
	Locates BCS Source and Stim Cals, and Memory Dumps
	Reports c/r, HV and Temps for Source Cals
 CALLING SEQUENCE:  
	find_cal,fsrting [,log=log] [,cal=cal, cals]
 INPUTS:

 OPTIONAL INPUTS:
	fstring		search string; requested if absent
 KEYWORD INPUTS:
	log		name of file for log; not logged if absent
	cal		create array with flags of type of data
			  -1 = skip, 0 nothing
			  1 = Source, 2 = Stim, 4 = Mem. Dump
	fsort		if present assembled search list from fstring
			and data_paths()
       path            if present, specifies search path (overrides data_paths)
	pause		if present, pauses at key places...
 OUTPUTS:

 OPTIONAL OUTPUTS:
	cals		Array of flags created if /cal stwitch used
 CALLS: ***
	ADDTIME [1], ADDTIME [2], AHK_CONV, ALL_VALS [1], ALL_VALS [2], BREAK_FILE [1]
	BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	DATA_PATHS, Int2Ex [1], Int2Ex [2], RD_BDA_DP, RD_QS, break_file [4], concat_dir [4]
	ex2fid [1], ex2fid [2], fmt_tim [1], fmt_tim [2]
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB  11-Dec-92	Written
	RDB  13-Jan-94	Many changes, return cal array, log to file
			Look for Mem. Dump
	RDB  18-Mar-94	Corrected code for finding stim cals.
       RDB  31-Aug-94  Improved test when finding stim cals. 
       RDB  29-Nov-97  Added path keyword


FIND_CAL [2] $SSW/yohkoh/bcs/idl/instr/find_cal.pro
[Previous] [Next]
 NAME:
	FIND_CAL
 PURPOSE:
	Locates BCS Source and Stim Cals, and Memory Dumps
	Reports c/r, HV and Temps for Source Cals
 CALLING SEQUENCE:  
	find_cal,fsrting [,log=log] [,cal=cal, cals]
 INPUTS:

 OPTIONAL INPUTS:
	fstring		search string; requested if absent
 KEYWORD INPUTS:
	log		name of file for log; not logged if absent
	cal		create array with flags of type of data
			  -1 = skip, 0 nothing
			  1 = Source, 2 = Stim, 4 = Mem. Dump
	fsort		if present assembled search list from fstring
			and data_paths()
	pause		if present, pauses at key places...
 OUTPUTS:

 OPTIONAL OUTPUTS:
	cals		Array of flags created if /cal stwitch used
 CALLS: ***
	ADDTIME [1], ADDTIME [2], AHK_CONV, ALL_VALS [1], ALL_VALS [2], BREAK_FILE [1]
	BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	DATA_PATHS, Int2Ex [1], Int2Ex [2], RD_BDA_DP, RD_QS, break_file [4], concat_dir [4]
	ex2fid [1], ex2fid [2], fmt_tim [1], fmt_tim [2]
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB  11-Dec-92	Written
	RDB  13-Jan-94	Many changes, return cal array, log to file
			Look for Mem. Dump
	RDB  18-Mar-94	Corrected code for finding stim cals.
       RDb  31-Aug-94  Improved test when finding stim cals. 


find_data $SSW/yohkoh/ucon/idl/pike/find_data.pro
[Previous] [Next]
                                                                          
 Procedure to find 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. 

 

  INPUT: 
         x       input data array 'time' values
         y       input data array data values
   invalid       value of datum to be ignored
   min_data_wind   chosen windows must contain at least this many data
                   points otherwise they are ignored.
   max_time_int    maximum time step which id considered legitimate within
                   a window. If two consecutive data points are separated
                   in time by more than this then a new data window is 
                   started.


  RETURNED:
          data_windows   A 2-d array containing the start and stop datum of
                         each window.


  Version 1                      Jan 92     CDP                           
                                                                          


find_dbo_dir $SSW/yohkoh/gen/idl/gbo/find_gbo_dir.pro
[Previous] [Next]
NAME:
	find_dbo_dir
PURPOSE:
	For a given GBO file, determine the week number and directory
	that it should go in.  Optionally create that directory.
CALLING SEQUENCE:
	dirs = find_gbo_dir(infil)
	dirs = find_gbo_dir(infil, /makedir)
INPUT:
	infil	- A single file name (or a list of file names)
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FIND_GBO_DIR, break_file [4], concat_dir [4], fid2ex [1]
	fid2ex [2], gbo_paths [1], gbo_paths [2], tim2orbit [1], tim2orbit [2]
OPTIONAL KEYWORD INPUT:
	makedir	- If set, and the required directory does not exist,
		  then create the directory.  It will use disk which
		  has the last GBO directory.
HISTORY:
	Written 27-Jan-93 by M.Morrison


FIND_FAST_DATA $SSW/yohkoh/ucon/idl/hudson/find_fast_data.pro
[Previous] [Next]
 NAME:
     FIND_FAST_DATA
 PURPOSE:
     Yohkoh observing log search for quiet-mode data with short time intervals
 CATEGORY:
     find_fast_data, t_start, t_stop, list
     find_fast_data, t_start, t_stop, list, /pfi_dom
     find_fast_data, t_start, t_stop, list, /pfi_dom, /plot
 CALLING SEQUENCE:
 INPUTS:
     start and end time 
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     pfi_dom counts short intervals (pfi_dominant)
     plot plots the time intervals
 ROUTINES CALLED
 OUTPUTS:
     list (observing log entries; use get_info to survey) 
 CALLS: ***
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	gt_dp_mode [1], gt_dp_mode [2], gt_dp_rate [1], gt_dp_rate [2], int2secarr [1]
	int2secarr [2], rd_obs
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
     Haven't been able to figure out yet how to tell if there really
       were PFI-dominant data, but this should show roughly where they
       are.
 MODIFICATION HISTORY:
     HSH 26-Aug-95


find_ftpts $SSW/yohkoh/ucon/idl/mctiernan/find_ftpts.pro
[Previous] [Next]
 NAME:
      find_ftpts
 CALLING SEQUENCE:
      find_ftpts, image0, n_ftpt, b_ftpt, r_ftpt, x_ftpt, y_ftpt, cyl=cyl, moff=moff, bck=bck, $
                  ok_ftpt_fraction=ok_ftpt_fraction, image_out=image_out, min_sep=min_sep, $
                  rmax=rmax
 PURPOSE:
      Given an image, find n_ftpt, gaussian sources, and return various values
 INPUTS:
      image0= an image
      n_ftpt= the number of sources you want
 OUTPUTS:
      b_ftpt = Total brightness of each source, fltarr(n), fixed to btot0/n
      r_ftpt = Radius of each source, fltarr(n), fixed to 1.0
      x_ftpt = x position of each source, fltarr(n)
      y_ftpt = y_position of each source, fltarr(n)
 KEYWORDS:
      cyl = if set, cylindrical sources
      moff = if set, use cylindrical moffat fns, f=c/(1+r^2/r0^2)^moff(0)
      bck = what's left over, the total of image0 minus the footpoints
      ok_ftpt_fraction = if set, its the fraction of the maximum footpoint
                         brightness for a good footpoint, if a footpoint
                         is found to have less than this total brightness,
                         then it gets deleted, the variable n_ftpt is
                         adjusted downwards by one. This we do to avoid
                         noise being called a footpoint...
      image_out = the final image, the sum of the footpoints
      min_sep = the minimum separation of your footpoints, once you have a
                footpoint, no other footpoints will be found within the
                minimum separation. The default is the footpoint radius
      rmax = a maximum footpoint radius
 CALLS: ***
	one_ftpt, twod_subs, width_2d
 HISTORY:
      3/16/95, jmm
      4/19/95, jmm, added ok_ftpt_fraction keyword, i hope it helps


FIND_LIMB $SSW/yohkoh/sxt/idl/register/find_limb.pro
[Previous] [Next]
 NAME:
	FIND_LIMB
 PURPOSE:
	Find the solar coordinates from an aspect camera image. 
	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)
	sxt	= 0 for results in units of the pixels of the input image
		= 1 for results in units of SXT 1x1 pixels (default)
 CALLS: ***
	GAUSS_FUNCT2 [1], GAUSS_FUNCT2 [2], POLY_FIT, STDEV, fit_circle [1]
	fit_circle [2]
 CALLED BY:
	GO_FIND_LIM2, GO_FIND_LIMB, eitoversxt, gbo_scale, rad_bck, sxt_align
	trace_make_vignette
 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
 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


FIND_LIMB_GEN $SSW/yohkoh/ucon/idl/nitta/find_limb_gen.pro
[Previous] [Next]
 NAME:
	FIND_LIMB_GEN
 PURPOSE:
	Find the solar limb from an image, Yohkoh or groundbased.
	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,
       assuming that lower left corner is (0,0).
 CALLING SEQUENCE:
	find_limb_gen, img, [x0, y0, r0, r_err, oblateness, ob_angle, bias, brightness, bright_limit=bright_limit], i_thres=i_thres
 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 = total signal expressed as DN per pixel
 SIDE EFFECTS
	None
 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)
 CALLS:
 CALLED BY
	align_gbo


FIND_LIMB_INIT $SSW/yohkoh/ucon/idl/nitta/find_limb_init.pro
[Previous] [Next]
 NAME:
	FIND_LIMB_INIT
 PURPOSE:
	Find the solar limb from an image, Yohkoh or groundbased.
	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,
       assuming that lower left corner is (0,0).
 CALLING SEQUENCE:
	find_limb_gen, img, [x0, y0, r0, r_err, oblateness, ob_angle, bias, brightness, b1=b1, b2=b2, initial=initial, r00=r00]
 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 = total signal expressed as DN per pixel
 SIDE EFFECTS
	None
 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)
 CALLS:


find_ptl $SSW/yohkoh/ucon/idl/kano/find_ptl.pro
[Previous] [Next]
function find_ptl,file

NAME:	find_ptl

PURPOSE:
	To find patrol images in a raw_tlm file.
EXAMPLE:
	ptl=find_ptl('/raw_tlm/v1/9808/08112339.08112352')
HISTORY:
	98-Aug-16	R.Kano	created


FIND_SEU $SSW/yohkoh/bcs/idl/micro/find_seu.pro
[Previous] [Next]
 NAME:
	FIND_SEU
 PURPOSE:
	Monitors memory checksum status and locates transitions
 CALLING SEQUENCE:  
	find_seu,fsrting [,log=log] [,fsort [,path=path]]
 INPUTS:

 OPTIONAL INPUTS:
	fstring		search string; requested if absent
 KEYWORD INPUTS:
	log		name of file for log; not logged if absent
	fsort		if present, assembles and orders search list from 
			fstring and defined path 
       path            path to be used for search (def is data_paths())
	pause		if present, pauses at key places...
       verbose         additional info printed
 OUTPUTS:

 OPTIONAL OUTPUTS:
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATA_PATHS, MEMCHK_TIMES, RD_BDA_DP, break_file [4]
	concat_dir [4], fmt_tim [1], fmt_tim [2]
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB   4-Sep-94  Written


finddir [2] $SSW/yohkoh/gen/idl/atest/finddir.pro
[Previous] [Next]
NAME:
	finddir
PURPOSE:
	Return the directory path to where "dir_name" is by looking
	in the directories listed in "dirs".  If "dirs" is not defined,
	then look at the /yd0, /yd1, ..., /yd12 directories.
	The value returned is the full path (including the "dir_name"
	portion) and has the trailing "/"
CALLING SEQUENCE:
	out = finddir('92_05a')
	out = finddir('ref_super', dir='~')
INPUT:
	dir_name- The directory name to find
	dirs	- The list of directories to check
	makecre	- If set, then if the directory does not exist,
		  request that the user make it and hit <CR> and
		  then check again.
METHOD:
	It searches the directories in the order that they are 
	passed in the array.  The first match on the directory
	name and the routine returns that path.
 CALLS: ***
	STR_LASTPOS [1], str_lastpos [2]
 CALLED BY:
	GetDatDir, mk_fidlist, mk_gx, mk_mo2 [1], mk_mo2 [2], mk_pnt, mk_sd2, mk_sdc [2]
	mk_sdc [3], mk_sdc [4], mk_sdl, mk_sdmi, mk_sft [1], mk_sft [2], mk_sl [1], mk_sl [2]
	mk_sot, mk_ssl, mk_week_file [1], mk_week_file [2], mktap, renbad, wk_online
HISTORY:
	14-Nov-91 (MDM) - Changed to use the new "yd" links
	17-Mar-92 (MDM) - Added document header
	20-Mar-92 (MDM) - Changed so that if the dir_name that is
			  passed in has a "/" as the first character,
			  assume that it is a full path, and do not
			  check the "dirs".
	 1-Jun-92 (MDM) - Modified default "dirs" definition - expanded from
			  12 /yd dirs to 16.
	 6-Aug-92 (slf) - expanded from 16 to 18 dirs through /yd17)
	16-Jun-93 (MDM) - expanded from 18 to 21 dires through /yd20
	27-Sep-94 (MDM) - Expanded from 21 to 30 dirs through /yd29 (/yd21 
			  is the last one being used right now)
       26-Aug-98 (PGS) - Added a few default directories for new isass0 & isass5 setup
       01-Sep-98 (PGS) - Added more default directories, changed order in vector.
	20-Jun-99 (GLS) - Call get_logenv to convert DIR_SITE_ONLINE_WEEKS to actual
			  path


first_bcs $SSW/yohkoh/bcs/idl/util/first_bcs.pro
[Previous] [Next]
 NAME:
  first_bcs
 PURPOSE:
  Display S XV, Ca XIX and Fe XXV spectra from the recent BDA data

  The BCS spectra are prepared by mk_bsc with the summing interval=200s.

 CALLING SEQUENCE:
  first_bcs		; Display data from the most recent file
  first_bcs,5		; Display from 4th most recent file
  first_bcs,0,index,data	; Most recent - return bsc index and data
  first_bcs,/interactive	; Show all spectra in the file
  first_bcs,0,index,data,/nodisp	; No display
  first_bcs,file=file		; User supplies the BDA file name
  first_bcs,/sxt		; Runs first_light first.

 INPUTS:
   None.
 OPTIONAL INPUTS:
   Nfile	- Default = 0 read most recent BDA file.
		  =1 read the 2nd to last most recent file
		  =2 read the 3rd to last most recent file
                 and so on.
 OPTIONAL KEYWORDS INPUTS:
  file		- To specify the bda file explicitly.
  interactive	- If set, display all spectra in the file.
  nodisplay	- If set, return without displaying any spectra.
  sxt		- If set, will call first_light first

 OUTPUTS:
   index	- The bsc index structure
   data	- The bsc data structure

 CALLS: ***
	BCS_SPEC_PLOT, FIRST_LIGHT [1], FIRST_LIGHT [2], GT_BSC_CHAN [1]
	GT_BSC_CHAN [2], MK_BSC [1], MK_BSC [2], RD_BDA [1], RD_BDA [2], WDEF [1], WDEF [2]
	clearplot [1], clearplot [2], days_2_xmas, newfiles [1], newfiles [2]
	newfiles [3], tbeep [1], tbeep [2], tbeep [3]
 SIDE EFFECTS:
   Unless the /nodisplay keyword is set, the routine will create a
   640 by 860 window (unless the current window is this size already).

 HISTORY:
   27-apr-95, J. R. Lemen (LPARL), Written.


FIRST_LIGHT [2] $SSW/yohkoh/gen/idl/util/first_light.pro
[Previous] [Next]
 NAME:
	FIRST_LIGHT
 PURPOSE:
	routine to give a quick look at SXT conditions.
	(thought to be useful for an indolent chief observer)

 CATEGORY:
	Yohkoh stuff

 CALLING SEQUENCE:
	first_light [,/generate]

 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
   generate - if set, force routines to update - default is to read from
              showpix files if available (almost always, the same data)

 OUTPUTS:
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], FMT_TIMER [1]
	FMT_TIMER [2], LOADCT, Rd_Roadmap [2], WDEF [1], WDEF [2], anytim2ints [1]
	anytim2ints [2], concat_dir [4], days_2_xmas, file_exist [1], file_exist [3]
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], fl_suntoday [1]
	fl_suntoday [2], fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2]
	get_logenv [1], get_logenv [2], gt_filtb, gt_percentd, gt_res, gtab_entry, jst
	lastsfd [1], lastsfd [2], newfiles [1], newfiles [2], newfiles [3]
	next_window [1], next_window [2], pr_evn [1], pr_evn [2], pr_visible, prstr [1]
	prstr [2], rd_roadmap [1], restgen [1], restgen [2], restsys [1], restsys [2]
	sfd_decomp, strjustify, term_times, tim2pass, timegrid, ut_time [1], ut_time [2]
 CALLED BY:
	first_bcs
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, written July 1993
	HSH mods 24-Aug-93
	HSH mods 31-Aug-93, pr_evn and Christmas calculation
	HSH mods  7-Dec-93, evt_grid
	SLF       8-Dec-93, evt_grid refinements
	SLF      14-Dec-93, chk_pointing call
	slf	 10-jan-94, HH requested minor mods
	slf       4-Mar-94, some protection (no goes, no spd)
	gal	  7-Mar-94, quick fix for typo-err 
	hsh	 13-Apr-94, Add KittPeak He10830 display
       da,hsh   16-Apr-94, Scales gb Image + Ulysses overlay
       da       30-Apr-94, Produces collage of SXT + 4 GBO images
	BNH	  1-Jul-94, Time stamp on collage and liberalized 
			    offpoint test
       BNH       6-Jul-94, Changed display stuff for collage to 
			    (hopefully) better deal with varying
                           background in gki, gkm images
       SLF      14-Jul-94, Made it a procedure - default is to read from
			    data files generated during go_toban
                           Got rid of some slow stuff which was not used
                           Dont clobber windows (use wdef) / broke out code
       SLF	 15-Jul-94, Allow it to run at any showpix site
       SLF      30-Aug-94, Add users UTTIME to collage image
       SLF       5-Oct-94, Add SUMMARY switch (read showpix version)
       SLF       7-oct-94, window number in summary window border
       SLF       9-oct-94, split into 2 windows for small screens
       SLF      20-nov-94, dont return immediately with /summary logic
       SLF      11-May-95, remove the 'Keith' message, various improves


first_over $SSW/yohkoh/gen/idl/ys_util/first_over.pro
[Previous] [Next]
 PURPOSE
   Simple program to "improve" the FIRST_LIGHT color table.
 CALLING SEQUENCE
   first_over
 EXPLANATION
   For those of you who object to the Stern Special color
   table for FIRST_LIGHT. I've written and put on line a
   routine called FIRST_OVER to run after first light to
   reverse the color table of the SXT FFI images and return
   the B&W color table.  Run it again and it reverses
   the reversed images.  Then loadct,15 to get back where you
   started.
 HISTORY
   30-Oct-94  Written by Acton and improved by Slater.
    1-nov-94  (SLF) protect against crash on small screen monitors or
                    if current window ne first_light window
 CALLS:
 CALLED BY
	fl_summary [1], fl_summary [2], fl_summary [3]


FIRST_WAVE $SSW/yohkoh/ucon/idl/hudson/first_wave.pro
[Previous] [Next]
 NAME:
	FIRST_WAVE
 PURPOSE:
	Main program to give a quick look at solar and BCS conditions.
	(thought to be useful for an indolent BTP) 
 CATEGORY:
	Yohkoh stuff
 CALLING SEQUENCE:
	.run first_wave
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, ACS written 22-Nov-93 


fit_1hxascan $SSW/yohkoh/ucon/idl/wuelser/fit_1hxascan.pro
[Previous] [Next]
 NAME:
        fit_1hxascan
 PURPOSE:
        determine sun center using hxa scan (intensity) data.
        Fits a limb darkening model and optionally returns residuals.
        Basically a curvefit front end that produces the initial guess.
 CATEGORY:
 CALLING SEQUENCE:
        fitparms = fit_1hxascan(scan,zone)
 INPUTS:
        scan = array(2048).  HXA scan (intensity) data.
        zone = intarr(2048).  Zones on detector to ignore.
               Zones straight from "forzones" program are fine.
 CALLED BY:
	HXASCAN2HXAXY
        Note: scan pixels below a lower intensity threshold and ge 63
              are also ignored.  See code for def. of lower threshold.
 KEYWORDS (INPUT):
        /noiter = do not iterate.
                  Default is to iterate once with those data points that
                  have a "small" residual.  See code for def. of "small"
 OUTPUTS:
        fitparms = fltarr(4): [center,radius,center_intens,dark_level]
                   "center" is calculated assuming that the first pixel of
                   the detector is pixel 0 (different from address data!).
        Note: To get suncenter locations in the same coordinate system as
              the hxa address data, add 2.0 to fitparms(0) (for hxa scan
              data with nposcan=2047).  To be done in calling program.
 KEYWORDS (OUTPUT):
        sigma = sigma of fitparameters.
        wfit = array of pixels (addresses) that were fitted.
        ffit = best fit function values at pixel addresses wfit.
 CALLS: ***
	CURVEFIT
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
        JPW, 29-sep-98
        JPW,  9-apr-99  set quiet before curvefit call


fit_bsc $SSW/yohkoh/bcs/idl/bsc/fit_bsc.pro
[Previous] [Next]
 NAME:
       fit_bsc
 PURPOSE:
       fit synthetic spectra to observed BSC spectra.
 CALLING SEQUENCE:
       fit_bsc,bsc_index,bsc_data,fit_index,fit_data
 INPUTS:
       bsc_index - BSC index
       bsc_data  - BSC data 
 OUTPUTS:
       fit_index - BSC index corresponding to fitted spectra
       fit_data  - BSC data  corresponding to fitted spectra
                   FIT_INDEX.FIT  - fitting information 
                   FIT_DATA.FLUX_FIT   - fitted spectra
                   FIT_DATA.FLUX_FIT2  - fitted spectra (2nd cmpt)
                   FIT_DATA.WAVE_FIT   - wavelength centers of fitted spectra
 OPTIONAL KEYWORDS
       te6 (in)  - electron temperature (MK) [otherwise use internal defaults]
       td6 (in)  - doppler  temperature (MK) [otherwise get from data guesses]
       wshift (in) - wavelength shift of observed resonance line relative to
                     theoretical value due to source position along dispersion axis.
       vshift (in)  - velocity shift of second component [otherwise get from data]
       chan (in)   - channel to fit (scalar)
       lrange (in) - wavelength range to limit line fit
       plot   (in) - if set, oplot fitted on observed spectrum
	ss     (in) - to select a subset of BCS_INDEX and BCS_DATA
       attempt (in) 
                       - 1 solve for EM50 and CNORM only
                       - 2 solve all single component parameters
                       - 3 solve for single + blueshifted component
       blue   (in)  - same as attempt=3
       tstart (in)  - UT time to start fit (e.g. 09:00 6-sep-92)
       tend   (in)  - UT time to end fit (use /tend to fit till end of data)
       newguess (in) - if set, don't use last converged parameters 
                       as starting guess for fit to first spectrum
       verbose (in) - if set, print diagnostic information
       err (out)    - 1 (fail)/ 0 (success)
       all (in)     - force all parameter fit for blueshifted cmpt
                      (i.e, do not tie Te6_s to Te6)
       thresh (in)  - count rate threshold above which to fit [def=10 cps]
       sample (in)  - flash a sample spectrum and upon which to select LRANGE
       nocont (in)  - turn off continuum fit (do line only)
       narrow (in)  - turn on line narrowing calculation (experimental!!!)
       dispc (in)   - correction factor for detector dispersion from CAL files
                      (def=1)
       nocnorm (in) - turn off fitting for CNORM
       hide (in)    - hide parts of spectra that are not included in fit
       def_range(in)- use hard-wired wavelength ranges as defaults 
                      (currently channel 3 and 4 only)
       fixp (in)    - keep supplied input parameters fixed
                      (e.g. to fix te6 use: te6=te6,/fixp )
       help (in)    - print documentation header
       xrange (out) - actual wavelength range(s) used in fit
       wdisp (out)  - dispersion correction factor (if /RECAL set)
       abun (in)    - user-supplied elemental abundance
       atocal (in)  - atomic calculation to use
       ioncal (in)  - ion balance calculation to use
	ion_mult (in)- Multipliers for the ionization fractions.  
                      This must be a floating vector of length 10.  
                      If ion_mult is undefined, or is vector that is less 
                      than 10 in length, then ion_mult will be set to:  
                          ion_mult = replicate(1.,10)  (i.e., all 1's).
       orig         - plot fitted spectrum on observed wavelength scale.
 CALLS: ***
	BCS_SPEC_PLOT, BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], BSC_FIELD, BSC_LRANGE
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOC_LIBRARY, FUNCT_FIT
	GT_BSC_CHAN [1], GT_BSC_CHAN [2], GT_BSC_CRATE, GT_BSC_TIME, REVERSE, SEL_BSC
	bcs_broad [1], bcs_broad [2], bcs_chi_norm, bcs_funct, cal_bsc, delvarx [5]
	fmt_tim [1], fmt_tim [2], str_copy_tags [1], str_copy_tags [2]
	str_copy_tags [3], str_copy_tags [4]
 CALLED BY:
	WBSC_SPC_EV [1], WBSC_SPC_EV [2]
 PROCEDURE:
       Calls BCS_SPEC to compute a model spectrum assuming Te6, Td6, and EM=1.e50 cm-3.
       Calls BCS_CHI_NORM to derive best fit EM and CNORM by minimizing chi^2.
       Calls CAL_BSC to infer starting guesses for fit.
       Calls FUNCT_FIT  to derive best fit.

       If user enters any of the parameters: Te6, Td6, Wshift, Vshift then
       they will be used as first guesses to the iteration cycle for
       the first spectrum that is fit. Fits to subsequent spectra will always
       use the most recent converged results for the starting guess.

       If /NEW is set, then the last converged results will be ignored
       for the first fit and will start with a either a new guess or a
       user-supplied value of Te6, Td6, Wshift, or Vshift. 

       If /FIXP is set, then the user-supplied parameter value will
       be fixed at that value.

       If /RECAL is set, then the detector dispersion will become
       an additional free parameter that is appended to the
       array of basic fit parameters.

       If /SAMPLE is set, then the peak count spectrum will be plotted and
       the user can select the appropriate fit ranges. The latter will
       be returned in the XRANGE keyword.

       If /BLUE is set, then a second blueshifted component will be
       solved for (this automatically sets ATTEMPT=3).

       The default value for ATTEMPT is 2, which is a single component fit.
       ATTEMPT=1 is for testing only and is used rarely.
       For a double cmpt fit, use ATTEMPT=3.
       For double cmpt fit, the default is to assume Te6_s = Te6_s (isothermal)
       Note that no assumption is made about whether the velocity of the
       second component is redshifted or blueshifted. Set /BLUE inorder
       to force a blueshift solution.
 HISTORY:
   20-Sep-93, D. Zarro & J. Lemen - written.
   30-Sep-93, Zarro - added full curvefit capability
   5 -Oct-93, Zarro - speeded up by calling CAL_BSC only when necessary
   19-Oct-93, Zarro - changed default to attempt=3
   20-Oct-93, Zarro - added more error checking (and ERR keyword)
   21-Oct-93, Zarro - added logic for secondary component
   28-Oct-93, Zarro - improved second component fitting by first converging
                      a single component model.
   26-Nov-93, Zarro - changed ATTEMPT keyword values:
                       1 = first guess single cmpt (fixed Te6, Td6, and Wshift) 
                       2 = full fit single cmpt (DEF)
                       3 = two components
		     - added BLUE keyword (same as ATTEMPT=3)
   1-Dec-93, Zarro  - added fit_model in COMMON BCS_FUNCT where fit_model
                      describes how parameters of 2nd cmpt will be computed:
                      fit_model = 0      (all parameters varied)
                                  2^0= 1 (Te6_s = Te6) [the default]
                                  2^1= 2 (Doppler shift == Td6_s)
                      (e.g. for isothermal model with doppler shift == Td6_s
                      use blue=1+2=3)
                    - added logic to start fitting at peak count rate 
                      when more than one spectrum.
   9-Dec-93, Zarro  - added ALL keyword to set fit_model=0
  13-Dec-93, Zarro  - added THRESH keyword to control threshold for fitting
  15-Dec-93, Zarro  - added logic for using converged parameters nearest
                      in time rather than previous.
  24-Dec-93, Zarro  - made default LRANGE to bracket resonance line 
                      rather than whole spectrum (Ca XIX only)
  12-Jan-94, Zarro  - added facility for multiple wavelength ranges via
                      LRANGE=[w1,w2,...w2n-1,w2n]
  20-Jan-94, Zarro  - added default LRANGE for SXV
   1-Feb-94, Zarro  - neutered LAST and CRANGE keywords
  16-Feb-94, Zarro  - added SAMPLE keyword
  11-Mar-94, Zarro  - added RECAL keyword to recalibrate wavelength scale
  15-Mar-94, Zarro  - made recal=1 the def for chan=4
   9-Apr-94, Zarro  - added NOCONT keyword
  17-Apr-94, Zarro  - lowered time difference check between current 
                      and last converged results from 60 to 300 sec
                    - turned off /SAMPLE message
   8-May-94, Zarro  - added NARROW keyword to implement line narrowing
  12-May-94, Zarro  - added DISPC keyword
  23-May-94, Zarro  - added HIDE keyword
   D-Day'94, Zarro  - made .FLUX_FIT2 tag omnipresent
  16-Jun-94, Zarro  - added DEF_RANGE, FIXP, and HELP keywords
  20-Jun-94, Zarro  - returned updated user supplied values of Te6, Td6, Wshift
  21-Jun-94, Zarro  - added more documentation
  23-Jun-94, Zarro  - improved RECAL switch
  23-Jun-94, Zarro  - added WDISP keyword to return fitted dispersions
  10-Aug-94, Zarro  - accomodated new .DISPC tag in BSC structure
  10-Oct-94, Lemen  - Changed eflux to ef in call to bcs_chi_norm; updated cthresh_def
  14-Oct-94, Zarro  - added ABUN keyword
  16-Oct-94, Zarro  - added IONCAL, ATOCAL keywords
  18-Oct-94, Zarro  - force initial guess of secondary cmpt Doppler width
                      to be same as primary width (keeps it from blowing up)
   9-Nov-94, Lemen  - Added ION_MULT keyword and added to common
  27-Dec-94, Zarro  - Tied initial guesses of Doppler broadening
                      to electron temperature. This helps keep a lid on
                      Td6, which tends to grow wildly with each iteration.
   4-Jan-95, Zarro  - Improved dispersion fit logic.
                      Added ORIG keyword.
   9-Feb-95, Zarro  - added VMODEL keyword to enable blueshift fitting
                      with blueshift linked to nonthermal width of 2nd cmpt.
                    - added check for nonstandard BLOCKID's
  18-Dec-95, Zarro  - forced Ca XIX fits to use default wavelength ranges
                      for fit


fit_bsc_as $SSW/yohkoh/ucon/idl/sterling/fit_bsc_as.pro
[Previous] [Next]
 NAME:
       fit_bsc_as
 PURPOSE:
       fit synthetic spectra to observed BSC spectra.
 CALLING SEQUENCE:
       fit_bsc_as,bsc_index,bsc_data,fit_index,fit_data
 INPUTS:
       bsc_index - BSC index
       bsc_data  - BSC data 
 OUTPUTS:
       fit_index - BSC index corresponding to fitted spectra
       fit_data  - BSC data  corresponding to fitted spectra
                   FIT_INDEX.FIT  - fitting information 
                   FIT_DATA.FLUX_FIT   - fitted spectra
                   FIT_DATA.FLUX_FIT2  - fitted spectra (2nd cmpt)
                   FIT_DATA.WAVE_FIT   - wavelength centers of fitted spectra
 OPTIONAL KEYWORDS
       te6 (in)  - electron temperature (MK) [otherwise use internal defaults]
       td6 (in)  - doppler  temperature (MK) [otherwise get from data guesses]
       wshift (in) - wavelength shift of observed resonance line relative to
                     theoretical value due to source position along dispersion axis.
       vshift (in)  - velocity shift of second component [otherwise get from data]
       chan (in)   - channel to fit (scalar)
       lrange (in) - wavelength range to limit line fit
       plot   (in) - if set, oplot fitted on observed spectrum
	ss     (in) - to select a subset of BCS_INDEX and BCS_DATA
       attempt (in) 
                       - 1 solve for EM50 and CNORM only
                       - 2 solve all single component parameters
                       - 3 solve for single + blueshifted component
       blue   (in)  - same as attempt=3
       tstart (in)  - UT time to start fit (e.g. 09:00 6-sep-92)
       tend   (in)  - UT time to end fit (use /tend to fit till end of data)
       newguess (in) - if set, don't use last converged parameters 
                       as starting guess for fit to first spectrum
       verbose (in) - if set, print diagnostic information
       err (out)    - 1 (fail)/ 0 (success)
       all (in)     - force all parameter fit for blueshifted cmpt
                      (i.e, do not tie Te6_s to Te6)
       thresh (in)  - count rate threshold above which to fit [def=10 cps]
       sample (in)  - flash a sample spectrum and upon which to select LRANGE
       nocont (in)  - turn off continuum fit (do line only)
       narrow (in)  - turn on line narrowing calculation (experimental!!!)
       dispc (in)   - correction factor for detector dispersion from CAL files
                      (def=1)
       nocnorm (in) - turn off fitting for CNORM
       hide (in)    - hide parts of spectra that are not included in fit
       def_range(in)- use hard-wired wavelength ranges as defaults 
                      (currently channel 3 and 4 only)
       fixp (in)    - keep supplied input parameters fixed
                      (e.g. to fix te6 use: te6=te6,/fixp )
       help (in)    - print documentation header
       xrange (out) - actual wavelength range(s) used in fit
       wdisp (out)  - dispersion correction factor (if /RECAL set)
       abun (in)    - user-supplied elemental abundance
       atocal (in)  - atomic calculation to use
       ioncal (in)  - ion balance calculation to use
	ion_mult (in)- Multipliers for the ionization fractions.  
                      This must be a floating vector of length 10.  
                      If ion_mult is undefined, or is vector that is less 
                      than 10 in length, then ion_mult will be set to:  
                          ion_mult = replicate(1.,10)  (i.e., all 1's).
       orig         - plot fitted spectrum on observed wavelength scale.
 CALLS: ***
	BCS_SPEC_PLOT, BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], BSC_FIELD, BSC_LRANGE
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOC_LIBRARY, FUNCT_FIT
	GT_BSC_CHAN [1], GT_BSC_CHAN [2], GT_BSC_CRATE, GT_BSC_TIME, REVERSE, SEL_BSC
	bcs_broad [1], bcs_broad [2], bcs_chi_norm, bcs_funct, cal_bsc, delvarx [5]
	fmt_tim [1], fmt_tim [2], str_copy_tags [1], str_copy_tags [2]
	str_copy_tags [3], str_copy_tags [4]
 PROCEDURE:
       Calls BCS_SPEC to compute a model spectrum assuming Te6, Td6, and EM=1.e50 cm-3.
       Calls BCS_CHI_NORM to derive best fit EM and CNORM by minimizing chi^2.
       Calls CAL_BSC to infer starting guesses for fit.
       Calls FUNCT_FIT  to derive best fit.

       If user enters any of the parameters: Te6, Td6, Wshift, Vshift then
       they will be used as first guesses to the iteration cycle for
       the first spectrum that is fit. Fits to subsequent spectra will always
       use the most recent converged results for the starting guess.

       If /NEW is set, then the last converged results will be ignored
       for the first fit and will start with a either a new guess or a
       user-supplied value of Te6, Td6, Wshift, or Vshift. 

       If /FIXP is set, then the user-supplied parameter value will
       be fixed at that value.

       If /RECAL is set, then the detector dispersion will become
       an additional free parameter that is appended to the
       array of basic fit parameters.

       If /SAMPLE is set, then the peak count spectrum will be plotted and
       the user can select the appropriate fit ranges. The latter will
       be returned in the XRANGE keyword.

       If /BLUE is set, then a second blueshifted component will be
       solved for (this automatically sets ATTEMPT=3).

       The default value for ATTEMPT is 2, which is a single component fit.
       ATTEMPT=1 is for testing only and is used rarely.
       For a double cmpt fit, use ATTEMPT=3.
       For double cmpt fit, the default is to assume Te6_s = Te6_s (isothermal)
       Note that no assumption is made about whether the velocity of the
       second component is redshifted or blueshifted. Set /BLUE inorder
       to force a blueshift solution.
 HISTORY:
   20-Sep-93, D. Zarro & J. Lemen - written.
   30-Sep-93, Zarro - added full curvefit capability
   5 -Oct-93, Zarro - speeded up by calling CAL_BSC only when necessary
   19-Oct-93, Zarro - changed default to attempt=3
   20-Oct-93, Zarro - added more error checking (and ERR keyword)
   21-Oct-93, Zarro - added logic for secondary component
   28-Oct-93, Zarro - improved second component fitting by first converging
                      a single component model.
   26-Nov-93, Zarro - changed ATTEMPT keyword values:
                       1 = first guess single cmpt (fixed Te6, Td6, and Wshift) 
                       2 = full fit single cmpt (DEF)
                       3 = two components
		     - added BLUE keyword (same as ATTEMPT=3)
   1-Dec-93, Zarro  - added fit_model in COMMON BCS_FUNCT where fit_model
                      describes how parameters of 2nd cmpt will be computed:
                      fit_model = 0      (all parameters varied)
                                  2^0= 1 (Te6_s = Te6) [the default]
                                  2^1= 2 (Doppler shift == Td6_s)
                      (e.g. for isothermal model with doppler shift == Td6_s
                      use blue=1+2=3)
                    - added logic to start fitting at peak count rate 
                      when more than one spectrum.
   9-Dec-93, Zarro  - added ALL keyword to set fit_model=0
  13-Dec-93, Zarro  - added THRESH keyword to control threshold for fitting
  15-Dec-93, Zarro  - added logic for using converged parameters nearest
                      in time rather than previous.
  24-Dec-93, Zarro  - made default LRANGE to bracket resonance line 
                      rather than whole spectrum (Ca XIX only)
  12-Jan-94, Zarro  - added facility for multiple wavelength ranges via
                      LRANGE=[w1,w2,...w2n-1,w2n]
  20-Jan-94, Zarro  - added default LRANGE for SXV
   1-Feb-94, Zarro  - neutered LAST and CRANGE keywords
  16-Feb-94, Zarro  - added SAMPLE keyword
  11-Mar-94, Zarro  - added RECAL keyword to recalibrate wavelength scale
  15-Mar-94, Zarro  - made recal=1 the def for chan=4
   9-Apr-94, Zarro  - added NOCONT keyword
  17-Apr-94, Zarro  - lowered time difference check between current 
                      and last converged results from 60 to 300 sec
                    - turned off /SAMPLE message
   8-May-94, Zarro  - added NARROW keyword to implement line narrowing
  12-May-94, Zarro  - added DISPC keyword
  23-May-94, Zarro  - added HIDE keyword
   D-Day'94, Zarro  - made .FLUX_FIT2 tag omnipresent
  16-Jun-94, Zarro  - added DEF_RANGE, FIXP, and HELP keywords
  20-Jun-94, Zarro  - returned updated user supplied values of Te6, Td6, Wshift
  21-Jun-94, Zarro  - added more documentation
  23-Jun-94, Zarro  - improved RECAL switch
  23-Jun-94, Zarro  - added WDISP keyword to return fitted dispersions
  10-Aug-94, Zarro  - accomodated new .DISPC tag in BSC structure
  10-Oct-94, Lemen  - Changed eflux to ef in call to bcs_chi_norm; updated cthresh_def
  14-Oct-94, Zarro  - added ABUN keyword
  16-Oct-94, Zarro  - added IONCAL, ATOCAL keywords
  18-Oct-94, Zarro  - force initial guess of secondary cmpt Doppler width
                      to be same as primary width (keeps it from blowing up)
   9-Nov-94, Lemen  - Added ION_MULT keyword and added to common
  27-Dec-94, Zarro  - Tied initial guesses of Doppler broadening
                      to electron temperature. This helps keep a lid on
                      Td6, which tends to grow wildly with each iteration.
   4-Jan-95, Zarro  - Improved dispersion fit logic.
                      Added ORIG keyword.
   9-Feb-95, Zarro  - added VMODEL keyword to enable blueshift fitting
                      with blueshift linked to nonthermal width of 2nd cmpt.
                    - added check for nonstandard BLOCKID's
  15-Dec-95, ACS    - made fit_bsc_as.  Has lowered Ca min count rate
  12-Aug-96, ACS    - Lowered S XV count rate.


fit_bsc_plot $SSW/yohkoh/bcs/idl/bsc/fit_bsc_plot.pro
[Previous] [Next]
 NAME:
   fit_bsc_plot
 PURPOSE:
   Plot fit_bsc results of fitted synthetic spectra to BCS observed spectra 
 CALLING SEQUENCE:
   fit_bsc_plot,bsc_index
   fit_bsc_plot,bsc_index
 INPUTS:
   INDEX  = BSC Index structure 
 OPTIONAL INPUT KEYWORDS:
   chan      = Select one channel to display
   xoff_anno = Number between 0 and 1 which specifies location of the plot annotation 
		[def=.97; defines right edge]
   font      = Specifies the font to use (make this a number -- not a string)
               0=Use hardware fonts.  -1=The current default fonts
   notitle   = If set, don't do any plot annotation.
   title     = User specified title (default title will be channel number)
   nodate    = By default, plot date is put on PS plots.  Use /nodate to suppress
   trange    = yrange option for Te    plots
   vrange    = yrange option for Vturb plots
   color     = color keyword for PLOT
   line      = Set to connect the points.
   charsize  = Normal keywords for plot, xyouts
 PostScript Specific:
    hc	      = If set, make a hardcopy version.
    PS       = If set, send the output to an idl.ps file 
		 (but don't close or send to printer)
    eps      = Same as PostScript, but makes an encapsulated file
    fileout  = Name of the output PostScript file
    xlen     = Specifies length of X-axis (inches)
    ylen     = Specifies length of y-axis (inches)
    xsize    = Specifies the PostScript Page X-size (inches) [def= 6.5 in]
    ysize    = Specifies the PostScript Page Y-size (inches) [def= 8.5 in]
    xoffs    = X-offset [def= 1.0 in]
    yoffs    = Y offset [def= 1.5 in]
  
 CALLS: ***
	BSC_CHECK [1], BSC_CHECK [2], CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], EUTPLOT
	GT_BSC_CHAN [1], GT_BSC_CHAN [2], OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], REVERSE
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], WDEF [1]
	WDEF [2], bcs_broad [1], bcs_broad [2], bsc_vturb, clearplot [1], clearplot [2]
	fmt_tim [1], fmt_tim [2], int2secarr [1], int2secarr [2], pprint [1], pprint [2]
 SIDE EFFECTS:
  
 MODIFICATION HISTORY:
 21-jan-94, J. R. Lemen (LPARL), Written
 14-oct-94, JRL, Changed plot to count rate (s-1); detect and eliminate gaps
	          in the count rate curve; added error bars to non-thermal vel.;
		  Set xstyle=2 to extend the x-axis slightly
 30-may-95, JRL, Fudge calls to utplot to overcome inconsistency when xstyle=2 and
		  timerange=timerange keywords are specified.


fit_limb $SSW/yohkoh/gen/idl/ys_util/fit_limb.pro
[Previous] [Next]
NAME:
	fit_limb
PURPOSE:
	Find the center and radius of an image.  NOTE: For SXT images, the
	default is to return the result in full resolution pixels.
CATEGORY:
CALLING SEQUENCE:
     fit_limb, image, x, y, r, pixel_size=2.5, date='05-Oct-93'
     fit_limb, image, x, y, r, pixel_size=2.5, intial=[434,512,403*2.5]
     fit_limb, data(*,*,nimage), x, y, r, index=index(nimage),/norfit
INPUTS:
     image	Full sun image for which the center and radius will 
		be computed.  It should be a 2-D array (not a 3-D data cube)
		It should be decompressed, and ideally background subtracted.
OPTIONAL KEYWORD INPUTS:
     index	SXT index structure.  If passed, it will use this value to
		derive the initial guess of the location.
     summed_pixels - If set, return the pixel coordinate of the sun center in
		the summed pixels, not the full resolution pixel coordinates
		which are the default (only relevant if index is set).
     pixel_size - The pixel size in arcseconds.  If the SXT index is passed
		it will be derived from that.
     /verbose = if set, print a bunch of diagnostics
     /ellipse = if set, fit an ellipse rather than a circle.  May work
                better for oblate images, but should not be used for circular
                images since it allows another degree of freedom in the fit.
     oblateness = return second harmonic of radius
     ob_angle = return phase of 2nd harmonic
     /noobcorrect = do not correct final sun center value for oblateness
     bias = return distortion of limb due higher harmonics
     xlimb,ylimb = returns the coordinates of the selected limb pixels
     /interactive = allows interactive selection of initial center
                    guess and deselection of limb points.
     /quiet = No images are displayed if set and interactive is not set
     initial_values = 3-element vector giving initial guess: [x0,y0,r0]
                      x0 and y0 are in pixels, r0 is in arcseconds !!
                      If initial values are passed, HXA is NOT used and index 
                      need not be passed as a parameter.  
     /fast = If set, do the fast but slightly less accurate computation of
             the limb position (limb derivative is not smoothed).
     xinitial = returns  x coordinate of image center for the initial guess
     yinitial = returns  y coordinate of image center for the initial guess
     /decompress = If set, use sxt_decomp to decompress the image
     /iterate = iterate in the circle fitting routine.  In principle this
                could improve the accuracy. (default)
     /noiterate = do not iterate.
     kill = number of iterations eliminating bad limb points.  The 
            default is 0 for non x-ray images and 2 for x-ray images.
            X-ray images often need kill of 1 or 2.
            Smaller numbers (0 or 1) make the algorithm 
            correspondingly less sensitive to the initial guess.
            Higher numbers will eliminate more limb points with the potential
            for a better fit in some cases.
     /norfit = if set, do not fit the radius of the sun: use the initial guess
               If you know the pixel size exactly and pass the date or index
               so that the sun's radius can be computed, this keyword should 
               be used since it removes one degree of freedom from the circle
               fit.
     date = date for computation of solar radius.  Index is used if it is 
            present.  If date is omitted, a crude value is computed from the
            image.
OUTPUTS:
     x = x position of the center of the image.
	  For SXT images, the units are FULL res pixels unless /SUMMED_PIXELS
	  is set.  There is also (0, 1 or 3) pixel offset for FR, HR, and QR.
     y = y position of the center of the image 
	  For SXT images, the units are FULL res pixels unless /SUMMED_PIXELS
	  is set.  There is also (0, 1 or 3) pixel offset for FR, HR, and QR.
     r = radius of the image in units of (original) pixels

     RSun/RFit = The ratio of the Sun's radius computed for the time of the
                 image to the fit radius.  This is the size of the SXT pixels
                 in arcseconds.  However, if the index in NOT suppled, the 
                 Sun's radius can not be computed and the result is the 
                 ratio of the initial guess of the radius to the fitted value.
                 In this case, this is NOT the size of the SXT pixels.
                 RSun/RFit is printed as the program ends.  It is not returned
                 in a variable.
 CALLS: ***
	CENTROIDW [1], CENTROIDW [2], INTERPOL, POLY_FIT, STDEV, circle_fit [1]
	circle_fit [2], deriv_lud, fit_circle [1], fit_circle [2], get_rb0p [1]
	get_rb0p [2], gt_corner, gt_filtb, gt_pix_size, gt_res, line_cent, sxt_decomp [1]
	sxt_decomp [2]
 CALLED BY:
	GEN_LOC, halp halphaprep, halpha_prep, sxt_center, sxt_mk3 mk3 index data [1]
	sxt_mk3 mk3 index data [2]
SIDE EFFECTS:
     Makes plots in the current window.
RESTRICTIONS:
     o The algorithm relies on a VERY good initital guess to remove bad limb
       points.
     o The correction for oblateness is not done for x-ray images.
     o If part of the limb is obscurred, you may need to use a large kill 
       value (around 5).  Such data must be treated on a case by case basis
       by a smart user!
PROCEDURE:
     The initial
     guess is used to find a rough limb position which is used to compute
     the points with the maximum derivative in the intensity along the radii. 
     These maximum derivative points are assumed to delineate the limb and a 
     circle is fit to these points and the center and the radius are computed.
     The derivative is smoothed using the deriv_lud procedure.
MODIFICATION HISTORY:
     T. Metcalf 4/1992
     T. Metcalf 10/1992:  Switched from gt_hxa to hxa_suncenter to get the 
                          initital guess.
     T. Metcalf 2/1993:   Switched from hxa_suncenter to get_suncenter
			  *** COPIED FROM SXT_CENTER.PRO TO FIT_LIMB.PRO ***
	21-Dec-93 (MDM) - Modified to work with non-SXT images
	 6-Jan-94 (MDM) - Minor changes
	14-Jan-94 (MDM) - Removed FID_FLAG keyword (was marking if RD_PNT
			  data had fidutial mark)
	19-Jan-94 (MDM) - Corrected error not allowing it to work on SXT image
			- Modified header.
	 3-Feb-94 (MDM) - Modified to use GT_CORNER with /FROM_SC switch
			  to determine the initial sun center guess.
     T. Metcalf 2/1994:   o Default kill for non x-ray images is now 0.
                          o Added obcorrect keyword.
                          o Added ellipse keyword
	15-Feb-94 (MDM) - Removed on_error,2 statement
			- Corrected error where IF statement was trying to
			  operate on a one byte array, not a scalar
			  (the problem was in GET_RB0P)
	21-Feb-94 (MDM) - Modified the header
	 9-Dec-94 (MDM) - MOdified the header
	22-Mar-95 (MDM) - Modified to add a 0.5 pixel offset for
			  the results when not passing an SXT index.


fit_pha $SSW/yohkoh/ucon/idl/phillips/fit_pha.pro
[Previous] [Next]
 Atp 1992, mssl
  This is a subroutine designed to plug into ppha.pro.
   to: fit to the summed spectrum from ppha
       optionally produce plot, and also write out data into a file
       appended onto the end, in format used for ETE files.

 requires: Calchisqr.pro

 inputs: xarray - xarray of data set to be fitted
         yarray - y array as above
         channel- Pha channel (0 - 3)
	  ident  - channel ident 
         scalo  - lower sca value
         scahi  - upper sca value
         filename- current filename

 outputs: After questions can stick results into a file/produce plot

 CALLS: ***
	Calchisqr, GAUSSFIT [1], GAUSSFIT [2], GAUSSFIT [3], GAUSSFIT [4], GAUSSFIT [5]
	PLTDV2, SET_XY
 history : atp 2/3/92  isas


FIT_POSSI4 main program $SSW/yohkoh/ucon/idl/hudson/fit_possi4.pro
[Previous] [Next]
 NAME:
	FIT_POSSI4 (main program)
 PURPOSE:
	integrate efficiency of HXT over thermal spectra
	and do fits
 HISTORY:
	HSH 11-Sep-93 
	HSH 8-Oct-93, fixed bug in summations


FIT_THERMmain program $SSW/yohkoh/ucon/idl/hudson/fit_therm.pro
[Previous] [Next]
 NAME:
	FIT_THERM	(main program)
 PURPOSE:
	integrate efficiency of HXT over thermal spectra
	and do fits
 HISTORY:
	written by HSH Oct. 1992
	update Nov. 1992 to handle new HXT response calculations


FITIM2INTS $SSW/yohkoh/ucon/idl/wuelser/fitim2ints.pro
[Previous] [Next]
 NAME:
        FITIM2INTS
 PURPOSE:
        Converts a FITS TIME-OBS time string (or array of time strings)
        into a standard Yohkoh time structure with tags .time and .day
 CATEGORY:
 CALLING SEQUENCE:
        time_struct = fitim2ints(time,date)
 INPUTS:
        time = stringarray with MCCD times
        date = date string (or array of date strings) in two possible formats:
               either same as FITS DATE_OBS keyword (e.g., '15-11-91'),
               or same as standard Yohkoh time string (e.g., '15-NOV-91').
               date can be a single string even if time is a string array.
 KEYWORDS (INPUT):
        t_off = offset in milliseconds. Output will be t_off later than input.
 OUTPUTS:
        time_struct = standard time structure with tags .time (milliseconds
                      of day) and .day (days since 1979).
 KEYWORDS (OUTPUT):
 CALLS: ***
	anytim2ints [1], anytim2ints [2]
 CALLED BY:
	PP_MWLT2SXT, mwlt_analyze, mwlt_tape2jpeg, rd_mwltlog, sun_grid
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
        JPW, Nov. 92


fits2time [3] $SSW/yohkoh/gen/idl/util/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_TIME $SSW/yohkoh/ucon/idl/hudson/fits_time.pro
[Previous] [Next]
 NAME:
     FITS_TIME
 PURPOSE
     interpret FITS header in Yohkoh string time
 CALLING SEQUENCE
     tt = fits_time(head)
 INPUT VARIABLES
     hehead, the FITS header
 HISTORY
     HSH, written 12-Nov-95
 CALLS:


fitspec $SSW/yohkoh/ucon/idl/mctiernan/fitspec.pro
[Previous] [Next]
 NAME:
	fitspec
 CALLING SEQUENCE:
	Fitspec,resp_struct,tyspec,cdta,fdta,init_a=init_a
 PURPOSE:
	Does the spectral fit, 
 INPUT: 
       resp_struct= an anonymous structure, tags
	        e10= channel low energy edges
	        e20= channel high energy edges
       	eb0= channel energies
               resp_files= inpf, the resp.file names
		n_ins= no. of detectors use in spectrum
		ncmx= no. of channels for each instrument
		nc0= total number of channels
		ne0= number of energies at which the response has been determined
		e0= the energies at which the response has been determined
		r0= the response matrix 
		rde0= response matrix*de0, so that counts(nc0)=flux(ne0)#rde0(nc0,ne0)
	tyspec= type of spectrum
 		=1, single p.l., a(0)=K, a(1)=gamma
		=2, double p.l., a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
			(ebr is the break energy in keV)
		=3, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6
		=4, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma
               =5, Double Thermal, a(0)=em1/1.0e47, a(1)=T1/1.0e6, 
			a(2)=em2/1.0e47, a(3)=T2/1.0e6
		=6, p.l.+p.l., a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
		=7, Thermal below Ebr, p.l. above Ebr, 
			a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
This is getting messy...
		=8 Thermal + double p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, 
			a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		=9 Triple P.L.,  a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			a(5)=eb2 (between gamma2 and gamma3)
		=10, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6, includes
                    SXR lines
		=11, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma, includes  SXR lines
 		=12, single p.l. flattens below e0, a(0)=K, a(1)=gamma, a(2)=e0
 		=13, single p.l. cuts off below e0, a(0)=K, a(1)=gamma, a(2)=e0
               =14, Double Thermal, a(0)=em1/1.0e47, a(1)=T1/1.0e6, 
			a(2)=em2/1.0e47, a(3)=T2/1.0e6, includes SXR lines
	cdta = a structure, of type xdta with tags, 
		tc= total count rate, b= bck count rate,
		c= fit count rate, yo = obs count rate, 
		s2= unc. in yo squared, icch= channel #
		ech= channel energy, Only c is calculated in this routine
	fdta = a structure with tags: 
		a=output parameters,
		sa=Unc. in a
		ma=no. of elements used in a
       ffx= 0 if the associated parameter is free, 1 if fixed at a
              user defined value, 2 if fixed at the value initially
              given by ainit
	chi2=chi^2
 OUTPUT:
	Structures cdta and fdta, filled with data
 KEYWORDS:
       init_a= initial values for the fit parameters, just for testing.
       amoeba= if set, use the routine amoeba_x to get fit
 CALLS: ***
	Ainit, Countrate, FSP_AMOEBA, Fsp_mrqmin, bad_a, fdf10_init
 CALLED BY:
	fsp_11, fsp_mc
 COMMON BLOCKS:
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY:
	Spring '92 JMcT


fitstap2tap [2] $SSW/yohkoh/gen/idl/util/fitstap2tap.pro
[Previous] [Next]
   Name:fitstap2tap

   Purpose: fits tape to tape copy routine

   Input Parameters:
      d1no - drive name for source 	(input)  - string or #
      d2no - drive name for destination  (output) - string or #
	    (note - type of d1no must=type of d2no)

   Calling Examples:
      fitstap2tap, '/dev/nrmt0h','/dev/nrmt1h'     ;drive0->drive1
      fitstap2tap,0,1				;same (on ultrix)
      fitstap2tap,0,1,/nofault	;same as above except user gets no prompts
				;to recheck source and destination drives

   Optional Keyword Parameters:
      nofault - if set, will not prompt the user with drive config for copy
      log - if set, log file written to current directory
      block - blocking factor (default=2880)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], STR2ARR [1], STR2ARR [2]
	concat_dir [4], def_tapd [1], def_tapd [2], def_tapd [3], get_logenv [1]
	get_logenv [2], mtcmd [1], mtcmd [2], rd_tfile [1], rd_tfile [2], tbeep [1]
	tbeep [2], tbeep [3]
 CALLED BY:
	ACOPY [1]
   Restrictions: unix only (uses mt and dd)

   HISTORY:
      3-Aug-1994 (SLF) - written (from arctap2tap)
      5-Aug-1994 (SLF) - rewind instead of unload (acopy.pro compatible)


Fix_bsd_header v12 $SSW/yohkoh/bcs/idl/bsd/fix_bsd_header.pro
[Previous] [Next]
 NAME: 		Fix_bsd_header v1.2

 PURPOSE:		rationalise bsd header structures

 CALLING SEQUENCE:     fix_bsd_header,bsd_header,bsd_index,bsd_data

 INPUTS:		bsd_header - header structure to be rationalised
			bsd_index  - index structure
			bsd_data   - data structure

 OUTPUTS:		rationalised bsd_header

 OPTIONAL OUTPUTS:	none

 CALLS: ***
	FIX_BSD_HEADER, int2secarr [1], int2secarr [2]
 RESTRICTIONS:		The Pointer arrays are **NOT** calculated. Use of
			the header block with any program other than one
			that explicitly calculates the roadmap ab initio,
			(eg wr_bsd.pro) will cause unpleasantness.

 PROCEDURE:		scan index structures and data structure + use to 
			regenerate header

 MODIFICATION HISTORY: written 4/7/92 atp mssl v1.0,1.1,1.2


fix_decon_pits $SSW/yohkoh/gen/galileo/idl/lmsal/fix_decon_pits.pro
[Previous] [Next]
 NAME:
	fix_decon_pits

 PURPOSE:
 Remove "pits" of negative pixel values surrounding short duration
 brightenings in SXT movie composites (SSS images).
 If a short duration brightening (e.g., impulsive flare) happens to
 occcur during the short exposure, but is finished by the time of the 
 long exposure, then the long+short composite image will suffer when
 the descattering step is applied.  Deconvolution from the PSF will 
 result in too much signal being taken from the faint plasma
 observed in the long exposure (because it's assumed to be due to 
 scattering when really it's not), so that the final composite image
 will have a "pit" of negative pixel values surrounding the brightening.
 This simpleminded program fixes these pits by identifying all pixels
 with negative values, and replacing them with values from the Level-1
 long exposure.  The program is a blunt instrument in that it makes no
 distinction between the pits due to pathological short-duration 
 brightenings and negative pixels caused by statistical fluctuations in
 areas of low signal (i.e., coronal holes and the corners of the FOV).
 For this reason, the program should ONLY BE USED FOR MOVIE IMAGES, 
 AND IS NOT SUITABLE FOR TREATING THE SCIENCE-QUALITY QUANTITATIVE 
 IMAGES.

 CALLING SEQUENCE:
	fix_decon_pits,index_in,data_in,index_out,data_out,silent=silent

 INPUT PARAMETERS:
	index_in = input index structure, needed for FMT_TIMER
	data_in = input image cube (SSCs for Yohkoh Legacy Archive)

 OUTPUT PARAMETERS:
	index_out = output index structure (currently = index_in)
	data_out = output image cube

 OPTIONAL PARAMETERS:
	silent = suppresses printing of time elapsed while running

 CALLS: ***
	FIND_FILE, FMT_TIMER [1], FMT_TIMER [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], mreadfits
 RESTRICTIONS:
	Uses the Level-1 FITS images located in '/disk/yl2/sxtf_fits/'

 HISTORY:
	Written 16-May-2006, DMcK
	16-Jun-2006 LWA  Fixed up header.
			 Changed lev1dir to /disk/yl2/sxtf_fits.
	26-Jun-2006 LWA  size(3) doesn't work for one image, fixed.


fix_hxtindex $SSW/yohkoh/ucon/idl/mctiernan/fix_hxtindex.pro
[Previous] [Next]
 NAME:
       fix_hxtindex
 PURPOSE:
       Calls hxt_prestore, and returns an index with the correct start
       times for the intervals. DON'T USE THIS BEFORE USING HXT_FSP,
       OR HXT_MULTIMG, AS THESE DO THIS CORRECTIONS THEMSELVES,
       THIS IS CREATED FOR USE BEFORE HXTPRO and HXTPIXON, WHICH
       HAVE NO TIME CORRECTIONS IN THEM.
 CALLING SEQUENCE:
       index_out=fix_hxtindex(index_in)
 INPUT:
       index_in = index from an HDA file, not an HXI file
 OUTPUT:
       index_out = The index, with the time fixed,
 CALLS: ***
	HXT_PRESTORE [1], HXT_PRESTORE [2], HXT_PRESTORE [3], HXT_PRESTORE [4]
	HXT_PRESTORE [5], anytim2ints [1], anytim2ints [2], dprate2sec [1]
	dprate2sec [2], mk_timarr [1], mk_timarr [2]
 CALLED BY:
	hxt_chsums, hxtaccumulate
 HISTORY:
       1/10/95, jmm
       changed calls to PRESTORE to HXT_PRESTORE, 8-jan-1997, jmm


FIX_OLD_ATT [1] $SSW/yohkoh/gen/galileo/idl/lmsal/fix_old_att.pro
[Previous] [Next]
 NAME:
        FIX_OLD_ATT
 PURPOSE:
        Remove the wrong mission correction offset from old ATT data.

 CATEGORY:
 CALLING SEQUENCE:
        fix_old_att,att
 INPUTS:
        att = att structure 
              The input is replaced by the corrected att structure.
 KEYWORDS (INPUT):
 OUTPUTS:
        att = att structure with corrected att.pnt values.
 KEYWORDS (OUTPUT):
 CALLS: ***
	data_chk [1], data_chk [2], gt_day [1], gt_day [2], tag_index [1], tag_index [2]
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	rd_att, show_hxafid
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:

 PROCEDURE:
    The following corrections are made by this routine.
    Algorithm = 0:
     Old ATT data (created before 21-sep-94) used an erroneous
     mission correction for data after 1-jan-93.  The offset is
     in the N-S direction and grew from less than 1" to more than 15"
     in September 1994.

 MODIFICATION HISTORY:
        19-sep-94 (JPW)
        22-sep-94 (SLF) - check ATT 'algorithm' (3 LSB in ATT.STATUS2)
                          ATT algorithm check and set correction 'history' bit
        24-mar-95 (SLF) - eliminate status message
        13-jan-98 (JPW) - add updated mission correction
        25-sep-98 (JPW) - apply updated (jan-98) mission correction
                          to version le 3 (was "le 2")
        22-may-03 (JPW) - updated the mission correction for a best-fit
                          over the entire Yohkoh mission


FIX_OLD_ATT [2] $SSW/yohkoh/gen/idl/atest/fix_old_att.pro
[Previous] [Next]
 NAME:
        FIX_OLD_ATT
 PURPOSE:
        Remove the wrong mission correction offset from old ATT data.

 CATEGORY:
 CALLING SEQUENCE:
        fix_old_att,att
 INPUTS:
        att = att structure 
              The input is replaced by the corrected att structure.
 KEYWORDS (INPUT):
 OUTPUTS:
        att = att structure with corrected att.pnt values.
 KEYWORDS (OUTPUT):
 CALLS: ***
	data_chk [1], data_chk [2], gt_day [1], gt_day [2], tag_index [1], tag_index [2]
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	rd_att, show_hxafid
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:

 PROCEDURE:
    The following corrections are made by this routine.
    Algorithm = 0:
     Old ATT data (created before 21-sep-94) used an erroneous
     mission correction for data after 1-jan-93.  The offset is
     in the N-S direction and grew from less than 1" to more than 15"
     in September 1994.

 MODIFICATION HISTORY:
        19-sep-94 (JPW)
        22-sep-94 (SLF) - check ATT 'algorithm' (3 LSB in ATT.STATUS2)
                          ATT algorithm check and set correction 'history' bit
        24-mar-95 (SLF) - eliminate status message
        13-jan-98 (JPW) - add updated mission correction
        25-sep-98 (JPW) - apply updated (jan-98) mission correction
                          to version le 3 (was "le 2")
                    


FIX_OLD_ATT [3] $SSW/yohkoh/ucon/idl/wuelser/fix_old_att_old.pro
[Previous] [Next]
 NAME:
        FIX_OLD_ATT
 PURPOSE:
        Remove the wrong mission correction offset from old ATT data.

 CATEGORY:
 CALLING SEQUENCE:
        fix_old_att,att
 INPUTS:
        att = att structure 
              The input is replaced by the corrected att structure.
 KEYWORDS (INPUT):
 OUTPUTS:
        att = att structure with corrected att.pnt values.
 KEYWORDS (OUTPUT):
 CALLED BY:
	rd_att, show_hxafid
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:

 PROCEDURE:
    The following corrections are made by this routine.
    Algorithm = 0:
     Old ATT data (created before 21-sep-94) used an erroneous
     mission correction for data after 1-jan-93.  The offset is
     in the N-S direction and grew from less than 1" to more than 15"
     in September 1994.

 MODIFICATION HISTORY:
        19-sep-94 (JPW)
        22-sep-94 (SLF) - check ATT 'algorithm' (3 LSB in ATT.STATUS2)
                          ATT algorithm check and set correction 'history' bit
        24-mar-95 (SLF) - eliminate status message
        13-jan-98 (JPW) - add updated mission correction


fix_pars $SSW/yohkoh/ucon/idl/mctiernan/fix_pars.pro
[Previous] [Next]
 NAME:
      fix_pars
 PURPOSE:
      To assign fixed values to certain spectral fit parameters
 CALLING SEQUENCE:
      fix_pars, events, a_fix, alabels, ma, a_0, ffx
 INPUT:
      events = the number of spectral fit intervals
      a_fix = an array, corresponding to a for the fit parameters,
              gives the values of a chosen to remain fixed by the
              user. If a_fix(j)=0.0, the parameter is free, if a_fix(j)
              is set to -1, then you choose the jth parameter in a
              routine called fix_pars, if a_fix(j)=-2, then the parameter
              will be chosen in ainit, but will remain fixed during the fit.
      alabels= labels for the appropriate fit parameters
      ma= number of parameters used in the fit
 OUTPUT:
      a_0= initial values = a_fix if set, =0.0 if a_fix=-1 or -2
      ffx= 0 if the associated parameter is free, 1 if fixed at a
           user defined value, 2 if fixed at the value initially
           given by ainit.
 CALLED BY:
	fsp_11, fsp_mc, fsp_proc
 HISTORY:
      4-JAN-94 by JMM


fix_pars0 $SSW/yohkoh/ucon/idl/mctiernan/fix_pars0.pro
[Previous] [Next]
 NAME:
      fix_pars0
 PURPOSE:
      To assign fixed values to certain spectral fit parameters
 CALLING SEQUENCE:
      a_fix=fix_pars0(events, tyspec)
 INPUT:
      events = the number of spectral fit intervals
      tyspec = spectral type
 		=1, single p.l., a(0)=K, a(1)=gamma
		=2, double p.l., a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
			(ebr is the break energy in keV)
		=3, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6
		=4, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma
               =5, Double Thermal, a(0)=em1/1.0e47, a(1)=T1/1.0e6, 
			a(2)=em2/1.0e47, a(3)=T2/1.0e6
		=6, p.l.+p.l., a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
		=7, Thermal below Ebr, p.l. above Ebr, 
			a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		=8 Thermal + double p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, 
			a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		=9 Triple P.L.,  a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			a(5)=eb2 (between gamma2 and gamma3)
		=10, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6, includes
                    SXR lines
		=11, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma, includes  SXR lines
 		=12, single p.l. flattens below e0, a(0)=K, a(1)=gamma, a(2)=e0
 		=13, single p.l. cuts off below e0, a(0)=K, a(1)=gamma, a(2)=e0
 OUTPUT:
      a_fix = an array, corresponding to a for the fit parameters,
              gives the values of a chosen to remain fixed by the
              user. If a_fix(j)=0.0, the parameter is free, if a_fix(j)
              is set to -1, then you choose the jth parameter in a
              routine called fix_pars, if a_fix(j)=-2, then the parameter
              will be chosen in ainit, but will remain fixed during the fit.
 CALLS: ***
	ma_labels, yesnox [1], yesnox [2]
 CALLED BY:
	any_fsp, mult_th_fsp
 HISTORY:
      5-JAN-94 by JMM


FIX_SFD $SSW/yohkoh/ucon/idl/hudson/fix_sfd.pro
[Previous] [Next]
 NAME:
    FIX_SFD 
 PURPOSE:
    Reconcile the Q and H res images in an SFD data cube,
    intended for use with floating-point SFD. This registers 
    the images using SXT_PREP. Heliographic registration is
    a future project. 
 CATEGORY:
 CALLING SEQUENCE:
    fix_sfd, infil, index, data 
    fix_sfd, infil, index, data, side=256
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
    side (output image dimension, 128 is the default) 
 OUTPUTS:
 CALLS: ***
	RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], rd_roadmap [1], str_concat [1]
	str_concat [2], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 COMMON BLOCKS:
 SIDE EFFECTS:
    May take lots of memory if you're doing a big SFD
 RESTRICTIONS:
 MODIFICATION HISTORY:
    HSH, written 21-Jul-97 (see RECONCILE_SFD)


fl_annotate [2] $SSW/yohkoh/gen/idl/util/fl_annotate.pro
[Previous] [Next]
       NAME:
             fl_annotate

       PURPOSE:
               To annotate the collage image produced by first_light.
      
       METHOD: Standard xyouts calls

	CALLING SEQUENCE:

               fl_annotate,gnttime,gkitime,gbhtime,gkmtime


	PARAMETERS:
	   g**time  the times corresponding to the ground based images used     

	KEYWORDS:

       OUTPUT TYPE:
 
       CALLS: 
 CALLED BY:
	fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], sun_today [1], sun_today [2]
	sun_today [3]
	HISTORY:
	   Procedure developed to annotate the first_light collage 
	   Written by D. Alexander 5-May-94
          12-Jul-1994 - (SLF) add character size scaling for z-buffer
			       parameterize character size


fl_goesplot [2] $SSW/yohkoh/gen/idl/atest/fl_goesplot.pro
[Previous] [Next]
   Name: fl_goesplot

   Purpose: make goes plot in 'first_light' format or read existing

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], FMT_TIMER [1]
	FMT_TIMER [2], LOADCT, PLOT_GOES, Rd_Roadmap [2], WDEF [1], WDEF [2], concat_dir [4]
	data_chk [1], data_chk [2], evt_grid, fem_grid [1], fem_grid [2], file_exist [1]
	file_exist [3], fl_summary [1], fl_summary [2], fl_summary [3], fmt_tim [1]
	fmt_tim [2], get_logenv [1], get_logenv [2], gt_day [1], gt_day [2]
	gt_dp_mode [1], gt_dp_mode [2], mk_pix [1], mk_pix [2], newfiles [1], newfiles [2]
	newfiles [3], rd_roadmap [1], restgen [1], restgen [2], savegen [1], savegen [2]
	ut_time [1], ut_time [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], fl_summary [1], fl_summary [2], fl_summary [3]
	goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
   History:
      14-Jul-1994 - (SLF) broke out first_light code, use Z-buffer so it can
                           run as a background task
      18-Jul-1994 - (SLF) corrected time range logic
      19-Jul-1994 - (SLF) read last 10 sfr/spr roadmaps (changed from 5)
       6-Sep-1994 - (SLF) call fl_summary
       7-Sep-1994 - (SLF) use device,set_colors=240 (make Z-buff ~ X win)
       5-oct-1994 - (SLF) add SMALL keyword (collage insert = 512x128
                          added COLORS array [goeslevel, night , saa]
       8-oct-1994 - (SLF) move distribution to fl_summary
      10-nov-1994 - (SLF) pass !y.crange to fem_grid
       7-apr-1995 - (SLF) protect against no goesdata 
       9-apr-1995 - (SLF) try 1 min if 3 fails (ydb_exist not reliable?)
       6-sep-1995 - (SLF) use 1 minute (new G71 files)
      14-aug-1996 - (SLF) GOES7 off, use GOES9
       7-Aug-1998 - (SLF) GOES9 off, use GOES8 (just title change)


fl_goesplot [3] $SSW/yohkoh/gen/idl/util/fl_goesplot.pro
[Previous] [Next]
   Name: fl_goesplot

   Purpose: make goes plot in 'first_light' format or read existing

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], FMT_TIMER [1]
	FMT_TIMER [2], LOADCT, PLOT_GOES, Rd_Roadmap [2], WDEF [1], WDEF [2], concat_dir [4]
	data_chk [1], data_chk [2], evt_grid, fem_grid [1], fem_grid [2], file_exist [1]
	file_exist [3], fl_summary [1], fl_summary [2], fl_summary [3], fmt_tim [1]
	fmt_tim [2], get_logenv [1], get_logenv [2], gt_day [1], gt_day [2]
	gt_dp_mode [1], gt_dp_mode [2], mk_pix [1], mk_pix [2], newfiles [1], newfiles [2]
	newfiles [3], rd_roadmap [1], restgen [1], restgen [2], savegen [1], savegen [2]
	ut_time [1], ut_time [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], fl_summary [1], fl_summary [2], fl_summary [3]
	goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
   History:
      14-Jul-1994 - (SLF) broke out first_light code, use Z-buffer so it can
                           run as a background task
      18-Jul-1994 - (SLF) corrected time range logic
      19-Jul-1994 - (SLF) read last 10 sfr/spr roadmaps (changed from 5)
       6-Sep-1994 - (SLF) call fl_summary
       7-Sep-1994 - (SLF) use device,set_colors=240 (make Z-buff ~ X win)
       5-oct-1994 - (SLF) add SMALL keyword (collage insert = 512x128
                          added COLORS array [goeslevel, night , saa]
       8-oct-1994 - (SLF) move distribution to fl_summary
      10-nov-1994 - (SLF) pass !y.crange to fem_grid
       7-apr-1995 - (SLF) protect against no goesdata 
       9-apr-1995 - (SLF) try 1 min if 3 fails (ydb_exist not reliable?)
       6-sep-1995 - (SLF) use 1 minute (new G71 files)
      14-aug-1996 - (SLF) GOES7 off, use GOES9


fl_mktext $SSW/yohkoh/gen/idl/ys_util/fl_mktext.pro
[Previous] [Next]
 NAME: fl_mktext

 PURPOSE: make near realtime text file for first_light /distribution

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_STAT [1], FILE_STAT [2]
	anytim2ints [1], anytim2ints [2], concat_dir [4], file_append [1]
	file_append [2], file_stat [3], get_logenv [1], get_logenv [2], gt_day [1]
	gt_day [2], rd_tfile [1], rd_tfile [2], ut_time [1], ut_time [2]
 CALLED BY:
	fl_summary [1], fl_summary [2], fl_summary [3]
 History:
   6-sep-1994 (SLF)
   3-jun-1995 (SLF) - set minimum eventlog duration to 7 minutes


fl_summary [2] $SSW/yohkoh/gen/idl/atest/fl_summary.pro
[Previous] [Next]
   Name: fl_summary

   Purpose: combine fl_xxx images into summary image

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], FILE_EXIST [2], FL_NARGEV, LOADCT, STR2ARR [1], STR2ARR [2], SXT_MK3
	WDEF [1], WDEF [2], concat_dir [4], file_exist [1], file_exist [3], first_over
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], fl_mktext, fl_suntoday [1]
	fl_suntoday [2], fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2]
	get_info [1], get_info [2], get_info [3], get_info [4], gt_center, gt_dpe, gt_filtb
	gt_percentd, lastsfd [1], lastsfd [2], mk_pix [1], mk_pix [2], restgen [1]
	restgen [2]
 CALLED BY:
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3]
   History:
      3-sep-94 (SLF) test one possible summary format
      6-sep-94 (SLF) call mk_pix to generate 'First_Light' summary image
      7-sep-94 (SLF) call fl_mktext
     20-sep-94 (SLF) rearrange, add images
      5-oct-94 (SLF) new format (small goes, add SXT OR)
      9-oct-94 (SLF) use relative screen postions, shift some stuff
                     (make it easier to re-format) add white light
     12-oct-94 (SLF) add call to fl_nargev
     18-oct-94 (SLF) restored previous change (heliographic via gt_center)
     31-oct-94 (SLF) dont label small sxt
      9-Feb-95 (SLF) scale obs region to max=256 
     13-feb-95 (SLF) use REBIN=512 in lastsfd call
      6-apr-95 (SLF) embed congridded OR in 256x256 so tv position will work
     28-apr-95 (SLF) color table (3 w/reverse SXT)
     24-sep-95 (SLF) add MK3/SXT composite
     25-sep-95 (SLF) CaIIK
     13-oct-95 (SLF) minor cleanup (lower SXT OBs text, ...)
      7-feb-96 (SLF) Add EIT images
     18-feb-96 (SLF) Tweak EIT scaling
     22-feb-96 (SLF) EIT ss protect 
     12-mar-96 (SLF) invert border line colors (EIT)
      8-apr-96 (SLF) censored the EIT 171 image due to outside pressure
     17-apr-96 (SLF) use MEES POI CaKline
     12-jul-96 (SLF) add some urls.
      8-may-97 (SLF) EIT -> lparl
     11-may-97 (SLF) EIT movie link to JS version
     12-aug-97 (SLF) SOHO/MDI magnetogram and continuum
    ~15-Aug-98 (SLF) add TRACE mosaic @512x512
      8-Sep-98 (SLF) use TRACE 195 if much newer than the 171


fl_summary [3] $SSW/yohkoh/gen/idl/util/fl_summary.pro
[Previous] [Next]
   Name: fl_summary

   Purpose: combine fl_xxx images into summary image

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], FILE_EXIST [2], FL_NARGEV, LOADCT, STR2ARR [1], STR2ARR [2], SXT_MK3
	WDEF [1], WDEF [2], concat_dir [4], file_exist [1], file_exist [3], first_over
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], fl_mktext, fl_suntoday [1]
	fl_suntoday [2], fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2]
	get_info [1], get_info [2], get_info [3], get_info [4], gt_center, gt_dpe, gt_filtb
	gt_percentd, lastsfd [1], lastsfd [2], mk_pix [1], mk_pix [2], restgen [1]
	restgen [2]
 CALLED BY:
	fl_goesplot [1], fl_goesplot [2], fl_goesplot [3]
   History:
      3-sep-94 (SLF) test one possible summary format
      6-sep-94 (SLF) call mk_pix to generate 'First_Light' summary image
      7-sep-94 (SLF) call fl_mktext
     20-sep-94 (SLF) rearrange, add images
      5-oct-94 (SLF) new format (small goes, add SXT OR)
      9-oct-94 (SLF) use relative screen postions, shift some stuff
                     (make it easier to re-format) add white light
     12-oct-94 (SLF) add call to fl_nargev
     18-oct-94 (SLF) restored previous change (heliographic via gt_center)
     31-oct-94 (SLF) dont label small sxt
      9-Feb-95 (SLF) scale obs region to max=256 
     13-feb-95 (SLF) use REBIN=512 in lastsfd call
      6-apr-95 (SLF) embed congridded OR in 256x256 so tv position will work
     28-apr-95 (SLF) color table (3 w/reverse SXT)
     24-sep-95 (SLF) add MK3/SXT composite
     25-sep-95 (SLF) CaIIK
     13-oct-95 (SLF) minor cleanup (lower SXT OBs text, ...)
      7-feb-96 (SLF) Add EIT images
     18-feb-96 (SLF) Tweak EIT scaling
     22-feb-96 (SLF) EIT ss protect 
     12-mar-96 (SLF) invert border line colors (EIT)
      8-apr-96 (SLF) censored the EIT 171 image due to outside pressure
     17-apr-96 (SLF) use MEES POI CaKline
     12-jul-96 (SLF) add some urls.


fl_suntoday [2] $SSW/yohkoh/gen/idl/atest/fl_suntoday.pro
[Previous] [Next]
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DIST, FILE_EXIST [2], HALP, LOADCT
	ROT, SIGMA_FILTER, WDEF [1], WDEF [2], concat_dir [4], data_chk [1], data_chk [2]
	file_exist [1], file_exist [3], fl_annotate [1], fl_annotate [2], fmt_tim [1]
	fmt_tim [2], get1gbo, get_info [1], get_info [2], get_info [3], get_info [4]
	get_logenv [1], get_logenv [2], get_newsoon, get_rb0p [1], get_rb0p [2], gntcleen
	histscale [1], histscale [2], lastsfd [1], lastsfd [2], mk_pix [1], mk_pix [2]
	restgen [1], restgen [2], rm_darklimb, savegen [1], savegen [2], scale_gbo
	sxt_cen [1], sxt_cen [2], wc_where [1], wc_where [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], bbso_copy [1], bbso_copy [2], fl_summary [1]
	fl_summary [2], fl_summary [3], selsisi_copy, sun_today [1], sun_today [2]
	sun_today [3]
	HISTORY:
	   Procedure developed to annotate the first_light collage 
	   Written by D. Alexander 5-May-94
          12-Jul-1994 - (SLF) add character size scaling for z-buffer
			       parameterize character size
          15-sep-1994 - (SLF) minor mods - make it part of fl_suntoday
          19-oct-1994 - (SLF) replace lastgbo call with calls to get1gbo
          24-sep-1995 - (SLF) scale gkm, rm_darklimb on soon data


fl_suntoday [3] $SSW/yohkoh/gen/idl/util/fl_suntoday.pro
[Previous] [Next]
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DIST, FILE_EXIST [2], HALP, LOADCT
	ROT, SIGMA_FILTER, WDEF [1], WDEF [2], concat_dir [4], data_chk [1], data_chk [2]
	file_exist [1], file_exist [3], fl_annotate [1], fl_annotate [2], fmt_tim [1]
	fmt_tim [2], get1gbo, get_info [1], get_info [2], get_info [3], get_info [4]
	get_logenv [1], get_logenv [2], get_newsoon, get_rb0p [1], get_rb0p [2], gntcleen
	histscale [1], histscale [2], lastsfd [1], lastsfd [2], mk_pix [1], mk_pix [2]
	restgen [1], restgen [2], rm_darklimb, savegen [1], savegen [2], scale_gbo
	sxt_cen [1], sxt_cen [2], wc_where [1], wc_where [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], bbso_copy [1], bbso_copy [2], fl_summary [1]
	fl_summary [2], fl_summary [3], selsisi_copy, sun_today [1], sun_today [2]
	sun_today [3]
	HISTORY:
	   Procedure developed to annotate the first_light collage 
	   Written by D. Alexander 5-May-94
          12-Jul-1994 - (SLF) add character size scaling for z-buffer
			       parameterize character size
          15-sep-1994 - (SLF) minor mods - make it part of fl_suntoday
          19-oct-1994 - (SLF) replace lastgbo call with calls to get1gbo
          24-sep-1995 - (SLF) scale gkm, rm_darklimb on soon data


fl_sxtobsnar [2] $SSW/yohkoh/gen/idl/util/fl_sxtobsnar.pro
[Previous] [Next]
   Name: fl_sxtobsnar

   Purpose: return the SXT / NAR / Observing region overlay, 'first_light' style

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], LOADCT
	Rd_Roadmap [2], SXT_IMG_SUMMARY, SXT_UNIQFOV, concat_dir [4], file_exist [1]
	file_exist [3], fmt_tim [1], fmt_tim [2], get_logenv [1], get_logenv [2]
	lastsfd [1], lastsfd [2], mk_pix [1], mk_pix [2], newfiles [1], newfiles [2]
	newfiles [3], plot_nar [1], plot_nar [2], rd_roadmap [1], rd_tfile [1]
	rd_tfile [2], restgen [1], restgen [2], savegen [1], savegen [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], fl_summary [1], fl_summary [2], fl_summary [3]
   History:
      14-Jul-1994 (SLF) - broke code out from first_light, added z-buffer
                          support for Back Ground, generate a mkpix file
                          default read from that file (faster) linked to
                          mk_sfd phase of go_toban etc...
       7-Sep-1994 (SLF) - use device,set_colors to make Z-buff look like X
       5-oct-1994 (SLF) - pick half res, not last (if avail in last file)
			   use /short title in lastsfd keyword
       9-oct-1994 (SLF) - dont AR label the small (collage) version
      31-oct-1994 (SLF) - label small with time
       8-Feb-1995 (SLF) - change file name to: LAST_SXT_NOAA_AR,
			   include image info in text section of genx
      13-feb-1995 (SLF) - add REBIN=512 to lastsfd call (fill FOV)
      29-aug-1994 (SLF) - tone down stoney-grid on small version
       1-feb-1996 (SLF) - add MAG parameter to plot_nar call


FLARE_POS $SSW/yohkoh/ucon/idl/bentley/flare_pos.pro
[Previous] [Next]
 NAME:
	FLARE_POS
 PURPOSE:
	Determines possible HXT flare positions from HXT data
 CATEGORY:
 CALLING SEQUENCE:
	flare_pos,channel
 INPUTS:
	channel		HXT channel to be used
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], TASK_OS, concat_dir [4]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	Creates JCL file and runs F77 task flare_pos
 MODIFICATION HISTORY:
	RDB  23-Jun-93	Written


flares2disk $SSW/yohkoh/gen/idl/ys_util/flare2disk.pro
[Previous] [Next]
   Name: flares2disk

   Purpose: copy files from MO to disk (mag or mo)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FLARE2DISK, STR2ARR [1]
	STR2ARR [2], UNIQ [1], UNIQ [2], UNIQ [3], concat_dir [4], curdir [1], curdir [2]
	diskfree [1], diskfree [2], file_append [1], file_append [2], file_list [1]
	file_list [2], get_afile_size [1], get_afile_size [2], get_host [1]
	get_host [2], momount, prstr [1], prstr [2], rd_tfile [1], rd_tfile [2]
	str2cols [1], str2cols [2], str_perm, tbeep [1], tbeep [2], tbeep [3], wmenu_sel [1]
	wmenu_sel [2]
   History:
      1-Decc-1994 (SLF) 


flat_floor $SSW/yohkoh/sxt/idl/util/flat_floor.pro
[Previous] [Next]
NAME:
	flat_floor
PURPOSE:
	To shift a series of images so that the background level 
	is the same for all images.
SAMPLE CALLING SEQUENCE:
	data3 = flat_floor(data, /lr)
	data3 = flat_floor(data, /lr, shifted=shifted)
INPUT:
	data	- The data cube
KEYWORD INPUT:
	nbox	- The size of the subbox to find the average of
		  and to make zero.  Default is 4 (4x4 pixels)
	ll	- Make the lower left box equal to zero (DEFAULT)
	lr	- Make the lower right box equal to zero
	ul	- Make the upper left box equal to zero
	ur	- Make the upper right box euqal to zero
OUTPUT:
	shift	- amount shifted
HISTORY:
	Written 4-May-95 by M.Morrison


FLOYD_STEINBERG $SSW/yohkoh/ucon/idl/labonte/floyd_steinberg.pro
[Previous] [Next]

 NAME: FLOYD_STEINBERG

 PURPOSE: Convert a byte image to a bit image, or halftone.


PRO floyd_steinberg, image, dots


 INPUT PARAMETERS:
	image = byte image

 OUTPUT PARAMETERS:
	dots = byte array, either 0 or 1, same dimensions as image

 METHOD:
	Uses Floyd-Steinberg weighting, error-diffusion scheme.
	Result is cleaner but computation is slower than DOT_PLOTTER.

 CALLED BY:
	MK_ROOT_BITMAP
 HISTORY:
	Written April 25, 1995  Barry LaBonte


fluxc_mult $SSW/yohkoh/ucon/idl/mctiernan/fluxc_mult.pro
[Previous] [Next]
 NAME:
	fluxc_mult
 CALLING SEQUENCE:
	fluxc_mult,a,tyspec,fluxc
 PURPOSE:
	Adjust for flux conversion
 INPUT:
	a= fit parameters
	tyspec= type of spectrum
	fluxc= flux correction factor
 OUTPUT:
	a, corrected by fluxc
 CALLED BY:
	fsp_11, fsp_mc
 HISTORY:
	Dec '92 JMcT
       made ok for 2d arrays, 18-dec-96, jmm


fmt_doc [3] $SSW/yohkoh/gen/idl/util/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_pass $SSW/yohkoh/gen/idl/orbit/fmt_pass.pro
[Previous] [Next]
  Name:
    fmt_pass
  Purpose:
    Produce a text string array containing the information about Yohkoh
    station contacts contained in the structure contacts.

 Calling sequence:
    A = fmt_pass( contacts )

 Inputs:
     contacts  =  Structure written by the function contact_sum

 CALLS: ***
	ADDTIME [1], ADDTIME [2], gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 CALLED BY:
	get_dn_rate [1], get_dn_rate [2], make_32 [1], make_32 [2], op_edit [1]
	op_edit [2], op_time_sort, valid_pass4 [1], valid_pass4 [2]
 Modification History:
    Written, 10-dec-91, J. R. Lemen
    Modified, 5-aug-92, JRL:  Add KSC Ant=10 deg time.  Change the format
			       so that 5 text lines are now produced.
    28-mar-95, JRL, Changed one tag name slightly


fmt_rasm $SSW/yohkoh/gen/idl/orbit/fmt_rasm.pro
[Previous] [Next]
 Name:
  fmt_rasm
 Purpose:
  Format a weekly rasm file (from JPL) which contains all spacecraft.
  Produce an output file which contains only Yohkoh Pass entries.

  Can read solass or 7dayss files.
  Will write solass or rasmss-stye files.

 Calling Sequence:
  fmt_rasm,file_in,file_out		; Write rasmss (edited) file
  fmt_rasm,file_in,file_out, /all	; Write solass file
  fmt_rasm,file_in,file_out, /chmod	; Make output file chmod 666
  fmt_rasm,file_in,file_out, /asca	; Write asca file from 7dayss

 Default output name is the rasmss_fin.wXX.

 Normally the following convention is used:
  Input			Output
  ----------			----------
  7dayss.wXX /all		solass.wXX
  7dayss.wXX /all /asca	astdss.wXX
  7dayss.wXX			rasmss.wXX
  7dayss.wXX /asca		rasmss_astd.wXX
  forecast.wXX /all		solasf.wXX
  forecast.wXX /all /asca	astdsf.wXX
  forecast.wXX 		rasmsf.wXX
  forecast.wXX /asca		rasmsf_astd.wXX

 INPUTS:
  input	- Input  solass or 7dayss file name
  output	- Output rasmss or solass file name
 OPTIONAL INPUTS:
  all		- Set for solass or ascass-style
  path_out	- Use to specify output directory if file_out is
		  not specified (uses default output name).

 CALLS: ***
	ADDTIME [1], ADDTIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], break_file [4], concat_dir [4]
	doytim2ex [1], doytim2ex [2], ex2week [1], ex2week [2], fmt_tim [1], fmt_tim [2]
	rd_rasm, strjustify, week2ex [1], week2ex [2]
 CALLED BY:
	mk_rasm_files
 Modification History:
  21-sep-92, Written, J.R. Lemen, LPARL
   2-jul-93, JRL, Modified to use rd_rasm.
   3-Feb-96, JRL, Modified to be able to read 7dayss.wXX files.
  


FndDur $SSW/yohkoh/gen/idl/tape/fnddur.pro
[Previous] [Next]
	NAME:
		FndDur
	PURPOSE:
		Compute the number of calender days spanned by the start 
		and end times.  If the start and end times are undefined 
		user is prompted for times.  Default start time is todays
		date minus 3 days.
	CALLING SEQUENCE:
		durnation = FndDur( alldata, [startT=startTime, endT=endTime] )
	INPUT/Keywords:
		alldata		flag. If set (1) will archive all data to
				tape. If not will prompt user.
		startTime	string-type with yymmdd
		endTime		string-type with yymmdd
	RETURNED:
		durnation	the number of calender days spanned by
				the start and end times.
 CALLS: ***
	Date2DOY [1], Date2DOY [2], GetT
 CALLED BY:
	TapDir
	HISTORY:
		written 19-Sep-91, by GAL
		5-Mar-92, alldata switch


fndfld $SSW/yohkoh/gen/idl/dbase/fndfld.pro
[Previous] [Next]
	NAME: fndfld
	
	Purpose: given an array of structures, it finds the tag and 
		returns an array of the requested tag.

	Input:
		idx	an array of structures
		tag	requested tag
	Returned:
		an array of the requested tag
 CALLED BY:
	yolist
	HISTORY:
		written, 16-Jan-92, GAL
		updated for either .gen or .sxt nested path


FndIDs $SSW/yohkoh/gen/idl/tape/fndids.pro
[Previous] [Next]
	NAME:
		FndIDs
	PURPOSE:
		Using the input time "startTime" return a list of 
		fileIDs for a given prefix on current dir!!!
 CALLS: ***
	Date2DOY [1], Date2DOY [2], doy2date [1], doy2date [2]
	HISTORY:
		written 24-Oct-91, GAL
		last update 2-Dec-91, GAL


fndrids $SSW/yohkoh/gen/idl/tape/fndrids.pro
[Previous] [Next]
	NAME: fndrids
	
	PURPOSE: Return a list of fileIDs which correspond to the 
		specified start and end times.

	CALLING SEQUENCE:
		IDs = fndrids('ada' [, startT='911015', endT='911017'])

	INPUT:
		prefix		valid YOHKOH file prefix (should be ada)
		startTime	string with the start time 'yymmdd'
		endTime		string with the end time 'yymmdd'

 CALLS: ***
	uniq_fid [1], uniq_fid [2]
 CALLED BY:
	TapDir
	HISTORY: written 13-Feb-92, GAL
		18-Apr-92, change to use uniq_fid instead of ....
		to generate file id list.


fnmap2file $SSW/yohkoh/gen/idl/dbase/fnmap2file.pro
[Previous] [Next]
Name:
       fnmap2file
Purpose:
       Given a filename map and a dataset vector and a
	selection of an instrument, return the
	file names and datasets for the desired dataset.  

	It assumes that the routines
       GETOBSDAT/FIDMAP/CREDVEC (or equivalent routines)
	have already been run.
 CALLS: ***
	get_fninfo
Restrictions:
Input:
       fnmap   - The structure returned from CREDVEC
       dset    - A vector "m" long with the data
                 set number within the file for
                 the desired image which is also
		  part of CREDVEC output
	One of the instruments must be selected:
	/sxtp
	/sxtf
	/bcs
	/hxt
	/wbs
Output:
	files	- The name of the file selected.
		  If ONE_IMG or ONE_FILE is not used, then
		  file_out is an array of all files
	dset_out- A list of the datasets selected.
		  If ONE_IMG or ONE_FILE is not used, then
		  dset_out is a copy of dset
Optional Input:
       one_set - Only select one dset.
                 The value should be between
                 0 and "m-1"
       one_file- Only return the datasets for 
                 datasets that fall in one file.
History:
       written 17-Oct-91 by M.Morrison


FNS $SSW/yohkoh/ucon/idl/shimizu/fns.pro
[Previous] [Next]
 NAME:
	FNS
 PURPOSE:
	When, for example, name='le75f2w6302m60rcpn####.strt' and 
	number = 23, are inputted, FNS will return a string
		'le75f2w6302m60rcpn0023.strt'.
 CALLING SEQUENCE:
	out = FNS(name, number)
 INPUTS:
	name = string including the mark "####".
	number = integer.
 OUTPUTS:
	out = string
 OPTIONAL OUTPUTS:
       count = the number of #
 CALLED BY:
	LP_OBSLOG, RD_LP, SEEIGN_CHECKER
 HISTORY:
	26 Jan, 94	written by TShimizu (Univ. of Tokyo)
	18 Jun, 94	option count


for defining a data set record window from greyscale image $SSW/yohkoh/bcs/idl/bda/gs_cur.pro
[Previous] [Next]
  ROUTINE: for defining a data set record window from greyscale image 
  displayed using GS (qv).  The data set number range and the corresponding 
  times are reported.  If the current device is not X or the GS cursor flag
  is disabled then the datasets will be prompted for instead of using the
  cursor.  Use commands the variable GS_CUR_FLAG = 1/0 to enable/disable 
  the cursor use.


  By-products:   GS_TIME(2) array containing hours UT of start & stop of
                 window chosen.

                 GS_START(7) & GS_END(7) arrays containing the start and
                                         stop times in format:-
                                         hh, mm, ss, msec, dd, mon, year.


  Use:
          IDL>  .run gs_cur


  Version 2    changed to extract time from infil (not filnam) because of 
               change in test_rd.    cdp 16/1/92

          3    include cursor flag - so that can specify precise dataset
                                     limits even if cursor is available
  
          4    Make time calculation non-VMS specific    Mar 92   cdp
               sort out array references (yds1/2 --> gs_ds1/2)  
    


for noting the time from a greyscale image $SSW/yohkoh/bcs/idl/bda/gs_when.pro
[Previous] [Next]
  ROUTINE: for noting the time from a greyscale image.

  Click mouse button to get time of corresponding spectrum
  End by clicking at same place twice in succession.


  Use:
          IDL>  .run gs              display data
          IDL>  .run gs_when         time output each button click
                                     enter same place twice running to end

  To switch off display of time on screen, set GS_WHEN_DISP = 0
  or to switch ON set it to 1.

   
    v1.0         Feb 92 CDP
    v1.1         make time calculation non-VMS specific
    v1.2         use yds3 instead of yds1                   Mar 92   
    v2.0         rewrite using fmt_tim                      Mar 92
                 introduce switch off off on-display time o/p


for simulating ARS targetting algorithm of SXT $SSW/yohkoh/ucon/idl/acton/lwa_ars_show.pro
[Previous] [Next]
  PROGRAM: for simulating ARS targetting algorithm of SXT.
  Adapted from MDM program asr_show.pro
  LWA, March(?) 1994
 CALLS:


foreshort $SSW/yohkoh/ucon/idl/slater/foreshort.pro
[Previous] [Next]
NAME:
       foreshort
PURPOSE:
       Returns the projected area of an SXT full resolution pixel onto
	a sphere of radius equal to the solar photospheric radius.
SAMPLE CALLING SEQUENCE:
       proj_area = foreshort(helio, time, [proj_fac=proj_fac])
INPUT:
       helio   - is a vector of heliocentric coordinates.  It should be 2xN.
                       (0,*) = longitude (degrees) W positive
                       (1,*) = latitude (degrees) N positive
                 They can also be strings in the form 'N30W23'.
       time    - Either an index (indeices) or time (times) in any
		  standardd format.
OUTPUT:
       proj_area -
		  Projected area of an SXT full resolution pixel.
 CALLS: ***
	CONV_H2A [1], CONV_H2A [2], conv_a2ap, get_rb0p [1], get_rb0p [2], gt_pix_size
HISTORY:
       Written 28-Mar-95 by G. Slater


formatter2 $SSW/yohkoh/gen/idl/orbit/dsn_conflict.pro
[Previous] [Next]
 NAME:
  formatter2
 PURPOSE:
  Format the output string array for printing
 MODIFICATION HISTORY:
   1-aug-94, J. R. Lemen LPARL, Written
   27-Jan-95, JRL, Fixed loop counter so last pass is printed


fort2hxi [1] $SSW/yohkoh/hxt/idl/atest/fort2hxi.pro
[Previous] [Next]
NAME:
	fort2hxi
PURPOSE:
	This routine reads the FORTRAN data file which holds an HXT image
	and converts it to the HXI format.
SAMPLE CALLING SEQUENCE:
	fort2hxi, infil, index, data
	fort2hxi, '/home/flare/hxt/sakao/mov_sun/#hxt_img.dat', index, data
INPUT:
	infil	- The name of the FORTRAN data file
OUTPUT:
	index	- The HXI index structure
	data	- The data array
 CALLS: ***
	DATA_PATHS, FILE_EXIST [2], HXT_STRUCT [1], HXT_STRUCT [2], RD_HXTIMG, RD_XDA [1]
	RD_XDA [2], anytim2ints [1], anytim2ints [2], file_exist [1], file_exist [3]
	file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], fort2hxi_tim, getmax
	input [1], input [2], prstr [1], prstr [2], str_merge [1], str_merge [2], tbeep [1]
	tbeep [2], tbeep [3]
OPTIONAL KEYWORD INPUT:
	qdebug	- If set, print some debug messages
RESTRICTION:
	This routine must be run from the same type of platform that the
	FORTRAN program did in order to read the FORTRAN data file properly.
	When the HXI file is made, it can be read on any platform since it
	will swap bytes and convert REAL*4 where necessary.
HISTORY:
	Written 19-Jun-93 by M.Morrison
	11-Aug-93 (MDM) - Wrote patch because FORTRAN header does not include
			  the directory in the name of the file
	16-Dec-93 (MDM) - Removed the command to flip images N/S since it
			  appears that Sakao has put it into RD_HXTIMG
	 3-May-98 (J.Sato)	- Incorporated proper treatment of the `maxb' 
				  variable.


fort2hxi [2] $SSW/yohkoh/hxt/idl/util/fort2hxi.pro
[Previous] [Next]
NAME:
	fort2hxi
PURPOSE:
	This routine reads the FORTRAN data file which holds an HXT image
	and converts it to the HXI format.
SAMPLE CALLING SEQUENCE:
	fort2hxi, infil, index, data
	fort2hxi, '/home/flare/hxt/sakao/mov_sun/#hxt_img.dat', index, data
INPUT:
	infil	- The name of the FORTRAN data file
OUTPUT:
	index	- The HXI index structure
	data	- The data array
 CALLS: ***
	DATA_PATHS, FILE_EXIST [2], HXT_STRUCT [1], HXT_STRUCT [2], RD_HXTIMG, RD_XDA [1]
	RD_XDA [2], anytim2ints [1], anytim2ints [2], file_exist [1], file_exist [3]
	file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], fort2hxi_tim, getmax
	input [1], input [2], prstr [1], prstr [2], str_merge [1], str_merge [2], tbeep [1]
	tbeep [2], tbeep [3]
OPTIONAL KEYWORD INPUT:
	qdebug	- If set, print some debug messages
RESTRICTION:
	This routine must be run from the same type of platform that the
	FORTRAN program did in order to read the FORTRAN data file properly.
	When the HXI file is made, it can be read on any platform since it
	will swap bytes and convert REAL*4 where necessary.
HISTORY:
	Written 19-Jun-93 by M.Morrison
	11-Aug-93 (MDM) - Wrote patch because FORTRAN header does not include
			  the directory in the name of the file
	16-Dec-93 (MDM) - Removed the command to flip images N/S since it
			  appears that Sakao has put it into RD_HXTIMG


fort2hxi_tim $SSW/yohkoh/ucon/idl/morrison/fort2hxi_tim.pro
[Previous] [Next]
NAME:
       fort2hxi_tim
PURPOSE:
       This routine converts the HXT FORTRAN image files dataset numbers 
	into absolute time.
SAMPLE CALLING SEQUENCE:
       fort2hxi_tim, infil, range, time, day, actim, interval
INPUT:
       infil   - The name of the FORTRAN data file
	range	- The dataset numbers - an array of 4 elements.
			(0) = starting dataset number
			(1) = starting 1/4 MF number (0,1,2, or 3)
			(2) = ending dataset number
			(3) = ending 1/4 MF number (inclusive)
OUTPUT:
	time	- The time in milliseconds of day of the input range
	day	- The day in days since 1-Jan-79 of the input range
	actim	- The accumulation time in 0.1 sec units
	interval- The time spanned by the datasets selected (if there
		  are no dropouts, then interval should equal actim)
 CALLS: ***
	CHECK_TIME, Rd_Roadmap [2], dprate2sec [1], dprate2sec [2], rd_roadmap [1]
 CALLED BY:
	fort2hxi [1], fort2hxi [2]
HISTORY:
       Written 19-Jun-93 by M.Morrison


FORZONES [1] $SSW/yohkoh/hxt/idl/util/forzones.pro
[Previous] [Next]
 NAME:
	FORZONES
 PURPOSE:
	Generate arrays showing "forbidden zones" of HXA pixels, i.e.
	those that are masked by the fiducial grids.
 CALLING SEQUENCE:
	forzones,x_add,y_add
 WARNING:
	The zones may change with time! This is preliminary, be careful!
 CALLED BY:
	GETCAL_ATT [1], GETCAL_ATT [2], GOOD_HXA_SCAN, HXA2HXAXY [1], HXA2HXAXY [2]
	HXASCAN2HXAXY, HXA_LIMBS, HXA_LIMBS2, HXA_SUNCENTER, atr2hxa_dbase, gt_hxa
	show_hxafid
 HISTORY:
	Written by Hugh Hudson, Jan. 27, 1992
       All forzones extended by 6 units on their lower ends,
       and 3 units on their upper ends. JPW, Sep. 92
	14-Jun-93 (MDM) - Added 0 and 2047 as forbidden zones since the
			  raw HXA value will be forced to be between 0
			  and 2047 and if they are out of that range,
			  then they should be forbidden.


FORZONES [2] $SSW/yohkoh/ucon/idl/hudson/forzones_old.pro
[Previous] [Next]
 NAME:
	FORZONES
 PURPOSE:
	Generate arrays showing "forbidden zones" of HXA pixels, i.e.
	those that are masked by the fiducial grids.
 CALLING SEQUENCE:
	forzones,x_add,y_add
 CALLED BY:
	GETCAL_ATT [1], GETCAL_ATT [2], GOOD_HXA_SCAN, HXA2HXAXY [1], HXA2HXAXY [2]
	HXASCAN2HXAXY, HXA_LIMBS, HXA_LIMBS2, HXA_SUNCENTER, atr2hxa_dbase, gt_hxa
	show_hxafid
 HISTORY:
	Written by Hugh Hudson, Jan. 27, 1992
 WARNING:
	The zones may change with time! This is preliminary, be careful!


FOV_COORDS $SSW/yohkoh/ucon/idl/hudson/fov_coords.pro
[Previous] [Next]
 NAME:
       FOV_COORDS
 PURPOSE:
       Give the coordinates of field-of-view center for an SXT
         for a partial-frame image.
 CALLING SEQUENCE:
       fov_coords,index,nn,ww
       fov_coords,index,nn,ww,/arcsec
       fov_coords,index,nn,ww,/helio
 METHOD:
	calls hxa_suncenter and pix2hel
 INPUTS:
       index(*) = reformatter index element (or array) 
 OUTPUTS:
 	nn(*) is the fov location N of sun center, full res SXT pixels
	ww(*) is the fov location W of sun center, full res SXT pixels
 KEYWORDS:
	/arcsec gives the output in arc sec, rather than pixel units
       /helio  gives the output in heliographic coordinates (NN, WW)
 CONVENTIONS:
 	adheres to the Yohkoh coordinate conventions:
          order NS, EW 
          positive N, W
 WARNINGS:
	Initial version does not correct for spacecraft roll motion.
 CALLS: ***
	HXA_SUNCENTER, PIX2HEL, fmt_tim [1], fmt_tim [2], get_pix_coor, gt_res
 HISTORY:
       Written Dec. 19, 1992  H. Hudson.


fovc2corn_cmd $SSW/yohkoh/sxt/idl/util/fovc2corn_cmd.pro
[Previous] [Next]
NAME:
	fovc2corn_cmd
PURPOSE:
	To extract the word corresponding to the FOV (Field of View) center
	and convert it back to corner commanded pixel.
CALLING SEQUENCE:
	cmd = fovc2corn_cmd(roadmap)
INPUT:
	item	- A roadmap or index
OUTPUT:
	returns	- The FOV Center in arcmin, a integer value or a string
		  value depending on the switches used.  It is a vector
		  if the input is a vector.
			(0,*) = East/West (east is negative)
			(1,*) = North/South (south is negative)
		  If heliocentric coordinate option is used, the results
		  are in degrees.  The order for E/W and N/S is the same
		  as shown above.
 CALLS: ***
	gt_res, gt_shape_cmd, sgn [1], sgn [2]
 CALLED BY:
	gt_corner_cmd
HISTORY:
	Written 23-Jun-93 by M.Morrison


frame_trans $SSW/yohkoh/ucon/idl/leka/frame_trans.pro
[Previous] [Next]
NAME:
	frame_trans
PURPOSE:
	return heliographic longitude, latitude coordinates
	   for image-plane data, given pixel spacing, and
	   lat/long of one known point.  (e.g. from coalignment
	   with white-light image)
CATEGORY:
	data analysis
CALLING SEQUENCE:
	out=frame_trans(yy,mm,dd,hh,b1,l1,pixsize,nx,ny,ref=ref)
INPUTS:
	yy - e.g. 1994
	mm - e.g. 03
	dd - e.g. 15
	hh - e.g. 18.31 (decimal UT hour)
	b1 - known latitude of reference point, degrees, -90 > l1 > 90.
	l1 - known solar longitude of reference point, degrees, -90 > l1 > 90.
	pixsize - pixel spacing in arcsec, assumed square
	nx - size of image, x-dir
	ny - size of image, y-dir
OPTIONAL INPUTS:
	ref = [xoff,yoff], 2-element array indicating the offset
	   from the bottom right corner.  Default = nx/2, ny/2 (i.e.
	   reference point is at the center of the frame).  [0,0]
	   gives the bottom right corner as the reference point,
		
		nx,ny---0,ny
		  |      |
		  | def. |
		  |      |
		nx,0----0,0
OUTPUTS:
	out - [2,nx,ny] array, out(0,*,*) = longitude of data points,
	   out(1,*,*) = latitude
 CALLED BY:
	get_helio_dist
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
	needs functions: sun.pro   (JHUAPL)
			 coord.pro (HKohl)
PROCEDURE:
MODIFICATION HISTORY:
	KDL, written March 1994 to provide better input to get_hel_dis.pro


free_in $SSW/yohkoh/bcs/idl/bsd/free_in.pro
[Previous] [Next]
  Procedure to allow free format input of up to 10 integers (0-9)
  representing the option choices within BSDCAL. The list supplied 
  may be either separated by spaces, commas or a mixture.

  The values are returned in the array OPTARR(10) and the number of valid
  numbers given in NOPT.

  Note the restriction to single digit numbers - for the purpose in hand!

  CDP - May '91

 CALLED BY
	PLOTBPC


fsc_init $SSW/yohkoh/ucon/idl/mctiernan/fsc_init.pro
[Previous] [Next]
NAME:
 fsc_init
CALLING SEQUENCE:
 fsc_init, fit_pars, sc_par, ch_dta, nchannels = nchannels
PURPOSE:
 initializes fit structures, to pass out of
 a crashed fit routine
INPUT:
 none
OUTPUT:
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
               c0 = Model Excess count rates
 BUT WITH NO DATA...
KEYWORDS:
 nchannels = the number of channels for the detector, the default is 1
 CALLED BY:
	hxs_fsp, hxt_fsp
HISTORY:
 17-sep-1997, jmm


FSHIFT $SSW/yohkoh/ucon/idl/sakao/fshift.pro
[Previous] [Next]
 NAME:
	FSHIFT
 PURPOSE:
	To provide a shifted image in units of fractional pixels. 
 CALLING SEQUENCE:
	oimage = fshift(data,x,y)
 INPUTS:
	data	- An array of any size.
	x,y	- Fractional amount of shift in x and y directions. 
		  x positive ... shifts the image RIGHT
		  y positive ... shifts the image UP
		(i.e. signs of x and y have the same meaning as those of SHIFT)
 OPTIONAL INPUT:
	interp	- Specify method of interpolation. Default value is 2 
		  (cubic convolution interpolation). 
		  See IDL manual for details. 
 OUTPUT:
	oimage	- shifted image
 CALLED BY:
	SHIFT_HXT2P, SHIFT_O2P
 HISTORY:
	version 1.0	T.Sakao written on 95.06.30 (Fri)
		1.1	96.01.16 (Tue)	Option interp added. 


fsp_11 $SSW/yohkoh/ucon/idl/mctiernan/fsp_11.pro
[Previous] [Next]
 NAME: fsp_11
 PURPOSE: 
	Runs the spectral fitting routine fitspec, to
	obtain spectral fits. Unlike fsp_proc.pro, fsp_11
	assumes that you already have the countrates and 
	time info.
 CALLING SEQUENCE: 
	fsp_11,detector,inpf,tyspec,fit_pars,sc_par,ch_dta,ofile=ofile,$
		pfile=pfile,sdel=sdel,flux_corr=flux_corr,nsigmas=nsigmas,$
		noplot=noplot,a_fix=a_fix,erange=erange,init_a=init_a,$
               amoeba=amoeba
 INPUT:
	detector=a string identifying the instrument
	inpf= a strarr containing the names of the appropriate detector 
		response files, or the structure containing the responses
               and channel info, it's an anonymous structure, tags
	        e10= channel low energy edges
	        e20= channel high energy edges
       	eb0= channel energies
               resp_files= inpf, the resp.file names
		n_ins= no. of detectors use in spectrum
		ncmx= no. of channels for each instrument
		nc0= total number of channels
		ne0= number of energies at which the response has been determined
		e0= the energies at which the response has been determined
		r0= the response matrix 
		rde0= response matrix*de0, so that counts(nc0)=flux(ne0)#rde0(nc0,ne0)
	tyspec=the spectral type
	      = 1 for single p.l.
	      = 2 for double p.l.
	      = 3 for single thermal
	      = 4 for p.l. + thermal
	      = 5 for thermal + thermal
	      = 6 for p.l. + p.l.
	      = 7 thermal below Ebr, p.l. above Ebr
	      = 8 Thermal + double p.l.
	      = 9 Triple P.L.
             = 10 thermal including line emission
	      = 11 for p.l. + thermal, includes SXR lines
             = 12 for a p.l. that flattens below a value e0
             = 13 for a p.l. with an exponential cutoff below a value e0
             = 14 for a double thermal model including lines
	The following tags of the input structures must also be filled;
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		t= the interval START times
		dt= the interval lengths
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel with excess>sigma(bck), 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		bck= background count rates, 2 intervals
		sbck= Uncertainty in bck
		tb= the background START times
		dtb= the bck time intervals
	ch_dta, a structure containing data for each channel for each interval
		y0= incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
 OUTPUT:
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
                  NOTE ON UNITS: for Power laws, K is the differential flux
                                 at 1keV, in photons/(sec-cm^2-keV).
                                 Break energies (ebr) are in keV.
                                 For thermal fits, em is the Emission Measure
                                 in cm^(-3) but the output EM is normalized
                                 by 1.0e47. T is in Kelvin, but the output
                                 temperatures are in MK. (T/10^6)
 			tyspec  =1 a(0)=K, a(1)=gamma
				=2 a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
				=3 a(0)=em/1.0e47, a(1)=T/1.0e6
				=4 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
				=5 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
				=6 a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
				=7 a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		                =8 a(0)=em/1.0e47, a(1)=T/1.0e6, 
			           a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		                =9 a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			           a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			           a(5)=eb2 (between gamma2 and gamma3)
                               =10 a(0)=em/1.0e47, a(1)=T/1.0e6
                               =11 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
 		                =12, a(0)=K, a(1)=gamma, a(2)=e0
 		                =13, a(0)=K, a(1)=gamma, a(2)=e0
				=14, a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= total (i.e., not background subtracted) incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
               c0 = Model Excess count rates
 KEYWORD INPUT:
	ofile, if set output to file ofile
	pfile, if set will give a hardcopy into the file pfile, assumed to be
		opened
	sdel= the subscripts of channels to delete
	flux_corr= the value of the flux_correction factor
	nsigmas= the number of sigmas above background for a "good" channel,
		=3.0 as a default
	noplot= if set don't do any screen plots
       a_fix= an array, corresponding to a for the fit parameters,
              gives the values of a chosen to remain fixed by the
              user. If a_fix(j)=0.0, the parameter is free, if a_fix(j)
              is set to -1, then you choose the jth parameter in a
              routine called fix_pars, if a_fix(j)=-2, then the parameter
              will be chosen in ainit, but will remain fixed during the fit.
       erange= an energy range to be used for the spectral fit, channels with
               middle energies between the two limits are included. Channels
               specified in sdel are still to be deleted...
       init_a= initial values for the fit parameters, can be an array
               of (number of fit parameters, ntimes)
       amoeba= if set, use the routine amoeba_x to get fit
 CALLS: ***
	Countrate, Multresponses, UNIQ [1], UNIQ [2], UNIQ [3], bck_interp, fdf10_init
	fitspec, fix_pars, fluxc_mult, fsp_outplot, fsp_output, fx_phflux, goodch, ma_labels
 CALLED BY:
	any_fsp, fsp_proc, mult_th_fsp
 COMMON BLOCKS: Two of them, for responses
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
 MODIFICATION HISTORY:
	Written By JMcT , Dec '92


fsp_avsig $SSW/yohkoh/ucon/idl/mctiernan/fsp_avsig.pro
[Previous] [Next]
 NAME:
       fsp_avsig
 CALLING SEQUENCE:
       Fsp_avsig, fitp_in, scp_in, chd_in, fitp_out, scp_out, chd_out, $
              sigma_chi2=sigma_chi2, av_1pl_flux=av_1pl_flux, $
              sig_1pl_flux=sig_1pl_flux, e0=e0
 PURPOSE:
       Averages and sigmas for fit parameters, from HXTBOX_FSP, used
       on HXT_MCIMG output, or used in the /mc option of FSP_PROC
 INPUT:
       fitp_in, scp_in, chd_in= from fits of spectra (from hxtbox_fsp)
 OUTPUT:
       fitp_out, scp_out, chd_out= averages and sigmas of all the fits,
            for each box.
 KEYWORDS:
       sigma_chi2= variance in chi2
       av_1pl_flux= average photon flux, if the fit is a 1 pl
       sig_1pl_flux= variance in 1pl flux
       e0=cutoff energy for the calculation
 CALLS: ***
	avsig_1 [1], avsig_1 [2], avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6]
	avsig_1 [7], pn_pl
 HISTORY:
       10/12/94, jmm
       8-7-95, new structure formats, jmm


fsp_mc $SSW/yohkoh/ucon/idl/mctiernan/fsp_mc.pro
[Previous] [Next]
 NAME: fsp_mc
 PURPOSE: 
	Runs the spectral fitting routine fitspec, to
	obtain spectral fits. Uses a Monte Carlo-like
       procedure to obtain the uncertainties.
 CALLING SEQUENCE: 
	fsp_mc,detector,inpf,tyspec,fit_pars,sc_par,ch_dta,ofile=ofile,$
		pfile=pfile,sdel=sdel,flux_corr=flux_corr,nsigmas=nsigmas,$
		noplot=noplot,a_fix=a_fix,erange=erange, n_trials=n_trials,$
               mc_counts=mc_counts,mc_fits=mc_fits,init_a=init_a
 INPUT:
	detector=a string identifying the instrument
	inpf= a strarr containing the names of the appropriate detector 
		response files, or the structure containing the responses
               and channel info, it's an anonymous structure, tags
	        e10= channel low energy edges
	        e20= channel high energy edges
       	eb0= channel energies
               resp_files= inpf, the resp.file names
		n_ins= no. of detectors use in spectrum
		ncmx= no. of channels for each instrument
		nc0= total number of channels
		ne0= number of energies at which the response has been determined
		e0= the energies at which the response has been determined
		r0= the response matrix 
		rde0= response matrix*de0, so that counts(nc0)=flux(ne0)#rde0(nc0,ne0)
	tyspec=the spectral type
	      = 1 for single p.l.
	      = 2 for double p.l.
	      = 3 for single thermal
	      = 4 for p.l. + thermal
	      = 5 for thermal + thermal
	      = 6 for p.l. + p.l.
	      = 7 thermal below Ebr, p.l. above Ebr
	      = 8 Thermal + double p.l.
	      = 9 Triple P.L.
             = 10 thermal including line emission
	      = 11 for p.l. + thermal, includes SXR lines
             = 12 for a p.l. that flattens below a value e0
             = 13 for a p.l. with an exponential cutoff below a value e0
	The following tags of the input structures must also be filled;
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		t= the interval START times
		dt= the interval lengths
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel with excess>sigma(bck), 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		bck= background count rates, 2 intervals
		sbck= Uncertainty in bck
		tb= the background START times
		dtb= the bck time intervals
	ch_dta, a structure containing data for each channel for each interval
		y0= incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
 OUTPUT:
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
                  NOTE ON UNITS: for Power laws, K is the differential flux
                                 at 1keV, in photons/(sec-cm^2-keV).
                                 Break energies (ebr) are in keV.
                                 For thermal fits, em is the Emission Measure
                                 in cm^(-3) but the output EM is normalized
                                 by 1.0e47. T is in Kelvin, but the output
                                 temperatures are in MK. (T/10^6)
 			tyspec  =1 a(0)=K, a(1)=gamma
				=2 a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
				=3 a(0)=em/1.0e47, a(1)=T/1.0e6
				=4 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
				=5 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
				=6 a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
				=7 a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		                =8 a(0)=em/1.0e47, a(1)=T/1.0e6, 
			           a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		                =9 a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			           a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			           a(5)=eb2 (between gamma2 and gamma3)
                               =10 a(0)=em/1.0e47, a(1)=T/1.0e6
                               =11 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
 		                =12, a(0)=K, a(1)=gamma, a(2)=e0
 		                =13, a(0)=K, a(1)=gamma, a(2)=e0
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= total (i.e., not background subtracted) incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
               c0 = Model Excess count rates
 KEYWORD INPUT:
	ofile, if set output to file ofile
	pfile, if set will give a hardcopy into the file pfile, assumed to be
		opened
	sdel= the subscripts of channels to delete
	flux_corr= the value of the flux_correction factor
	nsigmas= the number of sigmas above background for a "good" channel,
		=3.0 as a default
	noplot= if set don't do any screen plots
       a_fix= an array, corresponding to a for the fit parameters,
              gives the values of a chosen to remain fixed by the
              user. If a_fix(j)=0.0, the parameter is free, if a_fix(j)
              is set to -1, then you choose the jth parameter in a
              routine called fix_pars, if a_fix(j)=-2, then the parameter
              will be chosen in ainit, but will remain fixed during the fit.
       erange= an energy range to be used for the spectral fit, channels with
               middle energies between the two limits are included. Channels
               specified in sdel are still to be deleted...
       n_trials= number of Monte Carlo trials, the default is 100
       mc_counts= the poisson deviates used for the count rates in the trial fits
       mc_fits= the values of the fit parameters for all the trials
       init_a= initial values for the fit parameters
 CALLS: ***
	Countrate, Multresponses, POIDEV, UNIQ [1], UNIQ [2], UNIQ [3], bad_a, bck_interp
	fdf10_init, fitspec, fix_pars, fluxc_mult, fsp_outplot, fsp_output, fx_phflux, goodch
	ma_labels
 CALLED BY:
	fsp_proc
 COMMON BLOCKS: Two of them, for responses
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
 MODIFICATION HISTORY:
	Written By JMcT , Dec '92


Fsp_mrqcof $SSW/yohkoh/ucon/idl/mctiernan/fsp_mrqcof.pro
[Previous] [Next]
 NAME:
	Fsp_mrqcof
 CALLING SEQUENCE:
	Fsp_mrqcof,tyspec,ma,yo,s2,a,alpha,beta,chisq
 PURPOSE:
	Calculates the matrices alpha and beta used in the spectral fit
	and also calculates chisq.
 INPUT:
	tyspec=spectral type, 
	ma=no. of parameterss used in fit, 
	yo=obs. counts, 
	s2=sigma(yo)^2, 
	a=fit parameters, 
 OUTPUT:
	alpha is the inverse of the covariance matrix, 
	alpha(i,j)=sum over channels(ich) of dcda(i,ich)*dcda(j,ich)/s2(ich),  
		or (1/2)d2chisq/da(i)da(j),
	beta(i)=sum over ich of dcda(i,ich)*(c(ich)-yo(ich))/s2(ich), or 
		dchisq/da(i)
 KEYWORDS:
       ffx= an array of ma integers, ffx=1 for parameters that remain fixed
            ffx is 0 for free parameters
 CALLS: ***
	Cdcda, Countrate
 CALLED BY:
	Fsp_mrqmin
 COMMON BLOCKS:
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
 HISTORY:
 	Copied from mrqcof.f from Numerical Recipies, JMcT, Spring '92
       Added ffx keyword, 9-july-1996, jmm
       Changed name, 25-sep-1996, jmm


Fsp_mrqmin $SSW/yohkoh/ucon/idl/mctiernan/fsp_mrqmin.pro
[Previous] [Next]
 NAME:
	Fsp_mrqmin
 CALLING SEQUENCE:
	Fsp_mrqmin,tyspec,cdta,fdta
 PURPOSE: 
	Spectral Fit, copied from Numerical Recipies, ch 14 but translated 
	into IDL, see also Bevington pgs 237-239, this should give the same 
	results as the IDL users library curvefit, but that doesn't return 
	the uncertainties in the fit parameters, 
 INPUT: 
	tyspec=type of spectrum
	cdta= structure containing the data
	with tags, c= fit count rate, yo = obs count rate, 
		   s2= unc. in yo squared, icch= channel #
		   ech= channel energy
	a=initial values of fit parameters, ma=no.of elements
	sa=Unc. in a
 OUTPUT: 
	In the structure fdta,
	a=fit parameters
	sa=unc. in a
       ffx= 0 if the associated parameter is free, 1 if fixed at a
              user defined value, 2 if fixed at the value initially
              given by ainit
 CALLS: ***
	Fsp_mrqcof, dude
 CALLED BY:
	fitspec
 COMMON BLOCKS:
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
 HISTORY:
 	Copied from Fsp_mrqmin.f from Numerical Recipies, JMcT, Spring '92
       Made a double precision, 25-jan-96, jmm
       Changed handling of fixed parameters, 9-jul-1996, jmm
       Changed name to avoid IDL conflicts, 25-sep-1196, jmm


fsp_outplot $SSW/yohkoh/ucon/idl/mctiernan/fsp_outplot.pro
[Previous] [Next]
 NAME:
	fsp_outplot
 CALLING SEQUENCE:
       Fsp_outplot, fit_pars, sc_par, ch_dta, erange=erange, yrange=yrange, $
               toptitle=toptitle, Oplot=oplot, Label=label, no_unc=no_unc, $
               psym=psym, linestyle=linestyle, xv_range = xv_range, color=color
 PURPOSE:
	Spectral plot, intended for multiple spectra
 INPUT:
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
 			tyspec  =1 a(0)=K, a(1)=gamma
				=2 a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
				=3 a(0)=em/1.0e47, a(1)=T/1.0e6
				=4 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
				=5 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
				=6 a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
				=7 a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		                =8 a(0)=em/1.0e47, a(1)=T/1.0e6, 
			           a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		                =9 a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			           a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			           a(5)=eb2 (between gamma2 and gamma3)
                               =10 a(0)=em/1.0e47, a(1)=T/1.0e6
                               =11 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
 		                =12 a(0)=K, a(1)=gamma, a(2)=e0
 		                =13 a(0)=K, a(1)=gamma, a(2)=e0
				=14 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
		fmiss= # of missing frames in data
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
 KEYWORD INPUT:
	toptitle= and extra string for the title on top
       oplot= if set put the new plot on top of an old one
       label= a label for the curve
       psym= symbol type for channels, default=4
       linestyle= line type for plot, default=0
       erange= renage of x values
       yrange=renge of y values
       color= color for plot, default=!P.COLOR
       xv_range = if set, a range where the line should extend to
       no_unc= if set, do not print out the uncertaintes
 CALLS: ***
	ebplpl, ebthpl, fx_1pl, fx_1th, fx_phflux
 CALLED BY:
	box_sxtth_hxt, fsp_11, fsp_mc, sxtth_hxt
 HISTORY:
	Written May '93 by JMcT


fsp_output $SSW/yohkoh/ucon/idl/mctiernan/fsp_output.pro
[Previous] [Next]
 NAME:
	fsp_output
 CALLING SEQUENCE:
	fsp_output,out_unit,fit_pars,sc_par,ch_dta,detector=detector
 PURPOSE:
	Outputs the spectral fit, only one fit at a time, please...
 INPUT:
       out_unit = a unit number for the output file, or a string variable
                  containing an output file name
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
 			tyspec  =1 a(0)=K, a(1)=gamma
				=2 a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
				=3 a(0)=em/1.0e47, a(1)=T/1.0e6
				=4 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
				=5 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
				=6 a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
				=7 a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		                =8 a(0)=em/1.0e47, a(1)=T/1.0e6, 
			           a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		                =9 a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			           a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			           a(5)=eb2 (between gamma2 and gamma3)
                               =10 a(0)=em/1.0e47, a(1)=T/1.0e6
                               =11 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
 		                =12, a(0)=K, a(1)=gamma, a(2)=e0
 		                =13, a(0)=K, a(1)=gamma, a(2)=e0
				=14, a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
		fmiss= # of missing frames in data
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
        detector= a string variable for the detector
 CALLS: ***
	ebplpl, ebthpl, ebthth, fx_1pl, fx_1th
 CALLED BY:
	box_sxtth_hxt, fsp_11, fsp_mc, sxtth_hxt
 HISTORY:
	Written Nov'93 by JMcT


fsp_proc $SSW/yohkoh/ucon/idl/mctiernan/fsp_proc.pro
[Previous] [Next]
 NAME: fsp_proc
 PURPOSE: 
	Runs the spectral fitting routine fitspec, to
	obtain spectral fits. 
 CALLING SEQUENCE: 
	fsp_proc,cfile,ofile,tyspec,fit_pars,sc_par,ch_dta,$
		pfile=pfile,sdel=sdel,flux_corr=flux_corr,nsigmas=nsigmas,$
		noplot=noplot,a_fix=a_fix,erange=erange,mc_trials=mc_trials,$
               mc_counts=mc_counts,mc_fits=mc_fits, init_a=init_a
 INPUT:
	cfile=the input file
	ofile=the output file
	tyspec=the spectral type
	      = 1 for single p.l.
	      = 2 for double p.l.
	      = 3 for single thermal
	      = 4 for p.l. + thermal
	      = 5 for thermal + thermal
	      = 6 for p.l. + p.l.
	      = 7 thermal below Ebr, p.l. above Ebr
	      = 8 Thermal + double p.l.
	      = 9 Triple P.L.
	      = 10 for single thermal, includes SXR lines
	      = 11 for p.l. + thermal, includes SXR lines
             = 12 for a p.l. that flattens below a value e0
             = 12 for a p.l. with an exponential cutoff below a value e0
 OUTPUT:
	fit_pars, a structure of type {fitinfo}, for each interval, with tags:
		tyspec= type of spectrum
		ma= no. of parameters fit
		alabels = labels for the fit parameters
		t= the interval START times, in the 7 element array
		dt= the interval lengths
		a= the fit parameters, a fltarr(6)
                  NOTE ON UNITS: for Power laws, K is the differential flux
                                 at 1keV, in photons/(sec-cm^2-keV).
                                 Break energies (ebr) are in keV.
                                 For thermal fits, em is the Emission Measure
                                 in cm^(-3) but the output EM is normalized
                                 by 1.0e47. T is in Kelvin, but the output
                                 temperatures are in MK. (T/10^6)
 			tyspec  =1 a(0)=K, a(1)=gamma
				=2 a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
				=3 a(0)=em/1.0e47, a(1)=T/1.0e6
				=4 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
				=5 a(0)=em1/1.0e47, a(1)=T1/1.0e6, a(2)=em2/1.0e47, a(3)=T2/1.0e6
				=6 a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
				=7 a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		                =8 a(0)=em/1.0e47, a(1)=T/1.0e6, 
			           a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		                =9 a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			           a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			           a(5)=eb2 (between gamma2 and gamma3)
                               =10 a(0)=em/1.0e47, a(1)=T/1.0e6
                               =11 a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, a(3)=gamma
 		                =12, a(0)=K, a(1)=gamma, a(2)=e0
 		                =13, a(0)=K, a(1)=gamma, a(2)=e0
		sa= uncertainties in the fit parameters
               ffx= 0 if the associated parameter is free, 1 if fixed at a
                    user defined value, 2 if fixed at the value initially
                    given by ainit.
		chi2= chi^2
		nch= the number of channels for each interval
		fluxc= flux correction if any
		nsig= # of sigmas above background for good channels.
		flags= saturated flag, incomplete flag, channel event 
			was found in, highest channel included in fit, 
			mro flag.
	sc_par, a structure containing data for each sc channel, tags:
		e10= channel low energy edges
		e20= channel high energy edges
		eb0= channel midpt energy
		bck= background count rates, for the two bck intervals, fltarr(2)
		sbck= Uncertainty in bck
		tb= the background START time for two background intervals, an array of(7, 2)
		dtb= the bck time interval, fltarr(2)
	ch_dta, a structure containing data for each channel for each interval
		y0= total (i.e., not background subtracted) incident count rates
		sy0= Uncertainty in y0
		chok=channel flag, 0 for channels used in fit , 
				   1 for channel not used
               b0 = background count rate
               sb0 = uncertainty in b0
               f0 = photon flux in the channel, for most cases f0 is
                    the flux at the channel energy, for thermal  + line fits
                    f0 is the average photon flux in that channel.
                    Note that f0 = model flux * ((y0-b0)/c0)
               sf0 = uncertainty in f0.      
               c0 = Model Excess count rates
 KEYWORD INPUT:
	pfile, if set will give a hardcopy into the file pfile
	sdel= the subscripts of channels to delete
	flux_corr= the value of the flux_correction factor
	nsigmas= the number of sigmas above background for a "good" channel,
		=3.0 as a default
	noplot= if set don't do any screen plots
       a_fix= an array, corresponding to a for the fit parameters,
              gives the values of a chosen to remain fixed by the
              user. If a_fix(j)=0.0, the parameter is free, if a_fix(j)
              is set to -1, then you choose the jth parameter in a
              routine called fix_pars, if a_fix(j)=-2, then the parameter
              will be chosen in ainit, but will remain fixed during the fit.
       erange= an energy range to be used for the spectral fit, channels with
               middle energies between the two limits are included. Note that
               channels already specified in sdel are still deleted.
       mc_trials= if set, call fsp_mc, which does a monte carlo simulation
                  for the uncertainties, this is the number of trials
       mc_counts= the poisson deviates used for the count rates in the monte carlo trial fits
       mc_fits= the values of the fit parameters for all the monte carlo trials
       init_a= initial values for the fit parameters
 COMMON BLOCK:
	Common rsp,nch,nsc,esc,rsc
		nch= no. of channels used it fit
		nsc= no. of energies used,
		esc=energies used
		rsc=rde0 only for the channels used in the fit
 CALLS: ***
	Dummy_rd [1], Dummy_rd [2], Dummy_rd [3], Multresponses, dude, fix_pars, fsp_11
	fsp_mc, ma_labels
 MODIFICATION HISTORY:
	Written By JMcT , Dec '92
       Changed lots of stuff, defaults, now calls fsp_11, 14-jul-95, jmm


fstepper $SSW/yohkoh/ucon/idl/freeland/fstepper.pro
[Previous] [Next]
   Name:fstepper

   Purpose: step through file

 CALLS:


ftp_copy2sites $SSW/yohkoh/gen/idl/ys_util/ftp_copy2sites.pro
[Previous] [Next]
   Name: ftp_copy2sites

   Purpose: export fits, gif, etc 

 CALLED BY:
	daily_forecast [2]
   History:
      9-May-1995 (SLF) 

 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], ftp_copy [1], ftp_copy [2], get_logenv [1], get_logenv [2]
	is_member [1], is_member [2], rd_tfile [1], rd_tfile [2], strsplit, tbeep [1]
	tbeep [2], tbeep [3], wmenu_sel [1], wmenu_sel [2]
   Restrictions: 
      must be a sites file: $DIR_SITE_LOGS/sxt_NNN.sites 
      where NNN={fits, gif, forecast, etc}

   Actual restrictions: FITS only for now


ftp_defprompt $SSW/yohkoh/gen/idl/ys_util/ftp_defprompt.pro
[Previous] [Next]
   Name: ftp_defprompt

   Purpose: return default for ftp 'prompt' flag 
            (since no command for absolute setting of PROMPT, as far as I know)

   Output:
      function boolean (1=prompt ON, 0=prompt off)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4], file_append [1]
	file_append [2], get_logenv [1], get_logenv [2], prstr [1], prstr [2]
   History:
       2-Sep-94 (SLF) written 


ftp_from_facom $SSW/yohkoh/ucon/idl/hudson/ftp_from_facom.pro
[Previous] [Next]
 NAME:
  ftp_from_facom
 PURPOSE:
  Transfer files from the Facom Mainframe using FTP
 CALLING SEQUENCE:
  ftp_from_facom,remotefile,localfile,host,user_password
 CALLED BY:
	PRINT_OP, print_ogsel
 HISTORY:
   97/08/05 TSakurai, based on Jim Lemen's facom_ftp


ftpts_chi2 $SSW/yohkoh/ucon/idl/mctiernan/ftpts_chi2.pro
[Previous] [Next]
 NAME:
      ftpts_chi2
 PURPOSE:
      given the strengths, radiuses and positions of one or more Gaussian
      footpoints, return chi2. For use by AMOEBA_X, from MAKIMG_G.
      This has a different arg list from mult_ftpt_chi2... since amoeba_hXi
      takes an array, and the obs variables are passed in in common.
 CALLING SEQUENCE:
      chi2 = mult_ftpt_chi2(simplex, b=b, b_ftpt=b_ftpt, r_ftpt=r_ftpt, xy_ftpt=xy_ftpt)
 INPUT:
      The input array contains, in order
      b_ftpt = Total brightness of each source, except for one, fltarr(n-1),
               n is the number OF sources
      r_ftpt = Radius of each source, fltarr(n)
      x_ftpt = x position of each source, fltarr(n)
      y_ftpt = y_position of each source, fltarr(n)
      In the common block obs_data0:
      p0 = modulation patterns, fobs(j) = total(b*p(*,*,j))
      fobs0 = counts in each sub-collimator, this is what you are fitting to
      sig0 = uncertainty in fobs 
      cyl0 = if set to 1, use cylindrical sources, if set to 2 use moffat fn. sources
      moff0 = if non-zero, use cylindrical moffat sources prop. to 1/(1+r^2/r0^2)^moff0
      btot0 = the total brightness, this is fixed
 KEYWORDS:
      img=the output brightness
      b_ftpt = Total brightness of each source, fltarr(n)
      r_ftpt = Radius of each source, fltarr(n)
      x_ftpt = x position of each source, fltarr(n)
      y_ftpt = y_position of each source, fltarr(n)
 CALLED BY:
	amoeba_hxi
 HISTORY:
      14-mar-95, jmm
      added moff0, 3-20-95, jmm


ftpts_chi21 $SSW/yohkoh/ucon/idl/mctiernan/ftpts_chi21.pro
[Previous] [Next]
 NAME:
      ftpts_chi21
 PURPOSE:
      given the strengths, radiuses and positions of one or more Gaussian
      footpoints, return chi2. For use by AMOEBA_X, from MAKIMG_G.
      This has a different arg list from mult_ftpt_chi2... since amoeba_hXi
      takes an array, and the obs variables are passed in in common.
 CALLING SEQUENCE:
      chi2 = mult_ftpt_chi2(simplex, b=b, b_ftpt=b_ftpt, r_ftpt=r_ftpt, $
                            x_ftpt=x_ftpt, y_ftpt=y_ftpt, bck=bck)
 INPUT:
      The input array contains, in order
      b_ftpt = Total brightness of each source, except for one, fltarr(n-1),
               n is the number OF sources
      r_ftpt = Radius of each source, fltarr(n)
      x_ftpt = x position of each source, fltarr(n)
      y_ftpt = y_position of each source, fltarr(n)
      bck = the total bck left over
      In the common block obs_data0:
      p0 = modulation patterns, fobs(j) = total(b*p(*,*,j))
      fobs0 = counts in each sub-collimator, this is what you are fitting to
      sig0 = uncertainty in fobs 
      cyl0 = if set to 1, use cylindrical sources
      moff0 = if non-zero, use cylindrical moffat sources prop. to 1/(1+r^2/r0^2)^moff0
      btot0 = the total brightness, this is fixed
 KEYWORDS:
      img=the output brightness
      b_ftpt = Total brightness of each source, fltarr(n)
      r_ftpt = Radius of each source, fltarr(n)
      x_ftpt = x position of each source, fltarr(n)
      y_ftpt = y_position of each source, fltarr(n)
      bck = the leftover background
 CALLED BY:
	amoeba_hxi1
 HISTORY:
      14-mar-95, jmm
      added moff0, 3-20-95, jmm


ftql pro $SSW/yohkoh/ucon/idl/naoj_mtk/ftql.pro
[Previous] [Next]

NAME       : ftql (pro)
 PURPOSE :
	quick look of flare tel. mini images
 CATEGORY :
	idl/lib/flare
 CALLING SEQUENCE :
	.run ftql
 INPUTS :
	data    : data(*,*,*)
 OPTIONAL INPUT PARAMETERS : 
	none
 KEYWORD PARAMETERS :
 OUTPUTS :
	none
 COMMON BLOCKS : 	none
 SIDE EFFECTS : 	none
 RESTRICTIONS :	none
 PROCEDURE :
	The newest directory in /data2/ftobs is the target.
	If data ('yymmdd') is previously defined, then use this.
 MODIFICATION HISTORY :
	K.I. '93/01/29	; 


fudge_scale $SSW/yohkoh/ucon/idl/nitta/fudge_scale.pro
[Previous] [Next]
 PURPOSE: Scale negative and positive portions of an image independently
         and make it appear consistent with your argument.
 CATEGORY: DISPLAY/dubious analysis
 CALLING SEQUENCE:  fake=fudge_data(data, /log, nc=!d.n_colors) 
                    fake=fudge_data(data, gamma=[0.3, 0.2])
                    fake=fudge_data(data, /log, low=[0.05,0.5],high=[0.2,0.9])
 INPUT PARAMETERS: 
         data: must have both positives and negatives
 OPTIONAL INPUT KEYWORDS:
         nc:   number of available color
         log:  for logarithmic scaling (default)
         gamma: two-element vector to specify gamma for - and +
         low, high: two-element vectors to specify min and max for
             - and +, in terms of the fraction of each maximum.
             Default is full scale.
 COMMENTS:  Wow, what a waste of time!
 CALLS:


fullwindow pro $SSW/yohkoh/ucon/idl/naoj_nkr/fullwindow.pro
[Previous] [Next]

NAME       : fullwindow (pro)
 PURPOSE :
	open a full screen window
 CATEGORY :
	idl/lib/nkr
 CALLING SEQUENCE :
	fullwindow,[wno],title=title,wsize=wsize
 INPUTS :

 OPTIONAL INPUT PARAMETERS : 
	wno   -- window no.
		 if wno=999, return screen size in wsize
 KEYWORD PARAMETERS :
	title	: title of new window 
 OUTPUTS :
	none
 CALLS: ***
	FULLWINDOW
 COMMON BLOCKS : 	none
 SIDE EFFECTS : 	
	window 0 is destroyed if it exist.
 RESTRICTIONS :	none
 PROCEDURE :
 MODIFICATION HISTORY :
	K.I. '93/01/31	; new
	K.I. '93/04/29	; wsize


FUNCT $SSW/yohkoh/ucon/idl/fludra/gaussfit_2.pro
[Previous] [Next]
 NAME:
	FUNCT
 PURPOSE:
	EVALUATE THE SUM OF A GAUSSIAN AND A 2ND ORDER POLYNOMIAL
	AND OPTIONALLY RETURN THE VALUE OF IT'S PARTIAL DERIVATIVES.
	NORMALLY, THIS FUNCTION IS USED BY CURVEFIT TO FIT THE
	SUM OF A LINE AND A VARYING BACKGROUND TO ACTUAL DATA.

 CATEGORY:
	E2 - CURVE AND SURFACE FITTING.
 CALLING SEQUENCE:
	FUNCT,X,A,F,PDER
 INPUTS:
	X = VALUES OF INDEPENDENT VARIABLE.
	A = PARAMETERS OF EQUATION DESCRIBED BELOW.
 OUTPUTS:
	F = VALUE OF FUNCTION AT EACH X(I).

 OPTIONAL OUTPUT PARAMETERS:
	PDER = (N_ELEMENTS(X),N_elements(a)) ARRAY CONTAINING THE
		PARTIAL DERIVATIVES.  P(I,J) = DERIVATIVE
		AT ITH POINT W/RESPECT TO JTH PARAMETER.
 CALLS: ***
	CURVEFIT, GAUSSFIT_2, POLY_FIT
 CALLED BY:
	ANAL_BCS_PHA, pointing
 COMMON BLOCKS:
	NONE.
 SIDE EFFECTS:
	NONE.
 RESTRICTIONS:
	NONE.
 PROCEDURE:
	F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
       Polynomial part is optional (depends on the N_elements(a))

	Z = (X-A(1))/A(2)
 MODIFICATION HISTORY:
	WRITTEN, DMS, RSI, SEPT, 1982.


function mycongridimgxsys $SSW/yohkoh/ucon/idl/tyoshida/mycongrid.pro
[Previous] [Next]
NAME:
function mycongrid,img,xs,ys
KEYWORDS:	Tool
PURPOSE:
	congrid image
CALLING SEQUENCE:
	answer=congrid(img,100,200)
INPUTS:
	image	:	2 dimensional array
	100	:	xsize
	200	:	ysize
RETURN:
	answer	: answer image
KEYWORDS:
	none
 CALLS:


function normimgcimgdnuptvdnupvalidregionvalidregionnullvaluenullvalue $SSW/yohkoh/ucon/idl/tyoshida/normimgc.pro
[Previous] [Next]
NAME:
function normimgc,img,dnup,tvdnup,validregion=validregion,nullvalue=nullvalue
KEYWORDS:	Tool
PURPOSE:
	normalize image(s) to byte
CALLING SEQUENCE:
	answer=normimgc(image,dnup,tvdnup)
	answer=normimgc(image,[-1.0,6.0],[0,!p.color])
	answer=normimgc(image,[3e+6,10e+6],[1,100],valid=mask,null=0)
INPUTS:
	img		: 2 dimensional array
	dnup		: 2 elements array (default [min(img),max(img)])
	tvdnup		: 2 elements array (default [0,!d.table_size-1])
RETURN:
	answer		: byte array
KEYWORDS:
	validregion	: Boolean array of valid region ( same size as 'img' )
	nullvalue	: Value in the invalid region (default 0)
HISTORY
	ver 2.0 95-11-30
 CALLS:


function ororab $SSW/yohkoh/ucon/idl/tyoshida/oror.pro
[Previous] [Next]
NAME:
function oror,a,b
KEYWORDS:	Tool
PURPOSE & CALLING SEQUENCE:
	When you are tired to write programs such as
		if (a eq b(0)) or (a eq b(1)) or (a eq b(2)) or ....
			or
		wh=where((a eq b(0)) or (a eq b(1)) or (a eq b(2)) or ....)
	you can write
		if oror(a,b) then ..
		wh=where(oror(a,b))
 CALLS: ***
	OROR
HISTORY:
	Ver 1.0 96-10-25	Created by TY


function timeintervalab $SSW/yohkoh/ucon/idl/tyoshida/timeinterval.pro
[Previous] [Next]
NAME:
function timeinterval,a,b
KEYWORDS:	Yohkoh data analysis, Yohkoh Operation
PURPOSE:
	calculate time interval (sec) between two time structures.
CALLING SEQUENCE:
       sec=timeinterval(srctime,starttime)
RETURN:
	time (second) float array.
INPUTS:
	a:	time structure
	b:	one dimensional time structure
 CALLS: ***
	TIMEINTERVAL, gt_day [1], gt_day [2], gt_time [1], gt_time [2]
HISTORY:
	Ver 1.0 96-10-25	Created by TY


fwhm_histo $SSW/yohkoh/ucon/idl/mctiernan/fwhm_histo.pro
[Previous] [Next]
 NAME:
      fwhm_histo
 PURPOSE:
      given a histogram, get the maximum and the fwhm, as a fn
      of bin_midpts.
 CALLING SEQUENCE:
      fwhm = fwhm(f, bin_edg=bin_edg, bin_mid=bin_mid, f_max=f_max, $
             max_bin = max_bin, intrp=intrp)
 INPUT:
      f = some histogram
 OUTPUT:
      fwhm= full width at half-maximum, the resolution can only be as
            good as the bin size, unless the intrp keyword is set.
 KEYWORDS:
      bin_edg = bin edges for histogram, the default is
                findgen(N_ELEMENTS(f)+1)
      bin_mid = bin midpoints for histograms, if not set, you get it
                from bin_edg. If you don't have a real histogram, set
                this to the x values of the function.
      f_max = max value of f
      max_val = where f = f_max, but not the bin number, the value
      intrp = if set, the number of points that you'll interpolate the
               midpts to to get better fwhm resolution, if set as /intrp
               it's set to 100.
 CALLS: ***
	INTERPU_1D
 HISTORY:
      10/12/94, jmm


fx_1pl $SSW/yohkoh/ucon/idl/mctiernan/fx_1pl.pro
[Previous] [Next]
 NAME:
	fx_1pl
 CALLING SEQUENCE:
	f=fx_1pl(a,esc)
 PURPOSE:
	Calculates photon flux for the single power law
 INPUT:
	a= fit parameters, a(0)=K, a(1)=gamma, 
	esc= energy in keV
 OUTPUT:
	f=a(0)/esc^a(1)
 HISTORY
	Spring '92 JMcT
 CALLED BY
	Ainit, SXT_POWL, dfx_1pl, dfx_plppl, dfx_thppl, dfx_thppl_l, dfx_thppl_lo, ebthpl
	fsp_outplot, fsp_output, fx_phflux, fx_plppl, fx_thbpl, fx_thppl, fx_thppl_l
	fx_thppl_lo


fx_1pl_cut $SSW/yohkoh/ucon/idl/mctiernan/fx_1pl_cut.pro
[Previous] [Next]
 NAME:
	fx_1pl_cut
 CALLING SEQUENCE:
	f=fx_1pl_cut(a,esc)
 PURPOSE:
	Calculates photon flux for the single power law, which cuts off
       below an energy e0, note that K corresponds to Flux at e0 KeV
 INPUT:
	a= fit parameters, a(0)=K, a(1)=gamma, a(2)=e0
	esc= energy in keV
 OUTPUT:
	f=a(0)*(esc/a(2))^(-a(1)), esc > a(2)
       f=0, esc< a(2)
 HISTORY
	11-apr-94, JMM
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm
 CALLED BY
	dfx_1pl_cut, hxt_cutoff


fx_1pl_ecut $SSW/yohkoh/ucon/idl/mctiernan/fx_1pl_ecut.pro
[Previous] [Next]
 NAME:
	fx_1pl_ecut
 CALLING SEQUENCE:
	f=fx_1pl_ecut(a,esc)
 PURPOSE:
	Calculates photon flux for the single power law, which cuts off
       below an energy e0, note that K corresponds to Flux at e0 KeV.
       Here there's an exponential cut-off, instead of a sharp one.
 INPUT:
	a= fit parameters, a(0)=K, a(1)=gamma, a(2)=e0
	esc= energy in keV
 OUTPUT:
	f=a(0)*(esc/a(2))^(-a(1)), esc > a(2)
       f=a(0)*(exp((esc/a(2))^pwr)-1), esc< a(2)
 KEYWORD OUTPUT:
       pwr= the power that (esc/a(2)) is raised to in the exponential
 HISTORY
	11-apr-94, JMM
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm
 CALLED BY
	dfx_1pl_ecut, fx_phflux, hxt_cutoff


fx_1pl_flat $SSW/yohkoh/ucon/idl/mctiernan/fx_1pl_flat.pro
[Previous] [Next]
 NAME:
	fx_1pl_flat
 CALLING SEQUENCE:
	f=fx_1pl_flat(a,esc)
 PURPOSE:
	Calculates photon flux for the single power law, which flattens
       below an energy e0, note that K corresponds to Flux below e0 KeV
 INPUT:
	a= fit parameters, a(0)=K, a(1)=gamma, a(2)=e0
	esc= energy in keV
 OUTPUT:
	f=a(0)*(esc/a(2))^(-a(1)), esc > a(2)
       f=a(0), esc< a(2)
 HISTORY
	29-mar-94, JMM
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm
 CALLED BY
	dfx_1pl_flat, fx_phflux, hxt_cutoff


fx_1th $SSW/yohkoh/ucon/idl/mctiernan/fx_1th.pro
[Previous] [Next]
 NAME:
	fx_1th
 CALLING SEQUENCE:
	f=fx_1th(a,esc)
 PURPOSE:
	Calculates photon flux for the single thermal fit
 INPUT:
	a= fit parameters, a(0)=e47, a(1)=t6, 
	esc= energy in keV
 OUTPUT:
	f=(gc*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))
 CALLED BY:
	dfx_1th, dfx_2th, dfx_thppl, ebthpl, fsp_outplot, fsp_output, fx_2th, fx_phflux
	fx_thbpl, fx_thp2pl, fx_thppl
 HISTORY:
	Spring '92 JMcT
	Non-1 gauntt factor, (Mewe 1985) added,11/27/92 (JM)


fx_1th_l $SSW/yohkoh/ucon/idl/mctiernan/fx_1th_l.pro
[Previous] [Next]
 NAME:
	fx_1th_l
 CALLING SEQUENCE:
	f=fx_1th_l(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the single thermal fit, includes SXR
	line spectra, as given by Jlemen's mewe_spec.pro. dfx_1th_l actually
       interpolates on a large array..
 INPUT:
	a= fit parameters, a(0)=e47, a(1)=t6, 
	esc= energy in keV
       nsc= no. of elements in esc
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 OUTPUT:
	f=(gc*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))+line fluxes
 CALLS: ***
	INTERPU_1D
 CALLED BY:
	ebthpl, fx_2th_l, fx_phflux, fx_thppl_l
 HISTORY:
	Feb. 93 J.McT


fx_1th_lo $SSW/yohkoh/ucon/idl/mctiernan/fx_1th_lo.pro
[Previous] [Next]
 NAME:
	fx_1th_lo
 CALLING SEQUENCE:
	f=fx_1th_lo(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the single thermal fit, includes SXR
	line spectra, as given by Jlemen's mewe_spec.pro.
 INPUT:
	a= fit parameters, a(0)=e47, a(1)=t6, 
	esc= energy in keV
       nsc= no. of elements in esc
 OUTPUT:
	f=(gc*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))+line fluxes
 KEYWORD:
       no_pts= the number of points used to calculate the flux in MEWE_SPEC,
               the default is 500
       use_esc= use the input energies to call MEWE_SPEC
 CALLS: ***
	INTERPU_1D, mewe_spec [1], mewe_spec [2]
 CALLED BY:
	SXT_POWL, fx_2th_lo, fx_phflux, fx_thppl_lo
 HISTORY:
	Feb. 93 J.McT
       Changed to deal with new version of MEWE_SPEC, 10/26/94, jmm
       Changes to deal with the fact that MEWE_SPEC uses bins, 5/23/95, jmm
       Added use_esc keyword, 12/5/95, jmm


fx_2pl $SSW/yohkoh/ucon/idl/mctiernan/fx_2pl.pro
[Previous] [Next]
 NAME:
	fx_2pl
 CALLING SEQUENCE:
	f=fx_2pl(a,esc)
 PURPOSE:
	Calculates photon flux for the double power law
 INPUT:
	a= fit parameters, a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=Ebr
	esc= energy in keV
 OUTPUT:
	f=a(0)/esc^a(1), esc<a(3)
	f=K2*/esc^a(1), esc>a(3), K2=a(0)*a(3)^(a(2)-a(1))
 CALLED BY:
	Ai_thp2pl, dfx_2pl, fx_phflux, fx_thp2pl
 HISTORY:
	Spring '92 JMcT
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm


fx_2th $SSW/yohkoh/ucon/idl/mctiernan/fx_2th.pro
[Previous] [Next]
 NAME:
	fx_2th
 CALLING SEQUENCE:
	f=fx_2th(a,esc)
 PURPOSE:
	Calculates photon flux for the double thermal fit
 INPUT:
	a= fit parameters, a(0)=e471, a(1)=T61, a(2)=e472, a(3)=t62
	esc= energy in keV
 OUTPUT:
	f=(gc1*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))
	 +(gc3*a(2)*3.63e5/(Sqrt(a(3))*esc))*exp(-11.6*esc/a(3))
	The gc's are non-1 gaunt factors for each component (Mewe, '85)
 CALLS: ***
	fx_1th
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '92 JMcT
	Non-1 gauntt factor, (Mewe 1985) added,11/27/92 (JM)


fx_2th_l $SSW/yohkoh/ucon/idl/mctiernan/fx_2th_l.pro
[Previous] [Next]
 NAME:
	fx_2th_l
 CALLING SEQUENCE:
	f=fx_2th_l(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the double thermal fit, includes SXR
	line spectra, as given by Jlemen's mewe_spec.pro.
 INPUT:
	a= fit parameters, a(0)=e471, a(1)=T61, a(2)=e472, a(3)=t62
	esc= energy in keV
 OUTPUT:
	f=(gc1*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))
	 +(gc3*a(2)*3.63e5/(Sqrt(a(3))*esc))*exp(-11.6*esc/a(3))+line fluxes
 KEYWORD:
       no_pts= the number of points used to calculate the flux in MEWE_SPEC,
               the default is 500
 CALLS: ***
	fx_1th_l
 CALLED BY:
	fx_phflux
 HISTORY:
	6-nov-95, jmm


fx_2th_lo $SSW/yohkoh/ucon/idl/mctiernan/fx_2th_lo.pro
[Previous] [Next]
 NAME:
	fx_2th_lo
 CALLING SEQUENCE:
	f=fx_2th_lo(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the double thermal fit, includes SXR
	line spectra, as given by Jlemen's mewe_spec.pro.
 INPUT:
	a= fit parameters, a(0)=e471, a(1)=T61, a(2)=e472, a(3)=t62
	esc= energy in keV
 OUTPUT:
	f=(gc1*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))
	 +(gc3*a(2)*3.63e5/(Sqrt(a(3))*esc))*exp(-11.6*esc/a(3))+line fluxes
 KEYWORD:
       no_pts= the number of points used to calculate the flux in MEWE_SPEC,
               the default is 500
 CALLS: ***
	fx_1th_lo
 CALLED BY:
	fx_phflux
 HISTORY:
	6-nov-95, jmm


fx_3pl $SSW/yohkoh/ucon/idl/mctiernan/fx_3pl.pro
[Previous] [Next]
 NAME:
	fx_3pl
 CALLING SEQUENCE:
	f=fx_3pl(a,esc)
 PURPOSE:
	Calculates photon flux for the 3 p.l. fit.
 INPUT:
	a= fit parameters, a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=gamma3,
			   a(4)=Eb1, a(5)=Eb2
	esc= energy in keV
 OUTPUT:
	f=a(0)*E^a(1), E<Eb1
	f=K2*E^a(2), Eb1<E<Eb2, K2=K1*Eb1^(a(2)-a(1))
	f=K3*E^a(3), Eb1<E<Eb2, K3=K2*Eb2^(a(3)-a(2))
 CALLED BY:
	dfx_3pl, fx_phflux
 HISTORY:
	Spring '92 JMcT
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm


fx_95 $SSW/yohkoh/ucon/idl/mctiernan/fx_95.pro
[Previous] [Next]
 NAME:
     fx_95
 PURPOSE:
     Differential EM function for a model (see, Dere etal. sphys36, 459)
     em = c_1*exp(-c_2*(ln(T))^c_3), Only works for T > 1 MK!
 CALLING SEQUENCE:
     flux = fx_95(a, esc)
 INPUT:
     a(0) = EM at 1 MK, c_1
     a(1) = c_2, see above
     a(2) = c_3, see above
     esc = the temperature grid
 OUTPUT:
     e47 = a(0)*exp(-a(1)*(alog(T)^a(2)))
     e47 = 0.0
 HISTORY;
     25-jun-96, jmm
 CALLED BY
	dem_models, dfx_95, fx_95_o, fx_phflux


fx_95_o $SSW/yohkoh/ucon/idl/mctiernan/fx_95_o.pro
[Previous] [Next]
 NAME:
     fx_95_o
 PURPOSE:
     Photon flux for a model (see, Dere etal. sphys36, 459)
     em = c_1*exp(-c_2*(ln(T))^c_3), for T > 2MK
 CALLING SEQUENCE:
     flux = fx_95_o(a, esc, nsc, /init)
 INPUT:
     a(0) = EM at 1 MK, c_1
     a(1) = c_2, see above
     a(2) = c_3, see above
     esc = the energies at which you want the flux
     nsc = n_elements(esc)
 OUTPUT:
     flux = the integral of the photon flux over temperature at each energy
 KEYOWRDS:
     /init = if set, fill the common block fdf10, which contains the
             flux for em=10^47 on a temperature grid.
 CALLS: ***
	fdf10_init, fx_95, simp_rule
 CALLED BY:
	fx_phflux
 COMMON BLOCKS:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY;
 25-jun-96, jmm


fx_96 $SSW/yohkoh/ucon/idl/mctiernan/fx_96.pro
[Previous] [Next]
 NAME:
     fx_96
 PURPOSE:
     Differential EM function for a model which is a double power law in
     Temperature (tyspec=96), with a a variable upper cutoff T, and a break
     at 5 MK
 CALLING SEQUENCE:
     flux = fx_96(a, esc, xxx=xxx)
 INPUT:
     a(0) = EM at 1 MK
     a(1) = Low T. pl. index of temperature variation.
     a(2) = High T. pl. index of temperature variation.
     a(3) = high T cutoff
     esc = the temperature grid
 OUTPUT:
     e47 = a(0)*T^(-a(1))*exp((-T/a(3))^xxx), T< 5
     e47 = a(0)*(5^(a(2)-a(1)))*T^(-a(2))*exp((-T/a(3))^xxx), T> 5
 KEYWORDS:
     xxx = the power of -T/a(3) in the exponential, default is 10
 HISTORY;
     19-jan-96, jmm
     Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm,
     Major bug for this case...
 CALLED BY
	dem_models, dfx_96, fx_96_o, fx_phflux


fx_96_o $SSW/yohkoh/ucon/idl/mctiernan/fx_96_o.pro
[Previous] [Next]
 NAME:
     fx_96_o
 PURPOSE:
     Photon flux for a model which is a double power law in Temperature
     (tyspec=96), sort of a differential emission measure,
     This is used for the case with a varying Temperature cutoff.
 CALLING SEQUENCE:
     flux = fx_96_o(a, esc, nsc, /init, xxx=xxx)
 INPUT:
     a(0) = EM at 1 MK
     a(1) = Low T. pl. index of temperature variation.
     a(2) = High T. pl. index of temperature variation.
     a(3) = high T cutoff
     esc = the energies at which you want the flux
     nsc = n_elements(esc)
 OUTPUT:
     flux = the integral of the photon flux at each temperature
            times a(0)*T^(-a(1))*exp((-T/a(3))^xxx) over temperature.
 KEYOWRDS:
     /init = if set, fill the common block fdf10, which contains the
             flux for em=10^47 on a temperature grid.
     xxx = the power of -T/a(3) in the exponential, default is 10
 CALLS: ***
	fdf10_init, fx_96, simp_rule
 CALLED BY:
	fx_phflux
 COMMON BLOCKS:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY;
 25-oct-95, jmm


fx_97 $SSW/yohkoh/ucon/idl/mctiernan/fx_97.pro
[Previous] [Next]
 NAME:
     fx_97
 PURPOSE:
     Differential EM function for a model which is a Gaussian in
     Temperature (tyspec=97)
 CALLING SEQUENCE:
     flux = fx_97(a, esc)
 INPUT:
     a(0) = EM at low Peak T
     a(1) = Peak T
     a(2) = width
 OUTPUT:
     e47 = a(0)*exp(-((T-a(1))/a(2))^2)
 HISTORY;
     31-jan-96, jmm
 CALLED BY
	dem_models, dfx_97, fx_97_o, fx_phflux


fx_97_o $SSW/yohkoh/ucon/idl/mctiernan/fx_97_o.pro
[Previous] [Next]
 NAME:
     fx_97_o
 PURPOSE:
     Photon flux for a model which is a Gaussian in
     Temperature (tyspec=97)
 CALLING SEQUENCE:
     flux = fx_97_o(a, esc, nsc, /init, xxx=xxx, yyy=yyy)
 INPUT:
     a(0) = EM at low Peak T
     a(1) = Peak T
     a(2) = width
     esc = the energies at which you want the flux
     nsc = n_elements(esc)
 OUTPUT:
     flux = the integral over temperature of the photon flux 
            times emission measure
 KEYOWRDS:
     /init = if set, fill the common block fdf10, which contains the
             flux for em=10^47 on a temperature grid.
 CALLS: ***
	fdf10_init, fx_97, simp_rule
 CALLED BY:
	fx_phflux
 COMMON BLOCKS:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY;
     18-jan-96, jmm


fx_98 $SSW/yohkoh/ucon/idl/mctiernan/fx_98.pro
[Previous] [Next]
 NAME:
     fx_98
 PURPOSE:
     Differential EM function for a model which is a power law in
     Temperature (tyspec=98), witha a variable upper cutoff T
 CALLING SEQUENCE:
     flux = fx_98(a, esc, xxx=xxx)
 INPUT:
     a(0) = EM at 1 MK
     a(1) = pl. index of temperature variation.
     a(2) = high T cutoff
     esc = the temperature grid
     nsc = n_elements(esc)
 OUTPUT:
     e47 = a(0)*T^(-a(1))*exp((-T/a(2))^xxx)
 KEYOWRDS:
     xxx = the power of -t/a(2) in the exponential, default is 10
 HISTORY;
     12-jan-96, jmm
 CALLED BY
	dem_models, fx_phflux


fx_98_o $SSW/yohkoh/ucon/idl/mctiernan/fx_98_o.pro
[Previous] [Next]
 NAME:
     fx_98_o
 PURPOSE:
     Photon flux for a model which is a power law in Temperature
     (tyspec=98), sort of a differential emission measure,
     This is used for the case with a varying Temperature cutoff.
 CALLING SEQUENCE:
     flux = fx_98_o(a, esc, nsc, /init, xxx=xxx)
 INPUT:
     a(0) = EM at 1 MK 
     a(1) = pl. index of temperature variation.
     a(2) = Cutoff temperature
     esc = the energies at which you want the flux
     nsc = n_elements(esc)
 OUTPUT:
     flux = the integral of the photon flux at each temperature
            times a(0)*T^(-a(1))*exp((-T/a(2))^xxx) over temperature.
 KEYOWRDS:
     /init = if set, fill the common block fdf10, which contains the
             flux for em=10^47 on a temperature grid.
     xxx = the power of -t/a(2) in the exponential, default is 10
 CALLS: ***
	fdf10_init, simp_rule
 CALLED BY:
	fx_phflux
 COMMON BLOCKS:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY;
 25-oct-95, jmm


fx_99 $SSW/yohkoh/ucon/idl/mctiernan/fx_99.pro
[Previous] [Next]
 NAME:
     fx_99
 PURPOSE:
     Differential EM function for a model which is a power law in
     Temperature (tyspec=99)
 CALLING SEQUENCE:
     flux = fx_99(a, esc)
 INPUT:
     a(0) = EM at 1 MK
     a(1) = pl. index of temperature variation.
     esc = the temperature grid
     nsc = n_elements(esc)
 OUTPUT:
     e47 = a(0)*T^(-a(1)) for T<30
         = 0 for T>30
 HISTORY;
     12-jan-96, jmm
 CALLED BY
	dem_models, dfx_99, fx_phflux


fx_99_o $SSW/yohkoh/ucon/idl/mctiernan/fx_99_o.pro
[Previous] [Next]
 NAME:
     fx_99_o
 PURPOSE:
     Photon flux for a model which is a power law in Temperature
     (tyspec=99), sort of a differential emission measure.
 CALLING SEQUENCE:
     flux = fx_99_o(a, esc, nsc, /init)
 INPUT:
     a(0) = EM at 1 MK 
     a(1) = pl. index of temperature variation.
     esc = the energies at which you want the flux
     nsc = n_elements(esc)
 OUTPUT:
     flux = the integral of the photon flux at each temperature
            times a(0)*T^(-a(1)) over temperature.
 KEYOWRDS:
     /init = if set, fill the common block fdf10, which contains the
             flux for em=10^47 on a temperature grid.
 CALLS: ***
	fdf10_init, simp_rule
 CALLED BY:
	fx_phflux
 COMMON BLOCKS:
       Common fdf10,fl10,dfl10,t610,nt610
               fl10=Log(emission) at EM47=1.0, for the Thermal SXR fit
               dfl10=dfl10/dt6 at EM47=1.0, for the Thermal SXR fit
               t610= Log(t6) for which we obtain fl10
               nt610= n_elements(t610)
 HISTORY;
 25-oct-95, jmm


fx_phflux $SSW/yohkoh/ucon/idl/mctiernan/fx_phflux.pro
[Previous] [Next]
 NAME:
      fx_phflux.pro
 PURPOSE:
      Calculates the expected photon flux for a given type of
      spectrum, or the DEM function, for the multiple thermal fits,
      (tyspec gt 90)
 CALLING SEQUENCE:
      flux= fx_phflux(tyspec,a,esc,nsc,/in_fitspec)
 INPUT:
      tyspec= type of spectrum
      a = fit parameters,
         tyspec=1, single p.l., a(0)=K, a(1)=gamma
		=2, double p.l., a(0)=K1, a(1)=gamma1, a(2)=gamma2, a(3)=ebr
			(ebr is the break energy in keV)
		=3, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6
		=4, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma
 	        =5, Double Thermal, a(0)=em1/1.0e47, a(1)=T1/1.0e6, 
			a(2)=em2/1.0e47, a(3)=T2/1.0e6
		=6, p.l.+p.l., a(0)=K1, a(1)=gamma1, a(2)=K2, a(3)=gamma2
		=7, Thermal below Ebr, p.l. above Ebr, 
			a(0)=K, a(1)=gamma, a(2)=T/1.0e6, a(3)=Ebr
		=8 Thermal + double p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, 
			a(2)=K1, a(3)=gamma1, a(4)=gamma2, a(5)=Ebr
		=9 Triple P.L.,  a(0)=K1, a(1)=gamma1, a(2)=gamma2, 
			a(3)=gamma3, a(4)=eb1 (between gamma1 & gamma2), 
			a(5)=eb2 (between gamma2 and gamma3)
		=10, Thermal, a(0)=em/1.0e47, a(1)=T/1.0e6, includes
                    SXR lines
		=11, Thermal + p.l., a(0)=em/1.0e47, a(1)=T/1.0e6, a(2)=K, 
			a(3)=gamma, includes  SXR lines
 		=12, single p.l. flattens below e0, a(0)=K, a(1)=gamma, a(2)=e0
 		=13, single p.l. cuts off below e0, a(0)=K, a(1)=gamma, a(2)=e0
 	        =14, Double Thermal, a(0)=em1/1.0e47, a(1)=T1/1.0e6, 
			a(2)=em2/1.0e47, a(3)=T2/1.0e6, includes lines
               =95, Dere, etal 1974 model em = a(0)*exp(-a(1)*(alog(esc)^a(2)))
               =96, Double Power Law in temperature, variable T cutoff, Tb=5MK
                    a(0) = EM at 1MK, a(1) = low pl. index OF T,
                    a(2) = high pl. index of T, a(3) = cutoff T
               =97, Gaussian in temperature
                    a(0) = EM at peak, a(1) = peak T, a(2) = width in T
               =98, Power Law in temperature, variable T cutoff,
                    a(0) = EM at 1MK, a(1) = pl. index OF T, a(2) = Max. T
               =99, Power Law in temperature, constantT cutoff,
                    a(0) = EM at 1MK, a(1) = pl. index OF T
      esc= photon energies
      nsc= n_elements(esc)
 OUTPUT:
      The photon flux
 KEYWORDS:
      in_fitspec= Called during the spectral fit: use interpolated values
                  in The COMMON block Fdf10, for the SXR line fits or return
                  the differential EM function instead of the photon flux
                  for the multi-thermal fits.
 CALLS: ***
	fx_1pl, fx_1pl_ecut, fx_1pl_flat, fx_1th, fx_1th_l, fx_1th_lo, fx_2pl, fx_2th, fx_2th_l
	fx_2th_lo, fx_3pl, fx_95, fx_95_o, fx_96, fx_96_o, fx_97, fx_97_o, fx_98, fx_98_o, fx_99
	fx_99_o, fx_plppl, fx_thbpl, fx_thp2pl, fx_thppl, fx_thppl_l, fx_thppl_lo
 CALLED BY:
	Countrate, av_chflux, fsp_11, fsp_mc, fsp_outplot
 HISTORY:
      15-nov-93 by JMM


fx_plppl $SSW/yohkoh/ucon/idl/mctiernan/fx_plppl.pro
[Previous] [Next]
 NAME:
	fx_plppl
 CALLING SEQUENCE:
	f=fx_plppl(a,esc)
 PURPOSE:
	Calculates photon flux for the power law + power law
 INPUT:
	a= fit parameters, a(0)=K1,a(1)=gamma1,a(2)=K2,a(3)=gamma2
	esc= energy in keV
 OUTPUT:
	f=a(0)/esc^a(1)+a(2)/esc^a(3)
 CALLS: ***
	fx_1pl
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '92 JMcT


fx_thbpl $SSW/yohkoh/ucon/idl/mctiernan/fx_thbpl.pro
[Previous] [Next]
 NAME:
	fx_thbpl
 CALLING SEQUENCE:
	f=fx_thbpl(a,esc)
 PURPOSE:
	Calculates photon flux for the thermal fit below Ebr, p.l. above
 INPUT:
	a= fit parameters, a(0)=K, a(1)=gamma, a(2)=T6, a(3)=ebr
	esc= energy in keV
 OUTPUT:
	f=Photon flux, it's a mess
 CALLS: ***
	fx_1pl, fx_1th
 CALLED BY:
	dfx_thbpl, fx_phflux
 HISTORY:
	Spring '92 JMcT
	Non-1 gauntt factor, (Mewe 1985) added,11/27/92 (JM)
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm


fx_thp2pl $SSW/yohkoh/ucon/idl/mctiernan/fx_thp2pl.pro
[Previous] [Next]
 NAME:
	fx_thp2pl
 CALLING SEQUENCE:
	f=fx_thp2pl(a,esc)
 PURPOSE:
	Calculates photon flux for the thermal + double p.l. fit.
 INPUT:
	a= fit parameters, a(0)=e47, a(1)=t6, a(2)=K1, a(3)=gamma1, 
			   a(4)=gamma2, a(5)=ebr
	esc= energy in keV
 OUTPUT:
	f=Photon flux, it's a mess
 CALLS: ***
	fx_1th, fx_2pl
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '92 JMcT
	Non-1 gauntt factor, (Mewe 1985) added,11/27/92 (JM)
       Rewritten, to allow non-monotonic esc, 25-jun-1996, jmm


fx_thppl $SSW/yohkoh/ucon/idl/mctiernan/fx_thppl.pro
[Previous] [Next]
 NAME:
	fx_thppl
 CALLING SEQUENCE:
	f=fx_thppl(a,esc)
 PURPOSE:
	Calculates photon flux for the power law + thermal fit
 INPUT:
	a= fit parameters, a(0)=em/1.0e47, a(1)=T6, a(2)=K, a(3)=gamma
	esc= energy in keV
 OUTPUT:
	f=(gc*a(0)*3.63e5/(Sqrt(a(1))*esc))*exp(-11.6*esc/a(1))+a(2)/esc^a(3)
	gc is a non-1 gauntt factor, (Mewe '85)
 CALLS: ***
	fx_1pl, fx_1th
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '92 JMcT
	Non-1 gauntt factor, (Mewe 1985) added,11/27/92 (JM)


fx_thppl_l $SSW/yohkoh/ucon/idl/mctiernan/fx_thppl_l.pro
[Previous] [Next]
 NAME:
	fx_thppl_l
 CALLING SEQUENCE:
	f=fx_thppl_l(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the power law + thermal fit.
       Includes SXR line emission.
 INPUT:
	a= fit parameters, a(0)=em/1.0e47, a(1)=T6, a(2)=K, a(3)=gamma
	esc= energy in keV
 OUTPUT:
	f=flux in photons/(sec-cm^2-keV)
 CALLS: ***
	fx_1pl, fx_1th_l
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '93 JMcT


fx_thppl_lo $SSW/yohkoh/ucon/idl/mctiernan/fx_thppl_lo.pro
[Previous] [Next]
 NAME:
	fx_thppl_lo
 CALLING SEQUENCE:
	f=fx_thppl_lo(a,esc,nsc)
 PURPOSE:
	Calculates photon flux for the power law + thermal fit.
       Includes SXR line emission.
 INPUT:
	a= fit parameters, a(0)=em/1.0e47, a(1)=T6, a(2)=K, a(3)=gamma
	esc= energy in keV
 OUTPUT:
	f=flux in photons/(sec-cm^2-keV)
 CALLS: ***
	fx_1pl, fx_1th_lo
 CALLED BY:
	fx_phflux
 HISTORY:
	Spring '93 JMcT